diff options
author | Sathya Perla <sathya.perla@emulex.com> | 2011-10-23 22:45:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-10-24 18:40:14 -0400 |
commit | 752961a11e847e604aeaaa798cac438c1e671ba4 (patch) | |
tree | 550a6d3ca83cd2404e70080575cb8e80d59dcdc1 /drivers/net/ethernet/emulex | |
parent | dafc0fe3afa565c88e44f1c243a49ce209f78ba7 (diff) |
be2net: don't create multiple RX/TX rings in multi channel mode
When the HW is in multi-channel mode based on the skew/IPL, there are
4 functions per port and so not enough resources to create multiple
RX/TX rings for each function.
Signed-off-by: Suresh Reddy <suresh.reddy@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/emulex')
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_cmds.h | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 16 |
2 files changed, 18 insertions, 4 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h b/drivers/net/ethernet/emulex/benet/be_cmds.h index 75b75741c80e..a35cd03fac4e 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.h +++ b/drivers/net/ethernet/emulex/benet/be_cmds.h | |||
@@ -1046,6 +1046,12 @@ struct be_cmd_resp_modify_eq_delay { | |||
1046 | 1046 | ||
1047 | /******************** Get FW Config *******************/ | 1047 | /******************** Get FW Config *******************/ |
1048 | #define BE_FUNCTION_CAPS_RSS 0x2 | 1048 | #define BE_FUNCTION_CAPS_RSS 0x2 |
1049 | /* The HW can come up in either of the following multi-channel modes | ||
1050 | * based on the skew/IPL. | ||
1051 | */ | ||
1052 | #define FLEX10_MODE 0x400 | ||
1053 | #define VNIC_MODE 0x20000 | ||
1054 | #define UMC_ENABLED 0x1000000 | ||
1049 | struct be_cmd_req_query_fw_cfg { | 1055 | struct be_cmd_req_query_fw_cfg { |
1050 | struct be_cmd_req_hdr hdr; | 1056 | struct be_cmd_req_hdr hdr; |
1051 | u32 rsvd[31]; | 1057 | u32 rsvd[31]; |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 555b0ec3fe5f..d6a232a300ad 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -114,6 +114,13 @@ static const char * const ue_status_hi_desc[] = { | |||
114 | "Unknown" | 114 | "Unknown" |
115 | }; | 115 | }; |
116 | 116 | ||
117 | /* Is BE in a multi-channel mode */ | ||
118 | static inline bool be_is_mc(struct be_adapter *adapter) { | ||
119 | return (adapter->function_mode & FLEX10_MODE || | ||
120 | adapter->function_mode & VNIC_MODE || | ||
121 | adapter->function_mode & UMC_ENABLED); | ||
122 | } | ||
123 | |||
117 | static void be_queue_free(struct be_adapter *adapter, struct be_queue_info *q) | 124 | static void be_queue_free(struct be_adapter *adapter, struct be_queue_info *q) |
118 | { | 125 | { |
119 | struct be_dma_mem *mem = &q->dma_mem; | 126 | struct be_dma_mem *mem = &q->dma_mem; |
@@ -1289,7 +1296,7 @@ static struct be_rx_compl_info *be_rx_compl_get(struct be_rx_obj *rxo) | |||
1289 | if (rxcp->vlanf) { | 1296 | if (rxcp->vlanf) { |
1290 | /* vlanf could be wrongly set in some cards. | 1297 | /* vlanf could be wrongly set in some cards. |
1291 | * ignore if vtm is not set */ | 1298 | * ignore if vtm is not set */ |
1292 | if ((adapter->function_mode & 0x400) && !rxcp->vtm) | 1299 | if ((adapter->function_mode & FLEX10_MODE) && !rxcp->vtm) |
1293 | rxcp->vlanf = 0; | 1300 | rxcp->vlanf = 0; |
1294 | 1301 | ||
1295 | if (!lancer_chip(adapter)) | 1302 | if (!lancer_chip(adapter)) |
@@ -1636,7 +1643,7 @@ static void be_tx_queues_destroy(struct be_adapter *adapter) | |||
1636 | static int be_num_txqs_want(struct be_adapter *adapter) | 1643 | static int be_num_txqs_want(struct be_adapter *adapter) |
1637 | { | 1644 | { |
1638 | if ((num_vfs && adapter->sriov_enabled) || | 1645 | if ((num_vfs && adapter->sriov_enabled) || |
1639 | (adapter->function_mode & 0x400) || | 1646 | be_is_mc(adapter) || |
1640 | lancer_chip(adapter) || !be_physfn(adapter) || | 1647 | lancer_chip(adapter) || !be_physfn(adapter) || |
1641 | adapter->generation == BE_GEN2) | 1648 | adapter->generation == BE_GEN2) |
1642 | return 1; | 1649 | return 1; |
@@ -1718,7 +1725,8 @@ static void be_rx_queues_destroy(struct be_adapter *adapter) | |||
1718 | static u32 be_num_rxqs_want(struct be_adapter *adapter) | 1725 | static u32 be_num_rxqs_want(struct be_adapter *adapter) |
1719 | { | 1726 | { |
1720 | if ((adapter->function_caps & BE_FUNCTION_CAPS_RSS) && | 1727 | if ((adapter->function_caps & BE_FUNCTION_CAPS_RSS) && |
1721 | !adapter->sriov_enabled && !(adapter->function_mode & 0x400)) { | 1728 | !adapter->sriov_enabled && be_physfn(adapter) && |
1729 | !be_is_mc(adapter)) { | ||
1722 | return 1 + MAX_RSS_QS; /* one default non-RSS queue */ | 1730 | return 1 + MAX_RSS_QS; /* one default non-RSS queue */ |
1723 | } else { | 1731 | } else { |
1724 | dev_warn(&adapter->pdev->dev, | 1732 | dev_warn(&adapter->pdev->dev, |
@@ -3187,7 +3195,7 @@ static int be_get_config(struct be_adapter *adapter) | |||
3187 | if (status) | 3195 | if (status) |
3188 | return status; | 3196 | return status; |
3189 | 3197 | ||
3190 | if (adapter->function_mode & 0x400) | 3198 | if (adapter->function_mode & FLEX10_MODE) |
3191 | adapter->max_vlans = BE_NUM_VLANS_SUPPORTED/4; | 3199 | adapter->max_vlans = BE_NUM_VLANS_SUPPORTED/4; |
3192 | else | 3200 | else |
3193 | adapter->max_vlans = BE_NUM_VLANS_SUPPORTED; | 3201 | adapter->max_vlans = BE_NUM_VLANS_SUPPORTED; |