patch 'net/cnxk: fix mbuf data length' has been queued to stable release 21.11.1

Kevin Traynor ktraynor at redhat.com
Tue Mar 1 11:41:58 CET 2022


Hi,

FYI, your patch has been queued to stable release 21.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/06/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/c93302dd4f481d60a53fc03298dda05ab3a719e7

Thanks.

Kevin

---
>From c93302dd4f481d60a53fc03298dda05ab3a719e7 Mon Sep 17 00:00:00 2001
From: Rahul Bhansali <rbhansali at marvell.com>
Date: Wed, 19 Jan 2022 16:22:03 +0530
Subject: [PATCH] net/cnxk: fix mbuf data length

[ upstream commit 4e00823dcc66c64e9462f7af09af22276ca36cce ]

If multi-segment is enabled and single segment/packet
is received, then mbuf data_len is not updated in
cn9k_nix_cqe_to_mbuf() function.
Also, in case of timestamp is enabled, mbuf data_len
and pkt_len will be updated for all packets including
multi segmented packets.

Fixes: 7c6bee34064f ("net/cnxk: enable PTP processing in vector Rx")

Signed-off-by: Rahul Bhansali <rbhansali at marvell.com>
Acked-by: Jerin Jacob <jerinj at marvell.com>
---
 drivers/event/cnxk/cn10k_worker.h |  2 --
 drivers/event/cnxk/cn9k_worker.h  |  2 --
 drivers/net/cnxk/cn10k_rx.h       |  9 +++++++--
 drivers/net/cnxk/cn9k_rx.h        | 14 +++++++++-----
 drivers/net/cnxk/cnxk_ethdev.h    |  9 +++------
 5 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/drivers/event/cnxk/cn10k_worker.h b/drivers/event/cnxk/cn10k_worker.h
