Message ID | 1437556410-14102-1-git-send-email-bruce.richardson@intel.com (mailing list archive) |
---|---|
State | Accepted, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 3BDFA592A; Wed, 22 Jul 2015 11:13:37 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 6DB825921 for <dev@dpdk.org>; Wed, 22 Jul 2015 11:13:36 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 22 Jul 2015 02:13:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,522,1432623600"; d="scan'208";a="768905493" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.intel.com with ESMTP; 22 Jul 2015 02:13:31 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t6M9DVdi023419; Wed, 22 Jul 2015 10:13:31 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id t6M9DU6h014142; Wed, 22 Jul 2015 10:13:30 +0100 Received: (from bricha3@localhost) by sivswdev01.ir.intel.com with id t6M9DU89014138; Wed, 22 Jul 2015 10:13:30 +0100 From: Bruce Richardson <bruce.richardson@intel.com> To: dev@dpdk.org Date: Wed, 22 Jul 2015 10:13:30 +0100 Message-Id: <1437556410-14102-1-git-send-email-bruce.richardson@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1437492307-29754-1-git-send-email-bruce.richardson@intel.com> References: <1437492307-29754-1-git-send-email-bruce.richardson@intel.com> Subject: [dpdk-dev] [PATCH v2] ixgbe: fix check for split packets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Bruce Richardson
July 22, 2015, 9:13 a.m. UTC
The check for split packets to be reassembled in the vector ixgbe PMD
was incorrectly only checking the first 16 elements of the array instead
of all 32. This is fixed by changing the uint32_t values to be uint64_t
instead.
Fixes: cf4b4708a88a ("ixgbe: improve slow-path perf with vector scattered Rx")
Reported-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
V2: Rename variable from split_fl32 to split_fl64 to match type change.
---
drivers/net/ixgbe/ixgbe_rxtx_vec.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Comments
Hi, And what happens if someone changes RTE_IXGBE_VPMD_RX_BURST to something else than 32? I guess this bug were introduced when someone raised it from 16 to 32 I think you are better off with a for loop which uses this value. Or at least make a comment around RTE_IXGBE_VPMD_RX_BURST that if you change that value this check should be modified as well. Regards, Zoltan On 22/07/15 10:13, Bruce Richardson wrote: > The check for split packets to be reassembled in the vector ixgbe PMD > was incorrectly only checking the first 16 elements of the array instead > of all 32. This is fixed by changing the uint32_t values to be uint64_t > instead. > > Fixes: cf4b4708a88a ("ixgbe: improve slow-path perf with vector scattered Rx") > > Reported-by: Zoltan Kiss <zoltan.kiss@linaro.org> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> > > --- > V2: Rename variable from split_fl32 to split_fl64 to match type change. > --- > drivers/net/ixgbe/ixgbe_rxtx_vec.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c b/drivers/net/ixgbe/ixgbe_rxtx_vec.c > index d3ac74a..f2052c6 100644 > --- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c > +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c > @@ -549,10 +549,10 @@ ixgbe_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, > return 0; > > /* happy day case, full burst + no packets to be joined */ > - const uint32_t *split_fl32 = (uint32_t *)split_flags; > + const uint64_t *split_fl64 = (uint64_t *)split_flags; > if (rxq->pkt_first_seg == NULL && > - split_fl32[0] == 0 && split_fl32[1] == 0 && > - split_fl32[2] == 0 && split_fl32[3] == 0) > + split_fl64[0] == 0 && split_fl64[1] == 0 && > + split_fl64[2] == 0 && split_fl64[3] == 0) > return nb_bufs; > > /* reassemble any packets that need reassembly*/ >
On Wed, Jul 22, 2015 at 10:47:34AM +0100, Zoltan Kiss wrote: > Hi, > > And what happens if someone changes RTE_IXGBE_VPMD_RX_BURST to something > else than 32? I guess this bug were introduced when someone raised it from > 16 to 32 Actually, no, this bug is purely due to me getting my maths wrong when I wrote this function. The vector PMD has always worked in bursts of 32 at a time. > I think you are better off with a for loop which uses this value. Or at > least make a comment around RTE_IXGBE_VPMD_RX_BURST that if you change that > value this check should be modified as well. The vector PMD always works off a fixed 32 burst size. Any change to that will lead to many changes in the code, so I don't believe a loop is necessary. Regards, /Bruce > > Regards, > > Zoltan > > On 22/07/15 10:13, Bruce Richardson wrote: > >The check for split packets to be reassembled in the vector ixgbe PMD > >was incorrectly only checking the first 16 elements of the array instead > >of all 32. This is fixed by changing the uint32_t values to be uint64_t > >instead. > > > >Fixes: cf4b4708a88a ("ixgbe: improve slow-path perf with vector scattered Rx") > > > >Reported-by: Zoltan Kiss <zoltan.kiss@linaro.org> > >Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> > > > >--- > >V2: Rename variable from split_fl32 to split_fl64 to match type change. > >--- > > drivers/net/ixgbe/ixgbe_rxtx_vec.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > >diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c b/drivers/net/ixgbe/ixgbe_rxtx_vec.c > >index d3ac74a..f2052c6 100644 > >--- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c > >+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c > >@@ -549,10 +549,10 @@ ixgbe_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, > > return 0; > > > > /* happy day case, full burst + no packets to be joined */ > >- const uint32_t *split_fl32 = (uint32_t *)split_flags; > >+ const uint64_t *split_fl64 = (uint64_t *)split_flags; > > if (rxq->pkt_first_seg == NULL && > >- split_fl32[0] == 0 && split_fl32[1] == 0 && > >- split_fl32[2] == 0 && split_fl32[3] == 0) > >+ split_fl64[0] == 0 && split_fl64[1] == 0 && > >+ split_fl64[2] == 0 && split_fl64[3] == 0) > > return nb_bufs; > > > > /* reassemble any packets that need reassembly*/ > >
On 22/07/15 10:59, Bruce Richardson wrote: > On Wed, Jul 22, 2015 at 10:47:34AM +0100, Zoltan Kiss wrote: >> Hi, >> >> And what happens if someone changes RTE_IXGBE_VPMD_RX_BURST to something >> else than 32? I guess this bug were introduced when someone raised it from >> 16 to 32 > > Actually, no, this bug is purely due to me getting my maths wrong when I > wrote this function. The vector PMD has always worked in bursts of 32 at a > time. > >> I think you are better off with a for loop which uses this value. Or at >> least make a comment around RTE_IXGBE_VPMD_RX_BURST that if you change that >> value this check should be modified as well. > > The vector PMD always works off a fixed 32 burst size. Any change to that will > lead to many changes in the code, so I don't believe a loop is necessary. Ok, then I suggest to make a comment around RTE_IXGBE_VPMD_RX_BURST that changing it needs a lot of other changes in the code elsewhere, e.g in this split_flags check. Btw. vPMD was a bit misleading abbreviation for me, it took me a while until I realized 'v' stands for 'vector', not 'virtualization' as in most cases nowadays. > > Regards, > /Bruce > >> >> Regards, >> >> Zoltan >> >> On 22/07/15 10:13, Bruce Richardson wrote: >>> The check for split packets to be reassembled in the vector ixgbe PMD >>> was incorrectly only checking the first 16 elements of the array instead >>> of all 32. This is fixed by changing the uint32_t values to be uint64_t >>> instead. >>> >>> Fixes: cf4b4708a88a ("ixgbe: improve slow-path perf with vector scattered Rx") >>> >>> Reported-by: Zoltan Kiss <zoltan.kiss@linaro.org> >>> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> >>> >>> --- >>> V2: Rename variable from split_fl32 to split_fl64 to match type change. >>> --- >>> drivers/net/ixgbe/ixgbe_rxtx_vec.c | 6 +++--- >>> 1 file changed, 3 insertions(+), 3 deletions(-) >>> >>> diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c b/drivers/net/ixgbe/ixgbe_rxtx_vec.c >>> index d3ac74a..f2052c6 100644 >>> --- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c >>> +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c >>> @@ -549,10 +549,10 @@ ixgbe_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, >>> return 0; >>> >>> /* happy day case, full burst + no packets to be joined */ >>> - const uint32_t *split_fl32 = (uint32_t *)split_flags; >>> + const uint64_t *split_fl64 = (uint64_t *)split_flags; >>> if (rxq->pkt_first_seg == NULL && >>> - split_fl32[0] == 0 && split_fl32[1] == 0 && >>> - split_fl32[2] == 0 && split_fl32[3] == 0) >>> + split_fl64[0] == 0 && split_fl64[1] == 0 && >>> + split_fl64[2] == 0 && split_fl64[3] == 0) >>> return nb_bufs; >>> >>> /* reassemble any packets that need reassembly*/ >>>
On 22/07/15 14:19, Zoltan Kiss wrote: > Btw. vPMD was a bit misleading abbreviation for me, it took me a while > until I realized 'v' stands for 'vector', not 'virtualization' as in > most cases nowadays. > Though that's mostly my fault to not to check the documentation :)
> -----Original Message----- > From: Zoltan Kiss [mailto:zoltan.kiss@linaro.org] > Sent: Wednesday, July 22, 2015 2:20 PM > To: Richardson, Bruce > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v2] ixgbe: fix check for split packets > > > > On 22/07/15 10:59, Bruce Richardson wrote: > > On Wed, Jul 22, 2015 at 10:47:34AM +0100, Zoltan Kiss wrote: > >> Hi, > >> > >> And what happens if someone changes RTE_IXGBE_VPMD_RX_BURST to > >> something else than 32? I guess this bug were introduced when someone > >> raised it from > >> 16 to 32 > > > > Actually, no, this bug is purely due to me getting my maths wrong when > > I wrote this function. The vector PMD has always worked in bursts of > > 32 at a time. > > > >> I think you are better off with a for loop which uses this value. Or > >> at least make a comment around RTE_IXGBE_VPMD_RX_BURST that if you > >> change that value this check should be modified as well. > > > > The vector PMD always works off a fixed 32 burst size. Any change to > > that will lead to many changes in the code, so I don't believe a loop is > necessary. > > Ok, then I suggest to make a comment around RTE_IXGBE_VPMD_RX_BURST that > changing it needs a lot of other changes in the code elsewhere, e.g in > this split_flags check. > Btw. vPMD was a bit misleading abbreviation for me, it took me a while > until I realized 'v' stands for 'vector', not 'virtualization' as in most > cases nowadays. Good idea. I'll try to submit a patch to add a comment if I get the chance - otherwise feel free to do so yourself. As for the naming, yes, I suppose it can be confusing. :-) We possibly need to start calling these pieces of code SSE or AVX rather than just vector, since for some we may end up with multiple vector versions. /Bruce > > > > > Regards, > > /Bruce > > > >> > >> Regards, > >> > >> Zoltan > >> > >> On 22/07/15 10:13, Bruce Richardson wrote: > >>> The check for split packets to be reassembled in the vector ixgbe > >>> PMD was incorrectly only checking the first 16 elements of the array > >>> instead of all 32. This is fixed by changing the uint32_t values to > >>> be uint64_t instead. > >>> > >>> Fixes: cf4b4708a88a ("ixgbe: improve slow-path perf with vector > >>> scattered Rx") > >>> > >>> Reported-by: Zoltan Kiss <zoltan.kiss@linaro.org> > >>> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> > >>> > >>> --- > >>> V2: Rename variable from split_fl32 to split_fl64 to match type > change. > >>> --- > >>> drivers/net/ixgbe/ixgbe_rxtx_vec.c | 6 +++--- > >>> 1 file changed, 3 insertions(+), 3 deletions(-) > >>> > >>> diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c > >>> b/drivers/net/ixgbe/ixgbe_rxtx_vec.c > >>> index d3ac74a..f2052c6 100644 > >>> --- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c > >>> +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c > >>> @@ -549,10 +549,10 @@ ixgbe_recv_scattered_pkts_vec(void *rx_queue, > struct rte_mbuf **rx_pkts, > >>> return 0; > >>> > >>> /* happy day case, full burst + no packets to be joined */ > >>> - const uint32_t *split_fl32 = (uint32_t *)split_flags; > >>> + const uint64_t *split_fl64 = (uint64_t *)split_flags; > >>> if (rxq->pkt_first_seg == NULL && > >>> - split_fl32[0] == 0 && split_fl32[1] == 0 && > >>> - split_fl32[2] == 0 && split_fl32[3] == 0) > >>> + split_fl64[0] == 0 && split_fl64[1] == 0 && > >>> + split_fl64[2] == 0 && split_fl64[3] == 0) > >>> return nb_bufs; > >>> > >>> /* reassemble any packets that need reassembly*/ > >>>
2015-07-22 13:35, Richardson, Bruce: > From: Zoltan Kiss [mailto:zoltan.kiss@linaro.org] > > On 22/07/15 10:59, Bruce Richardson wrote: > > > The vector PMD always works off a fixed 32 burst size. Any change to > > > that will lead to many changes in the code, so I don't believe a loop is > > necessary. > > > > Ok, then I suggest to make a comment around RTE_IXGBE_VPMD_RX_BURST that > > changing it needs a lot of other changes in the code elsewhere, e.g in > > this split_flags check. > > Btw. vPMD was a bit misleading abbreviation for me, it took me a while > > until I realized 'v' stands for 'vector', not 'virtualization' as in most > > cases nowadays. > > Good idea. I'll try to submit a patch to add a comment if I get the chance > - otherwise feel free to do so yourself. Why not do it in this patch? Is it not enough related? > As for the naming, yes, I suppose it can be confusing. :-) We possibly need > to start calling these pieces of code SSE or AVX rather than just vector, > since for some we may end up with multiple vector versions. +1 for SSE/AVX naming
> The check for split packets to be reassembled in the vector ixgbe PMD > was incorrectly only checking the first 16 elements of the array instead > of all 32. This is fixed by changing the uint32_t values to be uint64_t > instead. > > Fixes: cf4b4708a88a ("ixgbe: improve slow-path perf with vector scattered Rx") > > Reported-by: Zoltan Kiss <zoltan.kiss@linaro.org> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> > > --- > V2: Rename variable from split_fl32 to split_fl64 to match type change. Applied, thanks
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c b/drivers/net/ixgbe/ixgbe_rxtx_vec.c index d3ac74a..f2052c6 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c @@ -549,10 +549,10 @@ ixgbe_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, return 0; /* happy day case, full burst + no packets to be joined */ - const uint32_t *split_fl32 = (uint32_t *)split_flags; + const uint64_t *split_fl64 = (uint64_t *)split_flags; if (rxq->pkt_first_seg == NULL && - split_fl32[0] == 0 && split_fl32[1] == 0 && - split_fl32[2] == 0 && split_fl32[3] == 0) + split_fl64[0] == 0 && split_fl64[1] == 0 && + split_fl64[2] == 0 && split_fl64[3] == 0) return nb_bufs; /* reassemble any packets that need reassembly*/