mirror of https://gitee.com/openkylin/linux.git
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: Vladislav Zolotarov <vladz@cloudius-systems.com> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Ariel Elior <ariele@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
a02bdd423d
commit
e848582cee
|
@ -2499,4 +2499,6 @@ void bnx2x_set_local_cmng(struct bnx2x *bp);
|
|||
#define MCPR_SCRATCH_BASE(bp) \
|
||||
(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 */
|
||||
|
|
|
@ -11447,9 +11447,9 @@ static int bnx2x_get_hwinfo(struct bnx2x *bp)
|
|||
}
|
||||
}
|
||||
|
||||
/* adjust igu_sb_cnt to MF for E1x */
|
||||
if (CHIP_IS_E1x(bp) && IS_MF(bp))
|
||||
bp->igu_sb_cnt /= E1HVN_MAX;
|
||||
/* adjust igu_sb_cnt to MF for E1H */
|
||||
if (CHIP_IS_E1H(bp) && IS_MF(bp))
|
||||
bp->igu_sb_cnt = min_t(u8, bp->igu_sb_cnt, E1H_MAX_MF_SB_COUNT);
|
||||
|
||||
/* port info */
|
||||
bnx2x_get_port_hwinfo(bp);
|
||||
|
|
Loading…
Reference in New Issue