index f8331e88d7..340708aae5 100644
--- a/drivers/event/cnxk/cn10k_worker.h
+++ b/drivers/event/cnxk/cn10k_worker.h
@@ -170,5 +170,4 @@ cn10k_process_vwqe(uintptr_t vwqe, uint16_t port_id, const uint32_t flags,
 		cnxk_nix_mbuf_to_tstamp((struct rte_mbuf *)mbuf, tstamp,
 					flags & NIX_RX_OFFLOAD_TSTAMP_F,
-					flags & NIX_RX_MULTI_SEG_F,
 					(uint64_t *)tstamp_ptr);
 		wqe[0] = (uint64_t *)mbuf;
@@ -262,5 +261,4 @@ cn10k_sso_hws_get_work(struct cn10k_sso_hws *ws, struct rte_event *ev,
 						ws->tstamp,
 						flags & NIX_RX_OFFLOAD_TSTAMP_F,
-						flags & NIX_RX_MULTI_SEG_F,
 						(uint64_t *)tstamp_ptr);
 			gw.u64[1] = mbuf;
diff --git a/drivers/event/cnxk/cn9k_worker.h b/drivers/event/cnxk/cn9k_worker.h
index 9377fa50e7..8abdd13b66 100644
--- a/drivers/event/cnxk/cn9k_worker.h
+++ b/drivers/event/cnxk/cn9k_worker.h
@@ -210,5 +210,4 @@ cn9k_sso_hws_dual_get_work(uint64_t base, uint64_t pair_base,
 			cnxk_nix_mbuf_to_tstamp((struct rte_mbuf *)mbuf, tstamp,
 						flags & NIX_RX_OFFLOAD_TSTAMP_F,
-						flags & NIX_RX_MULTI_SEG_F,
 						(uint64_t *)tstamp_ptr);
 			gw.u64[1] = mbuf;
@@ -289,5 +288,4 @@ cn9k_sso_hws_get_work(struct cn9k_sso_hws *ws, struct rte_event *ev,
 						ws->tstamp,
 						flags & NIX_RX_OFFLOAD_TSTAMP_F,
-						flags & NIX_RX_MULTI_SEG_F,
 						(uint64_t *)tstamp_ptr);
 			gw.u64[1] = mbuf;
diff --git a/drivers/net/cnxk/cn10k_rx.h b/drivers/net/cnxk/cn10k_rx.h
index fe408907a6..9d969cee87 100644
--- a/drivers/net/cnxk/cn10k_rx.h
+++ b/drivers/net/cnxk/cn10k_rx.h
@@ -364,5 +364,11 @@ cn10k_nix_cqe_to_mbuf(const struct nix_cqe_hdr_s *cq, const uint32_t tag,
 
 	if (flag & NIX_RX_MULTI_SEG_F)
-		nix_cqe_xtract_mseg(rx, mbuf, val, flag);
+		/*
+		 * For multi segment packets, mbuf length correction according
+		 * to Rx timestamp length will be handled later during
+		 * timestamp data process.
+		 * Hence, flag argument is not required.
+		 */
+		nix_cqe_xtract_mseg(rx, mbuf, val, 0);
 	else
 		mbuf->next = NULL;
@@ -452,5 +458,4 @@ cn10k_nix_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t pkts,
 		cnxk_nix_mbuf_to_tstamp(mbuf, rxq->tstamp,
 					(flags & NIX_RX_OFFLOAD_TSTAMP_F),
-					(flags & NIX_RX_MULTI_SEG_F),
 					(uint64_t *)((uint8_t *)mbuf
 								+ data_off));
diff --git a/drivers/net/cnxk/cn9k_rx.h b/drivers/net/cnxk/cn9k_rx.h
index 225bb4197c..848df4190c 100644
--- a/drivers/net/cnxk/cn9k_rx.h
+++ b/drivers/net/cnxk/cn9k_rx.h
@@ -342,12 +342,17 @@ skip_parse:
 			nix_update_match_id(rx->cn9k.match_id, ol_flags, mbuf);
 
+	mbuf->ol_flags = ol_flags;
+	*(uint64_t *)(&mbuf->rearm_data) = val;
 	mbuf->pkt_len = len;
 	mbuf->data_len = len;
-	*(uint64_t *)(&mbuf->rearm_data) = val;
-
-	mbuf->ol_flags = ol_flags;
 
 	if (flag & NIX_RX_MULTI_SEG_F)
-		nix_cqe_xtract_mseg(rx, mbuf, val, flag);
+		/*
+		 * For multi segment packets, mbuf length correction according
+		 * to Rx timestamp length will be handled later during
+		 * timestamp data process.
+		 * Hence, flag argument is not required.
+		 */
+		nix_cqe_xtract_mseg(rx, mbuf, val, 0);
 	else
 		mbuf->next = NULL;
@@ -414,5 +419,4 @@ cn9k_nix_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t pkts,
 		cnxk_nix_mbuf_to_tstamp(mbuf, rxq->tstamp,
 					(flags & NIX_RX_OFFLOAD_TSTAMP_F),
-					(flags & NIX_RX_MULTI_SEG_F),
 					(uint64_t *)((uint8_t *)mbuf
 								+ data_off));
diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
index 5bfda3d815..480cc6dfa4 100644
--- a/drivers/net/cnxk/cnxk_ethdev.h
+++ b/drivers/net/cnxk/cnxk_ethdev.h
@@ -686,12 +686,9 @@ static __rte_always_inline void
 cnxk_nix_mbuf_to_tstamp(struct rte_mbuf *mbuf,
 			struct cnxk_timesync_info *tstamp,
-			const uint8_t ts_enable, const uint8_t mseg_enable,
-			uint64_t *tstamp_ptr)
+			const uint8_t ts_enable, uint64_t *tstamp_ptr)
 {
 	if (ts_enable) {
-		if (!mseg_enable) {
-			mbuf->pkt_len -= CNXK_NIX_TIMESYNC_RX_OFFSET;
-			mbuf->data_len -= CNXK_NIX_TIMESYNC_RX_OFFSET;
-		}
+		mbuf->pkt_len -= CNXK_NIX_TIMESYNC_RX_OFFSET;
+		mbuf->data_len -= CNXK_NIX_TIMESYNC_RX_OFFSET;
 
 		/* Reading the rx timestamp inserted by CGX, viz at
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-03-01 10:41:02.448728856 +0000
+++ 0042-net-cnxk-fix-mbuf-data-length.patch	2022-03-01 10:41:01.312244099 +0000
@@ -1 +1 @@
-From 4e00823dcc66c64e9462f7af09af22276ca36cce Mon Sep 17 00:00:00 2001
+From c93302dd4f481d60a53fc03298dda05ab3a719e7 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4e00823dcc66c64e9462f7af09af22276ca36cce ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
@@ -22 +23 @@
- drivers/net/cnxk/cn9k_rx.h        | 16 ++++++++++------
+ drivers/net/cnxk/cn9k_rx.h        | 14 +++++++++-----
@@ -24 +25 @@
- 5 files changed, 20 insertions(+), 18 deletions(-)
+ 5 files changed, 19 insertions(+), 17 deletions(-)
@@ -27 +28 @@
-index bb32ef75ef..56e84bd599 100644
+index f8331e88d7..340708aae5 100644
@@ -30 +31 @@
-@@ -175,5 +175,4 @@ cn10k_process_vwqe(uintptr_t vwqe, uint16_t port_id, const uint32_t flags,
+@@ -170,5 +170,4 @@ cn10k_process_vwqe(uintptr_t vwqe, uint16_t port_id, const uint32_t flags,
@@ -36 +37 @@
-@@ -267,5 +266,4 @@ cn10k_sso_hws_get_work(struct cn10k_sso_hws *ws, struct rte_event *ev,
+@@ -262,5 +261,4 @@ cn10k_sso_hws_get_work(struct cn10k_sso_hws *ws, struct rte_event *ev,
@@ -43 +44 @@
-index 79b2b3809f..385cc656cb 100644
+index 9377fa50e7..8abdd13b66 100644
@@ -46,2 +47,2 @@
-@@ -232,5 +232,4 @@ cn9k_sso_hws_dual_get_work(uint64_t base, uint64_t pair_base,
- 						dws->tstamp,
+@@ -210,5 +210,4 @@ cn9k_sso_hws_dual_get_work(uint64_t base, uint64_t pair_base,
+ 			cnxk_nix_mbuf_to_tstamp((struct rte_mbuf *)mbuf, tstamp,
@@ -52 +53 @@
-@@ -309,5 +308,4 @@ cn9k_sso_hws_get_work(struct cn9k_sso_hws *ws, struct rte_event *ev,
+@@ -289,5 +288,4 @@ cn9k_sso_hws_get_work(struct cn9k_sso_hws *ws, struct rte_event *ev,
@@ -59 +60 @@
-index 564e50f0af..0c9fe4af6d 100644
+index fe408907a6..9d969cee87 100644
@@ -62 +63 @@
-@@ -365,5 +365,11 @@ cn10k_nix_cqe_to_mbuf(const struct nix_cqe_hdr_s *cq, const uint32_t tag,
+@@ -364,5 +364,11 @@ cn10k_nix_cqe_to_mbuf(const struct nix_cqe_hdr_s *cq, const uint32_t tag,
@@ -75 +76 @@
-@@ -453,5 +459,4 @@ cn10k_nix_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t pkts,
+@@ -452,5 +458,4 @@ cn10k_nix_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t pkts,
@@ -82 +83 @@
-index d36f292c95..6b6c5bfbc2 100644
+index 225bb4197c..848df4190c 100644
@@ -85,2 +86,5 @@
-@@ -392,11 +392,16 @@ skip_parse:
- 	*(uint64_t *)(&mbuf->rearm_data) = val;
+@@ -342,12 +342,17 @@ skip_parse:
+ 			nix_update_match_id(rx->cn9k.match_id, ol_flags, mbuf);
+ 
++	mbuf->ol_flags = ol_flags;
++	*(uint64_t *)(&mbuf->rearm_data) = val;
@@ -88 +92,4 @@
-+	mbuf->data_len = len;
+ 	mbuf->data_len = len;
+-	*(uint64_t *)(&mbuf->rearm_data) = val;
+-
+-	mbuf->ol_flags = ol_flags;
@@ -90 +97 @@
--	if (flag & NIX_RX_MULTI_SEG_F) {
+ 	if (flag & NIX_RX_MULTI_SEG_F)
@@ -92,3 +98,0 @@
--	} else {
--		mbuf->data_len = len;
-+	if (flag & NIX_RX_MULTI_SEG_F)
@@ -102 +106 @@
-+	else
+ 	else
@@ -104,4 +108 @@
--	}
- }
- 
-@@ -461,5 +466,4 @@ cn9k_nix_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t pkts,
+@@ -414,5 +419,4 @@ cn9k_nix_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t pkts,
@@ -114 +115 @@
-index fadc8aaf45..ad568c9fcd 100644
+index 5bfda3d815..480cc6dfa4 100644
@@ -117 +118 @@
-@@ -697,12 +697,9 @@ static __rte_always_inline void
+@@ -686,12 +686,9 @@ static __rte_always_inline void



More information about the stable mailing list