diff options
author | David S. Miller <davem@davemloft.net> | 2014-01-06 13:09:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-06 13:09:26 -0500 |
commit | ce088848c29c08469f69ebeaa891fae574e2d18b (patch) | |
tree | 1bbc5ca4524c6025ef4a9c963caf3846dbd18eea /drivers | |
parent | f35f76ee76df008131bbe01a2297de0c55ee2297 (diff) | |
parent | e3dc867c1758fc4ae6fc6b63ea6bbcd454479f08 (diff) |
Merge branch 'be2net'
Sathya Perla says:
====================
be2net: patch set
Pls apply the following bug fixes to the 'net' tree. Thanks.
Suresh Reddy (2):
be2net: increase the timeout value for loopback-test FW cmd
be2net: fix max_evt_qs calculation for BE3 in SR-IOV config
Vasundhara Volam (1):
be2net: disable RSS when number of RXQs is reduced to 1 via
set-channels
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be.h | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_cmds.c | 33 | ||||
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 29 |
3 files changed, 43 insertions, 22 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h index 5878df619b53..4ccaf9af6fc9 100644 --- a/drivers/net/ethernet/emulex/benet/be.h +++ b/drivers/net/ethernet/emulex/benet/be.h | |||
@@ -104,6 +104,7 @@ static inline char *nic_name(struct pci_dev *pdev) | |||
104 | #define BE3_MAX_RSS_QS 16 | 104 | #define BE3_MAX_RSS_QS 16 |
105 | #define BE3_MAX_TX_QS 16 | 105 | #define BE3_MAX_TX_QS 16 |
106 | #define BE3_MAX_EVT_QS 16 | 106 | #define BE3_MAX_EVT_QS 16 |
107 | #define BE3_SRIOV_MAX_EVT_QS 8 | ||
107 | 108 | ||
108 | #define MAX_RX_QS 32 | 109 | #define MAX_RX_QS 32 |
109 | #define MAX_EVT_QS 32 | 110 | #define MAX_EVT_QS 32 |
@@ -480,7 +481,7 @@ struct be_adapter { | |||
480 | struct list_head entry; | 481 | struct list_head entry; |
481 | 482 | ||
482 | u32 flash_status; | 483 | u32 flash_status; |
483 | struct completion flash_compl; | 484 | struct completion et_cmd_compl; |
484 | 485 | ||
485 | struct be_resources res; /* resources available for the func */ | 486 | struct be_resources res; /* resources available for the func */ |
486 | u16 num_vfs; /* Number of VFs provisioned by PF */ | 487 | u16 num_vfs; /* Number of VFs provisioned by PF */ |
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index e0e8bc1ef14c..94c35c8d799d 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c | |||
@@ -141,11 +141,17 @@ static int be_mcc_compl_process(struct be_adapter *adapter, | |||
141 | subsystem = resp_hdr->subsystem; | 141 | subsystem = resp_hdr->subsystem; |
142 | } | 142 | } |
143 | 143 | ||
144 | if (opcode == OPCODE_LOWLEVEL_LOOPBACK_TEST && | ||
145 | subsystem == CMD_SUBSYSTEM_LOWLEVEL) { | ||
146 | complete(&adapter->et_cmd_compl); | ||
147 | return 0; | ||
148 | } | ||
149 | |||
144 | if (((opcode == OPCODE_COMMON_WRITE_FLASHROM) || | 150 | if (((opcode == OPCODE_COMMON_WRITE_FLASHROM) || |
145 | (opcode == OPCODE_COMMON_WRITE_OBJECT)) && | 151 | (opcode == OPCODE_COMMON_WRITE_OBJECT)) && |
146 | (subsystem == CMD_SUBSYSTEM_COMMON)) { | 152 | (subsystem == CMD_SUBSYSTEM_COMMON)) { |
147 | adapter->flash_status = compl_status; | 153 | adapter->flash_status = compl_status; |
148 | complete(&adapter->flash_compl); | 154 | complete(&adapter->et_cmd_compl); |
149 | } | 155 | } |
150 | 156 | ||
151 | if (compl_status == MCC_STATUS_SUCCESS) { | 157 | if (compl_status == MCC_STATUS_SUCCESS) { |
@@ -2017,6 +2023,9 @@ int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable, | |||
2017 | 0x3ea83c02, 0x4a110304}; | 2023 | 0x3ea83c02, 0x4a110304}; |
2018 | int status; | 2024 | int status; |
2019 | 2025 | ||
2026 | if (!(be_if_cap_flags(adapter) & BE_IF_FLAGS_RSS)) | ||
2027 | return 0; | ||
2028 | |||
2020 | if (mutex_lock_interruptible(&adapter->mbox_lock)) | 2029 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
2021 | return -1; | 2030 | return -1; |
2022 | 2031 | ||
@@ -2160,7 +2169,7 @@ int lancer_cmd_write_object(struct be_adapter *adapter, struct be_dma_mem *cmd, | |||
2160 | be_mcc_notify(adapter); | 2169 | be_mcc_notify(adapter); |
2161 | spin_unlock_bh(&adapter->mcc_lock); | 2170 | spin_unlock_bh(&adapter->mcc_lock); |
2162 | 2171 | ||
2163 | if (!wait_for_completion_timeout(&adapter->flash_compl, | 2172 | if (!wait_for_completion_timeout(&adapter->et_cmd_compl, |
2164 | msecs_to_jiffies(60000))) | 2173 | msecs_to_jiffies(60000))) |
2165 | status = -1; | 2174 | status = -1; |
2166 | else | 2175 | else |
@@ -2255,8 +2264,8 @@ int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd, | |||
2255 | be_mcc_notify(adapter); | 2264 | be_mcc_notify(adapter); |
2256 | spin_unlock_bh(&adapter->mcc_lock); | 2265 | spin_unlock_bh(&adapter->mcc_lock); |
2257 | 2266 | ||
2258 | if (!wait_for_completion_timeout(&adapter->flash_compl, | 2267 | if (!wait_for_completion_timeout(&adapter->et_cmd_compl, |
2259 | msecs_to_jiffies(40000))) | 2268 | msecs_to_jiffies(40000))) |
2260 | status = -1; | 2269 | status = -1; |
2261 | else | 2270 | else |
2262 | status = adapter->flash_status; | 2271 | status = adapter->flash_status; |
@@ -2367,6 +2376,7 @@ int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num, | |||
2367 | { | 2376 | { |
2368 | struct be_mcc_wrb *wrb; | 2377 | struct be_mcc_wrb *wrb; |
2369 | struct be_cmd_req_loopback_test *req; | 2378 | struct be_cmd_req_loopback_test *req; |
2379 | struct be_cmd_resp_loopback_test *resp; | ||
2370 | int status; | 2380 | int status; |
2371 | 2381 | ||
2372 | spin_lock_bh(&adapter->mcc_lock); | 2382 | spin_lock_bh(&adapter->mcc_lock); |
@@ -2381,8 +2391,8 @@ int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num, | |||
2381 | 2391 | ||
2382 | be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_LOWLEVEL, | 2392 | be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_LOWLEVEL, |
2383 | OPCODE_LOWLEVEL_LOOPBACK_TEST, sizeof(*req), wrb, NULL); | 2393 | OPCODE_LOWLEVEL_LOOPBACK_TEST, sizeof(*req), wrb, NULL); |
2384 | req->hdr.timeout = cpu_to_le32(4); | ||
2385 | 2394 | ||
2395 | req->hdr.timeout = cpu_to_le32(15); | ||
2386 | req->pattern = cpu_to_le64(pattern); | 2396 | req->pattern = cpu_to_le64(pattern); |
2387 | req->src_port = cpu_to_le32(port_num); | 2397 | req->src_port = cpu_to_le32(port_num); |
2388 | req->dest_port = cpu_to_le32(port_num); | 2398 | req->dest_port = cpu_to_le32(port_num); |
@@ -2390,12 +2400,15 @@ int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num, | |||
2390 | req->num_pkts = cpu_to_le32(num_pkts); | 2400 | req->num_pkts = cpu_to_le32(num_pkts); |
2391 | req->loopback_type = cpu_to_le32(loopback_type); | 2401 | req->loopback_type = cpu_to_le32(loopback_type); |
2392 | 2402 | ||
2393 | status = be_mcc_notify_wait(adapter); | 2403 | be_mcc_notify(adapter); |
2394 | if (!status) { | 2404 | |
2395 | struct be_cmd_resp_loopback_test *resp = embedded_payload(wrb); | 2405 | spin_unlock_bh(&adapter->mcc_lock); |
2396 | status = le32_to_cpu(resp->status); | ||
2397 | } | ||
2398 | 2406 | ||
2407 | wait_for_completion(&adapter->et_cmd_compl); | ||
2408 | resp = embedded_payload(wrb); | ||
2409 | status = le32_to_cpu(resp->status); | ||
2410 | |||
2411 | return status; | ||
2399 | err: | 2412 | err: |
2400 | spin_unlock_bh(&adapter->mcc_lock); | 2413 | spin_unlock_bh(&adapter->mcc_lock); |
2401 | return status; | 2414 | return status; |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 0fde69d5cb6a..bf40fdaecfa3 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -2744,13 +2744,16 @@ static int be_rx_qs_create(struct be_adapter *adapter) | |||
2744 | if (!BEx_chip(adapter)) | 2744 | if (!BEx_chip(adapter)) |
2745 | adapter->rss_flags |= RSS_ENABLE_UDP_IPV4 | | 2745 | adapter->rss_flags |= RSS_ENABLE_UDP_IPV4 | |
2746 | RSS_ENABLE_UDP_IPV6; | 2746 | RSS_ENABLE_UDP_IPV6; |
2747 | } else { | ||
2748 | /* Disable RSS, if only default RX Q is created */ | ||
2749 | adapter->rss_flags = RSS_ENABLE_NONE; | ||
2750 | } | ||
2747 | 2751 | ||
2748 | rc = be_cmd_rss_config(adapter, rsstable, adapter->rss_flags, | 2752 | rc = be_cmd_rss_config(adapter, rsstable, adapter->rss_flags, |
2749 | 128); | 2753 | 128); |
2750 | if (rc) { | 2754 | if (rc) { |
2751 | adapter->rss_flags = 0; | 2755 | adapter->rss_flags = RSS_ENABLE_NONE; |
2752 | return rc; | 2756 | return rc; |
2753 | } | ||
2754 | } | 2757 | } |
2755 | 2758 | ||
2756 | /* First time posting */ | 2759 | /* First time posting */ |
@@ -3124,11 +3127,11 @@ static void BEx_get_resources(struct be_adapter *adapter, | |||
3124 | { | 3127 | { |
3125 | struct pci_dev *pdev = adapter->pdev; | 3128 | struct pci_dev *pdev = adapter->pdev; |
3126 | bool use_sriov = false; | 3129 | bool use_sriov = false; |
3130 | int max_vfs; | ||
3127 | 3131 | ||
3128 | if (BE3_chip(adapter) && sriov_want(adapter)) { | 3132 | max_vfs = pci_sriov_get_totalvfs(pdev); |
3129 | int max_vfs; | ||
3130 | 3133 | ||
3131 | max_vfs = pci_sriov_get_totalvfs(pdev); | 3134 | if (BE3_chip(adapter) && sriov_want(adapter)) { |
3132 | res->max_vfs = max_vfs > 0 ? min(MAX_VFS, max_vfs) : 0; | 3135 | res->max_vfs = max_vfs > 0 ? min(MAX_VFS, max_vfs) : 0; |
3133 | use_sriov = res->max_vfs; | 3136 | use_sriov = res->max_vfs; |
3134 | } | 3137 | } |
@@ -3159,7 +3162,11 @@ static void BEx_get_resources(struct be_adapter *adapter, | |||
3159 | BE3_MAX_RSS_QS : BE2_MAX_RSS_QS; | 3162 | BE3_MAX_RSS_QS : BE2_MAX_RSS_QS; |
3160 | res->max_rx_qs = res->max_rss_qs + 1; | 3163 | res->max_rx_qs = res->max_rss_qs + 1; |
3161 | 3164 | ||
3162 | res->max_evt_qs = be_physfn(adapter) ? BE3_MAX_EVT_QS : 1; | 3165 | if (be_physfn(adapter)) |
3166 | res->max_evt_qs = (max_vfs > 0) ? | ||
3167 | BE3_SRIOV_MAX_EVT_QS : BE3_MAX_EVT_QS; | ||
3168 | else | ||
3169 | res->max_evt_qs = 1; | ||
3163 | 3170 | ||
3164 | res->if_cap_flags = BE_IF_CAP_FLAGS_WANT; | 3171 | res->if_cap_flags = BE_IF_CAP_FLAGS_WANT; |
3165 | if (!(adapter->function_caps & BE_FUNCTION_CAPS_RSS)) | 3172 | if (!(adapter->function_caps & BE_FUNCTION_CAPS_RSS)) |
@@ -4205,7 +4212,7 @@ static int be_ctrl_init(struct be_adapter *adapter) | |||
4205 | spin_lock_init(&adapter->mcc_lock); | 4212 | spin_lock_init(&adapter->mcc_lock); |
4206 | spin_lock_init(&adapter->mcc_cq_lock); | 4213 | spin_lock_init(&adapter->mcc_cq_lock); |
4207 | 4214 | ||
4208 | init_completion(&adapter->flash_compl); | 4215 | init_completion(&adapter->et_cmd_compl); |
4209 | pci_save_state(adapter->pdev); | 4216 | pci_save_state(adapter->pdev); |
4210 | return 0; | 4217 | return 0; |
4211 | 4218 | ||