From: Mingjin Ye <mingjinx.ye@intel.com>
To: dev@dpdk.org
Cc: stable@dpdk.org, yidingx.zhou@intel.com,
Mingjin Ye <mingjinx.ye@intel.com>,
Qiming Yang <qiming.yang@intel.com>,
Qi Zhang <qi.z.zhang@intel.com>,
Ajit Khaparde <ajit.khaparde@broadcom.com>,
Olivier Matz <olivier.matz@6wind.com>,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
Somnath Kotur <somnath.kotur@broadcom.com>,
Xiaolong Ye <xiaolong.ye@intel.com>,
Haiyue Wang <haiyue.wang@intel.com>
Subject: [PATCH v2] net/ice: fix rx scalar path offload parse
Date: Fri, 28 Oct 2022 10:47:09 +0000 [thread overview]
Message-ID: <20221028104709.527795-1-mingjinx.ye@intel.com> (raw)
The status_0 field of the rx descriptor is incorrectly parsed as the error
field, resulting in a parsing error of offload features.
This patch fixes parsing of wrong fields.
Fixes: daa02b5cddbb ("mbuf: add namespace to offload flags")
Fixes: dbf3c0e77a22 ("net/ice: handle Rx flex descriptor")
Cc: stable@dpdk.org
Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
---
drivers/net/ice/ice_rxtx.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 71e5c6f5d6..3c558b32bd 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -1485,36 +1485,36 @@ ice_rx_queue_count(void *rx_queue)
(1 << ICE_RX_FLEX_DESC_STATUS0_XSUM_EIPE_S) | \
(1 << ICE_RX_FLEX_DESC_STATUS0_XSUM_EUDPE_S) | \
(1 << ICE_RX_FLEX_DESC_STATUS0_RXE_S))
-
+#define ICE_RXD_QW1_ERROR_SHIFT 19
/* Rx L3/L4 checksum */
static inline uint64_t
ice_rxd_error_to_pkt_flags(uint16_t stat_err0)
{
uint64_t flags = 0;
- /* check if HW has decoded the packet and checksum */
- if (unlikely(!(stat_err0 & (1 << ICE_RX_FLEX_DESC_STATUS0_L3L4P_S))))
- return 0;
+ uint64_t error_bits = (stat_err0 >> ICE_RXD_QW1_ERROR_SHIFT) & 0x7D;
- if (likely(!(stat_err0 & ICE_RX_FLEX_ERR0_BITS))) {
- flags |= (RTE_MBUF_F_RX_IP_CKSUM_GOOD | RTE_MBUF_F_RX_L4_CKSUM_GOOD);
+ if (likely(!(error_bits & ICE_RX_FLEX_ERR0_BITS))) {
+ flags |= (RTE_MBUF_F_RX_IP_CKSUM_GOOD |
+ RTE_MBUF_F_RX_L4_CKSUM_GOOD |
+ RTE_MBUF_F_RX_OUTER_L4_CKSUM_GOOD);
return flags;
}
- if (unlikely(stat_err0 & (1 << ICE_RX_FLEX_DESC_STATUS0_XSUM_IPE_S)))
+ if (unlikely(error_bits & (1 << ICE_RX_FLEX_DESC_STATUS0_XSUM_IPE_S)))
flags |= RTE_MBUF_F_RX_IP_CKSUM_BAD;
else
flags |= RTE_MBUF_F_RX_IP_CKSUM_GOOD;
- if (unlikely(stat_err0 & (1 << ICE_RX_FLEX_DESC_STATUS0_XSUM_L4E_S)))
+ if (unlikely(error_bits & (1 << ICE_RX_FLEX_DESC_STATUS0_XSUM_L4E_S)))
flags |= RTE_MBUF_F_RX_L4_CKSUM_BAD;
else
flags |= RTE_MBUF_F_RX_L4_CKSUM_GOOD;
- if (unlikely(stat_err0 & (1 << ICE_RX_FLEX_DESC_STATUS0_XSUM_EIPE_S)))
+ if (unlikely(error_bits & (1 << ICE_RX_FLEX_DESC_STATUS0_XSUM_EIPE_S)))
flags |= RTE_MBUF_F_RX_OUTER_IP_CKSUM_BAD;
- if (unlikely(stat_err0 & (1 << ICE_RX_FLEX_DESC_STATUS0_XSUM_EUDPE_S)))
+ if (unlikely(error_bits & (1 << ICE_RX_FLEX_DESC_STATUS0_XSUM_EUDPE_S)))
flags |= RTE_MBUF_F_RX_OUTER_L4_CKSUM_BAD;
else
flags |= RTE_MBUF_F_RX_OUTER_L4_CKSUM_GOOD;
--
2.34.1
next reply other threads:[~2022-10-28 3:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-28 10:47 Mingjin Ye [this message]
2022-10-28 10:59 Mingjin Ye
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=20221028104709.527795-1-mingjinx.ye@intel.com \
--to=mingjinx.ye@intel.com \
--cc=ajit.khaparde@broadcom.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=haiyue.wang@intel.com \
--cc=olivier.matz@6wind.com \
--cc=qi.z.zhang@intel.com \
--cc=qiming.yang@intel.com \
--cc=somnath.kotur@broadcom.com \
--cc=stable@dpdk.org \
--cc=xiaolong.ye@intel.com \
--cc=yidingx.zhou@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;
as well as URLs for NNTP newsgroup(s).