[dpdk-stable] patch 'net/mlx5: fix eCPRI matching' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:28:13 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.4

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

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/4ba7ab1ebd55722715dbd8aca29ec0c60a098b98

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 4ba7ab1ebd55722715dbd8aca29ec0c60a098b98 Mon Sep 17 00:00:00 2001
From: Dmitry Kozlyuk <dkozlyuk at nvidia.com>
Date: Mon, 9 Aug 2021 17:26:46 +0300
Subject: [PATCH] net/mlx5: fix eCPRI matching
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 12d42b248c6a5eec17830b4163b0edaf5ec7bdb0 ]

When an ETH or VLAN flow item directly preceding ECPRI (i. e. a pattern
for eCPRI over Ethernet) did not specify the eCPRI protocol, matches
were not restricted to eCPRI traffic. For example, "eth / ecpri / end"
pattern behaved as "eth / end". Implicitly add Ethernet type condition,
so that "eth / ecpri / end" behaves as "eth type is 0xAEFE / end".

Fixes: daa38a8924a0 ("net/mlx5: add flow translation of eCPRI header")

Signed-off-by: Dmitry Kozlyuk <dkozlyuk at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 1793683421..0b1a488edb 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -7927,12 +7927,13 @@ flow_dv_translate_item_gtp(void *matcher, void *key,
  *   Flow matcher value.
  * @param[in] item
  *   Flow pattern to translate.
- * @param[in] samples
- *   Sample IDs to be used in the matching.
+ * @param[in] last_item
+ *   Last item flags.
  */
 static void
 flow_dv_translate_item_ecpri(struct rte_eth_dev *dev, void *matcher,
-			     void *key, const struct rte_flow_item *item)
+			     void *key, const struct rte_flow_item *item,
+			     uint64_t last_item)
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
 	const struct rte_flow_item_ecpri *ecpri_m = item->mask;
@@ -7945,6 +7946,22 @@ flow_dv_translate_item_ecpri(struct rte_eth_dev *dev, void *matcher,
 	void *dw_m;
 	void *dw_v;
 
+	/*
+	 * In case of eCPRI over Ethernet, if EtherType is not specified,
+	 * match on eCPRI EtherType implicitly.
+	 */
+	if (last_item & MLX5_FLOW_LAYER_OUTER_L2) {
+		void *hdrs_m, *hdrs_v, *l2m, *l2v;
+
+		hdrs_m = MLX5_ADDR_OF(fte_match_param, matcher, outer_headers);
+		hdrs_v = MLX5_ADDR_OF(fte_match_param, key, outer_headers);
+		l2m = MLX5_ADDR_OF(fte_match_set_lyr_2_4, hdrs_m, ethertype);
+		l2v = MLX5_ADDR_OF(fte_match_set_lyr_2_4, hdrs_v, ethertype);
+		if (*(uint16_t *)l2m == 0 && *(uint16_t *)l2v == 0) {
+			*(uint16_t *)l2m = UINT16_MAX;
+			*(uint16_t *)l2v = RTE_BE16(RTE_ETHER_TYPE_ECPRI);
+		}
+	}
 	if (!ecpri_v)
 		return;
 	if (!ecpri_m)
@@ -10603,7 +10620,8 @@ flow_dv_translate(struct rte_eth_dev *dev,
 			dev_flow->dv.value.size =
 					MLX5_ST_SZ_BYTES(fte_match_param);
 			flow_dv_translate_item_ecpri(dev, match_mask,
-						     match_value, items);
+						     match_value, items,
+						     last_item);
 			/* No other protocol should follow eCPRI layer. */
 			last_item = MLX5_FLOW_LAYER_ECPRI;
 			break;
-- 
2.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:02.529371657 +0800
+++ 0009-net-mlx5-fix-eCPRI-matching.patch	2021-11-10 14:17:01.747413767 +0800
@@ -1 +1 @@
-From 12d42b248c6a5eec17830b4163b0edaf5ec7bdb0 Mon Sep 17 00:00:00 2001
+From 4ba7ab1ebd55722715dbd8aca29ec0c60a098b98 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 12d42b248c6a5eec17830b4163b0edaf5ec7bdb0 ]
@@ -13 +15,0 @@
-Cc: stable at dpdk.org
@@ -22 +24 @@
-index 31d857030f..5bb6d89a3f 100644
+index 1793683421..0b1a488edb 100644
@@ -25 +27 @@
-@@ -9976,12 +9976,13 @@ flow_dv_translate_item_gtp_psc(void *matcher, void *key,
+@@ -7927,12 +7927,13 @@ flow_dv_translate_item_gtp(void *matcher, void *key,
@@ -42 +44 @@
-@@ -9994,6 +9995,22 @@ flow_dv_translate_item_ecpri(struct rte_eth_dev *dev, void *matcher,
+@@ -7945,6 +7946,22 @@ flow_dv_translate_item_ecpri(struct rte_eth_dev *dev, void *matcher,
@@ -65,3 +67,3 @@
-@@ -13474,7 +13491,8 @@ flow_dv_translate(struct rte_eth_dev *dev,
- 						"cannot create eCPRI parser");
- 			}
+@@ -10603,7 +10620,8 @@ flow_dv_translate(struct rte_eth_dev *dev,
+ 			dev_flow->dv.value.size =
+ 					MLX5_ST_SZ_BYTES(fte_match_param);


More information about the stable mailing list