patches for DPDK stable branches
 help / color / mirror / Atom feed
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@corigine.com, stable@dpdk.org
Subject: [PATCH 3/3] net/nfp: fix flow hash table creation failed
Date: Fri,  9 Jun 2023 14:01:00 +0800	[thread overview]
Message-ID: <20230609060100.1306648-4-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20230609060100.1306648-1-chaoyong.he@corigine.com>

From: Long Wu <long.wu@corigine.com>

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_hash_create().

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

Fixes: ac09376096d8 ("net/nfp: add structures and functions for flow offload")
Cc: chaoyong.he@corigine.com
Cc: stable@dpdk.org

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

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index cb7073f361..d392f9c77b 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -4105,11 +4105,21 @@ nfp_flow_priv_init(struct nfp_pf_dev *pf_dev)
 	size_t stats_size;
 	uint64_t ctx_count;
 	uint64_t ctx_split;
+	char mask_name[RTE_HASH_NAMESIZE];
+	char flow_name[RTE_HASH_NAMESIZE];
+	char pretun_name[RTE_HASH_NAMESIZE];
 	struct nfp_flow_priv *priv;
 	struct nfp_app_fw_flower *app_fw_flower;
 
+	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);
+
 	struct rte_hash_parameters mask_hash_params = {
-		.name       = "mask_hash_table",
+		.name       = mask_name,
 		.entries    = NFP_MASK_TABLE_ENTRIES,
 		.hash_func  = rte_jhash,
 		.socket_id  = rte_socket_id(),
@@ -4118,7 +4128,7 @@ nfp_flow_priv_init(struct nfp_pf_dev *pf_dev)
 	};
 
 	struct rte_hash_parameters flow_hash_params = {
-		.name       = "flow_hash_table",
+		.name       = flow_name,
 		.hash_func  = rte_jhash,
 		.socket_id  = rte_socket_id(),
 		.key_len    = sizeof(uint32_t),
@@ -4126,7 +4136,7 @@ nfp_flow_priv_init(struct nfp_pf_dev *pf_dev)
 	};
 
 	struct rte_hash_parameters pre_tun_hash_params = {
-		.name       = "pre_tunnel_table",
+		.name       = pretun_name,
 		.entries    = 32,
 		.hash_func  = rte_jhash,
 		.socket_id  = rte_socket_id(),
-- 
2.39.1


      parent reply	other threads:[~2023-06-09  6:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230609060100.1306648-1-chaoyong.he@corigine.com>
2023-06-09  6:00 ` [PATCH 1/3] net/nfp: fix control mempool " Chaoyong He
2023-06-09  6:00 ` [PATCH 2/3] net/nfp: fix representor " Chaoyong He
2023-06-09  6:01 ` Chaoyong He [this message]

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=20230609060100.1306648-4-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 \
    --cc=stable@dpdk.org \
    /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).