DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/i40e: fix incorrect checksum flag of L4 checksum
@ 2020-11-11  9:11 Murphy Yang
  2020-12-02  6:39 ` Guo, Jia
  2020-12-03  7:50 ` [dpdk-dev] [PATCH v2] " Murphy Yang
  0 siblings, 2 replies; 5+ messages in thread
From: Murphy Yang @ 2020-11-11  9:11 UTC (permalink / raw)
  To: dev; +Cc: qiming.yang, stevex.yang, beilei.xing, jia.guo, Murphy Yang

When send tunneled packet that inner L4 checksum value is correct,
the test_pmd output log shows 'ol_flags' value is
'PKT_RX_L4_CKSUM_UNKNOWN', but expected value is
'PKT_RX_L4_CKSUM_GOOD'.

Add the 'PKT_RX_L4_CKSUM_GOOD' to 'l3_l4e_flags' for sse and
'l3_l4_flags_shuf' for avx2 to ensure that the 'ol_flags' can match
correct flags.

Fixes: 9966a00a0688 ("net/i40e: enable bad checksum flags in vector Rx")
Fixes: dafadd73762e ("net/i40e: add AVX2 Rx function")

Signed-off-by: Murphy Yang <murphyx.yang@intel.com>
---
 drivers/net/i40e/i40e_rxtx_vec_avx2.c | 40 ++++++++++++++++-----------
 drivers/net/i40e/i40e_rxtx_vec_sse.c  | 20 ++++++++------
 2 files changed, 35 insertions(+), 25 deletions(-)

diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx2.c b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
index 7a558fc73a..fe6ec7deef 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_avx2.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
@@ -342,24 +342,32 @@ _recv_raw_pkts_vec_avx2(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts,
 	 */
 	const __m256i l3_l4_flags_shuf = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0,
 			/* shift right 1 bit to make sure it not exceed 255 */
-			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD) >> 1,
-			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_EIP_CKSUM_BAD) >> 1,
-			(PKT_RX_L4_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_BAD) >> 1,
-			PKT_RX_IP_CKSUM_BAD >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD) >> 1,
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD  |
+			 PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD  |
+			 PKT_RX_IP_CKSUM_GOOD) >> 1,
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_GOOD |
+			 PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_GOOD |
+			 PKT_RX_IP_CKSUM_GOOD) >> 1,
+			(PKT_RX_L4_CKSUM_BAD  | PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_L4_CKSUM_BAD  | PKT_RX_IP_CKSUM_GOOD) >> 1,
+			(PKT_RX_L4_CKSUM_GOOD | PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_L4_CKSUM_GOOD | PKT_RX_IP_CKSUM_GOOD) >> 1,
 			/* second 128-bits */
 			0, 0, 0, 0, 0, 0, 0, 0,
