Commit e848582c authored by Dmitry Kravkov's avatar Dmitry Kravkov Committed by David S. Miller

bnx2x: limit number of interrupt vectors for 57711

Original straightforward division may lead to zeroing number of SB and
null-pointer dereference when device is short of MSIX vectors or lacks
MSIX capabilities.
Reported-by: default avatarVladislav Zolotarov <vladz@cloudius-systems.com>
Signed-off-by: default avatarDmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: default avatarYuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: default avatarAriel Elior <ariele@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a02bdd42
...@@ -2499,4 +2499,6 @@ void bnx2x_set_local_cmng(struct bnx2x *bp); ...@@ -2499,4 +2499,6 @@ void bnx2x_set_local_cmng(struct bnx2x *bp);
#define MCPR_SCRATCH_BASE(bp) \ #define MCPR_SCRATCH_BASE(bp) \
(CHIP_IS_E1x(bp) ? MCP_REG_MCPR_SCRATCH : MCP_A_REG_MCPR_SCRATCH) (CHIP_IS_E1x(bp) ? MCP_REG_MCPR_SCRATCH : MCP_A_REG_MCPR_SCRATCH)
#define E1H_MAX_MF_SB_COUNT (HC_SB_MAX_SB_E1X/(E1HVN_MAX * PORT_MAX))
#endif /* bnx2x.h */ #endif /* bnx2x.h */
...@@ -11447,9 +11447,9 @@ static int bnx2x_get_hwinfo(struct bnx2x *bp) ...@@ -11447,9 +11447,9 @@ static int bnx2x_get_hwinfo(struct bnx2x *bp)
} }
} }
/* adjust igu_sb_cnt to MF for E1x */ /* adjust igu_sb_cnt to MF for E1H */
if (CHIP_IS_E1x(bp) && IS_MF(bp)) if (CHIP_IS_E1H(bp) && IS_MF(bp))
bp->igu_sb_cnt /= E1HVN_MAX; bp->igu_sb_cnt = min_t(u8, bp->igu_sb_cnt, E1H_MAX_MF_SB_COUNT);
/* port info */ /* port info */
bnx2x_get_port_hwinfo(bp); bnx2x_get_port_hwinfo(bp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment