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