From 48f753d2ba94a4081400fa8d26bdbfbbf12b10de Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Tue, 18 May 2010 11:32:53 +0000 Subject: cnic: Return SPQ credit to bnx2x after ring setup and shutdown. Everytime the iSCSI ring finishes setup or shutdown, we need to return the SPQ (slow path queue) credit to the bnx2x driver. Without this step, the SPQ will eventually be full causing iSCSI to fail. This can happen after 3 or 4 MTU changes for example. Add code to wait for these slow path commands to complete in the RX ring and return the SPQ credit to bnx2x. Signed-off-by: Michael Chan Signed-off-by: David S. Miller --- drivers/net/cnic.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/net/cnic.h') diff --git a/drivers/net/cnic.h b/drivers/net/cnic.h index 4422497249d..08b1235d987 100644 --- a/drivers/net/cnic.h +++ b/drivers/net/cnic.h @@ -181,6 +181,7 @@ struct cnic_local { unsigned long cnic_local_flags; #define CNIC_LCL_FL_KWQ_INIT 0x0 +#define CNIC_LCL_FL_L2_WAIT 0x1 struct cnic_dev *dev; @@ -348,6 +349,10 @@ struct bnx2x_bd_chain_next { #define BNX2X_RCQ_DESC_CNT (BCM_PAGE_SIZE / sizeof(union eth_rx_cqe)) #define BNX2X_MAX_RCQ_DESC_CNT (BNX2X_RCQ_DESC_CNT - 1) +#define BNX2X_NEXT_RCQE(x) (((x) & BNX2X_MAX_RCQ_DESC_CNT) == \ + (BNX2X_MAX_RCQ_DESC_CNT - 1)) ? \ + ((x) + 2) : ((x) + 1) + #define BNX2X_DEF_SB_ID 16 #define BNX2X_ISCSI_RX_SB_INDEX_NUM \ -- cgit v1.2.3-70-g09d2