patch 'net/nfp: fix representor name too long' has been queued to stable release 22.11.3
Xueming Li
xuemingl at nvidia.com
Thu Aug 10 01:47:54 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 08/11/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=715143b51e7b02fc854a26be0c03df26329789b2
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 715143b51e7b02fc854a26be0c03df26329789b2 Mon Sep 17 00:00:00 2001
From: Long Wu <long.wu at corigine.com>
Date: Thu, 15 Jun 2023 14:51:30 +0800
Subject: [PATCH] net/nfp: fix representor name too long
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 7347341c4815eef11b39ade1e0115d8310ce3b9a ]
The length of representor name may exceed the limit when we use
it to create rte_ring, so we reduce the length of its name.
For example:
old: 0000:af:00.0_fl_repr_p1
new: af:00.0_repr_p1
Fixes: 2003cb447aa5 ("net/nfp: fix representor creation")
Signed-off-by: Long Wu <long.wu at corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he at corigine.com>
---
drivers/net/nfp/flower/nfp_flower_representor.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index 95e6043a8d..d319aefb08 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -730,8 +730,9 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
{
int i;
int ret;
- struct rte_device *device;
+ const char *pci_name;
struct rte_eth_dev *eth_dev;
+ struct rte_pci_device *pci_dev;
struct nfp_eth_table *nfp_eth_table;
struct nfp_eth_table_port *eth_port;
struct nfp_flower_representor flower_repr = {
@@ -755,10 +756,12 @@ 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);
- device = &app_fw_flower->pf_hw->pf_dev->pci_dev->device;
+ pci_dev = app_fw_flower->pf_hw->pf_dev->pci_dev;
+
+ pci_name = strchr(pci_dev->name, ':') + 1;
snprintf(flower_repr.name, sizeof(flower_repr.name),
- "%s_flower_repr_pf", device->name);
+ "%s_repr_pf", pci_name);
/* Create a eth_dev for this representor */
ret = rte_eth_dev_create(eth_dev->device, flower_repr.name,
@@ -781,7 +784,7 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
rte_ether_addr_copy((struct rte_ether_addr *)eth_port->mac_addr,
&flower_repr.mac_addr);
snprintf(flower_repr.name, sizeof(flower_repr.name),
- "%s_fl_repr_p%d", device->name, i);
+ "%s_repr_p%d", pci_name, i);
/*
* Create a eth_dev for this representor
@@ -813,7 +816,7 @@ 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);
snprintf(flower_repr.name, sizeof(flower_repr.name),
- "%s_fl_repr_vf%d", device->name, i);
+ "%s_repr_vf%d", pci_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-08-09 21:51:19.088276900 +0800
+++ 0032-net-nfp-fix-representor-name-too-long.patch 2023-08-09 21:51:18.164352000 +0800
@@ -1 +1 @@
-From 7347341c4815eef11b39ade1e0115d8310ce3b9a Mon Sep 17 00:00:00 2001
+From 715143b51e7b02fc854a26be0c03df26329789b2 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 7347341c4815eef11b39ade1e0115d8310ce3b9a ]
@@ -14 +16,0 @@
-Cc: stable at dpdk.org
@@ -23 +25 @@
-index 7669ab6dae..5f94d20f1b 100644
+index 95e6043a8d..d319aefb08 100644
@@ -26 +28 @@
-@@ -732,8 +732,9 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
+@@ -730,8 +730,9 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
@@ -37 +39 @@
-@@ -757,10 +758,12 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
+@@ -755,10 +756,12 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
@@ -52,3 +54,3 @@
-@@ -782,7 +785,7 @@ 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(ð_port->mac_addr, &flower_repr.mac_addr);
+@@ -781,7 +784,7 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
+ rte_ether_addr_copy((struct rte_ether_addr *)eth_port->mac_addr,
+ &flower_repr.mac_addr);
@@ -61 +63 @@
-@@ -814,7 +817,7 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
+@@ -813,7 +816,7 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
More information about the stable
mailing list