Lines Matching refs:pf
41 static void i40e_vc_vf_broadcast(struct i40e_pf *pf, in i40e_vc_vf_broadcast() argument
46 struct i40e_hw *hw = &pf->hw; in i40e_vc_vf_broadcast()
47 struct i40e_vf *vf = pf->vf; in i40e_vc_vf_broadcast()
50 for (i = 0; i < pf->num_alloc_vfs; i++, vf++) { in i40e_vc_vf_broadcast()
74 struct i40e_pf *pf = vf->pf; in i40e_vc_notify_vf_link_state() local
75 struct i40e_hw *hw = &pf->hw; in i40e_vc_notify_vf_link_state()
76 struct i40e_link_status *ls = &pf->hw.phy.link_info; in i40e_vc_notify_vf_link_state()
101 void i40e_vc_notify_link_state(struct i40e_pf *pf) in i40e_vc_notify_link_state() argument
105 for (i = 0; i < pf->num_alloc_vfs; i++) in i40e_vc_notify_link_state()
106 i40e_vc_notify_vf_link_state(&pf->vf[i]); in i40e_vc_notify_link_state()
115 void i40e_vc_notify_reset(struct i40e_pf *pf) in i40e_vc_notify_reset() argument
121 i40e_vc_vf_broadcast(pf, VIRTCHNL_OP_EVENT, 0, in i40e_vc_notify_reset()
137 if (!vf || vf->vf_id >= vf->pf->num_alloc_vfs) in i40e_vc_notify_vf_reset()
145 abs_vf_id = vf->vf_id + (int)vf->pf->hw.func_caps.vf_base_id; in i40e_vc_notify_vf_reset()
149 i40e_aq_send_msg_to_vf(&vf->pf->hw, abs_vf_id, VIRTCHNL_OP_EVENT, in i40e_vc_notify_vf_reset()
162 static inline void i40e_vc_disable_vf(struct i40e_pf *pf, struct i40e_vf *vf) in i40e_vc_disable_vf() argument
177 struct i40e_pf *pf = vf->pf; in i40e_vc_isvalid_vsi_id() local
178 struct i40e_vsi *vsi = i40e_find_vsi_from_id(pf, vsi_id); in i40e_vc_isvalid_vsi_id()
194 struct i40e_pf *pf = vf->pf; in i40e_vc_isvalid_queue_id() local
195 struct i40e_vsi *vsi = i40e_find_vsi_from_id(pf, vsi_id); in i40e_vc_isvalid_queue_id()
209 struct i40e_pf *pf = vf->pf; in i40e_vc_isvalid_vector_id() local
211 return vector_id < pf->hw.func_caps.num_msix_vectors_vf; in i40e_vc_isvalid_vector_id()
227 struct i40e_pf *pf = vf->pf; in i40e_vc_get_pf_queue_id() local
228 struct i40e_vsi *vsi = i40e_find_vsi_from_id(pf, vsi_id); in i40e_vc_get_pf_queue_id()
257 struct i40e_pf *pf = vf->pf; in i40e_config_irq_link_list() local
258 struct i40e_hw *hw = &pf->hw; in i40e_config_irq_link_list()
271 ((pf->hw.func_caps.num_msix_vectors_vf - 1) * vf->vf_id) + in i40e_config_irq_link_list()
362 struct i40e_pf *pf = vf->pf; in i40e_release_iwarp_qvlist() local
370 msix_vf = pf->hw.func_caps.num_msix_vectors_vf; in i40e_release_iwarp_qvlist()
374 struct i40e_hw *hw = &pf->hw; in i40e_release_iwarp_qvlist()
415 struct i40e_pf *pf = vf->pf; in i40e_config_iwarp_qvlist() local
416 struct i40e_hw *hw = &pf->hw; in i40e_config_iwarp_qvlist()
428 msix_vf = pf->hw.func_caps.num_msix_vectors_vf; in i40e_config_iwarp_qvlist()
498 struct i40e_pf *pf = vf->pf; in i40e_config_vsi_tx_queue() local
499 struct i40e_hw *hw = &pf->hw; in i40e_config_vsi_tx_queue()
511 vsi = i40e_find_vsi_from_id(pf, vsi_id); in i40e_config_vsi_tx_queue()
531 dev_err(&pf->pdev->dev, in i40e_config_vsi_tx_queue()
541 dev_err(&pf->pdev->dev, in i40e_config_vsi_tx_queue()
575 struct i40e_pf *pf = vf->pf; in i40e_config_vsi_rx_queue() local
576 struct i40e_hw *hw = &pf->hw; in i40e_config_vsi_rx_queue()
632 dev_err(&pf->pdev->dev, in i40e_config_vsi_rx_queue()
642 dev_err(&pf->pdev->dev, in i40e_config_vsi_rx_queue()
663 struct i40e_pf *pf = vf->pf; in i40e_alloc_vsi_res() local
667 vsi = i40e_vsi_setup(pf, type, pf->vsi[pf->lan_vsi]->seid, vf->vf_id); in i40e_alloc_vsi_res()
670 dev_err(&pf->pdev->dev, in i40e_alloc_vsi_res()
672 vf->vf_id, pf->hw.aq.asq_last_status); in i40e_alloc_vsi_res()
677 u64 hena = i40e_pf_get_default_rss_hena(pf); in i40e_alloc_vsi_res()
696 dev_info(&pf->pdev->dev, in i40e_alloc_vsi_res()
703 dev_info(&pf->pdev->dev, in i40e_alloc_vsi_res()
706 wr32(&pf->hw, I40E_VFQF_HENA1(0, vf->vf_id), (u32)hena); in i40e_alloc_vsi_res()
707 wr32(&pf->hw, I40E_VFQF_HENA1(1, vf->vf_id), (u32)(hena >> 32)); in i40e_alloc_vsi_res()
713 dev_err(&pf->pdev->dev, "Unable to program ucast filters\n"); in i40e_alloc_vsi_res()
717 ret = i40e_aq_config_vsi_bw_limit(&pf->hw, vsi->seid, in i40e_alloc_vsi_res()
720 dev_err(&pf->pdev->dev, "Unable to set tx rate, VF %d, error code %d.\n", in i40e_alloc_vsi_res()
736 struct i40e_pf *pf = vf->pf; in i40e_enable_vf_mappings() local
737 struct i40e_hw *hw = &pf->hw; in i40e_enable_vf_mappings()
753 for (j = 0; j < pf->vsi[vf->lan_vsi_idx]->alloc_queue_pairs; j++) { in i40e_enable_vf_mappings()
763 if (j * 2 >= pf->vsi[vf->lan_vsi_idx]->alloc_queue_pairs) { in i40e_enable_vf_mappings()
788 struct i40e_pf *pf = vf->pf; in i40e_disable_vf_mappings() local
789 struct i40e_hw *hw = &pf->hw; in i40e_disable_vf_mappings()
808 struct i40e_pf *pf = vf->pf; in i40e_free_vf_res() local
809 struct i40e_hw *hw = &pf->hw; in i40e_free_vf_res()
820 i40e_vsi_release(pf->vsi[vf->lan_vsi_idx]); in i40e_free_vf_res()
825 msix_vf = pf->hw.func_caps.num_msix_vectors_vf; in i40e_free_vf_res()
867 struct i40e_pf *pf = vf->pf; in i40e_alloc_vf_res() local
875 total_queue_pairs += pf->vsi[vf->lan_vsi_idx]->alloc_queue_pairs; in i40e_alloc_vf_res()
908 struct i40e_pf *pf = vf->pf; in i40e_quiesce_vf_pci() local
909 struct i40e_hw *hw = &pf->hw; in i40e_quiesce_vf_pci()
937 struct i40e_pf *pf = vf->pf; in i40e_trigger_vf_reset() local
938 struct i40e_hw *hw = &pf->hw; in i40e_trigger_vf_reset()
969 dev_err(&pf->pdev->dev, "VF %d PCI transactions stuck\n", in i40e_trigger_vf_reset()
983 struct i40e_pf *pf = vf->pf; in i40e_cleanup_reset_vf() local
984 struct i40e_hw *hw = &pf->hw; in i40e_cleanup_reset_vf()
1013 i40e_notify_client_of_vf_reset(pf, abs_vf_id); in i40e_cleanup_reset_vf()
1033 struct i40e_pf *pf = vf->pf; in i40e_reset_vf() local
1034 struct i40e_hw *hw = &pf->hw; in i40e_reset_vf()
1040 if (test_and_set_bit(__I40E_VF_DISABLE, pf->state)) in i40e_reset_vf()
1066 dev_err(&pf->pdev->dev, "VF reset check timeout on VF %d\n", in i40e_reset_vf()
1072 i40e_vsi_stop_rings(pf->vsi[vf->lan_vsi_idx]); in i40e_reset_vf()
1077 clear_bit(__I40E_VF_DISABLE, pf->state); in i40e_reset_vf()
1090 void i40e_reset_all_vfs(struct i40e_pf *pf, bool flr) in i40e_reset_all_vfs() argument
1092 struct i40e_hw *hw = &pf->hw; in i40e_reset_all_vfs()
1098 if (!pf->num_alloc_vfs) in i40e_reset_all_vfs()
1102 if (test_and_set_bit(__I40E_VF_DISABLE, pf->state)) in i40e_reset_all_vfs()
1106 for (v = 0; v < pf->num_alloc_vfs; v++) in i40e_reset_all_vfs()
1107 i40e_trigger_vf_reset(&pf->vf[v], flr); in i40e_reset_all_vfs()
1115 for (i = 0, v = 0; i < 10 && v < pf->num_alloc_vfs; i++) { in i40e_reset_all_vfs()
1121 while (v < pf->num_alloc_vfs) { in i40e_reset_all_vfs()
1122 vf = &pf->vf[v]; in i40e_reset_all_vfs()
1140 if (v < pf->num_alloc_vfs) in i40e_reset_all_vfs()
1141 dev_err(&pf->pdev->dev, "VF reset check timeout on VF %d\n", in i40e_reset_all_vfs()
1142 pf->vf[v].vf_id); in i40e_reset_all_vfs()
1148 for (v = 0; v < pf->num_alloc_vfs; v++) { in i40e_reset_all_vfs()
1150 if (pf->vf[v].lan_vsi_idx == 0) in i40e_reset_all_vfs()
1153 i40e_vsi_stop_rings_no_wait(pf->vsi[pf->vf[v].lan_vsi_idx]); in i40e_reset_all_vfs()
1159 for (v = 0; v < pf->num_alloc_vfs; v++) { in i40e_reset_all_vfs()
1161 if (pf->vf[v].lan_vsi_idx == 0) in i40e_reset_all_vfs()
1164 i40e_vsi_wait_queues_disabled(pf->vsi[pf->vf[v].lan_vsi_idx]); in i40e_reset_all_vfs()
1173 for (v = 0; v < pf->num_alloc_vfs; v++) in i40e_reset_all_vfs()
1174 i40e_cleanup_reset_vf(&pf->vf[v]); in i40e_reset_all_vfs()
1177 clear_bit(__I40E_VF_DISABLE, pf->state); in i40e_reset_all_vfs()
1186 void i40e_free_vfs(struct i40e_pf *pf) in i40e_free_vfs() argument
1188 struct i40e_hw *hw = &pf->hw; in i40e_free_vfs()
1192 if (!pf->vf) in i40e_free_vfs()
1194 while (test_and_set_bit(__I40E_VF_DISABLE, pf->state)) in i40e_free_vfs()
1197 i40e_notify_client_of_vf_enable(pf, 0); in i40e_free_vfs()
1200 for (i = 0; i < pf->num_alloc_vfs; i++) { in i40e_free_vfs()
1201 if (test_bit(I40E_VF_STATE_INIT, &pf->vf[i].vf_states)) in i40e_free_vfs()
1204 i40e_vsi_stop_rings_no_wait(pf->vsi[pf->vf[i].lan_vsi_idx]); in i40e_free_vfs()
1207 for (i = 0; i < pf->num_alloc_vfs; i++) { in i40e_free_vfs()
1208 if (test_bit(I40E_VF_STATE_INIT, &pf->vf[i].vf_states)) in i40e_free_vfs()
1211 i40e_vsi_wait_queues_disabled(pf->vsi[pf->vf[i].lan_vsi_idx]); in i40e_free_vfs()
1218 if (!pci_vfs_assigned(pf->pdev)) in i40e_free_vfs()
1219 pci_disable_sriov(pf->pdev); in i40e_free_vfs()
1221 dev_warn(&pf->pdev->dev, "VFs are assigned - not disabling SR-IOV\n"); in i40e_free_vfs()
1224 tmp = pf->num_alloc_vfs; in i40e_free_vfs()
1225 pf->num_alloc_vfs = 0; in i40e_free_vfs()
1227 if (test_bit(I40E_VF_STATE_INIT, &pf->vf[i].vf_states)) in i40e_free_vfs()
1228 i40e_free_vf_res(&pf->vf[i]); in i40e_free_vfs()
1230 i40e_disable_vf_mappings(&pf->vf[i]); in i40e_free_vfs()
1233 kfree(pf->vf); in i40e_free_vfs()
1234 pf->vf = NULL; in i40e_free_vfs()
1240 if (!pci_vfs_assigned(pf->pdev)) { in i40e_free_vfs()
1250 clear_bit(__I40E_VF_DISABLE, pf->state); in i40e_free_vfs()
1261 int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs) in i40e_alloc_vfs() argument
1267 i40e_irq_dynamic_disable_icr0(pf); in i40e_alloc_vfs()
1270 if (pci_num_vf(pf->pdev) != num_alloc_vfs) { in i40e_alloc_vfs()
1271 ret = pci_enable_sriov(pf->pdev, num_alloc_vfs); in i40e_alloc_vfs()
1273 pf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED; in i40e_alloc_vfs()
1274 pf->num_alloc_vfs = 0; in i40e_alloc_vfs()
1284 pf->vf = vfs; in i40e_alloc_vfs()
1288 vfs[i].pf = pf; in i40e_alloc_vfs()
1299 pf->num_alloc_vfs = num_alloc_vfs; in i40e_alloc_vfs()
1302 i40e_reset_all_vfs(pf, false); in i40e_alloc_vfs()
1304 i40e_notify_client_of_vf_enable(pf, num_alloc_vfs); in i40e_alloc_vfs()
1308 i40e_free_vfs(pf); in i40e_alloc_vfs()
1311 i40e_irq_dynamic_enable_icr0(pf, false); in i40e_alloc_vfs()
1326 struct i40e_pf *pf = pci_get_drvdata(pdev); in i40e_pci_sriov_enable() local
1330 if (test_bit(__I40E_TESTING, pf->state)) { in i40e_pci_sriov_enable()
1338 i40e_free_vfs(pf); in i40e_pci_sriov_enable()
1342 if (num_vfs > pf->num_req_vfs) { in i40e_pci_sriov_enable()
1344 num_vfs, pf->num_req_vfs); in i40e_pci_sriov_enable()
1350 err = i40e_alloc_vfs(pf, num_vfs); in i40e_pci_sriov_enable()
1375 struct i40e_pf *pf = pci_get_drvdata(pdev); in i40e_pci_sriov_configure() local
1378 if (!(pf->flags & I40E_FLAG_VEB_MODE_ENABLED)) { in i40e_pci_sriov_configure()
1379 pf->flags |= I40E_FLAG_VEB_MODE_ENABLED; in i40e_pci_sriov_configure()
1380 i40e_do_reset_safe(pf, in i40e_pci_sriov_configure()
1386 if (!pci_vfs_assigned(pf->pdev)) { in i40e_pci_sriov_configure()
1387 i40e_free_vfs(pf); in i40e_pci_sriov_configure()
1388 pf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED; in i40e_pci_sriov_configure()
1389 i40e_do_reset_safe(pf, BIT_ULL(__I40E_PF_RESET_REQUESTED)); in i40e_pci_sriov_configure()
1412 struct i40e_pf *pf; in i40e_vc_send_msg_to_vf() local
1418 if (!vf || vf->vf_id >= vf->pf->num_alloc_vfs) in i40e_vc_send_msg_to_vf()
1421 pf = vf->pf; in i40e_vc_send_msg_to_vf()
1422 hw = &pf->hw; in i40e_vc_send_msg_to_vf()
1428 dev_info(&pf->pdev->dev, "VF %d failed opcode %d, retval: %d\n", in i40e_vc_send_msg_to_vf()
1432 dev_err(&pf->pdev->dev, in i40e_vc_send_msg_to_vf()
1435 dev_err(&pf->pdev->dev, "Use PF Control I/F to enable the VF\n"); in i40e_vc_send_msg_to_vf()
1447 dev_info(&pf->pdev->dev, in i40e_vc_send_msg_to_vf()
1449 vf->vf_id, pf->hw.aq.asq_last_status); in i40e_vc_send_msg_to_vf()
1503 struct i40e_pf *pf = vf->pf; in i40e_vc_get_vf_resources_msg() local
1532 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_get_vf_resources_msg()
1536 if (i40e_vf_client_capable(pf, vf->vf_id) && in i40e_vc_get_vf_resources_msg()
1545 if ((pf->hw_features & I40E_HW_RSS_AQ_CAPABLE) && in i40e_vc_get_vf_resources_msg()
1552 if (pf->hw_features & I40E_HW_MULTIPLE_TCP_UDP_RSS_PCTYPE) { in i40e_vc_get_vf_resources_msg()
1561 if ((pf->hw_features & I40E_HW_OUTER_UDP_CSUM_CAPABLE) && in i40e_vc_get_vf_resources_msg()
1566 if (pf->flags & I40E_FLAG_MFP_ENABLED) { in i40e_vc_get_vf_resources_msg()
1567 dev_err(&pf->pdev->dev, in i40e_vc_get_vf_resources_msg()
1576 if (pf->hw_features & I40E_HW_WB_ON_ITR_CAPABLE) { in i40e_vc_get_vf_resources_msg()
1584 vfres->max_vectors = pf->hw.func_caps.num_msix_vectors_vf; in i40e_vc_get_vf_resources_msg()
1658 struct i40e_pf *pf = vf->pf; in i40e_vc_config_promiscuous_mode_msg() local
1659 struct i40e_hw *hw = &pf->hw; in i40e_vc_config_promiscuous_mode_msg()
1668 vsi = i40e_find_vsi_from_id(pf, info->vsi_id); in i40e_vc_config_promiscuous_mode_msg()
1676 dev_err(&pf->pdev->dev, in i40e_vc_config_promiscuous_mode_msg()
1701 aq_err = pf->hw.aq.asq_last_status; in i40e_vc_config_promiscuous_mode_msg()
1703 dev_err(&pf->pdev->dev, in i40e_vc_config_promiscuous_mode_msg()
1706 i40e_stat_str(&pf->hw, aq_ret), in i40e_vc_config_promiscuous_mode_msg()
1707 i40e_aq_str(&pf->hw, aq_err)); in i40e_vc_config_promiscuous_mode_msg()
1714 aq_err = pf->hw.aq.asq_last_status; in i40e_vc_config_promiscuous_mode_msg()
1716 dev_err(&pf->pdev->dev, in i40e_vc_config_promiscuous_mode_msg()
1719 i40e_stat_str(&pf->hw, aq_ret), in i40e_vc_config_promiscuous_mode_msg()
1720 i40e_aq_str(&pf->hw, aq_err)); in i40e_vc_config_promiscuous_mode_msg()
1726 dev_info(&pf->pdev->dev, in i40e_vc_config_promiscuous_mode_msg()
1751 aq_err = pf->hw.aq.asq_last_status; in i40e_vc_config_promiscuous_mode_msg()
1753 dev_err(&pf->pdev->dev, in i40e_vc_config_promiscuous_mode_msg()
1756 i40e_stat_str(&pf->hw, aq_ret), in i40e_vc_config_promiscuous_mode_msg()
1757 i40e_aq_str(&pf->hw, aq_err)); in i40e_vc_config_promiscuous_mode_msg()
1763 aq_err = pf->hw.aq.asq_last_status; in i40e_vc_config_promiscuous_mode_msg()
1765 dev_err(&pf->pdev->dev, in i40e_vc_config_promiscuous_mode_msg()
1768 i40e_stat_str(&pf->hw, aq_ret), in i40e_vc_config_promiscuous_mode_msg()
1769 i40e_aq_str(&pf->hw, aq_err)); in i40e_vc_config_promiscuous_mode_msg()
1775 dev_info(&pf->pdev->dev, in i40e_vc_config_promiscuous_mode_msg()
1805 struct i40e_pf *pf = vf->pf; in i40e_vc_config_queues_msg() local
1840 pf->vsi[vf->lan_vsi_idx]->num_queue_pairs = qci->num_queue_pairs; in i40e_vc_config_queues_msg()
1923 struct i40e_pf *pf = vf->pf; in i40e_vc_enable_queues_msg() local
1942 if (i40e_vsi_start_rings(pf->vsi[vf->lan_vsi_idx])) in i40e_vc_enable_queues_msg()
1963 struct i40e_pf *pf = vf->pf; in i40e_vc_disable_queues_msg() local
1981 i40e_vsi_stop_rings(pf->vsi[vf->lan_vsi_idx]); in i40e_vc_disable_queues_msg()
2001 struct i40e_pf *pf = vf->pf; in i40e_vc_get_stats_msg() local
2018 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_get_stats_msg()
2050 struct i40e_pf *pf = vf->pf; in i40e_check_vf_permission() local
2055 dev_err(&pf->pdev->dev, "invalid VF MAC addr %pM\n", macaddr); in i40e_check_vf_permission()
2067 dev_err(&pf->pdev->dev, in i40e_check_vf_permission()
2072 dev_err(&pf->pdev->dev, in i40e_check_vf_permission()
2091 struct i40e_pf *pf = vf->pf; in i40e_vc_add_mac_addr_msg() local
2108 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_add_mac_addr_msg()
2124 dev_err(&pf->pdev->dev, in i40e_vc_add_mac_addr_msg()
2139 dev_err(&pf->pdev->dev, "Unable to program VF %d MAC filters, error %d\n", in i40e_vc_add_mac_addr_msg()
2160 struct i40e_pf *pf = vf->pf; in i40e_vc_del_mac_addr_msg() local
2175 dev_err(&pf->pdev->dev, "Invalid MAC addr %pM for VF %d\n", in i40e_vc_del_mac_addr_msg()
2184 dev_err(&pf->pdev->dev, in i40e_vc_del_mac_addr_msg()
2191 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_del_mac_addr_msg()
2209 dev_err(&pf->pdev->dev, "Unable to program VF %d MAC filters, error %d\n", in i40e_vc_del_mac_addr_msg()
2230 struct i40e_pf *pf = vf->pf; in i40e_vc_add_vlan_msg() local
2238 dev_err(&pf->pdev->dev, in i40e_vc_add_vlan_msg()
2251 dev_err(&pf->pdev->dev, in i40e_vc_add_vlan_msg()
2256 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_add_vlan_msg()
2270 i40e_aq_set_vsi_uc_promisc_on_vlan(&pf->hw, vsi->seid, in i40e_vc_add_vlan_msg()
2275 i40e_aq_set_vsi_mc_promisc_on_vlan(&pf->hw, vsi->seid, in i40e_vc_add_vlan_msg()
2281 dev_err(&pf->pdev->dev, in i40e_vc_add_vlan_msg()
2303 struct i40e_pf *pf = vf->pf; in i40e_vc_remove_vlan_msg() local
2322 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_remove_vlan_msg()
2333 i40e_aq_set_vsi_uc_promisc_on_vlan(&pf->hw, vsi->seid, in i40e_vc_remove_vlan_msg()
2338 i40e_aq_set_vsi_mc_promisc_on_vlan(&pf->hw, vsi->seid, in i40e_vc_remove_vlan_msg()
2359 struct i40e_pf *pf = vf->pf; in i40e_vc_iwarp_msg() local
2360 int abs_vf_id = vf->vf_id + pf->hw.func_caps.vf_base_id; in i40e_vc_iwarp_msg()
2369 i40e_notify_client_of_vf_msg(pf->vsi[pf->lan_vsi], abs_vf_id, in i40e_vc_iwarp_msg()
2427 struct i40e_pf *pf = vf->pf; in i40e_vc_config_rss_key() local
2439 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_config_rss_key()
2459 struct i40e_pf *pf = vf->pf; in i40e_vc_config_rss_lut() local
2471 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_config_rss_lut()
2490 struct i40e_pf *pf = vf->pf; in i40e_vc_get_rss_hena() local
2506 vrh->hena = i40e_pf_get_default_rss_hena(pf); in i40e_vc_get_rss_hena()
2527 struct i40e_pf *pf = vf->pf; in i40e_vc_set_rss_hena() local
2528 struct i40e_hw *hw = &pf->hw; in i40e_vc_set_rss_hena()
2555 struct i40e_vsi *vsi = vf->pf->vsi[vf->lan_vsi_idx]; in i40e_vc_enable_vlan_stripping()
2582 struct i40e_vsi *vsi = vf->pf->vsi[vf->lan_vsi_idx]; in i40e_vc_disable_vlan_stripping()
2609 int i40e_vc_process_vf_msg(struct i40e_pf *pf, s16 vf_id, u32 v_opcode, in i40e_vc_process_vf_msg() argument
2612 struct i40e_hw *hw = &pf->hw; in i40e_vc_process_vf_msg()
2617 pf->vf_aq_requests++; in i40e_vc_process_vf_msg()
2618 if (local_vf_id >= pf->num_alloc_vfs) in i40e_vc_process_vf_msg()
2620 vf = &(pf->vf[local_vf_id]); in i40e_vc_process_vf_msg()
2644 dev_err(&pf->pdev->dev, "Invalid message from VF %d, opcode %d, len %d\n", in i40e_vc_process_vf_msg()
2726 dev_err(&pf->pdev->dev, "Unsupported opcode %d from VF %d\n", in i40e_vc_process_vf_msg()
2743 int i40e_vc_process_vflr_event(struct i40e_pf *pf) in i40e_vc_process_vflr_event() argument
2745 struct i40e_hw *hw = &pf->hw; in i40e_vc_process_vflr_event()
2750 if (!test_bit(__I40E_VFLR_EVENT_PENDING, pf->state)) in i40e_vc_process_vflr_event()
2763 clear_bit(__I40E_VFLR_EVENT_PENDING, pf->state); in i40e_vc_process_vflr_event()
2764 for (vf_id = 0; vf_id < pf->num_alloc_vfs; vf_id++) { in i40e_vc_process_vflr_event()
2768 vf = &pf->vf[vf_id]; in i40e_vc_process_vflr_event()
2790 struct i40e_pf *pf = vsi->back; in i40e_ndo_set_vf_mac() local
2799 if (vf_id >= pf->num_alloc_vfs) { in i40e_ndo_set_vf_mac()
2800 dev_err(&pf->pdev->dev, in i40e_ndo_set_vf_mac()
2806 vf = &(pf->vf[vf_id]); in i40e_ndo_set_vf_mac()
2807 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_ndo_set_vf_mac()
2819 dev_err(&pf->pdev->dev, "VF %d still in reset. Try again.\n", in i40e_ndo_set_vf_mac()
2826 dev_err(&pf->pdev->dev, in i40e_ndo_set_vf_mac()
2851 dev_err(&pf->pdev->dev, "Unable to program ucast filters\n"); in i40e_ndo_set_vf_mac()
2859 dev_info(&pf->pdev->dev, "Removing MAC on VF %d\n", vf_id); in i40e_ndo_set_vf_mac()
2862 dev_info(&pf->pdev->dev, "Setting MAC %pM on VF %d\n", in i40e_ndo_set_vf_mac()
2867 i40e_vc_disable_vf(pf, vf); in i40e_ndo_set_vf_mac()
2868 dev_info(&pf->pdev->dev, "Reload the VF driver to make this change effective.\n"); in i40e_ndo_set_vf_mac()
2889 struct i40e_pf *pf = np->vsi->back; in i40e_ndo_set_vf_port_vlan() local
2895 if (vf_id >= pf->num_alloc_vfs) { in i40e_ndo_set_vf_port_vlan()
2896 dev_err(&pf->pdev->dev, "Invalid VF Identifier %d\n", vf_id); in i40e_ndo_set_vf_port_vlan()
2902 dev_err(&pf->pdev->dev, "Invalid VF Parameters\n"); in i40e_ndo_set_vf_port_vlan()
2908 dev_err(&pf->pdev->dev, "VF VLAN protocol is not supported\n"); in i40e_ndo_set_vf_port_vlan()
2913 vf = &(pf->vf[vf_id]); in i40e_ndo_set_vf_port_vlan()
2914 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_ndo_set_vf_port_vlan()
2916 dev_err(&pf->pdev->dev, "VF %d still in reset. Try again.\n", in i40e_ndo_set_vf_port_vlan()
2930 dev_err(&pf->pdev->dev, in i40e_ndo_set_vf_port_vlan()
2937 i40e_vc_disable_vf(pf, vf); in i40e_ndo_set_vf_port_vlan()
2939 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_ndo_set_vf_port_vlan()
2977 dev_info(&pf->pdev->dev, "Setting VLAN %d, QOS 0x%x on VF %d\n", in i40e_ndo_set_vf_port_vlan()
3000 dev_err(&pf->pdev->dev, "Unable to update VF vsi context\n"); in i40e_ndo_set_vf_port_vlan()
3028 struct i40e_pf *pf = np->vsi->back; in i40e_ndo_set_vf_bw() local
3035 if (vf_id >= pf->num_alloc_vfs) { in i40e_ndo_set_vf_bw()
3036 dev_err(&pf->pdev->dev, "Invalid VF Identifier %d.\n", vf_id); in i40e_ndo_set_vf_bw()
3042 dev_err(&pf->pdev->dev, "Invalid min tx rate (%d) (greater than 0) specified for VF %d.\n", in i40e_ndo_set_vf_bw()
3047 vf = &(pf->vf[vf_id]); in i40e_ndo_set_vf_bw()
3048 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_ndo_set_vf_bw()
3050 dev_err(&pf->pdev->dev, "VF %d still in reset. Try again.\n", in i40e_ndo_set_vf_bw()
3056 switch (pf->hw.phy.link_info.link_speed) { in i40e_ndo_set_vf_bw()
3077 dev_err(&pf->pdev->dev, "Invalid max tx rate %d specified for VF %d.\n", in i40e_ndo_set_vf_bw()
3084 dev_warn(&pf->pdev->dev, "Setting max Tx rate to minimum usable value of 50Mbps.\n"); in i40e_ndo_set_vf_bw()
3089 ret = i40e_aq_config_vsi_bw_limit(&pf->hw, vsi->seid, in i40e_ndo_set_vf_bw()
3093 dev_err(&pf->pdev->dev, "Unable to set max tx rate, error code %d.\n", in i40e_ndo_set_vf_bw()
3116 struct i40e_pf *pf = vsi->back; in i40e_ndo_get_vf_config() local
3121 if (vf_id >= pf->num_alloc_vfs) { in i40e_ndo_get_vf_config()
3122 dev_err(&pf->pdev->dev, "Invalid VF Identifier %d\n", vf_id); in i40e_ndo_get_vf_config()
3127 vf = &(pf->vf[vf_id]); in i40e_ndo_get_vf_config()
3129 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_ndo_get_vf_config()
3131 dev_err(&pf->pdev->dev, "VF %d still in reset. Try again.\n", in i40e_ndo_get_vf_config()
3171 struct i40e_pf *pf = np->vsi->back; in i40e_ndo_set_vf_link_state() local
3173 struct i40e_hw *hw = &pf->hw; in i40e_ndo_set_vf_link_state()
3179 if (vf_id >= pf->num_alloc_vfs) { in i40e_ndo_set_vf_link_state()
3180 dev_err(&pf->pdev->dev, "Invalid VF Identifier %d\n", vf_id); in i40e_ndo_set_vf_link_state()
3185 vf = &pf->vf[vf_id]; in i40e_ndo_set_vf_link_state()
3195 pf->hw.phy.link_info.link_info & I40E_AQ_LINK_UP; in i40e_ndo_set_vf_link_state()
3198 pf->hw.phy.link_info.link_speed; in i40e_ndo_set_vf_link_state()
3236 struct i40e_pf *pf = vsi->back; in i40e_ndo_set_vf_spoofchk() local
3238 struct i40e_hw *hw = &pf->hw; in i40e_ndo_set_vf_spoofchk()
3243 if (vf_id >= pf->num_alloc_vfs) { in i40e_ndo_set_vf_spoofchk()
3244 dev_err(&pf->pdev->dev, "Invalid VF Identifier %d\n", vf_id); in i40e_ndo_set_vf_spoofchk()
3249 vf = &(pf->vf[vf_id]); in i40e_ndo_set_vf_spoofchk()
3251 dev_err(&pf->pdev->dev, "VF %d still in reset. Try again.\n", in i40e_ndo_set_vf_spoofchk()
3262 ctxt.seid = pf->vsi[vf->lan_vsi_idx]->seid; in i40e_ndo_set_vf_spoofchk()
3263 ctxt.pf_num = pf->hw.pf_id; in i40e_ndo_set_vf_spoofchk()
3270 dev_err(&pf->pdev->dev, "Error %d updating VSI parameters\n", in i40e_ndo_set_vf_spoofchk()
3289 struct i40e_pf *pf = np->vsi->back; in i40e_ndo_set_vf_trust() local
3294 if (vf_id >= pf->num_alloc_vfs) { in i40e_ndo_set_vf_trust()
3295 dev_err(&pf->pdev->dev, "Invalid VF Identifier %d\n", vf_id); in i40e_ndo_set_vf_trust()
3299 if (pf->flags & I40E_FLAG_MFP_ENABLED) { in i40e_ndo_set_vf_trust()
3300 dev_err(&pf->pdev->dev, "Trusted VF not supported in MFP mode.\n"); in i40e_ndo_set_vf_trust()
3304 vf = &pf->vf[vf_id]; in i40e_ndo_set_vf_trust()
3314 dev_info(&pf->pdev->dev, "VF %u is now %strusted\n", in i40e_ndo_set_vf_trust()