From: Yuval Mintz Date: Mon, 12 Mar 2012 11:22:07 +0000 (+0000) Subject: bnx2x: FCoE statistics id fixed X-Git-Tag: v2.6.39-400.9.0~338^2~110 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3cc3de88ab1b72f8e1fc360bff138c300d33c6d2;p=users%2Fjedix%2Flinux-maple.git bnx2x: FCoE statistics id fixed FCoE statistics ids were distinguished from the L2's statistics ids. However, not all of the change was committed. This causes a possible collision of indices when FCoE is present. This patch fixes the issue. (cherry picked from commit de5c37414af10ac9305d4a3e9c1468347ca3ccaa) Signed-off-by: Yuval Mintz Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller Signed-off-by: Joe Jin --- diff --git a/drivers/net/bnx2x/bnx2x_cmn.h b/drivers/net/bnx2x/bnx2x_cmn.h index 315a43b4fe77..a5fdb241bf09 100644 --- a/drivers/net/bnx2x/bnx2x_cmn.h +++ b/drivers/net/bnx2x/bnx2x_cmn.h @@ -1179,10 +1179,16 @@ static inline int bnx2x_alloc_rx_bds(struct bnx2x_fastpath *fp, */ static inline u8 bnx2x_stats_id(struct bnx2x_fastpath *fp) { - if (!CHIP_IS_E1x(fp->bp)) + struct bnx2x *bp = fp->bp; + if (!CHIP_IS_E1x(bp)) { +#ifdef BCM_CNIC + /* there are special statistics counters for FCoE 136..140 */ + if (IS_FCOE_FP(fp)) + return bp->cnic_base_cl_id + (bp->pf_num >> 1); +#endif return fp->cl_id; - else - return fp->cl_id + BP_PORT(fp->bp) * FP_SB_MAX_E1x; + } + return fp->cl_id + BP_PORT(bp) * FP_SB_MAX_E1x; } static inline void bnx2x_init_vlan_mac_fp_objs(struct bnx2x_fastpath *fp,