* [PATCH v2] net/ice: fix rx scalar path offload parse
@ 2022-10-28 10:47 Mingjin Ye
0 siblings, 0 replies; 2+ messages in thread
From: Mingjin Ye @ 2022-10-28 10:47 UTC (permalink / raw)
To: dev
Cc: stable, yidingx.zhou, Mingjin Ye, Qiming Yang, Qi Zhang,
Ajit Khaparde, Olivier Matz, Andrew Rybchenko, Somnath Kotur,
Xiaolong Ye, Haiyue Wang
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH v2] net/ice: fix rx scalar path offload parse
@ 2022-10-28 10:59 Mingjin Ye
0 siblings, 0 replies; 2+ messages in thread
From: Mingjin Ye @ 2022-10-28 10:59 UTC (permalink / raw)
To: dev
Cc: stable, yidingx.zhou, Mingjin Ye, Qiming Yang, Qi Zhang,
Somnath Kotur, Andrew Rybchenko, Ajit Khaparde, Olivier Matz,
Haiyue Wang, Xiaolong Ye
The status_0 field of the rx descriptor is incorrectly parsed as the error
field, which causes the parsing error of offload features.
This patch is to fixe the 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-28 3:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-28 10:47 [PATCH v2] net/ice: fix rx scalar path offload parse Mingjin Ye
2022-10-28 10:59 Mingjin Ye
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).