Lines Matching refs:pf
20 static void i40e_vc_vf_broadcast(struct i40e_pf *pf, in i40e_vc_vf_broadcast() argument
25 struct i40e_hw *hw = &pf->hw; in i40e_vc_vf_broadcast()
26 struct i40e_vf *vf = pf->vf; in i40e_vc_vf_broadcast()
29 for (i = 0; i < pf->num_alloc_vfs; i++, vf++) { in i40e_vc_vf_broadcast()
113 struct i40e_pf *pf = vf->pf; in i40e_vc_notify_vf_link_state() local
114 struct i40e_hw *hw = &pf->hw; in i40e_vc_notify_vf_link_state()
115 struct i40e_link_status *ls = &pf->hw.phy.link_info; in i40e_vc_notify_vf_link_state()
133 void i40e_vc_notify_link_state(struct i40e_pf *pf) in i40e_vc_notify_link_state() argument
137 for (i = 0; i < pf->num_alloc_vfs; i++) in i40e_vc_notify_link_state()
138 i40e_vc_notify_vf_link_state(&pf->vf[i]); in i40e_vc_notify_link_state()
147 void i40e_vc_notify_reset(struct i40e_pf *pf) in i40e_vc_notify_reset() argument
153 i40e_vc_vf_broadcast(pf, VIRTCHNL_OP_EVENT, 0, in i40e_vc_notify_reset()
195 if (!vf || vf->vf_id >= vf->pf->num_alloc_vfs) in i40e_vc_notify_vf_reset()
203 abs_vf_id = vf->vf_id + (int)vf->pf->hw.func_caps.vf_base_id; in i40e_vc_notify_vf_reset()
207 i40e_aq_send_msg_to_vf(&vf->pf->hw, abs_vf_id, VIRTCHNL_OP_EVENT, in i40e_vc_notify_vf_reset()
221 struct i40e_pf *pf = vf->pf; in i40e_vc_reset_vf() local
236 if (test_bit(__I40E_VFS_RELEASING, pf->state)) in i40e_vc_reset_vf()
244 dev_warn(&vf->pf->pdev->dev, in i40e_vc_reset_vf()
248 dev_dbg(&vf->pf->pdev->dev, in i40e_vc_reset_vf()
262 struct i40e_pf *pf = vf->pf; in i40e_vc_isvalid_vsi_id() local
263 struct i40e_vsi *vsi = i40e_find_vsi_from_id(pf, vsi_id); in i40e_vc_isvalid_vsi_id()
279 struct i40e_pf *pf = vf->pf; in i40e_vc_isvalid_queue_id() local
280 struct i40e_vsi *vsi = i40e_find_vsi_from_id(pf, vsi_id); in i40e_vc_isvalid_queue_id()
294 struct i40e_pf *pf = vf->pf; in i40e_vc_isvalid_vector_id() local
296 return vector_id < pf->hw.func_caps.num_msix_vectors_vf; in i40e_vc_isvalid_vector_id()
312 struct i40e_pf *pf = vf->pf; in i40e_vc_get_pf_queue_id() local
313 struct i40e_vsi *vsi = i40e_find_vsi_from_id(pf, vsi_id); in i40e_vc_get_pf_queue_id()
374 struct i40e_pf *pf = vf->pf; in i40e_config_irq_link_list() local
375 struct i40e_hw *hw = &pf->hw; in i40e_config_irq_link_list()
388 ((pf->hw.func_caps.num_msix_vectors_vf - 1) * vf->vf_id) + in i40e_config_irq_link_list()
478 struct i40e_pf *pf = vf->pf; in i40e_release_rdma_qvlist() local
486 msix_vf = pf->hw.func_caps.num_msix_vectors_vf; in i40e_release_rdma_qvlist()
490 struct i40e_hw *hw = &pf->hw; in i40e_release_rdma_qvlist()
530 struct i40e_pf *pf = vf->pf; in i40e_config_rdma_qvlist() local
531 struct i40e_hw *hw = &pf->hw; in i40e_config_rdma_qvlist()
539 msix_vf = pf->hw.func_caps.num_msix_vectors_vf; in i40e_config_rdma_qvlist()
542 dev_warn(&pf->pdev->dev, in i40e_config_rdma_qvlist()
560 msix_vf = pf->hw.func_caps.num_msix_vectors_vf; in i40e_config_rdma_qvlist()
632 struct i40e_pf *pf = vf->pf; in i40e_config_vsi_tx_queue() local
633 struct i40e_hw *hw = &pf->hw; in i40e_config_vsi_tx_queue()
645 vsi = i40e_find_vsi_from_id(pf, vsi_id); in i40e_config_vsi_tx_queue()
665 dev_err(&pf->pdev->dev, in i40e_config_vsi_tx_queue()
675 dev_err(&pf->pdev->dev, in i40e_config_vsi_tx_queue()
708 struct i40e_pf *pf = vf->pf; in i40e_config_vsi_rx_queue() local
709 struct i40e_vsi *vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_config_vsi_rx_queue()
710 struct i40e_hw *hw = &pf->hw; in i40e_config_vsi_rx_queue()
767 dev_err(&pf->pdev->dev, in i40e_config_vsi_rx_queue()
777 dev_err(&pf->pdev->dev, in i40e_config_vsi_rx_queue()
799 struct i40e_pf *pf = vf->pf; in i40e_alloc_vsi_res() local
803 main_vsi = i40e_pf_get_main_vsi(pf); in i40e_alloc_vsi_res()
804 vsi = i40e_vsi_setup(pf, I40E_VSI_SRIOV, main_vsi->seid, vf->vf_id); in i40e_alloc_vsi_res()
807 dev_err(&pf->pdev->dev, in i40e_alloc_vsi_res()
809 vf->vf_id, pf->hw.aq.asq_last_status); in i40e_alloc_vsi_res()
815 u64 hashcfg = i40e_pf_get_default_rss_hashcfg(pf); in i40e_alloc_vsi_res()
834 dev_info(&pf->pdev->dev, in i40e_alloc_vsi_res()
841 dev_info(&pf->pdev->dev, in i40e_alloc_vsi_res()
844 wr32(&pf->hw, I40E_VFQF_HENA1(0, vf->vf_id), (u32)hashcfg); in i40e_alloc_vsi_res()
845 wr32(&pf->hw, I40E_VFQF_HENA1(1, vf->vf_id), in i40e_alloc_vsi_res()
850 dev_err(&pf->pdev->dev, "Unable to program ucast filters\n"); in i40e_alloc_vsi_res()
868 ret = i40e_aq_config_vsi_bw_limit(&pf->hw, vsi->seid, in i40e_alloc_vsi_res()
871 dev_err(&pf->pdev->dev, "Unable to set tx rate, VF %d, error code %d.\n", in i40e_alloc_vsi_res()
888 struct i40e_pf *pf = vf->pf; in i40e_map_pf_queues_to_vsi() local
889 struct i40e_hw *hw = &pf->hw; in i40e_map_pf_queues_to_vsi()
902 qps = pf->vsi[vf->lan_vsi_idx]->alloc_queue_pairs; in i40e_map_pf_queues_to_vsi()
935 struct i40e_pf *pf = vf->pf; in i40e_map_pf_to_vf_queues() local
936 struct i40e_hw *hw = &pf->hw; in i40e_map_pf_to_vf_queues()
950 qps = pf->vsi[vf->lan_vsi_idx]->alloc_queue_pairs; in i40e_map_pf_to_vf_queues()
973 struct i40e_pf *pf = vf->pf; in i40e_enable_vf_mappings() local
974 struct i40e_hw *hw = &pf->hw; in i40e_enable_vf_mappings()
1002 struct i40e_pf *pf = vf->pf; in i40e_disable_vf_mappings() local
1003 struct i40e_hw *hw = &pf->hw; in i40e_disable_vf_mappings()
1022 struct i40e_pf *pf = vf->pf; in i40e_free_vf_res() local
1023 struct i40e_hw *hw = &pf->hw; in i40e_free_vf_res()
1036 pf->queues_left += vf->num_queue_pairs - in i40e_free_vf_res()
1042 i40e_vsi_release(pf->vsi[vf->lan_vsi_idx]); in i40e_free_vf_res()
1055 i40e_vsi_release(pf->vsi[vf->ch[j].vsi_idx]); in i40e_free_vf_res()
1060 msix_vf = pf->hw.func_caps.num_msix_vectors_vf; in i40e_free_vf_res()
1103 struct i40e_pf *pf = vf->pf; in i40e_alloc_vf_res() local
1108 vf->num_req_queues <= pf->queues_left + I40E_DEFAULT_QUEUES_PER_VF) in i40e_alloc_vf_res()
1109 pf->num_vf_qps = vf->num_req_queues; in i40e_alloc_vf_res()
1111 pf->num_vf_qps = I40E_DEFAULT_QUEUES_PER_VF; in i40e_alloc_vf_res()
1117 total_queue_pairs += pf->vsi[vf->lan_vsi_idx]->alloc_queue_pairs; in i40e_alloc_vf_res()
1121 if (pf->queues_left >= in i40e_alloc_vf_res()
1132 dev_info(&pf->pdev->dev, "VF %d: Not enough queues to allocate, disabling ADq\n", in i40e_alloc_vf_res()
1144 pf->queues_left -= in i40e_alloc_vf_res()
1178 struct i40e_pf *pf = vf->pf; in i40e_quiesce_vf_pci() local
1179 struct i40e_hw *hw = &pf->hw; in i40e_quiesce_vf_pci()
1278 struct i40e_pf *pf = vf->pf; in i40e_set_vsi_promisc() local
1279 struct i40e_hw *hw = &pf->hw; in i40e_set_vsi_promisc()
1289 int aq_err = pf->hw.aq.asq_last_status; in i40e_set_vsi_promisc()
1291 dev_err(&pf->pdev->dev, in i40e_set_vsi_promisc()
1304 int aq_err = pf->hw.aq.asq_last_status; in i40e_set_vsi_promisc()
1306 dev_err(&pf->pdev->dev, in i40e_set_vsi_promisc()
1320 int aq_err = pf->hw.aq.asq_last_status; in i40e_set_vsi_promisc()
1322 dev_err(&pf->pdev->dev, in i40e_set_vsi_promisc()
1335 int aq_err = pf->hw.aq.asq_last_status; in i40e_set_vsi_promisc()
1337 dev_err(&pf->pdev->dev, in i40e_set_vsi_promisc()
1368 struct i40e_pf *pf = vf->pf; in i40e_config_vf_promiscuous_mode() local
1374 vsi = i40e_find_vsi_from_id(pf, vsi_id); in i40e_config_vf_promiscuous_mode()
1437 struct i40e_pf *pf = vf->pf; in i40e_trigger_vf_reset() local
1438 struct i40e_hw *hw = &pf->hw; in i40e_trigger_vf_reset()
1464 dev_info(&pf->pdev->dev, in i40e_trigger_vf_reset()
1483 dev_err(&pf->pdev->dev, "VF %d PCI transactions stuck\n", in i40e_trigger_vf_reset()
1497 struct i40e_pf *pf = vf->pf; in i40e_cleanup_reset_vf() local
1498 struct i40e_hw *hw = &pf->hw; in i40e_cleanup_reset_vf()
1530 i40e_notify_client_of_vf_reset(pf, abs_vf_id); in i40e_cleanup_reset_vf()
1551 struct i40e_pf *pf = vf->pf; in i40e_reset_vf() local
1552 struct i40e_hw *hw = &pf->hw; in i40e_reset_vf()
1557 if (test_bit(__I40E_VF_RESETS_DISABLED, pf->state)) in i40e_reset_vf()
1561 if (test_bit(__I40E_VF_DISABLE, pf->state)) in i40e_reset_vf()
1591 dev_err(&pf->pdev->dev, "VF reset check timeout on VF %d\n", in i40e_reset_vf()
1597 i40e_vsi_stop_rings(pf->vsi[vf->lan_vsi_idx]); in i40e_reset_vf()
1620 bool i40e_reset_all_vfs(struct i40e_pf *pf, bool flr) in i40e_reset_all_vfs() argument
1622 struct i40e_hw *hw = &pf->hw; in i40e_reset_all_vfs()
1628 if (!pf->num_alloc_vfs) in i40e_reset_all_vfs()
1632 if (test_and_set_bit(__I40E_VF_DISABLE, pf->state)) in i40e_reset_all_vfs()
1636 for (vf = &pf->vf[0]; vf < &pf->vf[pf->num_alloc_vfs]; ++vf) { in i40e_reset_all_vfs()
1648 for (i = 0, vf = &pf->vf[0]; i < 10 && vf < &pf->vf[pf->num_alloc_vfs]; ++i) { in i40e_reset_all_vfs()
1654 while (vf < &pf->vf[pf->num_alloc_vfs]) { in i40e_reset_all_vfs()
1674 if (vf < &pf->vf[pf->num_alloc_vfs]) in i40e_reset_all_vfs()
1675 dev_err(&pf->pdev->dev, "VF reset check timeout on VF %d\n", in i40e_reset_all_vfs()
1682 for (vf = &pf->vf[0]; vf < &pf->vf[pf->num_alloc_vfs]; ++vf) { in i40e_reset_all_vfs()
1691 i40e_vsi_stop_rings_no_wait(pf->vsi[vf->lan_vsi_idx]); in i40e_reset_all_vfs()
1697 for (vf = &pf->vf[0]; vf < &pf->vf[pf->num_alloc_vfs]; ++vf) { in i40e_reset_all_vfs()
1706 i40e_vsi_wait_queues_disabled(pf->vsi[vf->lan_vsi_idx]); in i40e_reset_all_vfs()
1715 for (vf = &pf->vf[0]; vf < &pf->vf[pf->num_alloc_vfs]; ++vf) { in i40e_reset_all_vfs()
1725 clear_bit(__I40E_VF_DISABLE, pf->state); in i40e_reset_all_vfs()
1736 void i40e_free_vfs(struct i40e_pf *pf) in i40e_free_vfs() argument
1738 struct i40e_hw *hw = &pf->hw; in i40e_free_vfs()
1742 if (!pf->vf) in i40e_free_vfs()
1745 set_bit(__I40E_VFS_RELEASING, pf->state); in i40e_free_vfs()
1746 while (test_and_set_bit(__I40E_VF_DISABLE, pf->state)) in i40e_free_vfs()
1749 i40e_notify_client_of_vf_enable(pf, 0); in i40e_free_vfs()
1755 if (!pci_vfs_assigned(pf->pdev)) in i40e_free_vfs()
1756 pci_disable_sriov(pf->pdev); in i40e_free_vfs()
1758 dev_warn(&pf->pdev->dev, "VFs are assigned - not disabling SR-IOV\n"); in i40e_free_vfs()
1761 for (i = 0; i < pf->num_alloc_vfs; i++) { in i40e_free_vfs()
1762 if (test_bit(I40E_VF_STATE_INIT, &pf->vf[i].vf_states)) in i40e_free_vfs()
1765 i40e_vsi_stop_rings_no_wait(pf->vsi[pf->vf[i].lan_vsi_idx]); in i40e_free_vfs()
1768 for (i = 0; i < pf->num_alloc_vfs; i++) { in i40e_free_vfs()
1769 if (test_bit(I40E_VF_STATE_INIT, &pf->vf[i].vf_states)) in i40e_free_vfs()
1772 i40e_vsi_wait_queues_disabled(pf->vsi[pf->vf[i].lan_vsi_idx]); in i40e_free_vfs()
1776 tmp = pf->num_alloc_vfs; in i40e_free_vfs()
1777 pf->num_alloc_vfs = 0; in i40e_free_vfs()
1779 if (test_bit(I40E_VF_STATE_INIT, &pf->vf[i].vf_states)) in i40e_free_vfs()
1780 i40e_free_vf_res(&pf->vf[i]); in i40e_free_vfs()
1782 i40e_disable_vf_mappings(&pf->vf[i]); in i40e_free_vfs()
1785 kfree(pf->vf); in i40e_free_vfs()
1786 pf->vf = NULL; in i40e_free_vfs()
1792 if (!pci_vfs_assigned(pf->pdev)) { in i40e_free_vfs()
1802 clear_bit(__I40E_VF_DISABLE, pf->state); in i40e_free_vfs()
1803 clear_bit(__I40E_VFS_RELEASING, pf->state); in i40e_free_vfs()
1814 int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs) in i40e_alloc_vfs() argument
1820 i40e_irq_dynamic_disable_icr0(pf); in i40e_alloc_vfs()
1823 if (pci_num_vf(pf->pdev) != num_alloc_vfs) { in i40e_alloc_vfs()
1824 ret = pci_enable_sriov(pf->pdev, num_alloc_vfs); in i40e_alloc_vfs()
1826 clear_bit(I40E_FLAG_VEB_MODE_ENA, pf->flags); in i40e_alloc_vfs()
1827 pf->num_alloc_vfs = 0; in i40e_alloc_vfs()
1837 pf->vf = vfs; in i40e_alloc_vfs()
1841 vfs[i].pf = pf; in i40e_alloc_vfs()
1852 pf->num_alloc_vfs = num_alloc_vfs; in i40e_alloc_vfs()
1855 i40e_reset_all_vfs(pf, false); in i40e_alloc_vfs()
1857 i40e_notify_client_of_vf_enable(pf, num_alloc_vfs); in i40e_alloc_vfs()
1861 i40e_free_vfs(pf); in i40e_alloc_vfs()
1864 i40e_irq_dynamic_enable_icr0(pf); in i40e_alloc_vfs()
1879 struct i40e_pf *pf = pci_get_drvdata(pdev); in i40e_pci_sriov_enable() local
1883 if (test_bit(__I40E_TESTING, pf->state)) { in i40e_pci_sriov_enable()
1891 i40e_free_vfs(pf); in i40e_pci_sriov_enable()
1895 if (num_vfs > pf->num_req_vfs) { in i40e_pci_sriov_enable()
1897 num_vfs, pf->num_req_vfs); in i40e_pci_sriov_enable()
1903 err = i40e_alloc_vfs(pf, num_vfs); in i40e_pci_sriov_enable()
1928 struct i40e_pf *pf = pci_get_drvdata(pdev); in i40e_pci_sriov_configure() local
1931 if (test_and_set_bit(__I40E_VIRTCHNL_OP_PENDING, pf->state)) { in i40e_pci_sriov_configure()
1937 if (!test_bit(I40E_FLAG_VEB_MODE_ENA, pf->flags)) { in i40e_pci_sriov_configure()
1938 set_bit(I40E_FLAG_VEB_MODE_ENA, pf->flags); in i40e_pci_sriov_configure()
1939 i40e_do_reset_safe(pf, I40E_PF_RESET_AND_REBUILD_FLAG); in i40e_pci_sriov_configure()
1945 if (!pci_vfs_assigned(pf->pdev)) { in i40e_pci_sriov_configure()
1946 i40e_free_vfs(pf); in i40e_pci_sriov_configure()
1947 clear_bit(I40E_FLAG_VEB_MODE_ENA, pf->flags); in i40e_pci_sriov_configure()
1948 i40e_do_reset_safe(pf, I40E_PF_RESET_AND_REBUILD_FLAG); in i40e_pci_sriov_configure()
1955 clear_bit(__I40E_VIRTCHNL_OP_PENDING, pf->state); in i40e_pci_sriov_configure()
1974 struct i40e_pf *pf; in i40e_vc_send_msg_to_vf() local
1980 if (!vf || vf->vf_id >= vf->pf->num_alloc_vfs) in i40e_vc_send_msg_to_vf()
1983 pf = vf->pf; in i40e_vc_send_msg_to_vf()
1984 hw = &pf->hw; in i40e_vc_send_msg_to_vf()
1990 dev_info(&pf->pdev->dev, in i40e_vc_send_msg_to_vf()
1992 vf->vf_id, pf->hw.aq.asq_last_status); in i40e_vc_send_msg_to_vf()
2068 struct i40e_pf *pf = vf->pf; in i40e_del_qch() local
2076 i40e_vsi_release(pf->vsi[vf->ch[i].vsi_idx]); in i40e_del_qch()
2094 u16 max_frame_size = vf->pf->hw.phy.link_info.max_frame_size; in i40e_vc_get_max_frame_size()
2112 struct i40e_pf *pf = vf->pf; in i40e_vc_get_vf_resources_msg() local
2140 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_get_vf_resources_msg()
2144 if (i40e_vf_client_capable(pf, vf->vf_id) && in i40e_vc_get_vf_resources_msg()
2155 if (test_bit(I40E_HW_CAP_RSS_AQ, pf->hw.caps) && in i40e_vc_get_vf_resources_msg()
2162 if (test_bit(I40E_HW_CAP_MULTI_TCP_UDP_RSS_PCTYPE, pf->hw.caps)) { in i40e_vc_get_vf_resources_msg()
2171 if (test_bit(I40E_HW_CAP_OUTER_UDP_CSUM, pf->hw.caps) && in i40e_vc_get_vf_resources_msg()
2176 if (test_bit(I40E_FLAG_MFP_ENA, pf->flags)) { in i40e_vc_get_vf_resources_msg()
2177 dev_err(&pf->pdev->dev, in i40e_vc_get_vf_resources_msg()
2186 if (test_bit(I40E_HW_CAP_WB_ON_ITR, pf->hw.caps)) { in i40e_vc_get_vf_resources_msg()
2200 vfres->max_vectors = pf->hw.func_caps.num_msix_vectors_vf; in i40e_vc_get_vf_resources_msg()
2244 struct i40e_pf *pf = vf->pf; in i40e_vc_config_promiscuous_mode_msg() local
2254 dev_err(&pf->pdev->dev, in i40e_vc_config_promiscuous_mode_msg()
2289 dev_info(&pf->pdev->dev, in i40e_vc_config_promiscuous_mode_msg()
2294 dev_info(&pf->pdev->dev, in i40e_vc_config_promiscuous_mode_msg()
2301 dev_info(&pf->pdev->dev, in i40e_vc_config_promiscuous_mode_msg()
2306 dev_info(&pf->pdev->dev, in i40e_vc_config_promiscuous_mode_msg()
2331 struct i40e_pf *pf = vf->pf; in i40e_vc_config_queues_msg() local
2421 pf->vsi[vf->lan_vsi_idx]->num_queue_pairs = in i40e_vc_config_queues_msg()
2425 vsi = pf->vsi[vf->ch[i].vsi_idx]; in i40e_vc_config_queues_msg()
2492 vf->pf->hw.func_caps.num_msix_vectors_vf) { in i40e_vc_config_irq_map_msg()
2534 struct i40e_pf *pf = vsi->back; in i40e_ctrl_vf_tx_rings() local
2539 ret = i40e_control_wait_tx_q(vsi->seid, pf, in i40e_ctrl_vf_tx_rings()
2557 struct i40e_pf *pf = vsi->back; in i40e_ctrl_vf_rx_rings() local
2562 ret = i40e_control_wait_rx_q(pf, vsi->base_queue + q_id, in i40e_ctrl_vf_rx_rings()
2597 struct i40e_pf *pf = vf->pf; in i40e_vc_enable_queues_msg() local
2603 dev_info(&pf->pdev->dev, in i40e_vc_enable_queues_msg()
2625 if (i40e_ctrl_vf_rx_rings(pf->vsi[vf->lan_vsi_idx], vqs->rx_queues, in i40e_vc_enable_queues_msg()
2630 if (i40e_ctrl_vf_tx_rings(pf->vsi[vf->lan_vsi_idx], vqs->tx_queues, in i40e_vc_enable_queues_msg()
2640 if (i40e_vsi_start_rings(pf->vsi[vf->ch[i].vsi_idx])) in i40e_vc_enable_queues_msg()
2663 struct i40e_pf *pf = vf->pf; in i40e_vc_disable_queues_msg() local
2682 if (i40e_ctrl_vf_tx_rings(pf->vsi[vf->lan_vsi_idx], vqs->tx_queues, in i40e_vc_disable_queues_msg()
2687 if (i40e_ctrl_vf_rx_rings(pf->vsi[vf->lan_vsi_idx], vqs->rx_queues, in i40e_vc_disable_queues_msg()
2709 struct i40e_pf *pf = vf->pf; in i40e_check_enough_queue() local
2712 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_check_enough_queue()
2719 pile = pf->qp_pile; in i40e_check_enough_queue()
2767 struct i40e_pf *pf = vf->pf; in i40e_vc_request_queues_msg() local
2773 dev_err(&pf->pdev->dev, in i40e_vc_request_queues_msg()
2778 } else if (req_pairs - cur_pairs > pf->queues_left) { in i40e_vc_request_queues_msg()
2779 dev_warn(&pf->pdev->dev, in i40e_vc_request_queues_msg()
2783 pf->queues_left); in i40e_vc_request_queues_msg()
2784 vfres->num_queue_pairs = pf->queues_left + cur_pairs; in i40e_vc_request_queues_msg()
2786 dev_warn(&pf->pdev->dev, in i40e_vc_request_queues_msg()
2813 struct i40e_pf *pf = vf->pf; in i40e_vc_get_stats_msg() local
2830 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_get_stats_msg()
2897 struct i40e_pf *pf = vf->pf; in i40e_check_vf_permission() local
2898 struct i40e_vsi *vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_check_vf_permission()
2899 struct i40e_hw *hw = &pf->hw; in i40e_check_vf_permission()
2909 dev_err(&pf->pdev->dev, "invalid VF MAC addr %pM\n", in i40e_check_vf_permission()
2924 dev_err(&pf->pdev->dev, in i40e_check_vf_permission()
2942 dev_err(&pf->pdev->dev, in i40e_check_vf_permission()
2953 I40E_VC_MAX_MACVLAN_PER_TRUSTED_VF(pf->num_alloc_vfs, in i40e_check_vf_permission()
2955 dev_err(&pf->pdev->dev, in i40e_check_vf_permission()
3040 struct i40e_pf *pf = vf->pf; in i40e_vc_add_mac_addr_msg() local
3051 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_add_mac_addr_msg()
3073 dev_err(&pf->pdev->dev, in i40e_vc_add_mac_addr_msg()
3088 dev_err(&pf->pdev->dev, "Unable to program VF %d MAC filters, error %d\n", in i40e_vc_add_mac_addr_msg()
3109 struct i40e_pf *pf = vf->pf; in i40e_vc_del_mac_addr_msg() local
3123 dev_err(&pf->pdev->dev, "Invalid MAC addr %pM for VF %d\n", in i40e_vc_del_mac_addr_msg()
3129 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_del_mac_addr_msg()
3161 dev_err(&pf->pdev->dev, "Unable to program VF %d MAC filters, error %d\n", in i40e_vc_del_mac_addr_msg()
3196 struct i40e_pf *pf = vf->pf; in i40e_vc_add_vlan_msg() local
3203 dev_err(&pf->pdev->dev, in i40e_vc_add_vlan_msg()
3216 dev_err(&pf->pdev->dev, in i40e_vc_add_vlan_msg()
3221 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_add_vlan_msg()
3235 i40e_aq_set_vsi_uc_promisc_on_vlan(&pf->hw, vsi->seid, in i40e_vc_add_vlan_msg()
3240 i40e_aq_set_vsi_mc_promisc_on_vlan(&pf->hw, vsi->seid, in i40e_vc_add_vlan_msg()
3246 dev_err(&pf->pdev->dev, in i40e_vc_add_vlan_msg()
3267 struct i40e_pf *pf = vf->pf; in i40e_vc_remove_vlan_msg() local
3285 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_remove_vlan_msg()
3297 i40e_aq_set_vsi_uc_promisc_on_vlan(&pf->hw, vsi->seid, in i40e_vc_remove_vlan_msg()
3302 i40e_aq_set_vsi_mc_promisc_on_vlan(&pf->hw, vsi->seid, in i40e_vc_remove_vlan_msg()
3323 struct i40e_pf *pf = vf->pf; in i40e_vc_rdma_msg() local
3334 main_vsi = i40e_pf_get_main_vsi(pf); in i40e_vc_rdma_msg()
3335 abs_vf_id = vf->vf_id + pf->hw.func_caps.vf_base_id; in i40e_vc_rdma_msg()
3390 struct i40e_pf *pf = vf->pf; in i40e_vc_config_rss_key() local
3401 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_config_rss_key()
3420 struct i40e_pf *pf = vf->pf; in i40e_vc_config_rss_lut() local
3438 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_config_rss_lut()
3456 struct i40e_pf *pf = vf->pf; in i40e_vc_get_rss_hashcfg() local
3472 vrh->hashcfg = i40e_pf_get_default_rss_hashcfg(pf); in i40e_vc_get_rss_hashcfg()
3492 struct i40e_pf *pf = vf->pf; in i40e_vc_set_rss_hashcfg() local
3493 struct i40e_hw *hw = &pf->hw; in i40e_vc_set_rss_hashcfg()
3527 vsi = vf->pf->vsi[vf->lan_vsi_idx]; in i40e_vc_enable_vlan_stripping()
3553 vsi = vf->pf->vsi[vf->lan_vsi_idx]; in i40e_vc_disable_vlan_stripping()
3574 struct i40e_pf *pf = vf->pf; in i40e_validate_cloud_filter() local
3582 dev_info(&pf->pdev->dev, in i40e_validate_cloud_filter()
3591 dev_info(&pf->pdev->dev, "VF %d: Invalid TC number %u\n", in i40e_validate_cloud_filter()
3606 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_validate_cloud_filter()
3610 dev_info(&pf->pdev->dev, in i40e_validate_cloud_filter()
3625 dev_info(&pf->pdev->dev, in i40e_validate_cloud_filter()
3634 dev_err(&pf->pdev->dev, in i40e_validate_cloud_filter()
3644 dev_info(&pf->pdev->dev, "VF %d: Invalid Dest MAC addr %pM\n", in i40e_validate_cloud_filter()
3653 dev_info(&pf->pdev->dev, "VF %d: Invalid Source MAC addr %pM\n", in i40e_validate_cloud_filter()
3661 dev_info(&pf->pdev->dev, "VF %d: Invalid Dest port\n", in i40e_validate_cloud_filter()
3669 dev_info(&pf->pdev->dev, "VF %d: Invalid Source port\n", in i40e_validate_cloud_filter()
3677 dev_info(&pf->pdev->dev, "VF %d: Invalid Flow type\n", in i40e_validate_cloud_filter()
3684 dev_info(&pf->pdev->dev, "VF %d: invalid VLAN ID\n", in i40e_validate_cloud_filter()
3702 struct i40e_pf *pf = vf->pf; in i40e_find_vsi_from_seid() local
3707 vsi = i40e_find_vsi_from_id(pf, vf->ch[i].vsi_id); in i40e_find_vsi_from_seid()
3723 struct i40e_pf *pf = vf->pf; in i40e_del_all_cloud_filters() local
3733 dev_err(&pf->pdev->dev, "VF %d: no VSI found for matching %u seid, can't delete cloud filter\n", in i40e_del_all_cloud_filters()
3744 dev_err(&pf->pdev->dev, in i40e_del_all_cloud_filters()
3747 libie_aq_str(pf->hw.aq.asq_last_status)); in i40e_del_all_cloud_filters()
3768 struct i40e_pf *pf = vf->pf; in i40e_vc_del_cloud_filter() local
3780 dev_info(&pf->pdev->dev, in i40e_vc_del_cloud_filter()
3788 dev_info(&pf->pdev->dev, in i40e_vc_del_cloud_filter()
3831 dev_info(&pf->pdev->dev, "VF %d: Flow type not configured\n", in i40e_vc_del_cloud_filter()
3836 vsi = pf->vsi[vf->ch[vcf->action_meta].vsi_idx]; in i40e_vc_del_cloud_filter()
3846 dev_err(&pf->pdev->dev, in i40e_vc_del_cloud_filter()
3849 libie_aq_str(pf->hw.aq.asq_last_status)); in i40e_vc_del_cloud_filter()
3900 struct i40e_pf *pf = vf->pf; in i40e_vc_add_cloud_filter() local
3911 dev_info(&pf->pdev->dev, in i40e_vc_add_cloud_filter()
3919 dev_info(&pf->pdev->dev, in i40e_vc_add_cloud_filter()
3967 dev_info(&pf->pdev->dev, "VF %d: Flow type not configured\n", in i40e_vc_add_cloud_filter()
3972 vsi = pf->vsi[vf->ch[vcf->action_meta].vsi_idx]; in i40e_vc_add_cloud_filter()
3982 dev_err(&pf->pdev->dev, in i40e_vc_add_cloud_filter()
3985 libie_aq_str(pf->hw.aq.asq_last_status)); in i40e_vc_add_cloud_filter()
4010 struct i40e_pf *pf = vf->pf; in i40e_vc_add_qch_msg() local
4011 struct i40e_link_status *ls = &pf->hw.phy.link_info; in i40e_vc_add_qch_msg()
4023 dev_err(&pf->pdev->dev, in i40e_vc_add_qch_msg()
4030 dev_err(&pf->pdev->dev, in i40e_vc_add_qch_msg()
4039 dev_err(&pf->pdev->dev, in i40e_vc_add_qch_msg()
4050 dev_err(&pf->pdev->dev, in i40e_vc_add_qch_msg()
4061 if (pf->queues_left < adq_request_qps) { in i40e_vc_add_qch_msg()
4062 dev_err(&pf->pdev->dev, in i40e_vc_add_qch_msg()
4078 dev_err(&pf->pdev->dev, in i40e_vc_add_qch_msg()
4089 dev_err(&pf->pdev->dev, in i40e_vc_add_qch_msg()
4124 struct i40e_pf *pf = vf->pf; in i40e_vc_del_qch_msg() local
4137 dev_info(&pf->pdev->dev, in i40e_vc_del_qch_msg()
4141 dev_info(&pf->pdev->dev, "VF %d trying to delete queue channels but ADq isn't enabled\n", in i40e_vc_del_qch_msg()
4168 int i40e_vc_process_vf_msg(struct i40e_pf *pf, s16 vf_id, u32 v_opcode, in i40e_vc_process_vf_msg() argument
4171 struct i40e_hw *hw = &pf->hw; in i40e_vc_process_vf_msg()
4176 pf->vf_aq_requests++; in i40e_vc_process_vf_msg()
4177 if (local_vf_id < 0 || local_vf_id >= pf->num_alloc_vfs) in i40e_vc_process_vf_msg()
4179 vf = &(pf->vf[local_vf_id]); in i40e_vc_process_vf_msg()
4190 dev_err(&pf->pdev->dev, "Invalid message from VF %d, opcode %d, len %d\n", in i40e_vc_process_vf_msg()
4282 dev_err(&pf->pdev->dev, "Unsupported opcode %d from VF %d\n", in i40e_vc_process_vf_msg()
4299 int i40e_vc_process_vflr_event(struct i40e_pf *pf) in i40e_vc_process_vflr_event() argument
4301 struct i40e_hw *hw = &pf->hw; in i40e_vc_process_vflr_event()
4306 if (!test_bit(__I40E_VFLR_EVENT_PENDING, pf->state)) in i40e_vc_process_vflr_event()
4319 clear_bit(__I40E_VFLR_EVENT_PENDING, pf->state); in i40e_vc_process_vflr_event()
4320 for (vf_id = 0; vf_id < pf->num_alloc_vfs; vf_id++) { in i40e_vc_process_vflr_event()
4324 vf = &pf->vf[vf_id]; in i40e_vc_process_vflr_event()
4330 set_bit(__I40E_VFLR_EVENT_PENDING, pf->state); in i40e_vc_process_vflr_event()
4346 static int i40e_validate_vf(struct i40e_pf *pf, int vf_id) in i40e_validate_vf() argument
4352 if (vf_id >= pf->num_alloc_vfs) { in i40e_validate_vf()
4353 dev_err(&pf->pdev->dev, in i40e_validate_vf()
4358 vf = &pf->vf[vf_id]; in i40e_validate_vf()
4359 vsi = i40e_find_vsi_from_id(pf, vf->lan_vsi_id); in i40e_validate_vf()
4390 dev_err(&vf->pf->pdev->dev, in i40e_check_vf_init_timeout()
4410 struct i40e_pf *pf = vsi->back; in i40e_ndo_set_vf_mac() local
4417 if (test_and_set_bit(__I40E_VIRTCHNL_OP_PENDING, pf->state)) { in i40e_ndo_set_vf_mac()
4418 dev_warn(&pf->pdev->dev, "Unable to configure VFs, other operation is pending.\n"); in i40e_ndo_set_vf_mac()
4423 ret = i40e_validate_vf(pf, vf_id); in i40e_ndo_set_vf_mac()
4427 vf = &pf->vf[vf_id]; in i40e_ndo_set_vf_mac()
4432 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_ndo_set_vf_mac()
4435 dev_err(&pf->pdev->dev, in i40e_ndo_set_vf_mac()
4460 dev_err(&pf->pdev->dev, "Unable to program ucast filters\n"); in i40e_ndo_set_vf_mac()
4468 dev_info(&pf->pdev->dev, "Removing MAC on VF %d\n", vf_id); in i40e_ndo_set_vf_mac()
4471 dev_info(&pf->pdev->dev, "Setting MAC %pM on VF %d\n", in i40e_ndo_set_vf_mac()
4479 dev_info(&pf->pdev->dev, "Bring down and up the VF interface to make this change effective.\n"); in i40e_ndo_set_vf_mac()
4482 clear_bit(__I40E_VIRTCHNL_OP_PENDING, pf->state); in i40e_ndo_set_vf_mac()
4502 struct i40e_pf *pf = np->vsi->back; in i40e_ndo_set_vf_port_vlan() local
4507 if (test_and_set_bit(__I40E_VIRTCHNL_OP_PENDING, pf->state)) { in i40e_ndo_set_vf_port_vlan()
4508 dev_warn(&pf->pdev->dev, "Unable to configure VFs, other operation is pending.\n"); in i40e_ndo_set_vf_port_vlan()
4513 ret = i40e_validate_vf(pf, vf_id); in i40e_ndo_set_vf_port_vlan()
4518 dev_err(&pf->pdev->dev, "Invalid VF Parameters\n"); in i40e_ndo_set_vf_port_vlan()
4524 dev_err(&pf->pdev->dev, "VF VLAN protocol is not supported\n"); in i40e_ndo_set_vf_port_vlan()
4529 vf = &pf->vf[vf_id]; in i40e_ndo_set_vf_port_vlan()
4534 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_ndo_set_vf_port_vlan()
4578 dev_err(&pf->pdev->dev, "Unable to config VF promiscuous mode\n"); in i40e_ndo_set_vf_port_vlan()
4589 dev_info(&pf->pdev->dev, "Setting VLAN %d, QOS 0x%x on VF %d\n", in i40e_ndo_set_vf_port_vlan()
4618 dev_err(&pf->pdev->dev, "Unable to update VF vsi context\n"); in i40e_ndo_set_vf_port_vlan()
4629 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_ndo_set_vf_port_vlan()
4633 dev_err(&pf->pdev->dev, "Unable to config vf promiscuous mode\n"); in i40e_ndo_set_vf_port_vlan()
4640 clear_bit(__I40E_VIRTCHNL_OP_PENDING, pf->state); in i40e_ndo_set_vf_port_vlan()
4657 struct i40e_pf *pf = np->vsi->back; in i40e_ndo_set_vf_bw() local
4662 if (test_and_set_bit(__I40E_VIRTCHNL_OP_PENDING, pf->state)) { in i40e_ndo_set_vf_bw()
4663 dev_warn(&pf->pdev->dev, "Unable to configure VFs, other operation is pending.\n"); in i40e_ndo_set_vf_bw()
4668 ret = i40e_validate_vf(pf, vf_id); in i40e_ndo_set_vf_bw()
4673 dev_err(&pf->pdev->dev, "Invalid min tx rate (%d) (greater than 0) specified for VF %d.\n", in i40e_ndo_set_vf_bw()
4679 vf = &pf->vf[vf_id]; in i40e_ndo_set_vf_bw()
4684 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_ndo_set_vf_bw()
4692 clear_bit(__I40E_VIRTCHNL_OP_PENDING, pf->state); in i40e_ndo_set_vf_bw()
4709 struct i40e_pf *pf = vsi->back; in i40e_ndo_get_vf_config() local
4713 if (test_and_set_bit(__I40E_VIRTCHNL_OP_PENDING, pf->state)) { in i40e_ndo_get_vf_config()
4714 dev_warn(&pf->pdev->dev, "Unable to configure VFs, other operation is pending.\n"); in i40e_ndo_get_vf_config()
4719 ret = i40e_validate_vf(pf, vf_id); in i40e_ndo_get_vf_config()
4723 vf = &pf->vf[vf_id]; in i40e_ndo_get_vf_config()
4725 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_ndo_get_vf_config()
4750 clear_bit(__I40E_VIRTCHNL_OP_PENDING, pf->state); in i40e_ndo_get_vf_config()
4765 struct i40e_pf *pf = np->vsi->back; in i40e_ndo_set_vf_link_state() local
4766 struct i40e_link_status *ls = &pf->hw.phy.link_info; in i40e_ndo_set_vf_link_state()
4768 struct i40e_hw *hw = &pf->hw; in i40e_ndo_set_vf_link_state()
4776 if (test_and_set_bit(__I40E_VIRTCHNL_OP_PENDING, pf->state)) { in i40e_ndo_set_vf_link_state()
4777 dev_warn(&pf->pdev->dev, "Unable to configure VFs, other operation is pending.\n"); in i40e_ndo_set_vf_link_state()
4782 if (vf_id >= pf->num_alloc_vfs) { in i40e_ndo_set_vf_link_state()
4783 dev_err(&pf->pdev->dev, "Invalid VF Identifier %d\n", vf_id); in i40e_ndo_set_vf_link_state()
4788 vf = &pf->vf[vf_id]; in i40e_ndo_set_vf_link_state()
4815 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_ndo_set_vf_link_state()
4839 clear_bit(__I40E_VIRTCHNL_OP_PENDING, pf->state); in i40e_ndo_set_vf_link_state()
4855 struct i40e_pf *pf = vsi->back; in i40e_ndo_set_vf_spoofchk() local
4857 struct i40e_hw *hw = &pf->hw; in i40e_ndo_set_vf_spoofchk()
4861 if (test_and_set_bit(__I40E_VIRTCHNL_OP_PENDING, pf->state)) { in i40e_ndo_set_vf_spoofchk()
4862 dev_warn(&pf->pdev->dev, "Unable to configure VFs, other operation is pending.\n"); in i40e_ndo_set_vf_spoofchk()
4867 if (vf_id >= pf->num_alloc_vfs) { in i40e_ndo_set_vf_spoofchk()
4868 dev_err(&pf->pdev->dev, "Invalid VF Identifier %d\n", vf_id); in i40e_ndo_set_vf_spoofchk()
4873 vf = &(pf->vf[vf_id]); in i40e_ndo_set_vf_spoofchk()
4884 ctxt.seid = pf->vsi[vf->lan_vsi_idx]->seid; in i40e_ndo_set_vf_spoofchk()
4885 ctxt.pf_num = pf->hw.pf_id; in i40e_ndo_set_vf_spoofchk()
4892 dev_err(&pf->pdev->dev, "Error %d updating VSI parameters\n", in i40e_ndo_set_vf_spoofchk()
4897 clear_bit(__I40E_VIRTCHNL_OP_PENDING, pf->state); in i40e_ndo_set_vf_spoofchk()
4912 struct i40e_pf *pf = np->vsi->back; in i40e_ndo_set_vf_trust() local
4916 if (test_and_set_bit(__I40E_VIRTCHNL_OP_PENDING, pf->state)) { in i40e_ndo_set_vf_trust()
4917 dev_warn(&pf->pdev->dev, "Unable to configure VFs, other operation is pending.\n"); in i40e_ndo_set_vf_trust()
4922 if (vf_id >= pf->num_alloc_vfs) { in i40e_ndo_set_vf_trust()
4923 dev_err(&pf->pdev->dev, "Invalid VF Identifier %d\n", vf_id); in i40e_ndo_set_vf_trust()
4928 if (test_bit(I40E_FLAG_MFP_ENA, pf->flags)) { in i40e_ndo_set_vf_trust()
4929 dev_err(&pf->pdev->dev, "Trusted VF not supported in MFP mode.\n"); in i40e_ndo_set_vf_trust()
4934 vf = &pf->vf[vf_id]; in i40e_ndo_set_vf_trust()
4942 set_bit(__I40E_MACVLAN_SYNC_PENDING, pf->state); in i40e_ndo_set_vf_trust()
4943 pf->vsi[vf->lan_vsi_idx]->flags |= I40E_VSI_FLAG_FILTER_CHANGED; in i40e_ndo_set_vf_trust()
4946 dev_info(&pf->pdev->dev, "VF %u is now %strusted\n", in i40e_ndo_set_vf_trust()
4951 dev_info(&pf->pdev->dev, in i40e_ndo_set_vf_trust()
4959 clear_bit(__I40E_VIRTCHNL_OP_PENDING, pf->state); in i40e_ndo_set_vf_trust()
4973 struct i40e_pf *pf = np->vsi->back; in i40e_get_vf_stats() local
4979 if (i40e_validate_vf(pf, vf_id)) in i40e_get_vf_stats()
4982 vf = &pf->vf[vf_id]; in i40e_get_vf_stats()
4984 dev_err(&pf->pdev->dev, "VF %d in reset. Try again.\n", vf_id); in i40e_get_vf_stats()
4988 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_get_vf_stats()