From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com,
Long Wu <long.wu@corigine.com>,
Chaoyong He <chaoyong.he@corigine.com>
Subject: [PATCH 2/2] net/nfp: reduce the length of PCI name
Date: Thu, 15 Jun 2023 14:51:31 +0800 [thread overview]
Message-ID: <20230615065131.1267711-3-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20230615065131.1267711-1-chaoyong.he@corigine.com>
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(-)
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
next prev parent reply other threads:[~2023-06-15 6:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-15 6:51 [PATCH 0/2] " Chaoyong He
2023-06-15 6:51 ` [PATCH 1/2] net/nfp: fix representor name too long Chaoyong He
2023-06-15 6:51 ` Chaoyong He [this message]
2023-06-21 17:28 ` [PATCH 0/2] reduce the length of PCI name Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230615065131.1267711-3-chaoyong.he@corigine.com \
--to=chaoyong.he@corigine.com \
--cc=dev@dpdk.org \
--cc=long.wu@corigine.com \
--cc=niklas.soderlund@corigine.com \
--cc=oss-drivers@corigine.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).