-			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD) >> 1,
-			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_EIP_CKSUM_BAD) >> 1,
-			(PKT_RX_L4_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_BAD) >> 1,
-			PKT_RX_IP_CKSUM_BAD >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD) >> 1);
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD  |
+			 PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD  |
+			 PKT_RX_IP_CKSUM_GOOD) >> 1,
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_GOOD |
+			 PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_GOOD |
+			 PKT_RX_IP_CKSUM_GOOD) >> 1,
+			(PKT_RX_L4_CKSUM_BAD  | PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_L4_CKSUM_BAD  | PKT_RX_IP_CKSUM_GOOD) >> 1,
+			(PKT_RX_L4_CKSUM_GOOD | PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_L4_CKSUM_GOOD | PKT_RX_IP_CKSUM_GOOD) >> 1);
 
 	const __m256i cksum_mask = _mm256_set1_epi32(
 			PKT_RX_IP_CKSUM_GOOD | PKT_RX_IP_CKSUM_BAD |
diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e_rxtx_vec_sse.c
index 4b2b6a28fc..0bcb48e24e 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
@@ -254,16 +254,18 @@ desc_to_olflags_v(struct i40e_rx_queue *rxq, volatile union i40e_rx_desc *rxdp,
 
 	const __m128i l3_l4e_flags = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0,
 			/* shift right 1 bit to make sure it not exceed 255 */
-			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD |
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD  |
 			 PKT_RX_IP_CKSUM_BAD) >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_EIP_CKSUM_BAD |
-			 PKT_RX_L4_CKSUM_BAD) >> 1,
-			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_EIP_CKSUM_BAD) >> 1,
-			(PKT_RX_L4_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_BAD) >> 1,
-			PKT_RX_IP_CKSUM_BAD >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD) >> 1);
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD  |
+			 PKT_RX_IP_CKSUM_GOOD) >> 1,
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_GOOD |
+			 PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_GOOD |
+			 PKT_RX_IP_CKSUM_GOOD) >> 1,
+			(PKT_RX_L4_CKSUM_BAD  | PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_L4_CKSUM_BAD  | PKT_RX_IP_CKSUM_GOOD) >> 1,
+			(PKT_RX_L4_CKSUM_GOOD | PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_L4_CKSUM_GOOD | PKT_RX_IP_CKSUM_GOOD) >> 1);
 
 	/* Unpack "status" from quadword 1, bits 0:32 */
 	vlan0 = _mm_unpackhi_epi32(descs[0], descs[1]);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] net/i40e: fix incorrect checksum flag of L4 checksum
  2020-11-11  9:11 [dpdk-dev] [PATCH] net/i40e: fix incorrect checksum flag of L4 checksum Murphy Yang
@ 2020-12-02  6:39 ` Guo, Jia
  2020-12-03  7:50 ` [dpdk-dev] [PATCH v2] " Murphy Yang
  1 sibling, 0 replies; 5+ messages in thread
From: Guo, Jia @ 2020-12-02  6:39 UTC (permalink / raw)
  To: Yang, MurphyX, dev
  Cc: Yang, Qiming, Yang, SteveX, Xing, Beilei, Yang, MurphyX

Hi, murphy

> -----Original Message-----
> From: Murphy Yang <murphyx.yang@intel.com>
> Sent: Wednesday, November 11, 2020 5:11 PM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Yang, SteveX
> <stevex.yang@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Guo, Jia
> <jia.guo@intel.com>; Yang, MurphyX <murphyx.yang@intel.com>
> Subject: [PATCH] net/i40e: fix incorrect checksum flag of L4 checksum
> 
> When send tunneled packet that inner L4 checksum value is correct, the
> test_pmd output log shows 'ol_flags' value is
> 'PKT_RX_L4_CKSUM_UNKNOWN', but expected value is
> 'PKT_RX_L4_CKSUM_GOOD'.
> 
> Add the 'PKT_RX_L4_CKSUM_GOOD' to 'l3_l4e_flags' for sse and
> 'l3_l4_flags_shuf' for avx2 to ensure that the 'ol_flags' can match correct flags.
> 

Seems that 'PKT_RX_L4_CKSUM_GOOD' is previous there but not set correctly, so maybe it should
not say " Add the 'PKT_RX_L4_CKSUM_GOOD' to 'l3_l4e_flags' .... "
Add more, could you please to check if the other rx vec path also need it, such as vec_altivec and vec_neon?

