From: Bruce Richardson <bruce.richardson@intel.com>
To: Shaiq Wani <shaiq.wani@intel.com>
Cc: <dev@dpdk.org>, <aman.deep.singh@intel.com>
Subject: Re: [PATCH 1/6] net/idpf: fix gen bit extraction in split queue AVX2 Rx
Date: Wed, 20 May 2026 13:20:44 +0100 [thread overview]
Message-ID: <ag2nHHmn-A3shpIE@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20260511090935.2288837-2-shaiq.wani@intel.com>
On Mon, May 11, 2026 at 02:39:30PM +0530, Shaiq Wani wrote:
> The generation bit in the pktlen_gen_bufq_id field of the split queue
> completion descriptor (virtchnl2_rx_flex_desc_adv_nic_3) must be
> extracted by masking first and then shifting, not the other way around.
>
> With shift-then-mask, the mask is applied to already-shifted bits,
> which can produce incorrect results when upper bits (packet length,
> buffer queue ID) leak into the extracted value.
>
> Change to mask-then-shift to correctly isolate the generation bit
> before comparing it with the expected generation ID.
>
> Fixes: 1f065f9d75ff ("net/idpf: add AVX2 Rx path for split queue config")
> Signed-off-by: Shaiq Wani <shaiq.wani@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> .../net/intel/idpf/idpf_common_rxtx_avx2.c | 20 +++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/net/intel/idpf/idpf_common_rxtx_avx2.c b/drivers/net/intel/idpf/idpf_common_rxtx_avx2.c
> index db7728afad..cd10c27a30 100644
> --- a/drivers/net/intel/idpf/idpf_common_rxtx_avx2.c
> +++ b/drivers/net/intel/idpf/idpf_common_rxtx_avx2.c
> @@ -524,8 +524,8 @@ idpf_dp_splitq_recv_pkts_avx2(void *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_
>
> /* check if there is at least one packet available */
> head_gen = rxdp->flex_adv_nic_3_wb.pktlen_gen_bufq_id;
> - if (((head_gen >> VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_S) &
> - VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_M) != queue->expected_gen_id)
> + if (((head_gen & VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_M) >>
> + VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_S) != queue->expected_gen_id)
> return 0;
>
> for (i = 0; i < nb_pkts;
> @@ -599,17 +599,17 @@ idpf_dp_splitq_recv_pkts_avx2(void *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_
> pktlen_gen3 = (uint16_t)_mm_extract_epi16(d3, 2);
>
> valid0 = (stat0 & 1) &&
> - (((pktlen_gen0 >> VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_S) &
> - VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_M) == queue->expected_gen_id);
> + (((pktlen_gen0 & VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_M) >>
> + VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_S) == queue->expected_gen_id);
> valid1 = (stat1 & 1) &&
> - (((pktlen_gen1 >> VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_S) &
> - VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_M) == queue->expected_gen_id);
> + (((pktlen_gen1 & VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_M) >>
> + VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_S) == queue->expected_gen_id);
> valid2 = (stat2 & 1) &&
> - (((pktlen_gen2 >> VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_S) &
> - VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_M) == queue->expected_gen_id);
> + (((pktlen_gen2 & VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_M) >>
> + VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_S) == queue->expected_gen_id);
> valid3 = (stat3 & 1) &&
> - (((pktlen_gen3 >> VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_S) &
> - VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_M) == queue->expected_gen_id);
> + (((pktlen_gen3 & VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_M) >>
> + VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_S) == queue->expected_gen_id);
>
> /* count valid descriptors (holes are impossible because
> * descriptors are read in reverse order while the NIC
> --
> 2.34.1
>
next prev parent reply other threads:[~2026-05-20 12:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 9:09 [PATCH 0/6] net/idpf: fix split queue AVX2 datapath Shaiq Wani
2026-05-11 9:09 ` [PATCH 1/6] net/idpf: fix gen bit extraction in split queue AVX2 Rx Shaiq Wani
2026-05-20 12:20 ` Bruce Richardson [this message]
2026-05-11 9:09 ` [PATCH 2/6] net/idpf: fix DD bit byte offset " Shaiq Wani
2026-05-20 12:21 ` Bruce Richardson
2026-05-11 9:09 ` [PATCH 3/6] net/idpf: fix mbuf initializer source " Shaiq Wani
2026-05-20 12:21 ` Bruce Richardson
2026-05-11 9:09 ` [PATCH 4/6] net/idpf: fix ptype insert position " Shaiq Wani
2026-05-20 12:22 ` Bruce Richardson
2026-05-11 9:09 ` [PATCH 5/6] net/idpf: fix split queue AVX2 Tx buffer size shift Shaiq Wani
2026-05-20 12:23 ` Bruce Richardson
2026-05-11 9:09 ` [PATCH 6/6] net/idpf: fix split queue AVX2 Tx burst and completion Shaiq Wani
2026-05-20 12:25 ` Bruce Richardson
2026-05-20 12:36 ` [PATCH 0/6] net/idpf: fix split queue AVX2 datapath Bruce Richardson
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=ag2nHHmn-A3shpIE@bricha3-mobl1.ger.corp.intel.com \
--to=bruce.richardson@intel.com \
--cc=aman.deep.singh@intel.com \
--cc=dev@dpdk.org \
--cc=shaiq.wani@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox