Commit 51a8f54d authored by Michael Chan's avatar Michael Chan Committed by David S. Miller

cnic: Allocate kcq resource only on devices that support FCoE.

To save memory and to exit IRQ loop quicker on devices that don't support
FCoE.
Reviewed-by: default avatarEddie Wai <eddie.wai@broadcom.com>
Reviewed-by: default avatarBhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8cc0e028
...@@ -1288,7 +1288,7 @@ static int cnic_alloc_bnx2x_resc(struct cnic_dev *dev) ...@@ -1288,7 +1288,7 @@ static int cnic_alloc_bnx2x_resc(struct cnic_dev *dev)
if (ret) if (ret)
goto error; goto error;
if (BNX2X_CHIP_IS_E2_PLUS(cp->chip_id)) { if (CNIC_SUPPORTS_FCOE(cp)) {
ret = cnic_alloc_kcq(dev, &cp->kcq2, true); ret = cnic_alloc_kcq(dev, &cp->kcq2, true);
if (ret) if (ret)
goto error; goto error;
...@@ -3130,7 +3130,7 @@ static void cnic_service_bnx2x_bh(unsigned long data) ...@@ -3130,7 +3130,7 @@ static void cnic_service_bnx2x_bh(unsigned long data)
CNIC_WR16(dev, cp->kcq1.io_addr, CNIC_WR16(dev, cp->kcq1.io_addr,
cp->kcq1.sw_prod_idx + MAX_KCQ_IDX); cp->kcq1.sw_prod_idx + MAX_KCQ_IDX);
if (!BNX2X_CHIP_IS_E2_PLUS(cp->chip_id)) { if (cp->ethdev->drv_state & CNIC_DRV_STATE_NO_FCOE) {
cp->arm_int(dev, status_idx); cp->arm_int(dev, status_idx);
break; break;
} }
...@@ -5516,8 +5516,7 @@ static struct cnic_dev *init_bnx2x_cnic(struct net_device *dev) ...@@ -5516,8 +5516,7 @@ static struct cnic_dev *init_bnx2x_cnic(struct net_device *dev)
if (!(ethdev->drv_state & CNIC_DRV_STATE_NO_ISCSI)) if (!(ethdev->drv_state & CNIC_DRV_STATE_NO_ISCSI))
cdev->max_iscsi_conn = ethdev->max_iscsi_conn; cdev->max_iscsi_conn = ethdev->max_iscsi_conn;
if (BNX2X_CHIP_IS_E2_PLUS(cp->chip_id) && if (CNIC_SUPPORTS_FCOE(cp))
!(ethdev->drv_state & CNIC_DRV_STATE_NO_FCOE))
cdev->max_fcoe_conn = ethdev->max_fcoe_conn; cdev->max_fcoe_conn = ethdev->max_fcoe_conn;
if (cdev->max_fcoe_conn > BNX2X_FCOE_NUM_CONNECTIONS) if (cdev->max_fcoe_conn > BNX2X_FCOE_NUM_CONNECTIONS)
......
...@@ -475,6 +475,10 @@ struct bnx2x_bd_chain_next { ...@@ -475,6 +475,10 @@ struct bnx2x_bd_chain_next {
MAX_STAT_COUNTER_ID_E1)) MAX_STAT_COUNTER_ID_E1))
#endif #endif
#define CNIC_SUPPORTS_FCOE(cp) \
(BNX2X_CHIP_IS_E2_PLUS((cp)->chip_id) && \
!((cp)->ethdev->drv_state & CNIC_DRV_STATE_NO_FCOE))
#define CNIC_RAMROD_TMO (HZ / 4) #define CNIC_RAMROD_TMO (HZ / 4)
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment