[2/2] net/nfp: reduce the length of PCI name

Message ID 20230615065131.1267711-3-chaoyong.he@corigine.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series reduce the length of PCI name |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch-unit-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS

Commit Message

Chaoyong He June 15, 2023, 6:51 a.m. UTC
  From: Long Wu <long.wu@corigine.com>

The whole PCI name is too long and we remove the part before
the first colon.

For example:
old: 0000:af:00.0_ctrlmp
new: af:00.0_ctrlmp

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/net/nfp/flower/nfp_flower.c |  2 +-
 drivers/net/nfp/nfp_flow.c          | 10 ++++------
 2 files changed, 5 insertions(+), 7 deletions(-)
  

Patch

diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c
index 53ee936f4c..6a4d3c7dae 100644
--- a/drivers/net/nfp/flower/nfp_flower.c
+++ b/drivers/net/nfp/flower/nfp_flower.c
@@ -456,7 +456,7 @@  nfp_flower_init_ctrl_vnic(struct nfp_net_hw *hw)
 	/* Create a mbuf pool for the ctrl vNIC */
 	numa_node = rte_socket_id();
 	snprintf(ctrl_pktmbuf_pool_name, sizeof(ctrl_pktmbuf_pool_name),
-			"%s_ctrlmp", pf_dev->pci_dev->device.name);
+			"%s_ctrlmp", (strchr(pf_dev->pci_dev->name, ':') + 1));
 	app_fw_flower->ctrl_pktmbuf_pool =
 			rte_pktmbuf_pool_create(ctrl_pktmbuf_pool_name,
 			4 * CTRL_VNIC_NB_DESC, 64, 0, 9216, numa_node);
diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 5acb7f6ff3..3446adb766 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -4135,13 +4135,11 @@  nfp_flow_priv_init(struct nfp_pf_dev *pf_dev)
 	char pretun_name[RTE_HASH_NAMESIZE];
 	struct nfp_flow_priv *priv;
 	struct nfp_app_fw_flower *app_fw_flower;
+	const char *pci_name = strchr(pf_dev->pci_dev->name, ':') + 1;
 
-	snprintf(mask_name, sizeof(mask_name), "%s_mask",
-			pf_dev->pci_dev->device.name);
-	snprintf(flow_name, sizeof(flow_name), "%s_flow",
-			pf_dev->pci_dev->device.name);
-	snprintf(pretun_name, sizeof(pretun_name), "%s_pretun",
-			pf_dev->pci_dev->device.name);
+	snprintf(mask_name, sizeof(mask_name), "%s_mask", pci_name);
+	snprintf(flow_name, sizeof(flow_name), "%s_flow", pci_name);
+	snprintf(pretun_name, sizeof(pretun_name), "%s_pretun", pci_name);
 
 	struct rte_hash_parameters mask_hash_params = {
 		.name       = mask_name,