Subject: Re: [PATCH net 1/5] bnx2x: limit number of interrupt vectors for 57711

From: Sergei Shtylyov <[email-masked]>
Date: Mon, 06 Jan 2014 17:47:34 +0400

Hello.

On 05-01-2014 20:33, Yuval Mintz wrote:

> From: Dmitry Kravkov <[email-masked]>

> 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 <[email-masked]>
> Signed-off-by: Dmitry Kravkov <[email-masked]>
> Signed-off-by: Yuval Mintz <[email-masked]>
> Signed-off-by: Ariel Elior <[email-masked]>
> ---
>   drivers/net/ethernet/broadcom/bnx2x/bnx2x.h      | 2 ++
>   drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 6 +++---
>   2 files changed, 5 insertions(+), 3 deletions(-)

> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
> index a1f66e2..cb30d1a 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
> @@ -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))

    Be consistent and put spaces around / too, please.

WBR, Sergei