Lines Matching full:adapter
12 * @adapter: adapter structure
19 static int iavf_send_pf_msg(struct iavf_adapter *adapter, in iavf_send_pf_msg() argument
22 struct iavf_hw *hw = &adapter->hw; in iavf_send_pf_msg()
25 if (adapter->flags & IAVF_FLAG_PF_COMMS_FAILED) in iavf_send_pf_msg()
30 dev_dbg(&adapter->pdev->dev, "Unable to send opcode %d to PF, status %s, aq_err %s\n", in iavf_send_pf_msg()
38 * @adapter: adapter structure
44 int iavf_send_api_ver(struct iavf_adapter *adapter) in iavf_send_api_ver() argument
51 return iavf_send_pf_msg(adapter, VIRTCHNL_OP_VERSION, (u8 *)&vvi, in iavf_send_api_ver()
92 * @adapter: adapter structure
99 int iavf_verify_api_ver(struct iavf_adapter *adapter) in iavf_verify_api_ver() argument
109 err = iavf_poll_virtchnl_msg(&adapter->hw, &event, VIRTCHNL_OP_VERSION); in iavf_verify_api_ver()
113 adapter->pf_version = *pf_vvi; in iavf_verify_api_ver()
128 * @adapter: adapter structure
134 int iavf_send_vf_config_msg(struct iavf_adapter *adapter) in iavf_send_vf_config_msg() argument
160 adapter->current_op = VIRTCHNL_OP_GET_VF_RESOURCES; in iavf_send_vf_config_msg()
161 adapter->aq_required &= ~IAVF_FLAG_AQ_GET_CONFIG; in iavf_send_vf_config_msg()
162 if (PF_IS_V11(adapter)) in iavf_send_vf_config_msg()
163 return iavf_send_pf_msg(adapter, VIRTCHNL_OP_GET_VF_RESOURCES, in iavf_send_vf_config_msg()
166 return iavf_send_pf_msg(adapter, VIRTCHNL_OP_GET_VF_RESOURCES, in iavf_send_vf_config_msg()
170 int iavf_send_vf_offload_vlan_v2_msg(struct iavf_adapter *adapter) in iavf_send_vf_offload_vlan_v2_msg() argument
172 adapter->aq_required &= ~IAVF_FLAG_AQ_GET_OFFLOAD_VLAN_V2_CAPS; in iavf_send_vf_offload_vlan_v2_msg()
174 if (!VLAN_V2_ALLOWED(adapter)) in iavf_send_vf_offload_vlan_v2_msg()
177 adapter->current_op = VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS; in iavf_send_vf_offload_vlan_v2_msg()
179 return iavf_send_pf_msg(adapter, VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS, in iavf_send_vf_offload_vlan_v2_msg()
183 int iavf_send_vf_supported_rxdids_msg(struct iavf_adapter *adapter) in iavf_send_vf_supported_rxdids_msg() argument
185 adapter->aq_required &= ~IAVF_FLAG_AQ_GET_SUPPORTED_RXDIDS; in iavf_send_vf_supported_rxdids_msg()
187 if (!IAVF_RXDID_ALLOWED(adapter)) in iavf_send_vf_supported_rxdids_msg()
190 adapter->current_op = VIRTCHNL_OP_GET_SUPPORTED_RXDIDS; in iavf_send_vf_supported_rxdids_msg()
192 return iavf_send_pf_msg(adapter, VIRTCHNL_OP_GET_SUPPORTED_RXDIDS, in iavf_send_vf_supported_rxdids_msg()
198 * @adapter: private adapter structure
213 int iavf_send_vf_ptp_caps_msg(struct iavf_adapter *adapter) in iavf_send_vf_ptp_caps_msg() argument
220 adapter->aq_required &= ~IAVF_FLAG_AQ_GET_PTP_CAPS; in iavf_send_vf_ptp_caps_msg()
222 if (!IAVF_PTP_ALLOWED(adapter)) in iavf_send_vf_ptp_caps_msg()
225 adapter->current_op = VIRTCHNL_OP_1588_PTP_GET_CAPS; in iavf_send_vf_ptp_caps_msg()
227 return iavf_send_pf_msg(adapter, VIRTCHNL_OP_1588_PTP_GET_CAPS, in iavf_send_vf_ptp_caps_msg()
233 * @adapter: adapter structure
238 static void iavf_validate_num_queues(struct iavf_adapter *adapter) in iavf_validate_num_queues() argument
240 if (adapter->vf_res->num_queue_pairs > IAVF_MAX_REQ_QUEUES) { in iavf_validate_num_queues()
244 dev_info(&adapter->pdev->dev, "Received %d queues, but can only have a max of %d\n", in iavf_validate_num_queues()
245 adapter->vf_res->num_queue_pairs, in iavf_validate_num_queues()
247 dev_info(&adapter->pdev->dev, "Fixing by reducing queues to %d\n", in iavf_validate_num_queues()
249 adapter->vf_res->num_queue_pairs = IAVF_MAX_REQ_QUEUES; in iavf_validate_num_queues()
250 for (i = 0; i < adapter->vf_res->num_vsis; i++) { in iavf_validate_num_queues()
251 vsi_res = &adapter->vf_res->vsi_res[i]; in iavf_validate_num_queues()
259 * @adapter: private adapter structure
266 int iavf_get_vf_config(struct iavf_adapter *adapter) in iavf_get_vf_config() argument
268 struct iavf_hw *hw = &adapter->hw; in iavf_get_vf_config()
280 memcpy(adapter->vf_res, event.msg_buf, min(event.msg_len, len)); in iavf_get_vf_config()
286 iavf_validate_num_queues(adapter); in iavf_get_vf_config()
287 iavf_vf_parse_hw_config(hw, adapter->vf_res); in iavf_get_vf_config()
294 int iavf_get_vf_vlan_v2_caps(struct iavf_adapter *adapter) in iavf_get_vf_vlan_v2_caps() argument
306 err = iavf_poll_virtchnl_msg(&adapter->hw, &event, in iavf_get_vf_vlan_v2_caps()
309 memcpy(&adapter->vlan_v2_caps, event.msg_buf, in iavf_get_vf_vlan_v2_caps()
317 int iavf_get_vf_supported_rxdids(struct iavf_adapter *adapter) in iavf_get_vf_supported_rxdids() argument
326 err = iavf_poll_virtchnl_msg(&adapter->hw, &event, in iavf_get_vf_supported_rxdids()
329 adapter->supp_rxdids = rxdids; in iavf_get_vf_supported_rxdids()
334 int iavf_get_vf_ptp_caps(struct iavf_adapter *adapter) in iavf_get_vf_ptp_caps() argument
343 err = iavf_poll_virtchnl_msg(&adapter->hw, &event, in iavf_get_vf_ptp_caps()
346 adapter->ptp.hw_caps = caps; in iavf_get_vf_ptp_caps()
353 * @adapter: adapter structure
357 void iavf_configure_queues(struct iavf_adapter *adapter) in iavf_configure_queues() argument
360 int pairs = adapter->num_active_queues; in iavf_configure_queues()
366 max_frame = LIBIE_MAX_RX_FRM_LEN(adapter->rx_rings->pp->p.offset); in iavf_configure_queues()
367 max_frame = min_not_zero(adapter->vf_res->max_mtu, max_frame); in iavf_configure_queues()
369 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_configure_queues()
371 dev_err(&adapter->pdev->dev, "Cannot configure queues, command %d pending\n", in iavf_configure_queues()
372 adapter->current_op); in iavf_configure_queues()
375 adapter->current_op = VIRTCHNL_OP_CONFIG_VSI_QUEUES; in iavf_configure_queues()
381 if (iavf_ptp_cap_supported(adapter, VIRTCHNL_1588_PTP_CAP_RX_TSTAMP)) in iavf_configure_queues()
384 vqci->vsi_id = adapter->vsi_res->vsi_id; in iavf_configure_queues()
393 vqpi->txq.ring_len = adapter->tx_rings[i].count; in iavf_configure_queues()
394 vqpi->txq.dma_ring_addr = adapter->tx_rings[i].dma; in iavf_configure_queues()
397 vqpi->rxq.ring_len = adapter->rx_rings[i].count; in iavf_configure_queues()
398 vqpi->rxq.dma_ring_addr = adapter->rx_rings[i].dma; in iavf_configure_queues()
400 vqpi->rxq.databuffer_size = adapter->rx_rings[i].rx_buf_len; in iavf_configure_queues()
401 if (IAVF_RXDID_ALLOWED(adapter)) in iavf_configure_queues()
402 vqpi->rxq.rxdid = adapter->rxdid; in iavf_configure_queues()
403 if (CRC_OFFLOAD_ALLOWED(adapter)) in iavf_configure_queues()
404 vqpi->rxq.crc_disable = !!(adapter->netdev->features & in iavf_configure_queues()
410 adapter->aq_required &= ~IAVF_FLAG_AQ_CONFIGURE_QUEUES; in iavf_configure_queues()
411 iavf_send_pf_msg(adapter, VIRTCHNL_OP_CONFIG_VSI_QUEUES, in iavf_configure_queues()
418 * @adapter: adapter structure
422 void iavf_enable_queues(struct iavf_adapter *adapter) in iavf_enable_queues() argument
426 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_enable_queues()
428 dev_err(&adapter->pdev->dev, "Cannot enable queues, command %d pending\n", in iavf_enable_queues()
429 adapter->current_op); in iavf_enable_queues()
432 adapter->current_op = VIRTCHNL_OP_ENABLE_QUEUES; in iavf_enable_queues()
433 vqs.vsi_id = adapter->vsi_res->vsi_id; in iavf_enable_queues()
434 vqs.tx_queues = BIT(adapter->num_active_queues) - 1; in iavf_enable_queues()
436 adapter->aq_required &= ~IAVF_FLAG_AQ_ENABLE_QUEUES; in iavf_enable_queues()
437 iavf_send_pf_msg(adapter, VIRTCHNL_OP_ENABLE_QUEUES, in iavf_enable_queues()
443 * @adapter: adapter structure
447 void iavf_disable_queues(struct iavf_adapter *adapter) in iavf_disable_queues() argument
451 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_disable_queues()
453 dev_err(&adapter->pdev->dev, "Cannot disable queues, command %d pending\n", in iavf_disable_queues()
454 adapter->current_op); in iavf_disable_queues()
457 adapter->current_op = VIRTCHNL_OP_DISABLE_QUEUES; in iavf_disable_queues()
458 vqs.vsi_id = adapter->vsi_res->vsi_id; in iavf_disable_queues()
459 vqs.tx_queues = BIT(adapter->num_active_queues) - 1; in iavf_disable_queues()
461 adapter->aq_required &= ~IAVF_FLAG_AQ_DISABLE_QUEUES; in iavf_disable_queues()
462 iavf_send_pf_msg(adapter, VIRTCHNL_OP_DISABLE_QUEUES, in iavf_disable_queues()
468 * @adapter: adapter structure
473 void iavf_map_queues(struct iavf_adapter *adapter) in iavf_map_queues() argument
481 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_map_queues()
483 dev_err(&adapter->pdev->dev, "Cannot map queues to vectors, command %d pending\n", in iavf_map_queues()
484 adapter->current_op); in iavf_map_queues()
487 adapter->current_op = VIRTCHNL_OP_CONFIG_IRQ_MAP; in iavf_map_queues()
489 q_vectors = adapter->num_msix_vectors - NONQ_VECS; in iavf_map_queues()
491 len = virtchnl_struct_size(vimi, vecmap, adapter->num_msix_vectors); in iavf_map_queues()
496 vimi->num_vectors = adapter->num_msix_vectors; in iavf_map_queues()
499 q_vector = &adapter->q_vectors[v_idx]; in iavf_map_queues()
502 vecmap->vsi_id = adapter->vsi_res->vsi_id; in iavf_map_queues()
511 vecmap->vsi_id = adapter->vsi_res->vsi_id; in iavf_map_queues()
516 adapter->aq_required &= ~IAVF_FLAG_AQ_MAP_VECTORS; in iavf_map_queues()
517 iavf_send_pf_msg(adapter, VIRTCHNL_OP_CONFIG_IRQ_MAP, in iavf_map_queues()
538 * @adapter: adapter structure
542 void iavf_add_ether_addrs(struct iavf_adapter *adapter) in iavf_add_ether_addrs() argument
550 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_add_ether_addrs()
552 dev_err(&adapter->pdev->dev, "Cannot add filters, command %d pending\n", in iavf_add_ether_addrs()
553 adapter->current_op); in iavf_add_ether_addrs()
557 spin_lock_bh(&adapter->mac_vlan_list_lock); in iavf_add_ether_addrs()
559 list_for_each_entry(f, &adapter->mac_filter_list, list) { in iavf_add_ether_addrs()
564 adapter->aq_required &= ~IAVF_FLAG_AQ_ADD_MAC_FILTER; in iavf_add_ether_addrs()
565 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_add_ether_addrs()
568 adapter->current_op = VIRTCHNL_OP_ADD_ETH_ADDR; in iavf_add_ether_addrs()
572 dev_warn(&adapter->pdev->dev, "Too many add MAC changes in one request\n"); in iavf_add_ether_addrs()
580 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_add_ether_addrs()
584 veal->vsi_id = adapter->vsi_res->vsi_id; in iavf_add_ether_addrs()
586 list_for_each_entry(f, &adapter->mac_filter_list, list) { in iavf_add_ether_addrs()
597 adapter->aq_required &= ~IAVF_FLAG_AQ_ADD_MAC_FILTER; in iavf_add_ether_addrs()
599 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_add_ether_addrs()
601 iavf_send_pf_msg(adapter, VIRTCHNL_OP_ADD_ETH_ADDR, (u8 *)veal, len); in iavf_add_ether_addrs()
607 * @adapter: adapter structure
611 void iavf_del_ether_addrs(struct iavf_adapter *adapter) in iavf_del_ether_addrs() argument
619 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_del_ether_addrs()
621 dev_err(&adapter->pdev->dev, "Cannot remove filters, command %d pending\n", in iavf_del_ether_addrs()
622 adapter->current_op); in iavf_del_ether_addrs()
626 spin_lock_bh(&adapter->mac_vlan_list_lock); in iavf_del_ether_addrs()
628 list_for_each_entry(f, &adapter->mac_filter_list, list) { in iavf_del_ether_addrs()
633 adapter->aq_required &= ~IAVF_FLAG_AQ_DEL_MAC_FILTER; in iavf_del_ether_addrs()
634 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_del_ether_addrs()
637 adapter->current_op = VIRTCHNL_OP_DEL_ETH_ADDR; in iavf_del_ether_addrs()
641 dev_warn(&adapter->pdev->dev, "Too many delete MAC changes in one request\n"); in iavf_del_ether_addrs()
648 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_del_ether_addrs()
652 veal->vsi_id = adapter->vsi_res->vsi_id; in iavf_del_ether_addrs()
654 list_for_each_entry_safe(f, ftmp, &adapter->mac_filter_list, list) { in iavf_del_ether_addrs()
666 adapter->aq_required &= ~IAVF_FLAG_AQ_DEL_MAC_FILTER; in iavf_del_ether_addrs()
668 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_del_ether_addrs()
670 iavf_send_pf_msg(adapter, VIRTCHNL_OP_DEL_ETH_ADDR, (u8 *)veal, len); in iavf_del_ether_addrs()
676 * @adapter: adapter structure
680 static void iavf_mac_add_ok(struct iavf_adapter *adapter) in iavf_mac_add_ok() argument
684 spin_lock_bh(&adapter->mac_vlan_list_lock); in iavf_mac_add_ok()
685 list_for_each_entry_safe(f, ftmp, &adapter->mac_filter_list, list) { in iavf_mac_add_ok()
690 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_mac_add_ok()
695 * @adapter: adapter structure
699 static void iavf_mac_add_reject(struct iavf_adapter *adapter) in iavf_mac_add_reject() argument
701 struct net_device *netdev = adapter->netdev; in iavf_mac_add_reject()
704 spin_lock_bh(&adapter->mac_vlan_list_lock); in iavf_mac_add_reject()
705 list_for_each_entry_safe(f, ftmp, &adapter->mac_filter_list, list) { in iavf_mac_add_reject()
717 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_mac_add_reject()
722 * @adapter: adapter structure
726 static void iavf_vlan_add_reject(struct iavf_adapter *adapter) in iavf_vlan_add_reject() argument
730 spin_lock_bh(&adapter->mac_vlan_list_lock); in iavf_vlan_add_reject()
731 list_for_each_entry_safe(f, ftmp, &adapter->vlan_filter_list, list) { in iavf_vlan_add_reject()
735 adapter->num_vlan_filters--; in iavf_vlan_add_reject()
738 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_vlan_add_reject()
743 * @adapter: adapter structure
747 void iavf_add_vlans(struct iavf_adapter *adapter) in iavf_add_vlans() argument
753 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_add_vlans()
755 dev_err(&adapter->pdev->dev, "Cannot add VLANs, command %d pending\n", in iavf_add_vlans()
756 adapter->current_op); in iavf_add_vlans()
760 spin_lock_bh(&adapter->mac_vlan_list_lock); in iavf_add_vlans()
762 list_for_each_entry(f, &adapter->vlan_filter_list, list) { in iavf_add_vlans()
766 if (!count || !VLAN_FILTERING_ALLOWED(adapter)) { in iavf_add_vlans()
767 adapter->aq_required &= ~IAVF_FLAG_AQ_ADD_VLAN_FILTER; in iavf_add_vlans()
768 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_add_vlans()
772 if (VLAN_ALLOWED(adapter)) { in iavf_add_vlans()
775 adapter->current_op = VIRTCHNL_OP_ADD_VLAN; in iavf_add_vlans()
779 dev_warn(&adapter->pdev->dev, "Too many add VLAN changes in one request\n"); in iavf_add_vlans()
787 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_add_vlans()
791 vvfl->vsi_id = adapter->vsi_res->vsi_id; in iavf_add_vlans()
793 list_for_each_entry(f, &adapter->vlan_filter_list, list) { in iavf_add_vlans()
803 adapter->aq_required &= ~IAVF_FLAG_AQ_ADD_VLAN_FILTER; in iavf_add_vlans()
805 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_add_vlans()
807 iavf_send_pf_msg(adapter, VIRTCHNL_OP_ADD_VLAN, (u8 *)vvfl, len); in iavf_add_vlans()
810 u16 max_vlans = adapter->vlan_v2_caps.filtering.max_filters; in iavf_add_vlans()
811 u16 current_vlans = iavf_get_num_vlans_added(adapter); in iavf_add_vlans()
814 adapter->current_op = VIRTCHNL_OP_ADD_VLAN_V2; in iavf_add_vlans()
818 count = max_vlans - iavf_get_num_vlans_added(adapter); in iavf_add_vlans()
824 dev_warn(&adapter->pdev->dev, "Too many add VLAN changes in one request\n"); in iavf_add_vlans()
833 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_add_vlans()
837 vvfl_v2->vport_id = adapter->vsi_res->vsi_id; in iavf_add_vlans()
839 list_for_each_entry(f, &adapter->vlan_filter_list, list) { in iavf_add_vlans()
842 &adapter->vlan_v2_caps.filtering.filtering_support; in iavf_add_vlans()
863 adapter->aq_required &= ~IAVF_FLAG_AQ_ADD_VLAN_FILTER; in iavf_add_vlans()
865 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_add_vlans()
867 iavf_send_pf_msg(adapter, VIRTCHNL_OP_ADD_VLAN_V2, in iavf_add_vlans()
875 * @adapter: adapter structure
879 void iavf_del_vlans(struct iavf_adapter *adapter) in iavf_del_vlans() argument
885 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_del_vlans()
887 dev_err(&adapter->pdev->dev, "Cannot remove VLANs, command %d pending\n", in iavf_del_vlans()
888 adapter->current_op); in iavf_del_vlans()
892 spin_lock_bh(&adapter->mac_vlan_list_lock); in iavf_del_vlans()
894 list_for_each_entry_safe(f, ftmp, &adapter->vlan_filter_list, list) { in iavf_del_vlans()
902 !VLAN_FILTERING_ALLOWED(adapter)) { in iavf_del_vlans()
905 adapter->num_vlan_filters--; in iavf_del_vlans()
907 !VLAN_FILTERING_ALLOWED(adapter)) { in iavf_del_vlans()
914 if (!count || !VLAN_FILTERING_ALLOWED(adapter)) { in iavf_del_vlans()
915 adapter->aq_required &= ~IAVF_FLAG_AQ_DEL_VLAN_FILTER; in iavf_del_vlans()
916 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_del_vlans()
920 if (VLAN_ALLOWED(adapter)) { in iavf_del_vlans()
923 adapter->current_op = VIRTCHNL_OP_DEL_VLAN; in iavf_del_vlans()
927 dev_warn(&adapter->pdev->dev, "Too many delete VLAN changes in one request\n"); in iavf_del_vlans()
935 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_del_vlans()
939 vvfl->vsi_id = adapter->vsi_res->vsi_id; in iavf_del_vlans()
941 list_for_each_entry_safe(f, ftmp, &adapter->vlan_filter_list, list) { in iavf_del_vlans()
952 adapter->num_vlan_filters--; in iavf_del_vlans()
960 adapter->aq_required &= ~IAVF_FLAG_AQ_DEL_VLAN_FILTER; in iavf_del_vlans()
962 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_del_vlans()
964 iavf_send_pf_msg(adapter, VIRTCHNL_OP_DEL_VLAN, (u8 *)vvfl, len); in iavf_del_vlans()
969 adapter->current_op = VIRTCHNL_OP_DEL_VLAN_V2; in iavf_del_vlans()
973 dev_warn(&adapter->pdev->dev, "Too many add VLAN changes in one request\n"); in iavf_del_vlans()
982 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_del_vlans()
986 vvfl_v2->vport_id = adapter->vsi_res->vsi_id; in iavf_del_vlans()
988 list_for_each_entry_safe(f, ftmp, &adapter->vlan_filter_list, list) { in iavf_del_vlans()
992 &adapter->vlan_v2_caps.filtering.filtering_support; in iavf_del_vlans()
1009 adapter->num_vlan_filters--; in iavf_del_vlans()
1018 adapter->aq_required &= ~IAVF_FLAG_AQ_DEL_VLAN_FILTER; in iavf_del_vlans()
1020 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_del_vlans()
1022 iavf_send_pf_msg(adapter, VIRTCHNL_OP_DEL_VLAN_V2, in iavf_del_vlans()
1030 * @adapter: adapter structure
1034 void iavf_set_promiscuous(struct iavf_adapter *adapter) in iavf_set_promiscuous() argument
1036 struct net_device *netdev = adapter->netdev; in iavf_set_promiscuous()
1040 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_set_promiscuous()
1042 dev_err(&adapter->pdev->dev, "Cannot set promiscuous mode, command %d pending\n", in iavf_set_promiscuous()
1043 adapter->current_op); in iavf_set_promiscuous()
1048 spin_lock_bh(&adapter->current_netdev_promisc_flags_lock); in iavf_set_promiscuous()
1051 if (!iavf_promiscuous_mode_changed(adapter)) { in iavf_set_promiscuous()
1052 adapter->aq_required &= ~IAVF_FLAG_AQ_CONFIGURE_PROMISC_MODE; in iavf_set_promiscuous()
1053 dev_dbg(&adapter->pdev->dev, "No change in promiscuous mode\n"); in iavf_set_promiscuous()
1055 spin_unlock_bh(&adapter->current_netdev_promisc_flags_lock); in iavf_set_promiscuous()
1066 adapter->current_netdev_promisc_flags |= IFF_ALLMULTI; in iavf_set_promiscuous()
1067 adapter->current_netdev_promisc_flags &= ~IFF_PROMISC; in iavf_set_promiscuous()
1068 dev_info(&adapter->pdev->dev, "Entering multicast promiscuous mode\n"); in iavf_set_promiscuous()
1075 adapter->current_netdev_promisc_flags &= in iavf_set_promiscuous()
1077 dev_info(&adapter->pdev->dev, "Leaving promiscuous mode\n"); in iavf_set_promiscuous()
1084 adapter->current_netdev_promisc_flags |= IFF_PROMISC; in iavf_set_promiscuous()
1086 adapter->current_netdev_promisc_flags |= IFF_ALLMULTI; in iavf_set_promiscuous()
1088 adapter->current_netdev_promisc_flags &= ~IFF_ALLMULTI; in iavf_set_promiscuous()
1090 dev_info(&adapter->pdev->dev, "Entering promiscuous mode\n"); in iavf_set_promiscuous()
1093 adapter->aq_required &= ~IAVF_FLAG_AQ_CONFIGURE_PROMISC_MODE; in iavf_set_promiscuous()
1096 spin_unlock_bh(&adapter->current_netdev_promisc_flags_lock); in iavf_set_promiscuous()
1098 adapter->current_op = VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE; in iavf_set_promiscuous()
1099 vpi.vsi_id = adapter->vsi_res->vsi_id; in iavf_set_promiscuous()
1101 iavf_send_pf_msg(adapter, VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE, in iavf_set_promiscuous()
1107 * @adapter: adapter structure
1111 void iavf_request_stats(struct iavf_adapter *adapter) in iavf_request_stats() argument
1115 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_request_stats()
1120 adapter->aq_required &= ~IAVF_FLAG_AQ_REQUEST_STATS; in iavf_request_stats()
1121 adapter->current_op = VIRTCHNL_OP_GET_STATS; in iavf_request_stats()
1122 vqs.vsi_id = adapter->vsi_res->vsi_id; in iavf_request_stats()
1124 if (iavf_send_pf_msg(adapter, VIRTCHNL_OP_GET_STATS, (u8 *)&vqs, in iavf_request_stats()
1127 adapter->current_op = VIRTCHNL_OP_UNKNOWN; in iavf_request_stats()
1132 * @adapter: adapter structure
1136 void iavf_get_hena(struct iavf_adapter *adapter) in iavf_get_hena() argument
1138 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_get_hena()
1140 dev_err(&adapter->pdev->dev, "Cannot get RSS hash capabilities, command %d pending\n", in iavf_get_hena()
1141 adapter->current_op); in iavf_get_hena()
1144 adapter->current_op = VIRTCHNL_OP_GET_RSS_HENA_CAPS; in iavf_get_hena()
1145 adapter->aq_required &= ~IAVF_FLAG_AQ_GET_HENA; in iavf_get_hena()
1146 iavf_send_pf_msg(adapter, VIRTCHNL_OP_GET_RSS_HENA_CAPS, NULL, 0); in iavf_get_hena()
1151 * @adapter: adapter structure
1155 void iavf_set_hena(struct iavf_adapter *adapter) in iavf_set_hena() argument
1159 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_set_hena()
1161 dev_err(&adapter->pdev->dev, "Cannot set RSS hash enable, command %d pending\n", in iavf_set_hena()
1162 adapter->current_op); in iavf_set_hena()
1165 vrh.hena = adapter->hena; in iavf_set_hena()
1166 adapter->current_op = VIRTCHNL_OP_SET_RSS_HENA; in iavf_set_hena()
1167 adapter->aq_required &= ~IAVF_FLAG_AQ_SET_HENA; in iavf_set_hena()
1168 iavf_send_pf_msg(adapter, VIRTCHNL_OP_SET_RSS_HENA, (u8 *)&vrh, in iavf_set_hena()
1174 * @adapter: adapter structure
1178 void iavf_set_rss_key(struct iavf_adapter *adapter) in iavf_set_rss_key() argument
1183 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_set_rss_key()
1185 dev_err(&adapter->pdev->dev, "Cannot set RSS key, command %d pending\n", in iavf_set_rss_key()
1186 adapter->current_op); in iavf_set_rss_key()
1189 len = virtchnl_struct_size(vrk, key, adapter->rss_key_size); in iavf_set_rss_key()
1193 vrk->vsi_id = adapter->vsi.id; in iavf_set_rss_key()
1194 vrk->key_len = adapter->rss_key_size; in iavf_set_rss_key()
1195 memcpy(vrk->key, adapter->rss_key, adapter->rss_key_size); in iavf_set_rss_key()
1197 adapter->current_op = VIRTCHNL_OP_CONFIG_RSS_KEY; in iavf_set_rss_key()
1198 adapter->aq_required &= ~IAVF_FLAG_AQ_SET_RSS_KEY; in iavf_set_rss_key()
1199 iavf_send_pf_msg(adapter, VIRTCHNL_OP_CONFIG_RSS_KEY, (u8 *)vrk, len); in iavf_set_rss_key()
1205 * @adapter: adapter structure
1209 void iavf_set_rss_lut(struct iavf_adapter *adapter) in iavf_set_rss_lut() argument
1214 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_set_rss_lut()
1216 dev_err(&adapter->pdev->dev, "Cannot set RSS LUT, command %d pending\n", in iavf_set_rss_lut()
1217 adapter->current_op); in iavf_set_rss_lut()
1220 len = virtchnl_struct_size(vrl, lut, adapter->rss_lut_size); in iavf_set_rss_lut()
1224 vrl->vsi_id = adapter->vsi.id; in iavf_set_rss_lut()
1225 vrl->lut_entries = adapter->rss_lut_size; in iavf_set_rss_lut()
1226 memcpy(vrl->lut, adapter->rss_lut, adapter->rss_lut_size); in iavf_set_rss_lut()
1227 adapter->current_op = VIRTCHNL_OP_CONFIG_RSS_LUT; in iavf_set_rss_lut()
1228 adapter->aq_required &= ~IAVF_FLAG_AQ_SET_RSS_LUT; in iavf_set_rss_lut()
1229 iavf_send_pf_msg(adapter, VIRTCHNL_OP_CONFIG_RSS_LUT, (u8 *)vrl, len); in iavf_set_rss_lut()
1235 * @adapter: adapter structure
1239 void iavf_set_rss_hfunc(struct iavf_adapter *adapter) in iavf_set_rss_hfunc() argument
1244 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_set_rss_hfunc()
1246 dev_err(&adapter->pdev->dev, "Cannot set RSS Hash function, command %d pending\n", in iavf_set_rss_hfunc()
1247 adapter->current_op); in iavf_set_rss_hfunc()
1253 vrh->vsi_id = adapter->vsi.id; in iavf_set_rss_hfunc()
1254 vrh->rss_algorithm = adapter->hfunc; in iavf_set_rss_hfunc()
1255 adapter->current_op = VIRTCHNL_OP_CONFIG_RSS_HFUNC; in iavf_set_rss_hfunc()
1256 adapter->aq_required &= ~IAVF_FLAG_AQ_SET_RSS_HFUNC; in iavf_set_rss_hfunc()
1257 iavf_send_pf_msg(adapter, VIRTCHNL_OP_CONFIG_RSS_HFUNC, (u8 *)vrh, len); in iavf_set_rss_hfunc()
1263 * @adapter: adapter structure
1267 void iavf_enable_vlan_stripping(struct iavf_adapter *adapter) in iavf_enable_vlan_stripping() argument
1269 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_enable_vlan_stripping()
1271 dev_err(&adapter->pdev->dev, "Cannot enable stripping, command %d pending\n", in iavf_enable_vlan_stripping()
1272 adapter->current_op); in iavf_enable_vlan_stripping()
1275 adapter->current_op = VIRTCHNL_OP_ENABLE_VLAN_STRIPPING; in iavf_enable_vlan_stripping()
1276 adapter->aq_required &= ~IAVF_FLAG_AQ_ENABLE_VLAN_STRIPPING; in iavf_enable_vlan_stripping()
1277 iavf_send_pf_msg(adapter, VIRTCHNL_OP_ENABLE_VLAN_STRIPPING, NULL, 0); in iavf_enable_vlan_stripping()
1282 * @adapter: adapter structure
1286 void iavf_disable_vlan_stripping(struct iavf_adapter *adapter) in iavf_disable_vlan_stripping() argument
1288 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_disable_vlan_stripping()
1290 dev_err(&adapter->pdev->dev, "Cannot disable stripping, command %d pending\n", in iavf_disable_vlan_stripping()
1291 adapter->current_op); in iavf_disable_vlan_stripping()
1294 adapter->current_op = VIRTCHNL_OP_DISABLE_VLAN_STRIPPING; in iavf_disable_vlan_stripping()
1295 adapter->aq_required &= ~IAVF_FLAG_AQ_DISABLE_VLAN_STRIPPING; in iavf_disable_vlan_stripping()
1296 iavf_send_pf_msg(adapter, VIRTCHNL_OP_DISABLE_VLAN_STRIPPING, NULL, 0); in iavf_disable_vlan_stripping()
1317 * @adapter: adapter structure
1323 iavf_set_vc_offload_ethertype(struct iavf_adapter *adapter, in iavf_set_vc_offload_ethertype() argument
1335 &adapter->vlan_v2_caps.offloads.stripping_support; in iavf_set_vc_offload_ethertype()
1340 &adapter->vlan_v2_caps.offloads.insertion_support; in iavf_set_vc_offload_ethertype()
1343 …dev_err(&adapter->pdev->dev, "Invalid opcode %d for setting virtchnl ethertype to enable/disable V… in iavf_set_vc_offload_ethertype()
1356 dev_dbg(&adapter->pdev->dev, "opcode %d unsupported for VLAN TPID 0x%04x\n", in iavf_set_vc_offload_ethertype()
1366 * @adapter: adapter structure
1371 iavf_clear_offload_v2_aq_required(struct iavf_adapter *adapter, u16 tpid, in iavf_clear_offload_v2_aq_required() argument
1377 adapter->aq_required &= in iavf_clear_offload_v2_aq_required()
1380 adapter->aq_required &= in iavf_clear_offload_v2_aq_required()
1385 adapter->aq_required &= in iavf_clear_offload_v2_aq_required()
1388 adapter->aq_required &= in iavf_clear_offload_v2_aq_required()
1393 adapter->aq_required &= in iavf_clear_offload_v2_aq_required()
1396 adapter->aq_required &= in iavf_clear_offload_v2_aq_required()
1401 adapter->aq_required &= in iavf_clear_offload_v2_aq_required()
1404 adapter->aq_required &= in iavf_clear_offload_v2_aq_required()
1408 …dev_err(&adapter->pdev->dev, "Unsupported opcode %d specified for clearing aq_required bits for VI… in iavf_clear_offload_v2_aq_required()
1415 * @adapter: adapter structure
1420 iavf_send_vlan_offload_v2(struct iavf_adapter *adapter, u16 tpid, in iavf_send_vlan_offload_v2() argument
1426 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_send_vlan_offload_v2()
1428 dev_err(&adapter->pdev->dev, "Cannot send %d, command %d pending\n", in iavf_send_vlan_offload_v2()
1429 offload_op, adapter->current_op); in iavf_send_vlan_offload_v2()
1433 adapter->current_op = offload_op; in iavf_send_vlan_offload_v2()
1439 msg->vport_id = adapter->vsi_res->vsi_id; in iavf_send_vlan_offload_v2()
1442 iavf_clear_offload_v2_aq_required(adapter, tpid, offload_op); in iavf_send_vlan_offload_v2()
1445 if (!iavf_set_vc_offload_ethertype(adapter, msg, tpid, offload_op)) in iavf_send_vlan_offload_v2()
1446 iavf_send_pf_msg(adapter, offload_op, (u8 *)msg, len); in iavf_send_vlan_offload_v2()
1448 adapter->current_op = VIRTCHNL_OP_UNKNOWN; in iavf_send_vlan_offload_v2()
1455 * @adapter: adapter structure
1458 void iavf_enable_vlan_stripping_v2(struct iavf_adapter *adapter, u16 tpid) in iavf_enable_vlan_stripping_v2() argument
1460 iavf_send_vlan_offload_v2(adapter, tpid, in iavf_enable_vlan_stripping_v2()
1466 * @adapter: adapter structure
1469 void iavf_disable_vlan_stripping_v2(struct iavf_adapter *adapter, u16 tpid) in iavf_disable_vlan_stripping_v2() argument
1471 iavf_send_vlan_offload_v2(adapter, tpid, in iavf_disable_vlan_stripping_v2()
1477 * @adapter: adapter structure
1480 void iavf_enable_vlan_insertion_v2(struct iavf_adapter *adapter, u16 tpid) in iavf_enable_vlan_insertion_v2() argument
1482 iavf_send_vlan_offload_v2(adapter, tpid, in iavf_enable_vlan_insertion_v2()
1488 * @adapter: adapter structure
1491 void iavf_disable_vlan_insertion_v2(struct iavf_adapter *adapter, u16 tpid) in iavf_disable_vlan_insertion_v2() argument
1493 iavf_send_vlan_offload_v2(adapter, tpid, in iavf_disable_vlan_insertion_v2()
1500 * @adapter: adapter private structure
1505 void iavf_virtchnl_send_ptp_cmd(struct iavf_adapter *adapter) in iavf_virtchnl_send_ptp_cmd() argument
1510 if (!adapter->ptp.clock) { in iavf_virtchnl_send_ptp_cmd()
1514 pci_err(adapter->pdev, "PTP is not initialized\n"); in iavf_virtchnl_send_ptp_cmd()
1515 adapter->aq_required &= ~IAVF_FLAG_AQ_SEND_PTP_CMD; in iavf_virtchnl_send_ptp_cmd()
1519 mutex_lock(&adapter->ptp.aq_cmd_lock); in iavf_virtchnl_send_ptp_cmd()
1520 cmd = list_first_entry_or_null(&adapter->ptp.aq_cmds, in iavf_virtchnl_send_ptp_cmd()
1524 adapter->aq_required &= ~IAVF_FLAG_AQ_SEND_PTP_CMD; in iavf_virtchnl_send_ptp_cmd()
1528 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_virtchnl_send_ptp_cmd()
1530 pci_err(adapter->pdev, in iavf_virtchnl_send_ptp_cmd()
1532 cmd->v_opcode, adapter->current_op); in iavf_virtchnl_send_ptp_cmd()
1536 err = iavf_send_pf_msg(adapter, cmd->v_opcode, cmd->msg, cmd->msglen); in iavf_virtchnl_send_ptp_cmd()
1545 pci_err(adapter->pdev, "Failed to send PTP command %d\n", in iavf_virtchnl_send_ptp_cmd()
1549 if (list_empty(&adapter->ptp.aq_cmds)) in iavf_virtchnl_send_ptp_cmd()
1551 adapter->aq_required &= ~IAVF_FLAG_AQ_SEND_PTP_CMD; in iavf_virtchnl_send_ptp_cmd()
1554 mutex_unlock(&adapter->ptp.aq_cmd_lock); in iavf_virtchnl_send_ptp_cmd()
1560 * @adapter: adapter structure
1564 static void iavf_print_link_message(struct iavf_adapter *adapter) in iavf_print_link_message() argument
1566 struct net_device *netdev = adapter->netdev; in iavf_print_link_message()
1570 if (!adapter->link_up) { in iavf_print_link_message()
1575 if (ADV_LINK_SUPPORT(adapter)) { in iavf_print_link_message()
1576 link_speed_mbps = adapter->link_speed_mbps; in iavf_print_link_message()
1580 switch (adapter->link_speed) { in iavf_print_link_message()
1631 * @adapter: adapter structure
1637 iavf_get_vpe_link_status(struct iavf_adapter *adapter, in iavf_get_vpe_link_status() argument
1640 if (ADV_LINK_SUPPORT(adapter)) in iavf_get_vpe_link_status()
1648 * @adapter: adapter structure for which we are setting the link speed
1654 iavf_set_adapter_link_speed_from_vpe(struct iavf_adapter *adapter, in iavf_set_adapter_link_speed_from_vpe() argument
1657 if (ADV_LINK_SUPPORT(adapter)) in iavf_set_adapter_link_speed_from_vpe()
1658 adapter->link_speed_mbps = in iavf_set_adapter_link_speed_from_vpe()
1661 adapter->link_speed = vpe->event_data.link_event.link_speed; in iavf_set_adapter_link_speed_from_vpe()
1666 * @adapter: iavf adapter struct instance
1670 void iavf_get_qos_caps(struct iavf_adapter *adapter) in iavf_get_qos_caps() argument
1672 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_get_qos_caps()
1674 dev_err(&adapter->pdev->dev, in iavf_get_qos_caps()
1676 adapter->current_op); in iavf_get_qos_caps()
1680 adapter->current_op = VIRTCHNL_OP_GET_QOS_CAPS; in iavf_get_qos_caps()
1681 adapter->aq_required &= ~IAVF_FLAG_AQ_GET_QOS_CAPS; in iavf_get_qos_caps()
1682 iavf_send_pf_msg(adapter, VIRTCHNL_OP_GET_QOS_CAPS, NULL, 0); in iavf_get_qos_caps()
1687 * @adapter: iavf adapter struct instance
1696 iavf_set_quanta_size(struct iavf_adapter *adapter, u16 quanta_size, in iavf_set_quanta_size() argument
1701 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_set_quanta_size()
1703 dev_err(&adapter->pdev->dev, in iavf_set_quanta_size()
1705 adapter->current_op); in iavf_set_quanta_size()
1709 adapter->current_op = VIRTCHNL_OP_CONFIG_QUANTA; in iavf_set_quanta_size()
1714 adapter->aq_required &= ~IAVF_FLAG_AQ_CFG_QUEUES_QUANTA_SIZE; in iavf_set_quanta_size()
1715 iavf_send_pf_msg(adapter, VIRTCHNL_OP_CONFIG_QUANTA, in iavf_set_quanta_size()
1721 * @adapter: adapter structure
1725 void iavf_cfg_queues_quanta_size(struct iavf_adapter *adapter) in iavf_cfg_queues_quanta_size() argument
1730 iavf_set_quanta_size(adapter, quanta_size, 0, in iavf_cfg_queues_quanta_size()
1731 adapter->num_active_queues); in iavf_cfg_queues_quanta_size()
1736 * @adapter: iavf adapter structure instance
1740 void iavf_cfg_queues_bw(struct iavf_adapter *adapter) in iavf_cfg_queues_bw() argument
1748 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_cfg_queues_bw()
1750 dev_err(&adapter->pdev->dev, in iavf_cfg_queues_bw()
1752 adapter->current_op); in iavf_cfg_queues_bw()
1756 for (i = 0; i < adapter->num_active_queues; i++) { in iavf_cfg_queues_bw()
1757 if (adapter->tx_rings[i].q_shaper_update) in iavf_cfg_queues_bw()
1765 qs_bw_cfg->vsi_id = adapter->vsi.id; in iavf_cfg_queues_bw()
1768 for (i = 0; i < adapter->num_active_queues; i++) { in iavf_cfg_queues_bw()
1769 struct iavf_ring *tx_ring = &adapter->tx_rings[i]; in iavf_cfg_queues_bw()
1781 adapter->current_op = VIRTCHNL_OP_CONFIG_QUEUE_BW; in iavf_cfg_queues_bw()
1782 adapter->aq_required &= ~IAVF_FLAG_AQ_CONFIGURE_QUEUES_BW; in iavf_cfg_queues_bw()
1783 iavf_send_pf_msg(adapter, VIRTCHNL_OP_CONFIG_QUEUE_BW, in iavf_cfg_queues_bw()
1790 * @adapter: adapter structure
1795 void iavf_enable_channels(struct iavf_adapter *adapter) in iavf_enable_channels() argument
1801 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_enable_channels()
1803 dev_err(&adapter->pdev->dev, "Cannot configure mqprio, command %d pending\n", in iavf_enable_channels()
1804 adapter->current_op); in iavf_enable_channels()
1808 len = virtchnl_struct_size(vti, list, adapter->num_tc); in iavf_enable_channels()
1812 vti->num_tc = adapter->num_tc; in iavf_enable_channels()
1814 vti->list[i].count = adapter->ch_config.ch_info[i].count; in iavf_enable_channels()
1815 vti->list[i].offset = adapter->ch_config.ch_info[i].offset; in iavf_enable_channels()
1818 adapter->ch_config.ch_info[i].max_tx_rate; in iavf_enable_channels()
1821 adapter->ch_config.state = __IAVF_TC_RUNNING; in iavf_enable_channels()
1822 adapter->flags |= IAVF_FLAG_REINIT_ITR_NEEDED; in iavf_enable_channels()
1823 adapter->current_op = VIRTCHNL_OP_ENABLE_CHANNELS; in iavf_enable_channels()
1824 adapter->aq_required &= ~IAVF_FLAG_AQ_ENABLE_CHANNELS; in iavf_enable_channels()
1825 iavf_send_pf_msg(adapter, VIRTCHNL_OP_ENABLE_CHANNELS, (u8 *)vti, len); in iavf_enable_channels()
1831 * @adapter: adapter structure
1835 void iavf_disable_channels(struct iavf_adapter *adapter) in iavf_disable_channels() argument
1837 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_disable_channels()
1839 dev_err(&adapter->pdev->dev, "Cannot configure mqprio, command %d pending\n", in iavf_disable_channels()
1840 adapter->current_op); in iavf_disable_channels()
1844 adapter->ch_config.state = __IAVF_TC_INVALID; in iavf_disable_channels()
1845 adapter->flags |= IAVF_FLAG_REINIT_ITR_NEEDED; in iavf_disable_channels()
1846 adapter->current_op = VIRTCHNL_OP_DISABLE_CHANNELS; in iavf_disable_channels()
1847 adapter->aq_required &= ~IAVF_FLAG_AQ_DISABLE_CHANNELS; in iavf_disable_channels()
1848 iavf_send_pf_msg(adapter, VIRTCHNL_OP_DISABLE_CHANNELS, NULL, 0); in iavf_disable_channels()
1853 * @adapter: adapter structure
1858 static void iavf_print_cloud_filter(struct iavf_adapter *adapter, in iavf_print_cloud_filter() argument
1863 …dev_info(&adapter->pdev->dev, "dst_mac: %pM src_mac: %pM vlan_id: %hu dst_ip: %pI4 src_ip %pI4 dst… in iavf_print_cloud_filter()
1873 …dev_info(&adapter->pdev->dev, "dst_mac: %pM src_mac: %pM vlan_id: %hu dst_ip: %pI6 src_ip %pI6 dst… in iavf_print_cloud_filter()
1887 * @adapter: adapter structure
1892 void iavf_add_cloud_filter(struct iavf_adapter *adapter) in iavf_add_cloud_filter() argument
1898 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_add_cloud_filter()
1900 dev_err(&adapter->pdev->dev, "Cannot add cloud filter, command %d pending\n", in iavf_add_cloud_filter()
1901 adapter->current_op); in iavf_add_cloud_filter()
1904 list_for_each_entry(cf, &adapter->cloud_filter_list, list) { in iavf_add_cloud_filter()
1911 adapter->aq_required &= ~IAVF_FLAG_AQ_ADD_CLOUD_FILTER; in iavf_add_cloud_filter()
1914 adapter->current_op = VIRTCHNL_OP_ADD_CLOUD_FILTER; in iavf_add_cloud_filter()
1921 list_for_each_entry(cf, &adapter->cloud_filter_list, list) { in iavf_add_cloud_filter()
1926 iavf_send_pf_msg(adapter, VIRTCHNL_OP_ADD_CLOUD_FILTER, in iavf_add_cloud_filter()
1935 * @adapter: adapter structure
1940 void iavf_del_cloud_filter(struct iavf_adapter *adapter) in iavf_del_cloud_filter() argument
1946 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_del_cloud_filter()
1948 dev_err(&adapter->pdev->dev, "Cannot remove cloud filter, command %d pending\n", in iavf_del_cloud_filter()
1949 adapter->current_op); in iavf_del_cloud_filter()
1952 list_for_each_entry(cf, &adapter->cloud_filter_list, list) { in iavf_del_cloud_filter()
1959 adapter->aq_required &= ~IAVF_FLAG_AQ_DEL_CLOUD_FILTER; in iavf_del_cloud_filter()
1962 adapter->current_op = VIRTCHNL_OP_DEL_CLOUD_FILTER; in iavf_del_cloud_filter()
1969 list_for_each_entry_safe(cf, cftmp, &adapter->cloud_filter_list, list) { in iavf_del_cloud_filter()
1974 iavf_send_pf_msg(adapter, VIRTCHNL_OP_DEL_CLOUD_FILTER, in iavf_del_cloud_filter()
1983 * @adapter: the VF adapter structure
1988 void iavf_add_fdir_filter(struct iavf_adapter *adapter) in iavf_add_fdir_filter() argument
1995 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_add_fdir_filter()
1997 dev_err(&adapter->pdev->dev, "Cannot add Flow Director filter, command %d pending\n", in iavf_add_fdir_filter()
1998 adapter->current_op); in iavf_add_fdir_filter()
2007 spin_lock_bh(&adapter->fdir_fltr_lock); in iavf_add_fdir_filter()
2008 list_for_each_entry(fdir, &adapter->fdir_list_head, list) { in iavf_add_fdir_filter()
2016 spin_unlock_bh(&adapter->fdir_fltr_lock); in iavf_add_fdir_filter()
2022 adapter->aq_required &= ~IAVF_FLAG_AQ_ADD_FDIR_FILTER; in iavf_add_fdir_filter()
2026 adapter->current_op = VIRTCHNL_OP_ADD_FDIR_FILTER; in iavf_add_fdir_filter()
2027 iavf_send_pf_msg(adapter, VIRTCHNL_OP_ADD_FDIR_FILTER, (u8 *)f, len); in iavf_add_fdir_filter()
2033 * @adapter: the VF adapter structure
2038 void iavf_del_fdir_filter(struct iavf_adapter *adapter) in iavf_del_fdir_filter() argument
2045 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_del_fdir_filter()
2047 dev_err(&adapter->pdev->dev, "Cannot remove Flow Director filter, command %d pending\n", in iavf_del_fdir_filter()
2048 adapter->current_op); in iavf_del_fdir_filter()
2054 spin_lock_bh(&adapter->fdir_fltr_lock); in iavf_del_fdir_filter()
2055 list_for_each_entry(fdir, &adapter->fdir_list_head, list) { in iavf_del_fdir_filter()
2070 spin_unlock_bh(&adapter->fdir_fltr_lock); in iavf_del_fdir_filter()
2073 adapter->aq_required &= ~IAVF_FLAG_AQ_DEL_FDIR_FILTER; in iavf_del_fdir_filter()
2077 adapter->current_op = VIRTCHNL_OP_DEL_FDIR_FILTER; in iavf_del_fdir_filter()
2078 iavf_send_pf_msg(adapter, VIRTCHNL_OP_DEL_FDIR_FILTER, (u8 *)&f, len); in iavf_del_fdir_filter()
2083 * @adapter: the VF adapter structure
2088 void iavf_add_adv_rss_cfg(struct iavf_adapter *adapter) in iavf_add_adv_rss_cfg() argument
2095 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_add_adv_rss_cfg()
2097 dev_err(&adapter->pdev->dev, "Cannot add RSS configuration, command %d pending\n", in iavf_add_adv_rss_cfg()
2098 adapter->current_op); in iavf_add_adv_rss_cfg()
2107 spin_lock_bh(&adapter->adv_rss_lock); in iavf_add_adv_rss_cfg()
2108 list_for_each_entry(rss, &adapter->adv_rss_list_head, list) { in iavf_add_adv_rss_cfg()
2113 iavf_print_adv_rss_cfg(adapter, rss, in iavf_add_adv_rss_cfg()
2119 spin_unlock_bh(&adapter->adv_rss_lock); in iavf_add_adv_rss_cfg()
2122 adapter->current_op = VIRTCHNL_OP_ADD_RSS_CFG; in iavf_add_adv_rss_cfg()
2123 iavf_send_pf_msg(adapter, VIRTCHNL_OP_ADD_RSS_CFG, in iavf_add_adv_rss_cfg()
2126 adapter->aq_required &= ~IAVF_FLAG_AQ_ADD_ADV_RSS_CFG; in iavf_add_adv_rss_cfg()
2134 * @adapter: the VF adapter structure
2139 void iavf_del_adv_rss_cfg(struct iavf_adapter *adapter) in iavf_del_adv_rss_cfg() argument
2146 if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { in iavf_del_adv_rss_cfg()
2148 dev_err(&adapter->pdev->dev, "Cannot remove RSS configuration, command %d pending\n", in iavf_del_adv_rss_cfg()
2149 adapter->current_op); in iavf_del_adv_rss_cfg()
2158 spin_lock_bh(&adapter->adv_rss_lock); in iavf_del_adv_rss_cfg()
2159 list_for_each_entry(rss, &adapter->adv_rss_list_head, list) { in iavf_del_adv_rss_cfg()
2167 spin_unlock_bh(&adapter->adv_rss_lock); in iavf_del_adv_rss_cfg()
2170 adapter->current_op = VIRTCHNL_OP_DEL_RSS_CFG; in iavf_del_adv_rss_cfg()
2171 iavf_send_pf_msg(adapter, VIRTCHNL_OP_DEL_RSS_CFG, in iavf_del_adv_rss_cfg()
2174 adapter->aq_required &= ~IAVF_FLAG_AQ_DEL_ADV_RSS_CFG; in iavf_del_adv_rss_cfg()
2182 * @adapter: adapter structure
2186 int iavf_request_reset(struct iavf_adapter *adapter) in iavf_request_reset() argument
2190 err = iavf_send_pf_msg(adapter, VIRTCHNL_OP_RESET_VF, NULL, 0); in iavf_request_reset()
2191 adapter->current_op = VIRTCHNL_OP_UNKNOWN; in iavf_request_reset()
2213 * @adapter: private adapter structure
2218 static void iavf_activate_fdir_filters(struct iavf_adapter *adapter) in iavf_activate_fdir_filters() argument
2223 spin_lock_bh(&adapter->fdir_fltr_lock); in iavf_activate_fdir_filters()
2224 list_for_each_entry_safe(f, ftmp, &adapter->fdir_list_head, list) { in iavf_activate_fdir_filters()
2243 iavf_dec_fdir_active_fltr(adapter, f); in iavf_activate_fdir_filters()
2247 spin_unlock_bh(&adapter->fdir_fltr_lock); in iavf_activate_fdir_filters()
2250 adapter->aq_required |= IAVF_FLAG_AQ_ADD_FDIR_FILTER; in iavf_activate_fdir_filters()
2255 * @adapter: private adapter structure
2265 static void iavf_virtchnl_ptp_get_time(struct iavf_adapter *adapter, in iavf_virtchnl_ptp_get_time() argument
2271 dev_err_once(&adapter->pdev->dev, in iavf_virtchnl_ptp_get_time()
2277 adapter->ptp.cached_phc_time = msg->time; in iavf_virtchnl_ptp_get_time()
2278 adapter->ptp.cached_phc_updated = jiffies; in iavf_virtchnl_ptp_get_time()
2279 adapter->ptp.phc_time_ready = true; in iavf_virtchnl_ptp_get_time()
2281 wake_up(&adapter->ptp.phc_time_waitqueue); in iavf_virtchnl_ptp_get_time()
2286 * @adapter: adapter structure
2296 void iavf_virtchnl_completion(struct iavf_adapter *adapter, in iavf_virtchnl_completion() argument
2300 struct net_device *netdev = adapter->netdev; in iavf_virtchnl_completion()
2305 bool link_up = iavf_get_vpe_link_status(adapter, vpe); in iavf_virtchnl_completion()
2309 iavf_set_adapter_link_speed_from_vpe(adapter, vpe); in iavf_virtchnl_completion()
2312 if (adapter->link_up == link_up) in iavf_virtchnl_completion()
2323 if (adapter->state != __IAVF_RUNNING) in iavf_virtchnl_completion()
2330 if (adapter->flags & in iavf_virtchnl_completion()
2335 adapter->link_up = link_up; in iavf_virtchnl_completion()
2343 iavf_print_link_message(adapter); in iavf_virtchnl_completion()
2346 dev_info(&adapter->pdev->dev, "Reset indication received from the PF\n"); in iavf_virtchnl_completion()
2347 if (!(adapter->flags & IAVF_FLAG_RESET_PENDING)) { in iavf_virtchnl_completion()
2348 dev_info(&adapter->pdev->dev, "Scheduling reset task\n"); in iavf_virtchnl_completion()
2349 iavf_schedule_reset(adapter, IAVF_FLAG_RESET_PENDING); in iavf_virtchnl_completion()
2353 dev_err(&adapter->pdev->dev, "Unknown event %d from PF\n", in iavf_virtchnl_completion()
2362 dev_err(&adapter->pdev->dev, "Failed to add VLAN filter, error %s\n", in iavf_virtchnl_completion()
2363 iavf_stat_str(&adapter->hw, v_retval)); in iavf_virtchnl_completion()
2366 dev_err(&adapter->pdev->dev, "Failed to add MAC filter, error %s\n", in iavf_virtchnl_completion()
2367 iavf_stat_str(&adapter->hw, v_retval)); in iavf_virtchnl_completion()
2368 iavf_mac_add_reject(adapter); in iavf_virtchnl_completion()
2370 ether_addr_copy(adapter->hw.mac.addr, netdev->dev_addr); in iavf_virtchnl_completion()
2371 wake_up(&adapter->vc_waitqueue); in iavf_virtchnl_completion()
2374 dev_err(&adapter->pdev->dev, "Failed to delete VLAN filter, error %s\n", in iavf_virtchnl_completion()
2375 iavf_stat_str(&adapter->hw, v_retval)); in iavf_virtchnl_completion()
2378 dev_err(&adapter->pdev->dev, "Failed to delete MAC filter, error %s\n", in iavf_virtchnl_completion()
2379 iavf_stat_str(&adapter->hw, v_retval)); in iavf_virtchnl_completion()
2382 dev_err(&adapter->pdev->dev, "Failed to configure queue channels, error %s\n", in iavf_virtchnl_completion()
2383 iavf_stat_str(&adapter->hw, v_retval)); in iavf_virtchnl_completion()
2384 adapter->flags &= ~IAVF_FLAG_REINIT_ITR_NEEDED; in iavf_virtchnl_completion()
2385 adapter->ch_config.state = __IAVF_TC_INVALID; in iavf_virtchnl_completion()
2390 dev_err(&adapter->pdev->dev, "Failed to disable queue channels, error %s\n", in iavf_virtchnl_completion()
2391 iavf_stat_str(&adapter->hw, v_retval)); in iavf_virtchnl_completion()
2392 adapter->flags &= ~IAVF_FLAG_REINIT_ITR_NEEDED; in iavf_virtchnl_completion()
2393 adapter->ch_config.state = __IAVF_TC_RUNNING; in iavf_virtchnl_completion()
2400 &adapter->cloud_filter_list, in iavf_virtchnl_completion()
2404 dev_info(&adapter->pdev->dev, "Failed to add cloud filter, error %s\n", in iavf_virtchnl_completion()
2405 iavf_stat_str(&adapter->hw, in iavf_virtchnl_completion()
2407 iavf_print_cloud_filter(adapter, in iavf_virtchnl_completion()
2411 adapter->num_cloud_filters--; in iavf_virtchnl_completion()
2419 list_for_each_entry(cf, &adapter->cloud_filter_list, in iavf_virtchnl_completion()
2423 dev_info(&adapter->pdev->dev, "Failed to del cloud filter, error %s\n", in iavf_virtchnl_completion()
2424 iavf_stat_str(&adapter->hw, in iavf_virtchnl_completion()
2426 iavf_print_cloud_filter(adapter, in iavf_virtchnl_completion()
2435 spin_lock_bh(&adapter->fdir_fltr_lock); in iavf_virtchnl_completion()
2437 &adapter->fdir_list_head, in iavf_virtchnl_completion()
2440 dev_info(&adapter->pdev->dev, "Failed to add Flow Director filter, error %s\n", in iavf_virtchnl_completion()
2441 iavf_stat_str(&adapter->hw, in iavf_virtchnl_completion()
2443 iavf_print_fdir_fltr(adapter, fdir); in iavf_virtchnl_completion()
2445 dev_err(&adapter->pdev->dev, in iavf_virtchnl_completion()
2448 iavf_dec_fdir_active_fltr(adapter, fdir); in iavf_virtchnl_completion()
2452 spin_unlock_bh(&adapter->fdir_fltr_lock); in iavf_virtchnl_completion()
2458 spin_lock_bh(&adapter->fdir_fltr_lock); in iavf_virtchnl_completion()
2459 list_for_each_entry(fdir, &adapter->fdir_list_head, in iavf_virtchnl_completion()
2464 dev_info(&adapter->pdev->dev, "Failed to del Flow Director filter, error %s\n", in iavf_virtchnl_completion()
2465 iavf_stat_str(&adapter->hw, in iavf_virtchnl_completion()
2467 iavf_print_fdir_fltr(adapter, fdir); in iavf_virtchnl_completion()
2470 spin_unlock_bh(&adapter->fdir_fltr_lock); in iavf_virtchnl_completion()
2476 spin_lock_bh(&adapter->adv_rss_lock); in iavf_virtchnl_completion()
2478 &adapter->adv_rss_list_head, in iavf_virtchnl_completion()
2481 iavf_print_adv_rss_cfg(adapter, rss, in iavf_virtchnl_completion()
2488 spin_unlock_bh(&adapter->adv_rss_lock); in iavf_virtchnl_completion()
2494 spin_lock_bh(&adapter->adv_rss_lock); in iavf_virtchnl_completion()
2495 list_for_each_entry(rss, &adapter->adv_rss_list_head, in iavf_virtchnl_completion()
2499 dev_err(&adapter->pdev->dev, "Failed to delete RSS configuration, error %s\n", in iavf_virtchnl_completion()
2500 iavf_stat_str(&adapter->hw, in iavf_virtchnl_completion()
2504 spin_unlock_bh(&adapter->adv_rss_lock); in iavf_virtchnl_completion()
2508 …dev_warn(&adapter->pdev->dev, "Changing VLAN Stripping is not allowed when Port VLAN is configured… in iavf_virtchnl_completion()
2515 …dev_warn(&adapter->pdev->dev, "Changing VLAN Stripping is not allowed when Port VLAN is configured… in iavf_virtchnl_completion()
2522 iavf_vlan_add_reject(adapter); in iavf_virtchnl_completion()
2523 dev_warn(&adapter->pdev->dev, "Failed to add VLAN filter, error %s\n", in iavf_virtchnl_completion()
2524 iavf_stat_str(&adapter->hw, v_retval)); in iavf_virtchnl_completion()
2527 dev_warn(&adapter->pdev->dev, "Failed to configure hash function, error %s\n", in iavf_virtchnl_completion()
2528 iavf_stat_str(&adapter->hw, v_retval)); in iavf_virtchnl_completion()
2530 if (adapter->hfunc == in iavf_virtchnl_completion()
2532 adapter->hfunc = in iavf_virtchnl_completion()
2535 adapter->hfunc = in iavf_virtchnl_completion()
2540 dev_warn(&adapter->pdev->dev, "Failed to Get Qos CAPs, error %s\n", in iavf_virtchnl_completion()
2541 iavf_stat_str(&adapter->hw, v_retval)); in iavf_virtchnl_completion()
2544 dev_warn(&adapter->pdev->dev, "Failed to Config Quanta, error %s\n", in iavf_virtchnl_completion()
2545 iavf_stat_str(&adapter->hw, v_retval)); in iavf_virtchnl_completion()
2548 dev_warn(&adapter->pdev->dev, "Failed to Config Queue BW, error %s\n", in iavf_virtchnl_completion()
2549 iavf_stat_str(&adapter->hw, v_retval)); in iavf_virtchnl_completion()
2552 dev_err(&adapter->pdev->dev, "PF returned error %d (%s) to our request %d\n", in iavf_virtchnl_completion()
2553 v_retval, iavf_stat_str(&adapter->hw, v_retval), in iavf_virtchnl_completion()
2560 iavf_mac_add_ok(adapter); in iavf_virtchnl_completion()
2561 if (!ether_addr_equal(netdev->dev_addr, adapter->hw.mac.addr)) in iavf_virtchnl_completion()
2563 adapter->hw.mac.addr)) { in iavf_virtchnl_completion()
2565 eth_hw_addr_set(netdev, adapter->hw.mac.addr); in iavf_virtchnl_completion()
2568 wake_up(&adapter->vc_waitqueue); in iavf_virtchnl_completion()
2584 adapter->current_stats = *stats; in iavf_virtchnl_completion()
2590 memcpy(adapter->vf_res, msg, min(msglen, len)); in iavf_virtchnl_completion()
2591 iavf_validate_num_queues(adapter); in iavf_virtchnl_completion()
2592 iavf_vf_parse_hw_config(&adapter->hw, adapter->vf_res); in iavf_virtchnl_completion()
2593 if (is_zero_ether_addr(adapter->hw.mac.addr)) { in iavf_virtchnl_completion()
2595 ether_addr_copy(adapter->hw.mac.addr, netdev->dev_addr); in iavf_virtchnl_completion()
2600 adapter->hw.mac.addr); in iavf_virtchnl_completion()
2603 spin_lock_bh(&adapter->mac_vlan_list_lock); in iavf_virtchnl_completion()
2604 iavf_add_filter(adapter, adapter->hw.mac.addr); in iavf_virtchnl_completion()
2606 if (VLAN_ALLOWED(adapter)) { in iavf_virtchnl_completion()
2607 if (!list_empty(&adapter->vlan_filter_list)) { in iavf_virtchnl_completion()
2612 &adapter->vlan_filter_list, in iavf_virtchnl_completion()
2616 adapter->aq_required |= in iavf_virtchnl_completion()
2621 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_virtchnl_completion()
2623 iavf_activate_fdir_filters(adapter); in iavf_virtchnl_completion()
2625 iavf_parse_vf_resource_msg(adapter); in iavf_virtchnl_completion()
2631 if (VLAN_V2_ALLOWED(adapter)) in iavf_virtchnl_completion()
2644 memcpy(&adapter->vlan_v2_caps, msg, in iavf_virtchnl_completion()
2646 sizeof(adapter->vlan_v2_caps))); in iavf_virtchnl_completion()
2648 iavf_process_config(adapter); in iavf_virtchnl_completion()
2649 adapter->flags |= IAVF_FLAG_SETUP_NETDEV_FEATURES; in iavf_virtchnl_completion()
2650 iavf_schedule_finish_config(adapter); in iavf_virtchnl_completion()
2652 iavf_set_queue_vlan_tag_loc(adapter); in iavf_virtchnl_completion()
2655 adapter->hw.mac.addr); in iavf_virtchnl_completion()
2657 spin_lock_bh(&adapter->mac_vlan_list_lock); in iavf_virtchnl_completion()
2660 list_for_each_entry(f, &adapter->mac_filter_list, list) { in iavf_virtchnl_completion()
2664 adapter->hw.mac.addr); in iavf_virtchnl_completion()
2673 if (VLAN_FILTERING_ALLOWED(adapter)) { in iavf_virtchnl_completion()
2676 if (!list_empty(&adapter->vlan_filter_list)) { in iavf_virtchnl_completion()
2678 &adapter->vlan_filter_list, in iavf_virtchnl_completion()
2686 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_virtchnl_completion()
2689 eth_hw_addr_set(netdev, adapter->hw.mac.addr); in iavf_virtchnl_completion()
2692 adapter->aq_required |= IAVF_FLAG_AQ_ADD_MAC_FILTER | in iavf_virtchnl_completion()
2700 adapter->supp_rxdids = *(u64 *)msg; in iavf_virtchnl_completion()
2704 if (msglen != sizeof(adapter->ptp.hw_caps)) in iavf_virtchnl_completion()
2707 adapter->ptp.hw_caps = *(struct virtchnl_ptp_caps *)msg; in iavf_virtchnl_completion()
2710 iavf_ptp_process_caps(adapter); in iavf_virtchnl_completion()
2713 iavf_virtchnl_ptp_get_time(adapter, msg, msglen); in iavf_virtchnl_completion()
2717 iavf_irq_enable(adapter, true); in iavf_virtchnl_completion()
2718 wake_up(&adapter->reset_waitqueue); in iavf_virtchnl_completion()
2719 adapter->flags &= ~IAVF_FLAG_QUEUES_DISABLED; in iavf_virtchnl_completion()
2722 iavf_free_all_tx_resources(adapter); in iavf_virtchnl_completion()
2723 iavf_free_all_rx_resources(adapter); in iavf_virtchnl_completion()
2724 if (adapter->state == __IAVF_DOWN_PENDING) { in iavf_virtchnl_completion()
2725 iavf_change_state(adapter, __IAVF_DOWN); in iavf_virtchnl_completion()
2726 wake_up(&adapter->down_waitqueue); in iavf_virtchnl_completion()
2735 if (v_opcode != adapter->current_op) in iavf_virtchnl_completion()
2742 adapter->hena = vrh->hena; in iavf_virtchnl_completion()
2744 dev_warn(&adapter->pdev->dev, in iavf_virtchnl_completion()
2752 if (vfres->num_queue_pairs != adapter->num_req_queues) { in iavf_virtchnl_completion()
2753 dev_info(&adapter->pdev->dev, in iavf_virtchnl_completion()
2755 adapter->num_req_queues, in iavf_virtchnl_completion()
2757 adapter->num_req_queues = 0; in iavf_virtchnl_completion()
2758 adapter->flags &= ~IAVF_FLAG_REINIT_ITR_NEEDED; in iavf_virtchnl_completion()
2765 list_for_each_entry(cf, &adapter->cloud_filter_list, list) { in iavf_virtchnl_completion()
2774 list_for_each_entry_safe(cf, cftmp, &adapter->cloud_filter_list, in iavf_virtchnl_completion()
2780 adapter->num_cloud_filters--; in iavf_virtchnl_completion()
2789 spin_lock_bh(&adapter->fdir_fltr_lock); in iavf_virtchnl_completion()
2791 &adapter->fdir_list_head, in iavf_virtchnl_completion()
2796 dev_info(&adapter->pdev->dev, "Flow Director filter with location %u is added\n", in iavf_virtchnl_completion()
2799 dev_info(&adapter->pdev->dev, "Flow Director filter (raw) for TC handle %x is added\n", in iavf_virtchnl_completion()
2804 dev_info(&adapter->pdev->dev, "Failed to add Flow Director filter with status: %d\n", in iavf_virtchnl_completion()
2806 iavf_print_fdir_fltr(adapter, fdir); in iavf_virtchnl_completion()
2808 iavf_dec_fdir_active_fltr(adapter, fdir); in iavf_virtchnl_completion()
2813 spin_unlock_bh(&adapter->fdir_fltr_lock); in iavf_virtchnl_completion()
2820 spin_lock_bh(&adapter->fdir_fltr_lock); in iavf_virtchnl_completion()
2821 list_for_each_entry_safe(fdir, fdir_tmp, &adapter->fdir_list_head, in iavf_virtchnl_completion()
2828 dev_info(&adapter->pdev->dev, "Flow Director filter with location %u is deleted\n", in iavf_virtchnl_completion()
2831 dev_info(&adapter->pdev->dev, "Flow Director filter (raw) for TC handle %x is deleted\n", in iavf_virtchnl_completion()
2834 iavf_dec_fdir_active_fltr(adapter, fdir); in iavf_virtchnl_completion()
2838 dev_info(&adapter->pdev->dev, "Failed to delete Flow Director filter with status: %d\n", in iavf_virtchnl_completion()
2840 iavf_print_fdir_fltr(adapter, fdir); in iavf_virtchnl_completion()
2849 dev_info(&adapter->pdev->dev, "Failed to disable Flow Director filter with status: %d\n", in iavf_virtchnl_completion()
2851 iavf_print_fdir_fltr(adapter, fdir); in iavf_virtchnl_completion()
2855 spin_unlock_bh(&adapter->fdir_fltr_lock); in iavf_virtchnl_completion()
2861 spin_lock_bh(&adapter->adv_rss_lock); in iavf_virtchnl_completion()
2862 list_for_each_entry(rss, &adapter->adv_rss_list_head, list) { in iavf_virtchnl_completion()
2864 iavf_print_adv_rss_cfg(adapter, rss, in iavf_virtchnl_completion()
2870 spin_unlock_bh(&adapter->adv_rss_lock); in iavf_virtchnl_completion()
2876 spin_lock_bh(&adapter->adv_rss_lock); in iavf_virtchnl_completion()
2878 &adapter->adv_rss_list_head, list) { in iavf_virtchnl_completion()
2884 spin_unlock_bh(&adapter->adv_rss_lock); in iavf_virtchnl_completion()
2890 spin_lock_bh(&adapter->mac_vlan_list_lock); in iavf_virtchnl_completion()
2891 list_for_each_entry(f, &adapter->vlan_filter_list, list) { in iavf_virtchnl_completion()
2895 spin_unlock_bh(&adapter->mac_vlan_list_lock); in iavf_virtchnl_completion()
2913 u16 len = struct_size(adapter->qos_caps, cap, in iavf_virtchnl_completion()
2916 memcpy(adapter->qos_caps, msg, min(msglen, len)); in iavf_virtchnl_completion()
2918 adapter->aq_required |= IAVF_FLAG_AQ_CFG_QUEUES_QUANTA_SIZE; in iavf_virtchnl_completion()
2926 for (i = 0; i < adapter->num_active_queues; i++) in iavf_virtchnl_completion()
2927 adapter->tx_rings[i].q_shaper_update = false; in iavf_virtchnl_completion()
2931 if (adapter->current_op && (v_opcode != adapter->current_op)) in iavf_virtchnl_completion()
2932 dev_warn(&adapter->pdev->dev, "Expected response %d from PF, received %d\n", in iavf_virtchnl_completion()
2933 adapter->current_op, v_opcode); in iavf_virtchnl_completion()
2936 adapter->current_op = VIRTCHNL_OP_UNKNOWN; in iavf_virtchnl_completion()