> Fixes: 9966a00a0688 ("net/i40e: enable bad checksum flags in vector Rx")
> Fixes: dafadd73762e ("net/i40e: add AVX2 Rx function")
> 
> Signed-off-by: Murphy Yang <murphyx.yang@intel.com>
> ---
>  drivers/net/i40e/i40e_rxtx_vec_avx2.c | 40 ++++++++++++++++-----------
> drivers/net/i40e/i40e_rxtx_vec_sse.c  | 20 ++++++++------
>  2 files changed, 35 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx2.c
> b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
> index 7a558fc73a..fe6ec7deef 100644
> --- a/drivers/net/i40e/i40e_rxtx_vec_avx2.c
> +++ b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
> @@ -342,24 +342,32 @@ _recv_raw_pkts_vec_avx2(struct i40e_rx_queue
> *rxq, struct rte_mbuf **rx_pkts,
>  	 */
>  	const __m256i l3_l4_flags_shuf = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0,
> 0,
>  			/* shift right 1 bit to make sure it not exceed 255 */
> -			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD) >> 1,
> -			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_EIP_CKSUM_BAD) >> 1,
> -			(PKT_RX_L4_CKSUM_BAD |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_L4_CKSUM_BAD) >> 1,
> -			PKT_RX_IP_CKSUM_BAD >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_L4_CKSUM_GOOD) >> 1,
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_BAD  |
> +			 PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_BAD  |
> +			 PKT_RX_IP_CKSUM_GOOD) >> 1,
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_GOOD |
> +			 PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_GOOD |
> +			 PKT_RX_IP_CKSUM_GOOD) >> 1,
> +			(PKT_RX_L4_CKSUM_BAD  |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_L4_CKSUM_BAD  |
> PKT_RX_IP_CKSUM_GOOD) >> 1,
> +			(PKT_RX_L4_CKSUM_GOOD |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_L4_CKSUM_GOOD |
> PKT_RX_IP_CKSUM_GOOD) >> 1,
>  			/* second 128-bits */
>  			0, 0, 0, 0, 0, 0, 0, 0,
> -			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD) >> 1,
> -			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_EIP_CKSUM_BAD) >> 1,
> -			(PKT_RX_L4_CKSUM_BAD |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_L4_CKSUM_BAD) >> 1,
> -			PKT_RX_IP_CKSUM_BAD >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_L4_CKSUM_GOOD) >> 1);
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_BAD  |
> +			 PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_BAD  |
> +			 PKT_RX_IP_CKSUM_GOOD) >> 1,
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_GOOD |
> +			 PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_GOOD |
> +			 PKT_RX_IP_CKSUM_GOOD) >> 1,
> +			(PKT_RX_L4_CKSUM_BAD  |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_L4_CKSUM_BAD  |
> PKT_RX_IP_CKSUM_GOOD) >> 1,
> +			(PKT_RX_L4_CKSUM_GOOD |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_L4_CKSUM_GOOD |
> PKT_RX_IP_CKSUM_GOOD) >> 1);
> 

Could you double check if it is reasonable that the " PKT_RX_EIP_CKSUM_BAD" is always be set, but no " PKT_RX_EIP_CKSUM_GOOD "?

