[dpdk-dev] ixgbe: fix check for split packets

Message ID 1437492307-29754-1-git-send-email-bruce.richardson@intel.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Bruce Richardson July 21, 2015, 3:25 p.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>
---
 drivers/net/ixgbe/ixgbe_rxtx_vec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Wenzhuo Lu July 22, 2015, 12:44 a.m. UTC | #1
Hi Bruce,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Tuesday, July 21, 2015 11:25 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] ixgbe: fix check for split packets
> 
> 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>
> ---
>  drivers/net/ixgbe/ixgbe_rxtx_vec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> index 9f24849..cdad3e0 100644
> --- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> @@ -549,7 +549,7 @@ 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_fl32 = (uint64_t *)split_flags;
Why not change the name to split_fl64? I don't think it's appropriate to keep it be split_fl32.
Thanks.

>  	if (rxq->pkt_first_seg == NULL &&
>  			split_fl32[0] == 0 && split_fl32[1] == 0 &&
>  			split_fl32[2] == 0 && split_fl32[3] == 0)
> --
> 1.8.3.1
  
Bruce Richardson July 22, 2015, 8:29 a.m. UTC | #2
On Wed, Jul 22, 2015 at 01:44:14AM +0100, Lu, Wenzhuo wrote:
> Hi Bruce,
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> > Sent: Tuesday, July 21, 2015 11:25 PM
> > To: dev@dpdk.org
> > Subject: [dpdk-dev] [PATCH] ixgbe: fix check for split packets
> > 
> > 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>
> > ---
> >  drivers/net/ixgbe/ixgbe_rxtx_vec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> > b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> > index 9f24849..cdad3e0 100644
> > --- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> > +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> > @@ -549,7 +549,7 @@ 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_fl32 = (uint64_t *)split_flags;
> Why not change the name to split_fl64? I don't think it's appropriate to keep it be split_fl32.
> Thanks.
> 
Quite right, that's the obvious change! I'll do a V2.

/Bruce
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
index 9f24849..cdad3e0 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
@@ -549,7 +549,7 @@  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_fl32 = (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)