[dpdk-stable] patch 'net/mlx5: fix metadata for compressed Rx CQEs' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:02:36 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/21/20. 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.

Thanks.

Luca Boccassi

---
>From 2491443dce6ed77dca06fb173f5c90f791cc2839 Mon Sep 17 00:00:00 2001
From: Viacheslav Ovsiienko <viacheslavo at mellanox.com>
Date: Tue, 24 Mar 2020 12:15:18 +0000
Subject: [PATCH] net/mlx5: fix metadata for compressed Rx CQEs

[ upstream commit 70fa0b4ed083ea2444848716f5d396aba499b560 ]

If packets with the same metadata are received with compressed CQE
the metadata value is not copied from the title packet in vectorized
rx_burst routines, it causes wrong metadata values seeing by
applications.

Fixes: a18ac6113331 ("net/mlx5: add metadata support to Rx datapath")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo at mellanox.com>
Acked-by: Matan Azrad <matan at mellanox.com>
---
 drivers/net/mlx5/mlx5_rxtx_vec_altivec.h | 13 +++++++++++++
 drivers/net/mlx5/mlx5_rxtx_vec_neon.h    | 13 +++++++++++++
 drivers/net/mlx5/mlx5_rxtx_vec_sse.h     | 14 +++++++++++++-
 3 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
index 8e79883dfe..4df13b6d80 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
@@ -263,6 +263,19 @@ rxq_cq_decompress_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
 			elts[pos + 2]->hash.fdir.hi = flow_tag;
 			elts[pos + 3]->hash.fdir.hi = flow_tag;
 		}
+		if (rte_flow_dynf_metadata_avail()) {
+			const uint32_t meta = *RTE_FLOW_DYNF_METADATA(t_pkt);
+
+			/* Check if title packet has valid metadata. */
+			if (meta) {
+				assert(t_pkt->ol_flags &
+					    PKT_RX_DYNF_METADATA);
+				*RTE_FLOW_DYNF_METADATA(elts[pos]) = meta;
+				*RTE_FLOW_DYNF_METADATA(elts[pos + 1]) = meta;
+				*RTE_FLOW_DYNF_METADATA(elts[pos + 2]) = meta;
+				*RTE_FLOW_DYNF_METADATA(elts[pos + 3]) = meta;
+			}
+		}
 
 		pos += MLX5_VPMD_DESCS_PER_LOOP;
 		/* Move to next CQE and invalidate consumed CQEs. */
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
index 86785c7496..b3a3e028ee 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
@@ -205,6 +205,19 @@ rxq_cq_decompress_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
 			elts[pos + 2]->hash.fdir.hi = flow_tag;
 			elts[pos + 3]->hash.fdir.hi = flow_tag;
 		}
+		if (rte_flow_dynf_metadata_avail()) {
+			const uint32_t meta = *RTE_FLOW_DYNF_METADATA(t_pkt);
+
+			/* Check if title packet has valid metadata. */
+			if (meta) {
+				assert(t_pkt->ol_flags &
+					    PKT_RX_DYNF_METADATA);
+				*RTE_FLOW_DYNF_METADATA(elts[pos]) = meta;
+				*RTE_FLOW_DYNF_METADATA(elts[pos + 1]) = meta;
+				*RTE_FLOW_DYNF_METADATA(elts[pos + 2]) = meta;
+				*RTE_FLOW_DYNF_METADATA(elts[pos + 3]) = meta;
+			}
+		}
 		pos += MLX5_VPMD_DESCS_PER_LOOP;
 		/* Move to next CQE and invalidate consumed CQEs. */
 		if (!(pos & 0x7) && pos < mcqe_n) {
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
index 35b7761007..8aa3f0489c 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
@@ -118,7 +118,6 @@ rxq_cq_decompress_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
 			     14, 15,  6,  7,
 			     10, 11,  2,  3);
 #endif