>  	const __m256i cksum_mask = _mm256_set1_epi32(
>  			PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_IP_CKSUM_BAD | diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c
> b/drivers/net/i40e/i40e_rxtx_vec_sse.c
> index 4b2b6a28fc..0bcb48e24e 100644
> --- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
> +++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
> @@ -254,16 +254,18 @@ desc_to_olflags_v(struct i40e_rx_queue *rxq,
> volatile union i40e_rx_desc *rxdp,
> 
>  	const __m128i l3_l4e_flags = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0,
>  			/* shift right 1 bit to make sure it not exceed 255 */
> -			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_BAD |
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_BAD  |
>  			 PKT_RX_IP_CKSUM_BAD) >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_EIP_CKSUM_BAD |
> -			 PKT_RX_L4_CKSUM_BAD) >> 1,
> -			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_EIP_CKSUM_BAD) >> 1,
> -			(PKT_RX_L4_CKSUM_BAD |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_L4_CKSUM_BAD) >> 1,
> -			PKT_RX_IP_CKSUM_BAD >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_L4_CKSUM_GOOD) >> 1);
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_BAD  |
> +			 PKT_RX_IP_CKSUM_GOOD) >> 1,
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_GOOD |
> +			 PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_GOOD |
> +			 PKT_RX_IP_CKSUM_GOOD) >> 1,
> +			(PKT_RX_L4_CKSUM_BAD  |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_L4_CKSUM_BAD  |
> PKT_RX_IP_CKSUM_GOOD) >> 1,
> +			(PKT_RX_L4_CKSUM_GOOD |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_L4_CKSUM_GOOD |
> PKT_RX_IP_CKSUM_GOOD) >> 1);
> 
>  	/* Unpack "status" from quadword 1, bits 0:32 */
>  	vlan0 = _mm_unpackhi_epi32(descs[0], descs[1]);
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [PATCH v2] net/i40e: fix incorrect checksum flag of L4 checksum
  2020-11-11  9:11 [dpdk-dev] [PATCH] net/i40e: fix incorrect checksum flag of L4 checksum Murphy Yang
  2020-12-02  6:39 ` Guo, Jia
@ 2020-12-03  7:50 ` Murphy Yang
  2020-12-04  2:18   ` Guo, Jia
  1 sibling, 1 reply; 5+ messages in thread
From: Murphy Yang @ 2020-12-03  7:50 UTC (permalink / raw)
  To: dev; +Cc: qiming.yang, stevex.yang, jia.guo, beilei.xing, Murphy Yang

When send tunneled packet that inner L4 checksum value is correct,
the test_pmd output log shows 'ol_flags' value is
'PKT_RX_L4_CKSUM_UNKNOWN', but expected value is
'PKT_RX_L4_CKSUM_GOOD'.

If the inner l4 checksum is correctly, mark the 'PKT_RX_L4_CKSUM_GOOD'
flag to 'l3_l4e_flags' for sse and 'l3_l4_flags_shuf' for avx2 to
ensure that the 'ol_flags' can match correct flags.

Fixes: 9966a00a0688 ("net/i40e: enable bad checksum flags in vector Rx")
Fixes: dafadd73762e ("net/i40e: add AVX2 Rx function")

Signed-off-by: Murphy Yang <murphyx.yang@intel.com>
---
v2:
- update the comments.
 drivers/net/i40e/i40e_rxtx_vec_avx2.c | 40 ++++++++++++++++-----------
 drivers/net/i40e/i40e_rxtx_vec_sse.c  | 20 ++++++++------
 2 files changed, 35 insertions(+), 25 deletions(-)

diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx2.c b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
index 7a558fc73a..fe6ec7deef 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_avx2.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
@@ -342,24 +342,32 @@ _recv_raw_pkts_vec_avx2(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts,
 	 */
 	const __m256i l3_l4_flags_shuf = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0,
 			/* shift right 1 bit to make sure it not exceed 255 */
-			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD) >> 1,
-			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_EIP_CKSUM_BAD) >> 1,
-			(PKT_RX_L4_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_BAD) >> 1,
-			PKT_RX_IP_CKSUM_BAD >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD) >> 1,
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD  |
+			 PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD  |
+			 PKT_RX_IP_CKSUM_GOOD) >> 1,
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_GOOD |
+			 PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_GOOD |
+			 PKT_RX_IP_CKSUM_GOOD) >> 1,
+			(PKT_RX_L4_CKSUM_BAD  | PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_L4_CKSUM_BAD  | PKT_RX_IP_CKSUM_GOOD) >> 1,
+			(PKT_RX_L4_CKSUM_GOOD | PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_L4_CKSUM_GOOD | PKT_RX_IP_CKSUM_GOOD) >> 1,
 			/* second 128-bits */
 			0, 0, 0, 0, 0, 0, 0, 0,
-			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD) >> 1,
-			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_EIP_CKSUM_BAD) >> 1,
-			(PKT_RX_L4_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_BAD) >> 1,
-			PKT_RX_IP_CKSUM_BAD >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD) >> 1);
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD  |
+			 PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD  |
+			 PKT_RX_IP_CKSUM_GOOD) >> 1,
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_GOOD |
+			 PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_GOOD |
+			 PKT_RX_IP_CKSUM_GOOD) >> 1,
+			(PKT_RX_L4_CKSUM_BAD  | PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_L4_CKSUM_BAD  | PKT_RX_IP_CKSUM_GOOD) >> 1,
+			(PKT_RX_L4_CKSUM_GOOD | PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_L4_CKSUM_GOOD | PKT_RX_IP_CKSUM_GOOD) >> 1);
 
 	const __m256i cksum_mask = _mm256_set1_epi32(
 			PKT_RX_IP_CKSUM_GOOD | PKT_RX_IP_CKSUM_BAD |
diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e_rxtx_vec_sse.c
index 4b2b6a28fc..0bcb48e24e 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
@@ -254,16 +254,18 @@ desc_to_olflags_v(struct i40e_rx_queue *rxq, volatile union i40e_rx_desc *rxdp,
 
 	const __m128i l3_l4e_flags = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0,
 			/* shift right 1 bit to make sure it not exceed 255 */
-			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD |
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD  |
 			 PKT_RX_IP_CKSUM_BAD) >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_EIP_CKSUM_BAD |
-			 PKT_RX_L4_CKSUM_BAD) >> 1,
-			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_EIP_CKSUM_BAD) >> 1,
-			(PKT_RX_L4_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_BAD) >> 1,
-			PKT_RX_IP_CKSUM_BAD >> 1,
-			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD) >> 1);
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD  |
+			 PKT_RX_IP_CKSUM_GOOD) >> 1,
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_GOOD |
+			 PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_GOOD |
+			 PKT_RX_IP_CKSUM_GOOD) >> 1,
+			(PKT_RX_L4_CKSUM_BAD  | PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_L4_CKSUM_BAD  | PKT_RX_IP_CKSUM_GOOD) >> 1,
+			(PKT_RX_L4_CKSUM_GOOD | PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_L4_CKSUM_GOOD | PKT_RX_IP_CKSUM_GOOD) >> 1);
 
 	/* Unpack "status" from quadword 1, bits 0:32 */
 	vlan0 = _mm_unpackhi_epi32(descs[0], descs[1]);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/i40e: fix incorrect checksum flag of L4 checksum
  2020-12-03  7:50 ` [dpdk-dev] [PATCH v2] " Murphy Yang
