cnic: Fix L2CTX_STATUSB_NUM offset in context memory.
Subsystems (2)
PATCH 1/1 cnic: Fix L2CTX_STATUSB_NUM offset in context memory.
The BNX2_L2CTX_STATUSB_NUM definition needs to be changed to match the recent firmware update:
commit 078b0735881c7969aaf21469f3577831cddd9f8c
bnx2: Update firmware to 5.0.0.j3.
Without the fix, bnx2 can crash intermittently in bnx2_rx_int() when iSCSI is enabled.
--- drivers/net/bnx2.h | 9 ++++++--- drivers/net/cnic.c | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-)
drivers/net/bnx2.h +6 -3
@@ -361,9 +361,12 @@ struct l2_fhdr {#define BNX2_L2CTX_CTX_TYPE_CTX_BD_CHN_TYPE_VALUE (1<<28)#define BNX2_L2CTX_HOST_BDIDX 0x00000004 -#define BNX2_L2CTX_STATUSB_NUM_SHIFT 16 -#define BNX2_L2CTX_STATUSB_NUM (sb_id) \ - (((sb_id) > 0) ? (((sb_id) + 7) << BNX2_L2CTX_STATUSB_NUM_SHIFT) : 0) +#define BNX2_L2CTX_L5_STATUSB_NUM_SHIFT 16 +#define BNX2_L2CTX_L2_STATUSB_NUM_SHIFT 24 +#define BNX2_L2CTX_L5_STATUSB_NUM (sb_id) \ + (((sb_id) > 0) ? (((sb_id) + 7) << BNX2_L2CTX_L5_STATUSB_NUM_SHIFT) : 0) +#define BNX2_L2CTX_L2_STATUSB_NUM (sb_id) \ + (((sb_id) > 0) ? (((sb_id) + 7) << BNX2_L2CTX_L2_STATUSB_NUM_SHIFT) : 0)#define BNX2_L2CTX_HOST_BSEQ 0x00000008#define BNX2_L2CTX_NX_BSEQ 0x0000000c#define BNX2_L2CTX_NX_BDHADDR_HI 0x00000010
drivers/net/cnic.c +3 -3
@@ -2264,9 +2264,9 @@ static void cnic_init_bnx2_rx_ring(struct cnic_dev *dev)cnic_ctx_wr (dev, cid_addr,BNX2_L2CTX_CTX_TYPE , val);if (sb_id ==0 ) - val =2 <<BNX2_L2CTX_STATUSB_NUM_SHIFT ; + val =2 <<BNX2_L2CTX_L2_STATUSB_NUM_SHIFT ;else - val =BNX2_L2CTX_STATUSB_NUM (sb_id); + val =BNX2_L2CTX_L2_STATUSB_NUM (sb_id);cnic_ctx_wr (dev, cid_addr,BNX2_L2CTX_HOST_BDIDX , val); rxbd = (struct rx_bd *) (cp->l2_ring +BCM_PAGE_SIZE );
@@ -2423,7 +2423,7 @@ static int cnic_start_bnx2_hw(struct cnic_dev *dev) cp->int_num =0 ;if (ethdev->drv_state &CNIC_DRV_STATE_USING_MSIX ) {u32 sb_id = cp->status_blk_num; -u32 sb =BNX2_L2CTX_STATUSB_NUM (sb_id); +u32 sb =BNX2_L2CTX_L5_STATUSB_NUM (sb_id); cp->int_num = sb_id <<BNX2_PCICFG_INT_ACK_CMD_INT_NUM_SHIFT ;cnic_ctx_wr (dev, cp->kwq_cid_addr,L5_KRNLQ_HOST_QIDX , sb);
Signature · 1 line
1.6.4.GIT
From: "Michael Chan" <[email protected]>
Date: Tue, 27 Oct 2009 08:58:48 -0800
Quoted 11 lines
The
BNX2_L2CTX_STATUSB_NUMdefinition needs to be changed to match the recent firmware update:commit
078b0735881c7969aaf21469f3577831cddd9f8c
bnx2: Update firmware to 5.0.0.j3.Without the fix, bnx2 can crash intermittently in
bnx2_rx_int()when iSCSI is enabled.Signed-off-by Michael Chan <[email protected]>Signed-off-by Benjamin Li <[email protected]>
Applied to net-2.6, but please be explicit about what tree you want me to apply this to in the future.
Sure I could deduce this by running "git describe" on that commit ID mentioned in the commit message, but why not be explicit? :-)