patch 'net/nfp: restrict flow flush to the port' has been queued to stable release 22.11.2

Xueming Li xuemingl at nvidia.com
Mon Feb 27 08:00:55 CET 2023


Hi,

FYI, your patch has been queued to stable release 22.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 03/01/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=31f4d9ce135aba0a6f91f8b31329ec849c1a4b12

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 31f4d9ce135aba0a6f91f8b31329ec849c1a4b12 Mon Sep 17 00:00:00 2001
From: Jin Liu <jin.liu at corigine.com>
Date: Thu, 16 Feb 2023 14:36:44 +0800
Subject: [PATCH] net/nfp: restrict flow flush to the port
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit c2bd03f27fdd79f3440511237296eb51105ee9cc ]

The flow flush function will destroy all the flow table on all the
port of NFP NIC rather than the provide port. Modify logic, only
destroy the flow table on the corresponding port.

Fixes: 30ecce522732 ("net/nfp: support flow API")

Signed-off-by: Jin Liu <jin.liu at corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he at corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund at corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 18 +++++++++++++-----
 drivers/net/nfp/nfp_flow.h |  1 +
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 30e1edacb2..b3f4861ae4 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -339,7 +339,7 @@ nfp_flow_table_search(struct nfp_flow_priv *priv,
 }

 static struct rte_flow *
-nfp_flow_alloc(struct nfp_fl_key_ls *key_layer)
+nfp_flow_alloc(struct nfp_fl_key_ls *key_layer, uint32_t port_id)
 {
 	char *tmp;
 	size_t len;
@@ -357,6 +357,7 @@ nfp_flow_alloc(struct nfp_fl_key_ls *key_layer)

 	nfp_flow->length = len;

+	nfp_flow->port_id      = port_id;
 	payload                = &nfp_flow->payload;
 	payload->meta          = (struct nfp_fl_rule_metadata *)tmp;
 	payload->unmasked_data = tmp + sizeof(struct nfp_fl_rule_metadata);
@@ -3488,7 +3489,7 @@ nfp_flow_process(struct nfp_flower_representor *representor,
 		return NULL;
 	}

-	nfp_flow = nfp_flow_alloc(&key_layer);
+	nfp_flow = nfp_flow_alloc(&key_layer, representor->port_id);
 	if (nfp_flow == NULL) {
 		PMD_DRV_LOG(ERR, "Alloc nfp flow failed.");
 		goto free_stats;
@@ -3796,14 +3797,21 @@ nfp_flow_flush(struct rte_eth_dev *dev,
 	void *next_data;
 	uint32_t iter = 0;
 	const void *next_key;
+	struct rte_flow *nfp_flow;
 	struct nfp_flow_priv *priv;
+	struct nfp_flower_representor *representor;
+
+	representor = dev->data->dev_private;

 	priv = nfp_flow_dev_to_priv(dev);

 	while (rte_hash_iterate(priv->flow_table, &next_key, &next_data, &iter) >= 0) {
-		ret = nfp_flow_destroy(dev, (struct rte_flow *)next_data, error);
-		if (ret != 0)
-			break;
+		nfp_flow = next_data;
+		if (nfp_flow->port_id == representor->port_id) {
+			ret = nfp_flow_destroy(dev, nfp_flow, error);
+			if (ret != 0)
+				break;
+		}
 	}

 	return ret;
diff --git a/drivers/net/nfp/nfp_flow.h b/drivers/net/nfp/nfp_flow.h
index b0c2aaf6d8..8071243b86 100644
--- a/drivers/net/nfp/nfp_flow.h
+++ b/drivers/net/nfp/nfp_flow.h
@@ -222,6 +222,7 @@ struct rte_flow {
 	struct nfp_fl_tun tun;
 	size_t length;
 	uint32_t hash_key;
+	uint32_t port_id;
 	bool install_flag;
 	enum nfp_flow_type type;
 };
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.583583800 +0800
+++ 0148-net-nfp-restrict-flow-flush-to-the-port.patch	2023-02-27 14:08:40.949237000 +0800
@@ -1 +1 @@
-From c2bd03f27fdd79f3440511237296eb51105ee9cc Mon Sep 17 00:00:00 2001
+From 31f4d9ce135aba0a6f91f8b31329ec849c1a4b12 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit c2bd03f27fdd79f3440511237296eb51105ee9cc ]
@@ -14 +16,0 @@
-Cc: stable at dpdk.org
@@ -25 +27 @@
-index eba6aea40f..0c38925701 100644
+index 30e1edacb2..b3f4861ae4 100644
@@ -40 +42 @@
- 	nfp_flow->mtr_id       = NFP_MAX_MTR_CNT;
+
@@ -45 +47 @@
-@@ -3549,7 +3550,7 @@ nfp_flow_process(struct nfp_flower_representor *representor,
+@@ -3488,7 +3489,7 @@ nfp_flow_process(struct nfp_flower_representor *representor,
@@ -54 +56 @@
-@@ -3868,14 +3869,21 @@ nfp_flow_flush(struct rte_eth_dev *dev,
+@@ -3796,14 +3797,21 @@ nfp_flow_flush(struct rte_eth_dev *dev,
@@ -80 +82 @@
-index b8da752a9d..d352671c2c 100644
+index b0c2aaf6d8..8071243b86 100644
@@ -83 +85,2 @@
-@@ -223,6 +223,7 @@ struct rte_flow {
+@@ -222,6 +222,7 @@ struct rte_flow {
+ 	struct nfp_fl_tun tun;
@@ -86 +88,0 @@
- 	uint32_t mtr_id;


More information about the stable mailing list