[dpdk-stable] patch 'net/mlx5: fix Tx metadata for multi-segment packet' has been queued to LTS release 18.11.2

Kevin Traynor ktraynor at redhat.com
Wed Apr 10 18:43:17 CEST 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.2

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

Kevin Traynor

---
>From 2664e32795d8a459f76aa691819eaf9f3fa80fa1 Mon Sep 17 00:00:00 2001
From: Dekel Peled <dekelp at mellanox.com>
Date: Wed, 30 Jan 2019 08:43:29 +0200
Subject: [PATCH] net/mlx5: fix Tx metadata for multi-segment packet

[ upstream commit 7f4019d370f6edbd9d6ef26a9bc62442b0fd80a6 ]

Original patch implemented the use of match_metadata offload in the
different burst functions.
The concurrent use of match_metadata and multi_segs offloads was
not handled.

This patch updates function txq_scatter_v(), to pass metadata value
from mbuf to wqe, when indicated by offload flags.

Fixes: 6bd7fbd03c62 ("net/mlx5: support metadata as flow rule criteria")

Signed-off-by: Dekel Peled <dekelp at mellanox.com>
Acked-by: Yongseok Koh <yskoh at mellanox.com>
---
 drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 12 +++++++++---
 drivers/net/mlx5/mlx5_rxtx_vec_sse.h  | 11 ++++++++---
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
index 883fe1bf9..38e915c5c 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
@@ -105,4 +105,6 @@ txq_scatter_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts,
 	unsigned int n;
 	volatile struct mlx5_wqe *wqe = NULL;
+	bool metadata_ol =
+		txq->offloads & DEV_TX_OFFLOAD_MATCH_METADATA ? true : false;
 
 	assert(elts_n > pkts_n);
@@ -128,4 +130,7 @@ txq_scatter_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts,
 		uint8_t *dseg;
 		uint8x16_t ctrl;
+		rte_be32_t metadata =
+			metadata_ol && (buf->ol_flags & PKT_TX_METADATA) ?
+			buf->tx_metadata : 0;
 
 		assert(segs_n);
@@ -165,7 +170,8 @@ txq_scatter_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts,
 		vst1q_u8((void *)t_wqe, ctrl);
 		/* Fill ESEG in the header. */
-		vst1q_u16((void *)(t_wqe + 1),
-			  ((uint16x8_t) { 0, 0, cs_flags, rte_cpu_to_be_16(len),
-					  0, 0, 0, 0 }));
+		vst1q_u32((void *)(t_wqe + 1),
+			  ((uint32x4_t){ 0,
+					 cs_flags << 16 | rte_cpu_to_be_16(len),
+					 metadata, 0 }));
 		txq->wqe_ci = wqe_ci;
 	}
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
index 14117c4bb..fb384efde 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
@@ -105,4 +105,6 @@ txq_scatter_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts,
 	unsigned int n;
 	volatile struct mlx5_wqe *wqe = NULL;
+	bool metadata_ol =
+		txq->offloads & DEV_TX_OFFLOAD_MATCH_METADATA ? true : false;
 
 	assert(elts_n > pkts_n);
@@ -126,4 +128,7 @@ txq_scatter_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts,
 		__m128i *t_wqe, *dseg;
 		__m128i ctrl;
+		rte_be32_t metadata =
+			metadata_ol && (buf->ol_flags & PKT_TX_METADATA) ?
+			buf->tx_metadata : 0;
 
 		assert(segs_n);
@@ -166,7 +171,7 @@ txq_scatter_v(struct mlx5_txq_data *txq, struct rte_mbuf **pkts,
 		/* Fill ESEG in the header. */
 		_mm_store_si128(t_wqe + 1,
-				_mm_set_epi16(0, 0, 0, 0,
-					      rte_cpu_to_be_16(len), cs_flags,
-					      0, 0));
+				_mm_set_epi32(0, metadata,
+					      (rte_cpu_to_be_16(len) << 16) |
+					      cs_flags, 0));
 		txq->wqe_ci = wqe_ci;
 	}
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-04-10 14:06:08.711865131 +0100
+++ 0009-net-mlx5-fix-Tx-metadata-for-multi-segment-packet.patch	2019-04-10 14:06:07.779296189 +0100
@@ -1,8 +1,10 @@
-From 7f4019d370f6edbd9d6ef26a9bc62442b0fd80a6 Mon Sep 17 00:00:00 2001
+From 2664e32795d8a459f76aa691819eaf9f3fa80fa1 Mon Sep 17 00:00:00 2001
 From: Dekel Peled <dekelp at mellanox.com>
 Date: Wed, 30 Jan 2019 08:43:29 +0200
 Subject: [PATCH] net/mlx5: fix Tx metadata for multi-segment packet
 
+[ upstream commit 7f4019d370f6edbd9d6ef26a9bc62442b0fd80a6 ]
+
 Original patch implemented the use of match_metadata offload in the
 different burst functions.
 The concurrent use of match_metadata and multi_segs offloads was
@@ -12,7 +14,6 @@
 from mbuf to wqe, when indicated by offload flags.
 
 Fixes: 6bd7fbd03c62 ("net/mlx5: support metadata as flow rule criteria")
-Cc: stable at dpdk.org
 
 Signed-off-by: Dekel Peled <dekelp at mellanox.com>
 Acked-by: Yongseok Koh <yskoh at mellanox.com>


More information about the stable mailing list