From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Subject: [PATCH 3/3] net/bnxt: set max VFs count for P7
Date: Mon, 18 Nov 2024 09:36:13 -0800 [thread overview]
Message-ID: <20241118173613.94224-4-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20241118173613.94224-1-ajit.khaparde@broadcom.com>
The number of max VFs per PF is 128 for P7 devices.
Cap the vnic hash table creation if the number of max VNICs
is less than 8.
Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt.h | 1 +
drivers/net/bnxt/bnxt_vnic.c | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 0402de3eb9..b8b0ecc7e7 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -260,6 +260,7 @@ struct bnxt_pf_info {
#define BNXT_MAX_VFS(bp) ((bp)->pf->max_vfs)
#define BNXT_MAX_VF_REPS_P4 64
#define BNXT_MAX_VF_REPS_P5 256
+#define BNXT_MAX_VF_REPS_P7 128
#define BNXT_MAX_VF_REPS(bp) \
(BNXT_CHIP_P5(bp) ? BNXT_MAX_VF_REPS_P5 : \
BNXT_MAX_VF_REPS_P4)
diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index 7b028f2ee5..4b5ac84d70 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -978,6 +978,12 @@ int32_t bnxt_vnic_queue_db_init(struct bnxt *bp)
hash_tbl_params.name = hash_tbl_name;
hash_tbl_params.entries = (bp->max_vnics > BNXT_VNIC_MAX_SUPPORTED_ID) ?
BNXT_VNIC_MAX_SUPPORTED_ID : bp->max_vnics;
+
+ /* if the number of max vnics is less than bucket size */
+ /* then let the max entries size be the least value */
+ if (hash_tbl_params.entries <= RTE_HASH_BUCKET_ENTRIES)
+ hash_tbl_params.entries = RTE_HASH_BUCKET_ENTRIES;
+
hash_tbl_params.key_len = BNXT_VNIC_MAX_QUEUE_SZ_IN_8BITS;
hash_tbl_params.socket_id = rte_socket_id();
bp->vnic_queue_db.rss_q_db = rte_hash_create(&hash_tbl_params);
--
2.39.5 (Apple Git-154)
prev parent reply other threads:[~2024-11-18 17:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-18 17:36 [PATCH 0/3] bnxt patchset Ajit Khaparde
2024-11-18 17:36 ` [PATCH 1/3] net/bnxt: update HWRM API Ajit Khaparde
2024-11-18 17:36 ` [PATCH 2/3] net/bnxt: add support for Rx profile selection Ajit Khaparde
2024-11-18 17:36 ` Ajit Khaparde [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=20241118173613.94224-4-ajit.khaparde@broadcom.com \
--to=ajit.khaparde@broadcom.com \
--cc=dev@dpdk.org \
--cc=kishore.padmanabha@broadcom.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).