aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c')
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c42
1 files changed, 11 insertions, 31 deletions
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;