-
 	/*
 	 * A. load mCQEs into a 128bit register.
 	 * B. store rearm data to mbuf.
@@ -191,6 +190,19 @@ rxq_cq_decompress_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
 			elts[pos + 2]->hash.fdir.hi = flow_tag;
 			elts[pos + 3]->hash.fdir.hi = flow_tag;
 		}
+		if (rte_flow_dynf_metadata_avail()) {
+			const uint32_t meta = *RTE_FLOW_DYNF_METADATA(t_pkt);
+
+			/* Check if title packet has valid metadata. */
+			if (meta) {
+				assert(t_pkt->ol_flags &
+					    PKT_RX_DYNF_METADATA);
+				*RTE_FLOW_DYNF_METADATA(elts[pos]) = meta;
+				*RTE_FLOW_DYNF_METADATA(elts[pos + 1]) = meta;
+				*RTE_FLOW_DYNF_METADATA(elts[pos + 2]) = meta;
+				*RTE_FLOW_DYNF_METADATA(elts[pos + 3]) = meta;
+			}
+		}
 		pos += MLX5_VPMD_DESCS_PER_LOOP;
 		/* Move to next CQE and invalidate consumed CQEs. */
 		if (!(pos & 0x7) && pos < mcqe_n) {
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:45.467678005 +0100
+++ 0021-net-mlx5-fix-metadata-for-compressed-Rx-CQEs.patch	2020-05-19 14:04:44.136646922 +0100
@@ -1,15 +1,16 @@
-From 70fa0b4ed083ea2444848716f5d396aba499b560 Mon Sep 17 00:00:00 2001
+From 2491443dce6ed77dca06fb173f5c90f791cc2839 Mon Sep 17 00:00:00 2001
 From: Viacheslav Ovsiienko <viacheslavo at mellanox.com>
 Date: Tue, 24 Mar 2020 12:15:18 +0000
 Subject: [PATCH] net/mlx5: fix metadata for compressed Rx CQEs
 
+[ upstream commit 70fa0b4ed083ea2444848716f5d396aba499b560 ]
+
 If packets with the same metadata are received with compressed CQE
 the metadata value is not copied from the title packet in vectorized
 rx_burst routines, it causes wrong metadata values seeing by
 applications.
 
 Fixes: a18ac6113331 ("net/mlx5: add metadata support to Rx datapath")
-Cc: stable at dpdk.org
 
 Signed-off-by: Viacheslav Ovsiienko <viacheslavo at mellanox.com>
 Acked-by: Matan Azrad <matan at mellanox.com>
@@ -20,7 +21,7 @@
  3 files changed, 39 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
-index 8e8d59ae83..d55642e57a 100644
+index 8e79883dfe..4df13b6d80 100644
 --- a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
 +++ b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
 @@ -263,6 +263,19 @@ rxq_cq_decompress_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
@@ -32,7 +33,7 @@
 +
 +			/* Check if title packet has valid metadata. */
 +			if (meta) {
-+				MLX5_ASSERT(t_pkt->ol_flags &
++				assert(t_pkt->ol_flags &
 +					    PKT_RX_DYNF_METADATA);
 +				*RTE_FLOW_DYNF_METADATA(elts[pos]) = meta;
 +				*RTE_FLOW_DYNF_METADATA(elts[pos + 1]) = meta;
@@ -44,7 +45,7 @@
  		pos += MLX5_VPMD_DESCS_PER_LOOP;
  		/* Move to next CQE and invalidate consumed CQEs. */
 diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
-index 6d952df787..701e5e0cd5 100644
+index 86785c7496..b3a3e028ee 100644
 --- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
 +++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
 @@ -205,6 +205,19 @@ rxq_cq_decompress_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
@@ -56,7 +57,7 @@
 +
 +			/* Check if title packet has valid metadata. */
 +			if (meta) {
-+				MLX5_ASSERT(t_pkt->ol_flags &
++				assert(t_pkt->ol_flags &
 +					    PKT_RX_DYNF_METADATA);
 +				*RTE_FLOW_DYNF_METADATA(elts[pos]) = meta;
 +				*RTE_FLOW_DYNF_METADATA(elts[pos + 1]) = meta;
@@ -68,7 +69,7 @@
  		/* Move to next CQE and invalidate consumed CQEs. */
  		if (!(pos & 0x7) && pos < mcqe_n) {
 diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
-index 406f23f595..a4086df2e9 100644
+index 35b7761007..8aa3f0489c 100644
 --- a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
 +++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
 @@ -118,7 +118,6 @@ rxq_cq_decompress_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
@@ -88,7 +89,7 @@
 +
 +			/* Check if title packet has valid metadata. */
 +			if (meta) {
-+				MLX5_ASSERT(t_pkt->ol_flags &
++				assert(t_pkt->ol_flags &
 +					    PKT_RX_DYNF_METADATA);
 +				*RTE_FLOW_DYNF_METADATA(elts[pos]) = meta;
 +				*RTE_FLOW_DYNF_METADATA(elts[pos + 1]) = meta;


More information about the stable mailing list