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.padmana...@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khapa...@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)