Skip to content

Commit

Permalink
net/bnxt: fix backward firmware compatibility
Browse files Browse the repository at this point in the history
[ upstream commit 589619999b0411a4266e335fe105e1c7cba6e02b ]

On older firmware versions, HWRM_FUNC_QCAPS response is not
returning the maximum number of multicast filters that can be
supported by the function. As a result, memory allocation with
size 0 fails.

Bugzilla ID: 1309

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
  • Loading branch information
Kalesh AP authored and bluca committed Mar 7, 2024
1 parent 61fe746 commit e2cfac4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/net/bnxt/bnxt.h
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,7 @@ struct bnxt {
struct rte_ether_addr *mcast_addr_list;
rte_iova_t mc_list_dma_addr;
uint32_t nb_mc_addr;
#define BNXT_DFLT_MAX_MC_ADDR 16 /* for compatibility with older firmware */
uint32_t max_mcast_addr; /* maximum number of mcast filters supported */

struct rte_eth_rss_conf rss_conf; /* RSS configuration. */
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/bnxt/bnxt_hwrm.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,8 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
bp->max_l2_ctx, bp->max_vnics);
bp->max_stat_ctx = rte_le_to_cpu_16(resp->max_stat_ctx);
bp->max_mcast_addr = rte_le_to_cpu_32(resp->max_mcast_filters);

if (!bp->max_mcast_addr)
bp->max_mcast_addr = BNXT_DFLT_MAX_MC_ADDR;
if (BNXT_PF(bp)) {
bp->pf->total_vnics = rte_le_to_cpu_16(resp->max_vnics);
if (flags & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED) {
Expand Down

0 comments on commit e2cfac4

Please sign in to comment.