@ 2020-12-04  2:18   ` Guo, Jia
  2020-12-11  2:16     ` Zhang, Qi Z
  0 siblings, 1 reply; 5+ messages in thread
From: Guo, Jia @ 2020-12-04  2:18 UTC (permalink / raw)
  To: Yang, MurphyX, dev
  Cc: Yang, Qiming, Yang, SteveX, Xing, Beilei, Yang, MurphyX

Acked-by: Jeff Guo <jia.guo@intel.com>

> -----Original Message-----
> From: Murphy Yang <murphyx.yang@intel.com>
> Sent: Thursday, December 3, 2020 3:51 PM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Yang, SteveX
> <stevex.yang@intel.com>; Guo, Jia <jia.guo@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>; Yang, MurphyX <murphyx.yang@intel.com>
> Subject: [PATCH v2] net/i40e: fix incorrect checksum flag of L4 checksum
> 
> When send tunneled packet that inner L4 checksum value is correct, the
> test_pmd output log shows 'ol_flags' value is
> 'PKT_RX_L4_CKSUM_UNKNOWN', but expected value is
> 'PKT_RX_L4_CKSUM_GOOD'.
> 
> If the inner l4 checksum is correctly, mark the 'PKT_RX_L4_CKSUM_GOOD'
> flag to 'l3_l4e_flags' for sse and 'l3_l4_flags_shuf' for avx2 to ensure that the
> 'ol_flags' can match correct flags.
> 
> Fixes: 9966a00a0688 ("net/i40e: enable bad checksum flags in vector Rx")
> Fixes: dafadd73762e ("net/i40e: add AVX2 Rx function")
> 
> Signed-off-by: Murphy Yang <murphyx.yang@intel.com>
> ---
> v2:
> - update the comments.
>  drivers/net/i40e/i40e_rxtx_vec_avx2.c | 40 ++++++++++++++++-----------
> drivers/net/i40e/i40e_rxtx_vec_sse.c  | 20 ++++++++------
>  2 files changed, 35 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx2.c
> b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
> index 7a558fc73a..fe6ec7deef 100644
> --- a/drivers/net/i40e/i40e_rxtx_vec_avx2.c
> +++ b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
> @@ -342,24 +342,32 @@ _recv_raw_pkts_vec_avx2(struct i40e_rx_queue
> *rxq, struct rte_mbuf **rx_pkts,
>  	 */
>  	const __m256i l3_l4_flags_shuf = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0,
> 0,
>  			/* shift right 1 bit to make sure it not exceed 255 */
> -			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD) >> 1,
> -			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_EIP_CKSUM_BAD) >> 1,
> -			(PKT_RX_L4_CKSUM_BAD |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_L4_CKSUM_BAD) >> 1,
> -			PKT_RX_IP_CKSUM_BAD >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_L4_CKSUM_GOOD) >> 1,
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_BAD  |
> +			 PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_BAD  |
> +			 PKT_RX_IP_CKSUM_GOOD) >> 1,
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_GOOD |
> +			 PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_GOOD |
> +			 PKT_RX_IP_CKSUM_GOOD) >> 1,
> +			(PKT_RX_L4_CKSUM_BAD  |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_L4_CKSUM_BAD  |
> PKT_RX_IP_CKSUM_GOOD) >> 1,
> +			(PKT_RX_L4_CKSUM_GOOD |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_L4_CKSUM_GOOD |
> PKT_RX_IP_CKSUM_GOOD) >> 1,
>  			/* second 128-bits */
>  			0, 0, 0, 0, 0, 0, 0, 0,
> -			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD) >> 1,
> -			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_EIP_CKSUM_BAD) >> 1,
> -			(PKT_RX_L4_CKSUM_BAD |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_L4_CKSUM_BAD) >> 1,
> -			PKT_RX_IP_CKSUM_BAD >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_L4_CKSUM_GOOD) >> 1);
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_BAD  |
> +			 PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_BAD  |
> +			 PKT_RX_IP_CKSUM_GOOD) >> 1,
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_GOOD |
> +			 PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_GOOD |
> +			 PKT_RX_IP_CKSUM_GOOD) >> 1,
> +			(PKT_RX_L4_CKSUM_BAD  |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_L4_CKSUM_BAD  |
> PKT_RX_IP_CKSUM_GOOD) >> 1,
> +			(PKT_RX_L4_CKSUM_GOOD |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_L4_CKSUM_GOOD |
> PKT_RX_IP_CKSUM_GOOD) >> 1);
> 
>  	const __m256i cksum_mask = _mm256_set1_epi32(
>  			PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_IP_CKSUM_BAD | diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c
> b/drivers/net/i40e/i40e_rxtx_vec_sse.c
> index 4b2b6a28fc..0bcb48e24e 100644
> --- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
> +++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
> @@ -254,16 +254,18 @@ desc_to_olflags_v(struct i40e_rx_queue *rxq,
> volatile union i40e_rx_desc *rxdp,
> 
>  	const __m128i l3_l4e_flags = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0,
>  			/* shift right 1 bit to make sure it not exceed 255 */
> -			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_BAD |
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_BAD  |
>  			 PKT_RX_IP_CKSUM_BAD) >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_EIP_CKSUM_BAD |
> -			 PKT_RX_L4_CKSUM_BAD) >> 1,
> -			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_EIP_CKSUM_BAD) >> 1,
> -			(PKT_RX_L4_CKSUM_BAD |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_L4_CKSUM_BAD) >> 1,
> -			PKT_RX_IP_CKSUM_BAD >> 1,
> -			(PKT_RX_IP_CKSUM_GOOD |
> PKT_RX_L4_CKSUM_GOOD) >> 1);
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_BAD  |
> +			 PKT_RX_IP_CKSUM_GOOD) >> 1,
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_GOOD |
> +			 PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_EIP_CKSUM_BAD |
> PKT_RX_L4_CKSUM_GOOD |
> +			 PKT_RX_IP_CKSUM_GOOD) >> 1,
> +			(PKT_RX_L4_CKSUM_BAD  |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_L4_CKSUM_BAD  |
> PKT_RX_IP_CKSUM_GOOD) >> 1,
> +			(PKT_RX_L4_CKSUM_GOOD |
> PKT_RX_IP_CKSUM_BAD) >> 1,
> +			(PKT_RX_L4_CKSUM_GOOD |
> PKT_RX_IP_CKSUM_GOOD) >> 1);
> 
>  	/* Unpack "status" from quadword 1, bits 0:32 */
>  	vlan0 = _mm_unpackhi_epi32(descs[0], descs[1]);
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/i40e: fix incorrect checksum flag of L4 checksum
  2020-12-04  2:18   ` Guo, Jia
@ 2020-12-11  2:16     ` Zhang, Qi Z
  0 siblings, 0 replies; 5+ messages in thread
