diff options
author | Michael Chan <mchan@broadcom.com> | 2011-08-26 05:45:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-08-28 17:08:27 -0400 |
commit | dc219a2e4812eecdc5438d2a0e2434b03d3efbf2 (patch) | |
tree | 63e0a80b381df71c5c798b49d60f6fe5129d7ae0 | |
parent | 95148229d32e5c68445a59d981482dba57f91919 (diff) |
cnic, bnx2fc: Increase maximum FCoE sessions.
Increase it to NVRAM configured limit or 1024 whichever is less.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/broadcom/cnic.c | 14 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/cnic.h | 2 | ||||
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc.h | 2 |
3 files changed, 10 insertions, 8 deletions
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index 769816104a6d..73060f4a2f5f 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c | |||
@@ -1177,7 +1177,7 @@ static int cnic_alloc_bnx2x_resc(struct cnic_dev *dev) | |||
1177 | cp->fcoe_start_cid = start_cid + MAX_ISCSI_TBL_SZ; | 1177 | cp->fcoe_start_cid = start_cid + MAX_ISCSI_TBL_SZ; |
1178 | 1178 | ||
1179 | if (BNX2X_CHIP_IS_E2_PLUS(cp->chip_id)) { | 1179 | if (BNX2X_CHIP_IS_E2_PLUS(cp->chip_id)) { |
1180 | cp->max_cid_space += BNX2X_FCOE_NUM_CONNECTIONS; | 1180 | cp->max_cid_space += dev->max_fcoe_conn; |
1181 | cp->fcoe_init_cid = ethdev->fcoe_init_cid; | 1181 | cp->fcoe_init_cid = ethdev->fcoe_init_cid; |
1182 | if (!cp->fcoe_init_cid) | 1182 | if (!cp->fcoe_init_cid) |
1183 | cp->fcoe_init_cid = 0x10; | 1183 | cp->fcoe_init_cid = 0x10; |
@@ -2280,7 +2280,7 @@ static int cnic_bnx2x_fcoe_ofld1(struct cnic_dev *dev, struct kwqe *wqes[], | |||
2280 | *work = 4; | 2280 | *work = 4; |
2281 | 2281 | ||
2282 | l5_cid = req1->fcoe_conn_id; | 2282 | l5_cid = req1->fcoe_conn_id; |
2283 | if (l5_cid >= BNX2X_FCOE_NUM_CONNECTIONS) | 2283 | if (l5_cid >= dev->max_fcoe_conn) |
2284 | goto err_reply; | 2284 | goto err_reply; |
2285 | 2285 | ||
2286 | l5_cid += BNX2X_FCOE_L5_CID_BASE; | 2286 | l5_cid += BNX2X_FCOE_L5_CID_BASE; |
@@ -2384,7 +2384,7 @@ static int cnic_bnx2x_fcoe_disable(struct cnic_dev *dev, struct kwqe *kwqe) | |||
2384 | req = (struct fcoe_kwqe_conn_enable_disable *) kwqe; | 2384 | req = (struct fcoe_kwqe_conn_enable_disable *) kwqe; |
2385 | cid = req->context_id; | 2385 | cid = req->context_id; |
2386 | l5_cid = req->conn_id; | 2386 | l5_cid = req->conn_id; |
2387 | if (l5_cid >= BNX2X_FCOE_NUM_CONNECTIONS) | 2387 | if (l5_cid >= dev->max_fcoe_conn) |
2388 | return -EINVAL; | 2388 | return -EINVAL; |
2389 | 2389 | ||
2390 | l5_cid += BNX2X_FCOE_L5_CID_BASE; | 2390 | l5_cid += BNX2X_FCOE_L5_CID_BASE; |
@@ -2418,7 +2418,7 @@ static int cnic_bnx2x_fcoe_destroy(struct cnic_dev *dev, struct kwqe *kwqe) | |||
2418 | req = (struct fcoe_kwqe_conn_destroy *) kwqe; | 2418 | req = (struct fcoe_kwqe_conn_destroy *) kwqe; |
2419 | cid = req->context_id; | 2419 | cid = req->context_id; |
2420 | l5_cid = req->conn_id; | 2420 | l5_cid = req->conn_id; |
2421 | if (l5_cid >= BNX2X_FCOE_NUM_CONNECTIONS) | 2421 | if (l5_cid >= dev->max_fcoe_conn) |
2422 | return -EINVAL; | 2422 | return -EINVAL; |
2423 | 2423 | ||
2424 | l5_cid += BNX2X_FCOE_L5_CID_BASE; | 2424 | l5_cid += BNX2X_FCOE_L5_CID_BASE; |
@@ -4850,8 +4850,7 @@ static int cnic_start_bnx2x_hw(struct cnic_dev *dev) | |||
4850 | return -ENOMEM; | 4850 | return -ENOMEM; |
4851 | 4851 | ||
4852 | if (BNX2X_CHIP_IS_E2_PLUS(cp->chip_id)) { | 4852 | if (BNX2X_CHIP_IS_E2_PLUS(cp->chip_id)) { |
4853 | ret = cnic_init_id_tbl(&cp->fcoe_cid_tbl, | 4853 | ret = cnic_init_id_tbl(&cp->fcoe_cid_tbl, dev->max_fcoe_conn, |
4854 | BNX2X_FCOE_NUM_CONNECTIONS, | ||
4855 | cp->fcoe_start_cid, 0); | 4854 | cp->fcoe_start_cid, 0); |
4856 | 4855 | ||
4857 | if (ret) | 4856 | if (ret) |
@@ -5292,6 +5291,9 @@ static struct cnic_dev *init_bnx2x_cnic(struct net_device *dev) | |||
5292 | !(ethdev->drv_state & CNIC_DRV_STATE_NO_FCOE)) | 5291 | !(ethdev->drv_state & CNIC_DRV_STATE_NO_FCOE)) |
5293 | cdev->max_fcoe_conn = ethdev->max_fcoe_conn; | 5292 | cdev->max_fcoe_conn = ethdev->max_fcoe_conn; |
5294 | 5293 | ||
5294 | if (cdev->max_fcoe_conn > BNX2X_FCOE_NUM_CONNECTIONS) | ||
5295 | cdev->max_fcoe_conn = BNX2X_FCOE_NUM_CONNECTIONS; | ||
5296 | |||
5295 | memcpy(cdev->mac_addr, ethdev->iscsi_mac, 6); | 5297 | memcpy(cdev->mac_addr, ethdev->iscsi_mac, 6); |
5296 | 5298 | ||
5297 | cp->cnic_ops = &cnic_bnx2x_ops; | 5299 | cp->cnic_ops = &cnic_bnx2x_ops; |
diff --git a/drivers/net/ethernet/broadcom/cnic.h b/drivers/net/ethernet/broadcom/cnic.h index 7a2928f82d40..15b1c09f1d5c 100644 --- a/drivers/net/ethernet/broadcom/cnic.h +++ b/drivers/net/ethernet/broadcom/cnic.h | |||
@@ -373,7 +373,7 @@ struct bnx2x_bd_chain_next { | |||
373 | #define BNX2X_ISCSI_PBL_NOT_CACHED 0xff | 373 | #define BNX2X_ISCSI_PBL_NOT_CACHED 0xff |
374 | #define BNX2X_ISCSI_PDU_HEADER_NOT_CACHED 0xff | 374 | #define BNX2X_ISCSI_PDU_HEADER_NOT_CACHED 0xff |
375 | 375 | ||
376 | #define BNX2X_FCOE_NUM_CONNECTIONS 128 | 376 | #define BNX2X_FCOE_NUM_CONNECTIONS 1024 |
377 | 377 | ||
378 | #define BNX2X_FCOE_L5_CID_BASE MAX_ISCSI_TBL_SZ | 378 | #define BNX2X_FCOE_L5_CID_BASE MAX_ISCSI_TBL_SZ |
379 | 379 | ||
diff --git a/drivers/scsi/bnx2fc/bnx2fc.h b/drivers/scsi/bnx2fc/bnx2fc.h index 5613e8afffb0..dd335a2a797b 100644 --- a/drivers/scsi/bnx2fc/bnx2fc.h +++ b/drivers/scsi/bnx2fc/bnx2fc.h | |||
@@ -81,7 +81,7 @@ | |||
81 | #define BNX2FC_RQ_WQES_MAX 16 | 81 | #define BNX2FC_RQ_WQES_MAX 16 |
82 | #define BNX2FC_CQ_WQES_MAX (BNX2FC_SQ_WQES_MAX + BNX2FC_RQ_WQES_MAX) | 82 | #define BNX2FC_CQ_WQES_MAX (BNX2FC_SQ_WQES_MAX + BNX2FC_RQ_WQES_MAX) |
83 | 83 | ||
84 | #define BNX2FC_NUM_MAX_SESS 128 | 84 | #define BNX2FC_NUM_MAX_SESS 1024 |
85 | #define BNX2FC_NUM_MAX_SESS_LOG (ilog2(BNX2FC_NUM_MAX_SESS)) | 85 | #define BNX2FC_NUM_MAX_SESS_LOG (ilog2(BNX2FC_NUM_MAX_SESS)) |
86 | 86 | ||
87 | #define BNX2FC_MAX_OUTSTANDING_CMNDS 2048 | 87 | #define BNX2FC_MAX_OUTSTANDING_CMNDS 2048 |