[dpdk-dev] [PATCH v2 3/3] virtio: add neon support
On Mon, Jul 04, 2016 at 02:25:55PM +0530, Jerin Jacob wrote: > On Mon, Jul 04, 2016 at 03:53:22PM +0800, Yuanhan Liu wrote: > > On Fri, Jul 01, 2016 at 04:46:38PM +0530, Jerin Jacob wrote: > > > Added neon based Rx vector implementation. > > > Selection of the new handler based neon availability at runtime. > > > Updated the release notes and MAINTAINERS file. > > > > > > Signed-off-by: Jerin Jacob > > > --- > > > MAINTAINERS | 1 + > > > doc/guides/rel_notes/release_16_07.rst | 2 + > > > drivers/net/virtio/Makefile | 2 + > > > drivers/net/virtio/virtio_rxtx.c | 3 + > > > drivers/net/virtio/virtio_rxtx_simple_neon.c | 235 > > > +++ > > > 5 files changed, 243 insertions(+) > > > create mode 100644 drivers/net/virtio/virtio_rxtx_simple_neon.c > > > > > > diff --git a/MAINTAINERS b/MAINTAINERS > > > index a59191e..ab04cee 100644 > > > --- a/MAINTAINERS > > > +++ b/MAINTAINERS > > > @@ -143,6 +143,7 @@ F: lib/librte_acl/acl_run_neon.* > > > F: lib/librte_lpm/rte_lpm_neon.h > > > F: lib/librte_hash/rte*_arm64.h > > > F: drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c > > > +F: drivers/net/virtio/virtio_rxtx_simple_neon.c > > > > > > EZchip TILE-Gx > > > M: Zhigang Lu > > > diff --git a/doc/guides/rel_notes/release_16_07.rst > > > b/doc/guides/rel_notes/release_16_07.rst > > > index 9e2a817..3a5add5 100644 > > > --- a/doc/guides/rel_notes/release_16_07.rst > > > +++ b/doc/guides/rel_notes/release_16_07.rst > > > > This series basically looks good to me, but I don't think we can make it > > for v16.07: you missed v1 deadline; it's also too late: rc1 was already out. > > OK. But I thought, Thomas hasn't pulled the changes from dpdk-next-virtio. > > Even if didn't make it for v16.07, I would suggest you to consider taking > the changes to dpdk-next-virtio as this change involves file restructuring > (Will have issue with re-basing in future) without having any functional > impact. Yes, that's my plan. I will do the merge ASAP, when - v16.07 is out. - your patches are ready. --yliu
[dpdk-dev] [PATCH v2 3/3] virtio: add neon support
On Fri, Jul 01, 2016 at 04:46:38PM +0530, Jerin Jacob wrote: > Added neon based Rx vector implementation. > Selection of the new handler based neon availability at runtime. > Updated the release notes and MAINTAINERS file. > > Signed-off-by: Jerin Jacob > --- > MAINTAINERS | 1 + > doc/guides/rel_notes/release_16_07.rst | 2 + > drivers/net/virtio/Makefile | 2 + > drivers/net/virtio/virtio_rxtx.c | 3 + > drivers/net/virtio/virtio_rxtx_simple_neon.c | 235 > +++ > 5 files changed, 243 insertions(+) > create mode 100644 drivers/net/virtio/virtio_rxtx_simple_neon.c > > diff --git a/MAINTAINERS b/MAINTAINERS > index a59191e..ab04cee 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -143,6 +143,7 @@ F: lib/librte_acl/acl_run_neon.* > F: lib/librte_lpm/rte_lpm_neon.h > F: lib/librte_hash/rte*_arm64.h > F: drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c > +F: drivers/net/virtio/virtio_rxtx_simple_neon.c > > EZchip TILE-Gx > M: Zhigang Lu > diff --git a/doc/guides/rel_notes/release_16_07.rst > b/doc/guides/rel_notes/release_16_07.rst > index 9e2a817..3a5add5 100644 > --- a/doc/guides/rel_notes/release_16_07.rst > +++ b/doc/guides/rel_notes/release_16_07.rst This series basically looks good to me, but I don't think we can make it for v16.07: you missed v1 deadline; it's also too late: rc1 was already out. --yliu > @@ -174,6 +174,8 @@ New Features >section of the "Network Interface Controller Drivers" document. > > > +* **Virtio NEON support for ARM.** > + > Resolved Issues > --- >
[dpdk-dev] [PATCH v2 3/3] virtio: add neon support
On Mon, Jul 04, 2016 at 03:53:22PM +0800, Yuanhan Liu wrote: > On Fri, Jul 01, 2016 at 04:46:38PM +0530, Jerin Jacob wrote: > > Added neon based Rx vector implementation. > > Selection of the new handler based neon availability at runtime. > > Updated the release notes and MAINTAINERS file. > > > > Signed-off-by: Jerin Jacob > > --- > > MAINTAINERS | 1 + > > doc/guides/rel_notes/release_16_07.rst | 2 + > > drivers/net/virtio/Makefile | 2 + > > drivers/net/virtio/virtio_rxtx.c | 3 + > > drivers/net/virtio/virtio_rxtx_simple_neon.c | 235 > > +++ > > 5 files changed, 243 insertions(+) > > create mode 100644 drivers/net/virtio/virtio_rxtx_simple_neon.c > > > > diff --git a/MAINTAINERS b/MAINTAINERS > > index a59191e..ab04cee 100644 > > --- a/MAINTAINERS > > +++ b/MAINTAINERS > > @@ -143,6 +143,7 @@ F: lib/librte_acl/acl_run_neon.* > > F: lib/librte_lpm/rte_lpm_neon.h > > F: lib/librte_hash/rte*_arm64.h > > F: drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c > > +F: drivers/net/virtio/virtio_rxtx_simple_neon.c > > > > EZchip TILE-Gx > > M: Zhigang Lu > > diff --git a/doc/guides/rel_notes/release_16_07.rst > > b/doc/guides/rel_notes/release_16_07.rst > > index 9e2a817..3a5add5 100644 > > --- a/doc/guides/rel_notes/release_16_07.rst > > +++ b/doc/guides/rel_notes/release_16_07.rst > > This series basically looks good to me, but I don't think we can make it > for v16.07: you missed v1 deadline; it's also too late: rc1 was already out. OK. But I thought, Thomas hasn't pulled the changes from dpdk-next-virtio. Even if didn't make it for v16.07, I would suggest you to consider taking the changes to dpdk-next-virtio as this change involves file restructuring (Will have issue with re-basing in future) without having any functional impact. > > --yliu > > > @@ -174,6 +174,8 @@ New Features > >section of the "Network Interface Controller Drivers" document. > > > > > > +* **Virtio NEON support for ARM.** > > + > > Resolved Issues > > --- > >
[dpdk-dev] [PATCH v2 3/3] virtio: add neon support
Added neon based Rx vector implementation. Selection of the new handler based neon availability at runtime. Updated the release notes and MAINTAINERS file. Signed-off-by: Jerin Jacob --- MAINTAINERS | 1 + doc/guides/rel_notes/release_16_07.rst | 2 + drivers/net/virtio/Makefile | 2 + drivers/net/virtio/virtio_rxtx.c | 3 + drivers/net/virtio/virtio_rxtx_simple_neon.c | 235 +++ 5 files changed, 243 insertions(+) create mode 100644 drivers/net/virtio/virtio_rxtx_simple_neon.c diff --git a/MAINTAINERS b/MAINTAINERS index a59191e..ab04cee 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -143,6 +143,7 @@ F: lib/librte_acl/acl_run_neon.* F: lib/librte_lpm/rte_lpm_neon.h F: lib/librte_hash/rte*_arm64.h F: drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c +F: drivers/net/virtio/virtio_rxtx_simple_neon.c EZchip TILE-Gx M: Zhigang Lu diff --git a/doc/guides/rel_notes/release_16_07.rst b/doc/guides/rel_notes/release_16_07.rst index 9e2a817..3a5add5 100644 --- a/doc/guides/rel_notes/release_16_07.rst +++ b/doc/guides/rel_notes/release_16_07.rst @@ -174,6 +174,8 @@ New Features section of the "Network Interface Controller Drivers" document. +* **Virtio NEON support for ARM.** + Resolved Issues --- diff --git a/drivers/net/virtio/Makefile b/drivers/net/virtio/Makefile index c4103b7..97972a6 100644 --- a/drivers/net/virtio/Makefile +++ b/drivers/net/virtio/Makefile @@ -54,6 +54,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += virtio_rxtx_simple.c ifeq ($(CONFIG_RTE_ARCH_X86),y) SRCS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += virtio_rxtx_simple_sse.c +else ifneq ($(filter y,$(CONFIG_RTE_ARCH_ARM) $(CONFIG_RTE_ARCH_ARM64)),) +SRCS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += virtio_rxtx_simple_neon.c endif ifeq ($(CONFIG_RTE_VIRTIO_USER),y) diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index a4d4a57..19d1742 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -481,6 +481,9 @@ virtio_update_rxtx_handler(struct rte_eth_dev *dev, #if defined RTE_ARCH_X86 if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE3)) use_simple_rxtx = 1; +#elif defined RTE_ARCH_ARM64 || defined CONFIG_RTE_ARCH_ARM + if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_NEON)) + use_simple_rxtx = 1; #endif /* Use simple rx/tx func if single segment and no offloads */ if (use_simple_rxtx && diff --git a/drivers/net/virtio/virtio_rxtx_simple_neon.c b/drivers/net/virtio/virtio_rxtx_simple_neon.c new file mode 100644 index 000..793eefb --- /dev/null +++ b/drivers/net/virtio/virtio_rxtx_simple_neon.c @@ -0,0 +1,235 @@ +/* + * BSD LICENSE + * + * Copyright (C) Cavium networks Ltd. 2016 + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Cavium networks nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "virtio_rxtx_simple.h" + +#define RTE_VIRTIO_VPMD_RX_BURST 32 +#define RTE_VIRTIO_DESC_PER_LOOP 8 +#define RTE_VIRTIO_VPMD_RX_REARM_THRESH RTE_VIRTIO_VPMD_RX_BURST + +/* virtio vPMD receive routine, only accept(nb_pkts >= RTE_VIRTIO_DESC_PER_LOOP) + * + * This routine is for non-mergeable RX, one desc for each guest buffer. + * This routine is based on the RX