[dpdk-stable] patch 'net/mlx5: fix counter offset detection' has been queued to stable release 20.11.2

Xueming Li xuemingl at nvidia.com
Sat Jun 12 01:04:18 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.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 06/14/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/d565e160b11fff3c4c9c7e1c74cd81b76740153a

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From d565e160b11fff3c4c9c7e1c74cd81b76740153a Mon Sep 17 00:00:00 2001
From: Suanming Mou <suanmingm at nvidia.com>
Date: Thu, 13 May 2021 11:05:15 +0300
Subject: [PATCH] net/mlx5: fix counter offset detection
Cc: Luca Boccassi <bluca at debian.org>

[ upstream commit 4fd5e14848871a682840642fdd6ad776d0017080 ]

Currently, the counter offset support is discovered by creating the
rule with invalid offset counter and drop action in root table. If
the rule creation fails with EINVAL errno, that mean counter offset
is not supported in root table.

However, drop action may not be supported in some rdma-core version
in root table. In this case, the discover code will not work properly.

This commits changes flow attribute to egress. That removes all the
extra fate actions in the flow to avoid any unsupported fate actions
make the discover code fail time to time.

Fixes: 994829e695c0 ("net/mlx5: remove single counter container")

Signed-off-by: Suanming Mou <suanmingm at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 5a5a33172a..f5ceb7a2d5 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -12585,7 +12585,7 @@ mlx5_flow_dv_discover_counter_offset_support(struct rte_eth_dev *dev)
 		.size = sizeof(value.buf),
 	};
 	struct mlx5dv_flow_matcher_attr dv_attr = {
-		.type = IBV_FLOW_ATTR_NORMAL,
+		.type = IBV_FLOW_ATTR_NORMAL | IBV_FLOW_ATTR_FLAGS_EGRESS,
 		.priority = 0,
 		.match_criteria_enable = 0,
 		.match_mask = (void *)&mask,
@@ -12597,7 +12597,7 @@ mlx5_flow_dv_discover_counter_offset_support(struct rte_eth_dev *dev)
 	void *flow = NULL;
 	int ret = -1;
 
-	tbl = flow_dv_tbl_resource_get(dev, 0, 0, 0, false, NULL, 0, 0, NULL);
+	tbl = flow_dv_tbl_resource_get(dev, 0, 1, 0, false, NULL, 0, 0, NULL);
 	if (!tbl)
 		goto err;
 	dcs = mlx5_devx_cmd_flow_counter_alloc(priv->sh->ctx, 0x4);
@@ -12607,14 +12607,12 @@ mlx5_flow_dv_discover_counter_offset_support(struct rte_eth_dev *dev)
 						    &actions[0]);
 	if (ret)
 		goto err;
-	actions[1] = sh->dr_drop_action ? sh->dr_drop_action :
-					  priv->drop_queue.hrxq->action;
 	dv_attr.match_criteria_enable = flow_dv_matcher_enable(mask.buf);
 	ret = mlx5_flow_os_create_flow_matcher(sh->ctx, &dv_attr, tbl->obj,
 					       &matcher);
 	if (ret)
 		goto err;
-	ret = mlx5_flow_os_create_flow(matcher, (void *)&value, 2,
+	ret = mlx5_flow_os_create_flow(matcher, (void *)&value, 1,
 				       actions, &flow);
 err:
 	/*
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-06-12 06:54:00.697750300 +0800
+++ 0164-net-mlx5-fix-counter-offset-detection.patch	2021-06-12 06:53:56.650000000 +0800
@@ -1 +1 @@
-From 4fd5e14848871a682840642fdd6ad776d0017080 Mon Sep 17 00:00:00 2001
+From d565e160b11fff3c4c9c7e1c74cd81b76740153a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit 4fd5e14848871a682840642fdd6ad776d0017080 ]
@@ -19 +21,0 @@
-Cc: stable at dpdk.org
@@ -28 +30 @@
-index 7fc7efbc5c..71d9f88a95 100644
+index 5a5a33172a..f5ceb7a2d5 100644
@@ -31 +33 @@
-@@ -16081,7 +16081,7 @@ mlx5_flow_dv_discover_counter_offset_support(struct rte_eth_dev *dev)
+@@ -12585,7 +12585,7 @@ mlx5_flow_dv_discover_counter_offset_support(struct rte_eth_dev *dev)
@@ -40 +42 @@
-@@ -16093,7 +16093,7 @@ mlx5_flow_dv_discover_counter_offset_support(struct rte_eth_dev *dev)
+@@ -12597,7 +12597,7 @@ mlx5_flow_dv_discover_counter_offset_support(struct rte_eth_dev *dev)
@@ -44,3 +46,2 @@
--	tbl = flow_dv_tbl_resource_get(dev, 0, 0, 0, false, NULL,
-+	tbl = flow_dv_tbl_resource_get(dev, 0, 1, 0, false, NULL,
- 					0, 0, 0, NULL);
+-	tbl = flow_dv_tbl_resource_get(dev, 0, 0, 0, false, NULL, 0, 0, NULL);
++	tbl = flow_dv_tbl_resource_get(dev, 0, 1, 0, false, NULL, 0, 0, NULL);
@@ -49 +50,2 @@
-@@ -16104,14 +16104,12 @@ mlx5_flow_dv_discover_counter_offset_support(struct rte_eth_dev *dev)
+ 	dcs = mlx5_devx_cmd_flow_counter_alloc(priv->sh->ctx, 0x4);
+@@ -12607,14 +12607,12 @@ mlx5_flow_dv_discover_counter_offset_support(struct rte_eth_dev *dev)


More information about the stable mailing list