From: Zhang, Qi Z @ 2020-12-11  2:16 UTC (permalink / raw)
  To: Guo, Jia, Yang, MurphyX, dev
  Cc: Yang, Qiming, Yang, SteveX, Xing, Beilei, Yang, MurphyX



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Guo, Jia
> Sent: Friday, December 4, 2020 10:19 AM
> To: Yang, MurphyX <murphyx.yang@intel.com>; dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Yang, SteveX
> <stevex.yang@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Yang, MurphyX
> <murphyx.yang@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix incorrect checksum flag of L4
> checksum
> 
> Acked-by: Jeff Guo <jia.guo@intel.com>
> 
> > -----Original Message-----
> > From: Murphy Yang <murphyx.yang@intel.com>
> > Sent: Thursday, December 3, 2020 3:51 PM
> > To: dev@dpdk.org
> > Cc: Yang, Qiming <qiming.yang@intel.com>; Yang, SteveX
> > <stevex.yang@intel.com>; Guo, Jia <jia.guo@intel.com>; Xing, Beilei
> > <beilei.xing@intel.com>; Yang, MurphyX <murphyx.yang@intel.com>
> > Subject: [PATCH v2] net/i40e: fix incorrect checksum flag of L4
> > checksum
> >
> > When send tunneled packet that inner L4 checksum value is correct, the
> > test_pmd output log shows 'ol_flags' value is
> > 'PKT_RX_L4_CKSUM_UNKNOWN', but expected value is
> > 'PKT_RX_L4_CKSUM_GOOD'.
> >
> > If the inner l4 checksum is correctly, mark the 'PKT_RX_L4_CKSUM_GOOD'
> > flag to 'l3_l4e_flags' for sse and 'l3_l4_flags_shuf' for avx2 to
> > ensure that the 'ol_flags' can match correct flags.
> >
> > Fixes: 9966a00a0688 ("net/i40e: enable bad checksum flags in vector
> > Rx")
> > Fixes: dafadd73762e ("net/i40e: add AVX2 Rx function")
> >
> > Signed-off-by: Murphy Yang <murphyx.yang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-11  2:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-11  9:11 [dpdk-dev] [PATCH] net/i40e: fix incorrect checksum flag of L4 checksum Murphy Yang
2020-12-02  6:39 ` Guo, Jia
2020-12-03  7:50 ` [dpdk-dev] [PATCH v2] " Murphy Yang
2020-12-04  2:18   ` Guo, Jia
2020-12-11  2:16     ` Zhang, Qi Z

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git