aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitch Williams <mitch.a.williams@intel.com>2015-04-07 19:45:32 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2015-04-14 20:20:39 -0400
commited636960c3b5a44e59eccafef94837d14e3bc10f (patch)
tree3a58e7b9fc4f9a93638eb4561823041515bfc7d5
parente7c8c60bc5d48994a67e4b1c7bfb01d6979dbc54 (diff)
i40evf: remove aq_pending
The aq_pending field in the adapter structure is actually redundant with the current_op field. Remove the aq_pending field and expunge all traces of it from the official record. This simplifies the code significantly, especially in the virtual channel completion routine. Change-ID: Ib2957c8c19882bd0cecc6fcd133912c24b46a1ff Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40evf.h1
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40evf_main.c7
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c42
3 files changed, 12 insertions, 38 deletions
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ethernet/intel/i40evf/i40evf.h
index 34c8565031f6..1b98c25b3092 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf.h
+++ b/drivers/net/ethernet/intel/i40evf/i40evf.h
@@ -225,7 +225,6 @@ struct i40evf_adapter {
225#define I40E_FLAG_RX_CSUM_ENABLED I40EVF_FLAG_RX_CSUM_ENABLED 225#define I40E_FLAG_RX_CSUM_ENABLED I40EVF_FLAG_RX_CSUM_ENABLED
226 /* flags for admin queue service task */ 226 /* flags for admin queue service task */
227 u32 aq_required; 227 u32 aq_required;
228 u32 aq_pending;
229#define I40EVF_FLAG_AQ_ENABLE_QUEUES (u32)(1) 228#define I40EVF_FLAG_AQ_ENABLE_QUEUES (u32)(1)
230#define I40EVF_FLAG_AQ_DISABLE_QUEUES (u32)(1 << 1) 229#define I40EVF_FLAG_AQ_DISABLE_QUEUES (u32)(1 << 1)
231#define I40EVF_FLAG_AQ_ADD_MAC_FILTER (u32)(1 << 2) 230#define I40EVF_FLAG_AQ_ADD_MAC_FILTER (u32)(1 << 2)
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index a31bfd188e1a..7c53aca4b5a6 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1008,7 +1008,6 @@ void i40evf_down(struct i40evf_adapter *adapter)
1008 adapter->state != __I40EVF_RESETTING) { 1008 adapter->state != __I40EVF_RESETTING) {
1009 /* cancel any current operation */ 1009 /* cancel any current operation */
1010 adapter->current_op = I40E_VIRTCHNL_OP_UNKNOWN; 1010 adapter->current_op = I40E_VIRTCHNL_OP_UNKNOWN;
1011 adapter->aq_pending = 0;
1012 /* Schedule operations to close down the HW. Don't wait 1011 /* Schedule operations to close down the HW. Don't wait
1013 * here for this to complete. The watchdog is still running 1012 * here for this to complete. The watchdog is still running
1014 * and it will take care of this. 1013 * and it will take care of this.
@@ -1335,7 +1334,6 @@ static void i40evf_watchdog_task(struct work_struct *work)
1335 */ 1334 */
1336 return; 1335 return;
1337 } 1336 }
1338 adapter->aq_pending = 0;
1339 adapter->aq_required = 0; 1337 adapter->aq_required = 0;
1340 adapter->current_op = I40E_VIRTCHNL_OP_UNKNOWN; 1338 adapter->current_op = I40E_VIRTCHNL_OP_UNKNOWN;
1341 goto watchdog_done; 1339 goto watchdog_done;
@@ -1355,7 +1353,6 @@ static void i40evf_watchdog_task(struct work_struct *work)
1355 adapter->flags |= I40EVF_FLAG_RESET_PENDING; 1353 adapter->flags |= I40EVF_FLAG_RESET_PENDING;
1356 dev_err(&adapter->pdev->dev, "Hardware reset detected\n"); 1354 dev_err(&adapter->pdev->dev, "Hardware reset detected\n");
1357 schedule_work(&adapter->reset_task); 1355 schedule_work(&adapter->reset_task);
1358 adapter->aq_pending = 0;
1359 adapter->aq_required = 0; 1356 adapter->aq_required = 0;
1360 adapter->current_op = I40E_VIRTCHNL_OP_UNKNOWN; 1357 adapter->current_op = I40E_VIRTCHNL_OP_UNKNOWN;
1361 goto watchdog_done; 1358 goto watchdog_done;
@@ -1364,7 +1361,7 @@ static void i40evf_watchdog_task(struct work_struct *work)
1364 /* Process admin queue tasks. After init, everything gets done 1361 /* Process admin queue tasks. After init, everything gets done
1365 * here so we don't race on the admin queue. 1362 * here so we don't race on the admin queue.
1366 */ 1363 */
1367 if (adapter->aq_pending) { 1364 if (adapter->current_op) {
1368 if (!i40evf_asq_done(hw)) { 1365 if (!i40evf_asq_done(hw)) {
1369 dev_dbg(&adapter->pdev->dev, "Admin queue timeout\n"); 1366 dev_dbg(&adapter->pdev->dev, "Admin queue timeout\n");
1370 i40evf_send_api_ver(adapter); 1367 i40evf_send_api_ver(adapter);
@@ -2249,7 +2246,6 @@ static void i40evf_shutdown(struct pci_dev *pdev)
2249 /* Prevent the watchdog from running. */ 2246 /* Prevent the watchdog from running. */
2250 adapter->state = __I40EVF_REMOVE; 2247 adapter->state = __I40EVF_REMOVE;
2251 adapter->aq_required = 0; 2248 adapter->aq_required = 0;
2252 adapter->aq_pending = 0;
2253 2249
2254#ifdef CONFIG_PM 2250#ifdef CONFIG_PM
2255 pci_save_state(pdev); 2251 pci_save_state(pdev);
@@ -2467,7 +2463,6 @@ static void i40evf_remove(struct pci_dev *pdev)
2467 /* Shut down all the garbage mashers on the detention level */ 2463 /* Shut down all the garbage mashers on the detention level */
2468 adapter->state = __I40EVF_REMOVE; 2464 adapter->state = __I40EVF_REMOVE;
2469 adapter->aq_required = 0; 2465 adapter->aq_required = 0;
2470 adapter->aq_pending = 0;
2471 i40evf_request_reset(adapter); 2466 i40evf_request_reset(adapter);
2472 msleep(20); 2467 msleep(20);
2473 /* If the FW isn't responding, kick it once, but only once. */ 2468 /* If the FW isn't responding, kick it once, but only once. */
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
index 4240a496dc50..61e090558f31 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
@@ -250,7 +250,6 @@ void i40evf_configure_queues(struct i40evf_adapter *adapter)
250 vqpi++; 250 vqpi++;
251 } 251 }
252 252
253 adapter->aq_pending |= I40EVF_FLAG_AQ_CONFIGURE_QUEUES;
254 adapter->aq_required &= ~I40EVF_FLAG_AQ_CONFIGURE_QUEUES; 253 adapter->aq_required &= ~I40EVF_FLAG_AQ_CONFIGURE_QUEUES;
255 i40evf_send_pf_msg(adapter, I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES, 254 i40evf_send_pf_msg(adapter, I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES,
256 (u8 *)vqci, len); 255 (u8 *)vqci, len);
@@ -277,7 +276,6 @@ void i40evf_enable_queues(struct i40evf_adapter *adapter)
277 vqs.vsi_id = adapter->vsi_res->vsi_id; 276 vqs.vsi_id = adapter->vsi_res->vsi_id;
278 vqs.tx_queues = (1 << adapter->num_active_queues) - 1; 277 vqs.tx_queues = (1 << adapter->num_active_queues) - 1;
279 vqs.rx_queues = vqs.tx_queues; 278 vqs.rx_queues = vqs.tx_queues;
280 adapter->aq_pending |= I40EVF_FLAG_AQ_ENABLE_QUEUES;
281 adapter->aq_required &= ~I40EVF_FLAG_AQ_ENABLE_QUEUES; 279 adapter->aq_required &= ~I40EVF_FLAG_AQ_ENABLE_QUEUES;
282 i40evf_send_pf_msg(adapter, I40E_VIRTCHNL_OP_ENABLE_QUEUES, 280 i40evf_send_pf_msg(adapter, I40E_VIRTCHNL_OP_ENABLE_QUEUES,
283 (u8 *)&vqs, sizeof(vqs)); 281 (u8 *)&vqs, sizeof(vqs));
@@ -303,7 +301,6 @@ void i40evf_disable_queues(struct i40evf_adapter *adapter)
303 vqs.vsi_id = adapter->vsi_res->vsi_id; 301 vqs.vsi_id = adapter->vsi_res->vsi_id;
304 vqs.tx_queues = (1 << adapter->num_active_queues) - 1; 302 vqs.tx_queues = (1 << adapter->num_active_queues) - 1;
305 vqs.rx_queues = vqs.tx_queues; 303 vqs.rx_queues = vqs.tx_queues;
306 adapter->aq_pending |= I40EVF_FLAG_AQ_DISABLE_QUEUES;
307 adapter->aq_required &= ~I40EVF_FLAG_AQ_DISABLE_QUEUES; 304 adapter->aq_required &= ~I40EVF_FLAG_AQ_DISABLE_QUEUES;
308 i40evf_send_pf_msg(adapter, I40E_VIRTCHNL_OP_DISABLE_QUEUES, 305 i40evf_send_pf_msg(adapter, I40E_VIRTCHNL_OP_DISABLE_QUEUES,
309 (u8 *)&vqs, sizeof(vqs)); 306 (u8 *)&vqs, sizeof(vqs));
@@ -354,7 +351,6 @@ void i40evf_map_queues(struct i40evf_adapter *adapter)
354 vimi->vecmap[v_idx].txq_map = 0; 351 vimi->vecmap[v_idx].txq_map = 0;
355 vimi->vecmap[v_idx].rxq_map = 0; 352 vimi->vecmap[v_idx].rxq_map = 0;
356 353
357 adapter->aq_pending |= I40EVF_FLAG_AQ_MAP_VECTORS;
358 adapter->aq_required &= ~I40EVF_FLAG_AQ_MAP_VECTORS; 354 adapter->aq_required &= ~I40EVF_FLAG_AQ_MAP_VECTORS;
359 i40evf_send_pf_msg(adapter, I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP, 355 i40evf_send_pf_msg(adapter, I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP,
360 (u8 *)vimi, len); 356 (u8 *)vimi, len);
@@ -415,7 +411,6 @@ void i40evf_add_ether_addrs(struct i40evf_adapter *adapter)
415 f->add = false; 411 f->add = false;
416 } 412 }
417 } 413 }
418 adapter->aq_pending |= I40EVF_FLAG_AQ_ADD_MAC_FILTER;
419 adapter->aq_required &= ~I40EVF_FLAG_AQ_ADD_MAC_FILTER; 414 adapter->aq_required &= ~I40EVF_FLAG_AQ_ADD_MAC_FILTER;
420 i40evf_send_pf_msg(adapter, I40E_VIRTCHNL_OP_ADD_ETHER_ADDRESS, 415 i40evf_send_pf_msg(adapter, I40E_VIRTCHNL_OP_ADD_ETHER_ADDRESS,
421 (u8 *)veal, len); 416 (u8 *)veal, len);
@@ -476,7 +471,6 @@ void i40evf_del_ether_addrs(struct i40evf_adapter *adapter)
476 kfree(f); 471 kfree(f);
477 } 472 }
478 } 473 }
479 adapter->aq_pending |= I40EVF_FLAG_AQ_DEL_MAC_FILTER;
480 adapter->aq_required &= ~I40EVF_FLAG_AQ_DEL_MAC_FILTER; 474 adapter->aq_required &= ~I40EVF_FLAG_AQ_DEL_MAC_FILTER;
481 i40evf_send_pf_msg(adapter, I40E_VIRTCHNL_OP_DEL_ETHER_ADDRESS, 475 i40evf_send_pf_msg(adapter, I40E_VIRTCHNL_OP_DEL_ETHER_ADDRESS,
482 (u8 *)veal, len); 476 (u8 *)veal, len);
@@ -537,7 +531,6 @@ void i40evf_add_vlans(struct i40evf_adapter *adapter)
537 f->add = false; 531 f->add = false;
538 } 532 }
539 } 533 }
540 adapter->aq_pending |= I40EVF_FLAG_AQ_ADD_VLAN_FILTER;
541 adapter->aq_required &= ~I40EVF_FLAG_AQ_ADD_VLAN_FILTER; 534 adapter->aq_required &= ~I40EVF_FLAG_AQ_ADD_VLAN_FILTER;
542 i40evf_send_pf_msg(adapter, I40E_VIRTCHNL_OP_ADD_VLAN, (u8 *)vvfl, len); 535 i40evf_send_pf_msg(adapter, I40E_VIRTCHNL_OP_ADD_VLAN, (u8 *)vvfl, len);
543 kfree(vvfl); 536 kfree(vvfl);
@@ -598,7 +591,6 @@ void i40evf_del_vlans(struct i40evf_adapter *adapter)
598 kfree(f); 591 kfree(f);
599 } 592 }
600 } 593 }
601 adapter->aq_pending |= I40EVF_FLAG_AQ_DEL_VLAN_FILTER;
602 adapter->aq_required &= ~I40EVF_FLAG_AQ_DEL_VLAN_FILTER; 594 adapter->aq_required &= ~I40EVF_FLAG_AQ_DEL_VLAN_FILTER;
603 i40evf_send_pf_msg(adapter, I40E_VIRTCHNL_OP_DEL_VLAN, (u8 *)vvfl, len); 595 i40evf_send_pf_msg(adapter, I40E_VIRTCHNL_OP_DEL_VLAN, (u8 *)vvfl, len);
604 kfree(vvfl); 596 kfree(vvfl);
@@ -720,9 +712,6 @@ void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,
720 __func__, v_retval, v_opcode); 712 __func__, v_retval, v_opcode);
721 } 713 }
722 switch (v_opcode) { 714 switch (v_opcode) {
723 case I40E_VIRTCHNL_OP_VERSION:
724 /* no action, but also not an error */
725 break;
726 case I40E_VIRTCHNL_OP_GET_STATS: { 715 case I40E_VIRTCHNL_OP_GET_STATS: {
727 struct i40e_eth_stats *stats = 716 struct i40e_eth_stats *stats =
728 (struct i40e_eth_stats *)msg; 717 (struct i40e_eth_stats *)msg;
@@ -740,39 +729,30 @@ void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,
740 adapter->current_stats = *stats; 729 adapter->current_stats = *stats;
741 } 730 }
742 break; 731 break;
743 case I40E_VIRTCHNL_OP_ADD_ETHER_ADDRESS:
744 adapter->aq_pending &= ~(I40EVF_FLAG_AQ_ADD_MAC_FILTER);
745 break;
746 case I40E_VIRTCHNL_OP_DEL_ETHER_ADDRESS:
747 adapter->aq_pending &= ~(I40EVF_FLAG_AQ_DEL_MAC_FILTER);
748 break;
749 case I40E_VIRTCHNL_OP_ADD_VLAN:
750 adapter->aq_pending &= ~(I40EVF_FLAG_AQ_ADD_VLAN_FILTER);
751 break;
752 case I40E_VIRTCHNL_OP_DEL_VLAN:
753 adapter->aq_pending &= ~(I40EVF_FLAG_AQ_DEL_VLAN_FILTER);
754 break;
755 case I40E_VIRTCHNL_OP_ENABLE_QUEUES: 732 case I40E_VIRTCHNL_OP_ENABLE_QUEUES:
756 adapter->aq_pending &= ~(I40EVF_FLAG_AQ_ENABLE_QUEUES);
757 /* enable transmits */ 733 /* enable transmits */
758 i40evf_irq_enable(adapter, true); 734 i40evf_irq_enable(adapter, true);
759 netif_tx_start_all_queues(adapter->netdev); 735 netif_tx_start_all_queues(adapter->netdev);
760 netif_carrier_on(adapter->netdev); 736 netif_carrier_on(adapter->netdev);
761 break; 737 break;
762 case I40E_VIRTCHNL_OP_DISABLE_QUEUES: 738 case I40E_VIRTCHNL_OP_DISABLE_QUEUES:
763 adapter->aq_pending &= ~(I40EVF_FLAG_AQ_DISABLE_QUEUES);
764 i40evf_free_all_tx_resources(adapter); 739 i40evf_free_all_tx_resources(adapter);
765 i40evf_free_all_rx_resources(adapter); 740 i40evf_free_all_rx_resources(adapter);
766 break; 741 break;
767 case I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES: 742 case I40E_VIRTCHNL_OP_VERSION:
768 adapter->aq_pending &= ~(I40EVF_FLAG_AQ_CONFIGURE_QUEUES); 743 case I40E_VIRTCHNL_OP_GET_VF_RESOURCES:
769 break;
770 case I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP: 744 case I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP:
771 adapter->aq_pending &= ~(I40EVF_FLAG_AQ_MAP_VECTORS); 745 /* Don't display an error if we get these out of sequence.
746 * If the firmware needed to get kicked, we'll get these and
747 * it's no problem.
748 */
749 if (v_opcode != adapter->current_op)
750 return;
772 break; 751 break;
773 default: 752 default:
774 dev_info(&adapter->pdev->dev, "Received unexpected message %d from PF\n", 753 if (v_opcode != adapter->current_op)
775 v_opcode); 754 dev_warn(&adapter->pdev->dev, "Expected response %d from PF, received %d\n",
755 adapter->current_op, v_opcode);
776 break; 756 break;
777 } /* switch v_opcode */ 757 } /* switch v_opcode */
778 adapter->current_op = I40E_VIRTCHNL_OP_UNKNOWN; 758 adapter->current_op = I40E_VIRTCHNL_OP_UNKNOWN;