All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Guo, Jia" <jia.guo@intel.com>
To: "Yang, MurphyX" <murphyx.yang@intel.com>, "dev@dpdk.org" <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
Date: Fri, 4 Dec 2020 02:18:46 +0000	[thread overview]
Message-ID: <c48495cb80a04b42b839be9ac768f0b4@intel.com> (raw)
In-Reply-To: <20201203075030.70053-1-murphyx.yang@intel.com>

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


  reply	other threads:[~2020-12-04  2:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2020-12-11  2:16     ` Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c48495cb80a04b42b839be9ac768f0b4@intel.com \
    --to=jia.guo@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=murphyx.yang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=stevex.yang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.