Skip to content

Commit dc219a2

Browse files
Michael Chandavem330
authored andcommitted
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>
1 parent 9514822 commit dc219a2

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

drivers/net/ethernet/broadcom/cnic.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,7 @@ static int cnic_alloc_bnx2x_resc(struct cnic_dev *dev)
11771177
cp->fcoe_start_cid = start_cid + MAX_ISCSI_TBL_SZ;
11781178

11791179
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;
11811181
cp->fcoe_init_cid = ethdev->fcoe_init_cid;
11821182
if (!cp->fcoe_init_cid)
11831183
cp->fcoe_init_cid = 0x10;
@@ -2280,7 +2280,7 @@ static int cnic_bnx2x_fcoe_ofld1(struct cnic_dev *dev, struct kwqe *wqes[],
22802280
*work = 4;
22812281

22822282
l5_cid = req1->fcoe_conn_id;
2283-
if (l5_cid >= BNX2X_FCOE_NUM_CONNECTIONS)
2283+
if (l5_cid >= dev->max_fcoe_conn)
22842284
goto err_reply;
22852285

22862286
l5_cid += BNX2X_FCOE_L5_CID_BASE;
@@ -2384,7 +2384,7 @@ static int cnic_bnx2x_fcoe_disable(struct cnic_dev *dev, struct kwqe *kwqe)
23842384
req = (struct fcoe_kwqe_conn_enable_disable *) kwqe;
23852385
cid = req->context_id;
23862386
l5_cid = req->conn_id;
2387-
if (l5_cid >= BNX2X_FCOE_NUM_CONNECTIONS)
2387+
if (l5_cid >= dev->max_fcoe_conn)
23882388
return -EINVAL;
23892389

23902390
l5_cid += BNX2X_FCOE_L5_CID_BASE;
@@ -2418,7 +2418,7 @@ static int cnic_bnx2x_fcoe_destroy(struct cnic_dev *dev, struct kwqe *kwqe)
24182418
req = (struct fcoe_kwqe_conn_destroy *) kwqe;
24192419
cid = req->context_id;
24202420
l5_cid = req->conn_id;
2421-
if (l5_cid >= BNX2X_FCOE_NUM_CONNECTIONS)
2421+
if (l5_cid >= dev->max_fcoe_conn)
24222422
return -EINVAL;
24232423

24242424
l5_cid += BNX2X_FCOE_L5_CID_BASE;
@@ -4850,8 +4850,7 @@ static int cnic_start_bnx2x_hw(struct cnic_dev *dev)
48504850
return -ENOMEM;
48514851

48524852
if (BNX2X_CHIP_IS_E2_PLUS(cp->chip_id)) {
4853-
ret = cnic_init_id_tbl(&cp->fcoe_cid_tbl,
4854-
BNX2X_FCOE_NUM_CONNECTIONS,
4853+
ret = cnic_init_id_tbl(&cp->fcoe_cid_tbl, dev->max_fcoe_conn,
48554854
cp->fcoe_start_cid, 0);
48564855

48574856
if (ret)
@@ -5292,6 +5291,9 @@ static struct cnic_dev *init_bnx2x_cnic(struct net_device *dev)
52925291
!(ethdev->drv_state & CNIC_DRV_STATE_NO_FCOE))
52935292
cdev->max_fcoe_conn = ethdev->max_fcoe_conn;
52945293

5294+
if (cdev->max_fcoe_conn > BNX2X_FCOE_NUM_CONNECTIONS)
5295+
cdev->max_fcoe_conn = BNX2X_FCOE_NUM_CONNECTIONS;
5296+
52955297
memcpy(cdev->mac_addr, ethdev->iscsi_mac, 6);
52965298

52975299
cp->cnic_ops = &cnic_bnx2x_ops;

drivers/net/ethernet/broadcom/cnic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ struct bnx2x_bd_chain_next {
373373
#define BNX2X_ISCSI_PBL_NOT_CACHED 0xff
374374
#define BNX2X_ISCSI_PDU_HEADER_NOT_CACHED 0xff
375375

376-
#define BNX2X_FCOE_NUM_CONNECTIONS 128
376+
#define BNX2X_FCOE_NUM_CONNECTIONS 1024
377377

378378
#define BNX2X_FCOE_L5_CID_BASE MAX_ISCSI_TBL_SZ
379379

drivers/scsi/bnx2fc/bnx2fc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
#define BNX2FC_RQ_WQES_MAX 16
8282
#define BNX2FC_CQ_WQES_MAX (BNX2FC_SQ_WQES_MAX + BNX2FC_RQ_WQES_MAX)
8383

84-
#define BNX2FC_NUM_MAX_SESS 128
84+
#define BNX2FC_NUM_MAX_SESS 1024
8585
#define BNX2FC_NUM_MAX_SESS_LOG (ilog2(BNX2FC_NUM_MAX_SESS))
8686

8787
#define BNX2FC_MAX_OUTSTANDING_CMNDS 2048

0 commit comments

Comments
 (0)