aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorBhanu Prakash Gollapudi <bprakash@broadcom.com>2013-04-22 15:22:30 -0400
committerDavid S. Miller <davem@davemloft.net>2013-04-25 04:06:46 -0400
commit0eb43b4bb081a1a22574daab9c05286a600dd7fe (patch)
tree85933a915bbe9ebd7c3872feefc1d88972063835 /drivers/net
parent4c09eed9dc422e980fabdb25434ef68e599b704c (diff)
bnx2x, bnx2fc: Use per port max exchange resources
The firmware supports a maximum of 4K FCoE exchanges. In 4-port devices, or when working in multi-function mode, this resource needs to be distributed between the various possible FCoE functions. This information needs to be calculated by bnx2x and propagated into bnx2fc via cnic. bnx2fc can then use this value to calculate corresponding xid resources instead of using global constants. Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h4
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c6
-rw-r--r--drivers/net/ethernet/broadcom/cnic.c4
-rw-r--r--drivers/net/ethernet/broadcom/cnic_if.h3
4 files changed, 16 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h
index 40f22c6794cd..84aecdf06f7a 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h
@@ -386,4 +386,8 @@
386 386
387#define UNDEF_IRO 0x80000000 387#define UNDEF_IRO 0x80000000
388 388
389/* used for defining the amount of FCoE tasks supported for PF */
390#define MAX_FCOE_FUNCS_PER_ENGINE 2
391#define MAX_NUM_FCOE_TASKS_PER_ENGINE 4096
392
389#endif /* BNX2X_FW_DEFS_H */ 393#endif /* BNX2X_FW_DEFS_H */
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index fbfff1b3365e..927f83af9d5c 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -10791,6 +10791,12 @@ static void bnx2x_get_fcoe_info(struct bnx2x *bp)
10791 (max_fcoe_conn & BNX2X_MAX_FCOE_INIT_CONN_MASK) >> 10791 (max_fcoe_conn & BNX2X_MAX_FCOE_INIT_CONN_MASK) >>
10792 BNX2X_MAX_FCOE_INIT_CONN_SHIFT; 10792 BNX2X_MAX_FCOE_INIT_CONN_SHIFT;
10793 10793
10794 /* Calculate the number of maximum allowed FCoE tasks */
10795 bp->cnic_eth_dev.max_fcoe_exchanges = MAX_NUM_FCOE_TASKS_PER_ENGINE;
10796 if (IS_MF(bp) || CHIP_MODE_IS_4_PORT(bp))
10797 bp->cnic_eth_dev.max_fcoe_exchanges /=
10798 MAX_FCOE_FUNCS_PER_ENGINE;
10799
10794 /* Read the WWN: */ 10800 /* Read the WWN: */
10795 if (!IS_MF(bp)) { 10801 if (!IS_MF(bp)) {
10796 /* Port info */ 10802 /* Port info */
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c
index 149a3a038491..40649a8bf390 100644
--- a/drivers/net/ethernet/broadcom/cnic.c
+++ b/drivers/net/ethernet/broadcom/cnic.c
@@ -5544,8 +5544,10 @@ static struct cnic_dev *init_bnx2x_cnic(struct net_device *dev)
5544 5544
5545 if (!(ethdev->drv_state & CNIC_DRV_STATE_NO_ISCSI)) 5545 if (!(ethdev->drv_state & CNIC_DRV_STATE_NO_ISCSI))
5546 cdev->max_iscsi_conn = ethdev->max_iscsi_conn; 5546 cdev->max_iscsi_conn = ethdev->max_iscsi_conn;
5547 if (CNIC_SUPPORTS_FCOE(cp)) 5547 if (CNIC_SUPPORTS_FCOE(cp)) {
5548 cdev->max_fcoe_conn = ethdev->max_fcoe_conn; 5548 cdev->max_fcoe_conn = ethdev->max_fcoe_conn;
5549 cdev->max_fcoe_exchanges = ethdev->max_fcoe_exchanges;
5550 }
5549 5551
5550 if (cdev->max_fcoe_conn > BNX2X_FCOE_NUM_CONNECTIONS) 5552 if (cdev->max_fcoe_conn > BNX2X_FCOE_NUM_CONNECTIONS)
5551 cdev->max_fcoe_conn = BNX2X_FCOE_NUM_CONNECTIONS; 5553 cdev->max_fcoe_conn = BNX2X_FCOE_NUM_CONNECTIONS;
diff --git a/drivers/net/ethernet/broadcom/cnic_if.h b/drivers/net/ethernet/broadcom/cnic_if.h
index 0c9367a0f57d..ec9bb9ad4bb3 100644
--- a/drivers/net/ethernet/broadcom/cnic_if.h
+++ b/drivers/net/ethernet/broadcom/cnic_if.h
@@ -195,6 +195,7 @@ struct cnic_eth_dev {
195 u32 max_fcoe_conn; 195 u32 max_fcoe_conn;
196 u32 max_rdma_conn; 196 u32 max_rdma_conn;
197 u32 fcoe_init_cid; 197 u32 fcoe_init_cid;
198 u32 max_fcoe_exchanges;
198 u32 fcoe_wwn_port_name_hi; 199 u32 fcoe_wwn_port_name_hi;
199 u32 fcoe_wwn_port_name_lo; 200 u32 fcoe_wwn_port_name_lo;
200 u32 fcoe_wwn_node_name_hi; 201 u32 fcoe_wwn_node_name_hi;
@@ -313,6 +314,8 @@ struct cnic_dev {
313 int max_fcoe_conn; 314 int max_fcoe_conn;
314 int max_rdma_conn; 315 int max_rdma_conn;
315 316
317 int max_fcoe_exchanges;
318
316 union drv_info_to_mcp *stats_addr; 319 union drv_info_to_mcp *stats_addr;
317 struct fcoe_capabilities *fcoe_cap; 320 struct fcoe_capabilities *fcoe_cap;
318 321