[dpdk-dev,4/5] net/ixgbe: implement new Rx checksum flag

Message ID 1472147299-2376-5-git-send-email-xiao.w.wang@intel.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Xiao Wang Aug. 25, 2016, 5:48 p.m. UTC
  Add CKSUM_GOOD flag to distinguish a good checksum from an unknown one.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
---
 drivers/net/ixgbe/ixgbe_rxtx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Olivier Matz Aug. 26, 2016, 7:30 a.m. UTC | #1
Hi Xiao,

On 08/25/2016 07:48 PM, Xiao Wang wrote:
> Add CKSUM_GOOD flag to distinguish a good checksum from an unknown one.
> 
> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_rxtx.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
> index 8a306b0..d2dc82a 100644
> --- a/drivers/net/ixgbe/ixgbe_rxtx.c
> +++ b/drivers/net/ixgbe/ixgbe_rxtx.c
> @@ -1345,7 +1345,9 @@ rx_desc_error_to_pkt_flags(uint32_t rx_status)
>  	 * Bit 30: L4I, L4I integrity error
>  	 */
>  	static uint64_t error_to_pkt_flags_map[4] = {
> -		0,  PKT_RX_L4_CKSUM_BAD, PKT_RX_IP_CKSUM_BAD,
> +		PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD,
> +		PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_BAD,
> +		PKT_RX_IP_CKSUM_BAD | PKT_RX_L4_CKSUM_GOOD,
>  		PKT_RX_IP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD
>  	};
>  	pkt_flags = error_to_pkt_flags_map[(rx_status >>
> 

I think this would somehow conflict with the patch adding the support of
Rx checksum offload in vector receive function:

http://dpdk.org/dev/patchwork/patch/14630/

Depending on which one is pushed first, the second one would need to be
reworked.

Olivier
  
Xiao Wang Aug. 31, 2016, 9:07 a.m. UTC | #2
Hi Olivier,

> -----Original Message-----
> From: Olivier Matz [mailto:olivier.matz@6wind.com]
> Sent: Friday, August 26, 2016 3:30 PM
> To: Wang, Xiao W <xiao.w.wang@intel.com>; Chen, Jing D
> <jing.d.chen@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [PATCH 4/5] net/ixgbe: implement new Rx checksum flag
> 
> Hi Xiao,
> 
> On 08/25/2016 07:48 PM, Xiao Wang wrote:
> > Add CKSUM_GOOD flag to distinguish a good checksum from an unknown
> one.
> >
> > Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
> > ---
> >  drivers/net/ixgbe/ixgbe_rxtx.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
> > index 8a306b0..d2dc82a 100644
> > --- a/drivers/net/ixgbe/ixgbe_rxtx.c
> > +++ b/drivers/net/ixgbe/ixgbe_rxtx.c
> > @@ -1345,7 +1345,9 @@ rx_desc_error_to_pkt_flags(uint32_t rx_status)
> >  	 * Bit 30: L4I, L4I integrity error
> >  	 */
> >  	static uint64_t error_to_pkt_flags_map[4] = {
> > -		0,  PKT_RX_L4_CKSUM_BAD, PKT_RX_IP_CKSUM_BAD,
> > +		PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD,
> > +		PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_BAD,
> > +		PKT_RX_IP_CKSUM_BAD | PKT_RX_L4_CKSUM_GOOD,
> >  		PKT_RX_IP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD
> >  	};
> >  	pkt_flags = error_to_pkt_flags_map[(rx_status >>
> >
> 
> I think this would somehow conflict with the patch adding the support of
> Rx checksum offload in vector receive function:
> 
> http://dpdk.org/dev/patchwork/patch/14630/
> 
> Depending on which one is pushed first, the second one would need to be
> reworked.
> 
> Olivier

Yes, since your patch supports cksum in vector Rx, I'll add the new cksum flags for it
based on your patch.

Best Regards,
Xiao
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 8a306b0..d2dc82a 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -1345,7 +1345,9 @@  rx_desc_error_to_pkt_flags(uint32_t rx_status)
 	 * Bit 30: L4I, L4I integrity error
 	 */
 	static uint64_t error_to_pkt_flags_map[4] = {
-		0,  PKT_RX_L4_CKSUM_BAD, PKT_RX_IP_CKSUM_BAD,
+		PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD,
+		PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_BAD,
+		PKT_RX_IP_CKSUM_BAD | PKT_RX_L4_CKSUM_GOOD,
 		PKT_RX_IP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD
 	};
 	pkt_flags = error_to_pkt_flags_map[(rx_status >>