[3/3] net/bnxt: set max VFs count for P7
Checks
Commit Message
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(+)
@@ -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)
@@ -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);