patch 'net/nfp: fix representor creation' has been queued to stable release 22.11.3

Xueming Li xuemingl at nvidia.com
Sun Jun 25 08:34:44 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.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 06/27/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=18493825d11593dcb0550f96074920b353954c38

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 18493825d11593dcb0550f96074920b353954c38 Mon Sep 17 00:00:00 2001
From: Long Wu <long.wu at corigine.com>
Date: Fri, 9 Jun 2023 14:00:59 +0800
Subject: [PATCH] net/nfp: fix representor creation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 2003cb447aa5f3aa29eea853c1c1ac93949be659 ]

The former logic does not consider the simultaneous initialization of
several NICs using flower firmware. The reason the initialization
failed was because several NICs use the same name parameter when we
call rte_eth_dev_create().

We use the PCI address to give each NIC a unique name parameter and let
the initialization succeed.

Fixes: e1124c4f8a45 ("net/nfp: add flower representor framework")

Signed-off-by: Long Wu <long.wu at corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund at corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he at corigine.com>
---
 drivers/net/nfp/flower/nfp_flower_representor.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index c77495f348..95e6043a8d 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -730,6 +730,7 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
 {
 	int i;
 	int ret;
+	struct rte_device *device;
 	struct rte_eth_dev *eth_dev;
 	struct nfp_eth_table *nfp_eth_table;
 	struct nfp_eth_table_port *eth_port;
@@ -753,7 +754,11 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
 
 	/* PF vNIC reprs get a random MAC address */
 	rte_eth_random_addr(flower_repr.mac_addr.addr_bytes);
-	sprintf(flower_repr.name, "flower_repr_pf");
+
+	device = &app_fw_flower->pf_hw->pf_dev->pci_dev->device;
+
+	snprintf(flower_repr.name, sizeof(flower_repr.name),
+			"%s_flower_repr_pf", device->name);
 
 	/* Create a eth_dev for this representor */
 	ret = rte_eth_dev_create(eth_dev->device, flower_repr.name,
@@ -775,7 +780,8 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
 		/* Copy the real mac of the interface to the representor struct */
 		rte_ether_addr_copy((struct rte_ether_addr *)eth_port->mac_addr,
 				&flower_repr.mac_addr);
-		sprintf(flower_repr.name, "flower_repr_p%d", i);
+		snprintf(flower_repr.name, sizeof(flower_repr.name),
+				"%s_fl_repr_p%d", device->name, i);
 
 		/*
 		 * Create a eth_dev for this representor
@@ -806,7 +812,8 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
 
 		/* VF reprs get a random MAC address */
 		rte_eth_random_addr(flower_repr.mac_addr.addr_bytes);
-		sprintf(flower_repr.name, "flower_repr_vf%d", i);
+		snprintf(flower_repr.name, sizeof(flower_repr.name),
+				"%s_fl_repr_vf%d", device->name, i);
 
 		 /* This will also allocate private memory for the device*/
 		ret = rte_eth_dev_create(eth_dev->device, flower_repr.name,
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-06-25 14:32:00.283685200 +0800
+++ 0066-net-nfp-fix-representor-creation.patch	2023-06-25 14:31:58.425773900 +0800
@@ -1 +1 @@
-From 2003cb447aa5f3aa29eea853c1c1ac93949be659 Mon Sep 17 00:00:00 2001
+From 18493825d11593dcb0550f96074920b353954c38 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 2003cb447aa5f3aa29eea853c1c1ac93949be659 ]
@@ -18 +20,0 @@
-Cc: stable at dpdk.org
@@ -28 +30 @@
-index 3225a4b84a..5118c9c57c 100644
+index c77495f348..95e6043a8d 100644
@@ -31 +33 @@
-@@ -723,6 +723,7 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
+@@ -730,6 +730,7 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
@@ -39 +41 @@
-@@ -746,7 +747,11 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
+@@ -753,7 +754,11 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
@@ -52,2 +54 @@
-@@ -767,7 +772,8 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
- 
+@@ -775,7 +780,8 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
@@ -55 +56,2 @@
- 		rte_ether_addr_copy(&eth_port->mac_addr, &flower_repr.mac_addr);
+ 		rte_ether_addr_copy((struct rte_ether_addr *)eth_port->mac_addr,
+ 				&flower_repr.mac_addr);
@@ -62 +64 @@
-@@ -798,7 +804,8 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
+@@ -806,7 +812,8 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)


More information about the stable mailing list