Lines Matching refs:vf
24 struct i40e_vf *vf = pf->vf; in i40e_vc_vf_broadcast() local
27 for (i = 0; i < pf->num_alloc_vfs; i++, vf++) { in i40e_vc_vf_broadcast()
28 int abs_vf_id = vf->vf_id + (int)hw->func_caps.vf_base_id; in i40e_vc_vf_broadcast()
30 if (!test_bit(I40E_VF_STATE_INIT, &vf->vf_states) && in i40e_vc_vf_broadcast()
31 !test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) in i40e_vc_vf_broadcast()
83 static void i40e_set_vf_link_state(struct i40e_vf *vf, in i40e_set_vf_link_state() argument
88 if (vf->link_forced) in i40e_set_vf_link_state()
89 link_status = vf->link_up; in i40e_set_vf_link_state()
91 if (vf->driver_caps & VIRTCHNL_VF_CAP_ADV_LINK_SPEED) { in i40e_set_vf_link_state()
108 static void i40e_vc_notify_vf_link_state(struct i40e_vf *vf) in i40e_vc_notify_vf_link_state() argument
111 struct i40e_pf *pf = vf->pf; in i40e_vc_notify_vf_link_state()
114 int abs_vf_id = vf->vf_id + (int)hw->func_caps.vf_base_id; in i40e_vc_notify_vf_link_state()
119 i40e_set_vf_link_state(vf, &pfe, ls); in i40e_vc_notify_vf_link_state()
136 i40e_vc_notify_vf_link_state(&pf->vf[i]); in i40e_vc_notify_link_state()
161 void i40e_vc_notify_vf_reset(struct i40e_vf *vf) in i40e_vc_notify_vf_reset() argument
167 if (!vf || vf->vf_id >= vf->pf->num_alloc_vfs) in i40e_vc_notify_vf_reset()
171 if (!test_bit(I40E_VF_STATE_INIT, &vf->vf_states) && in i40e_vc_notify_vf_reset()
172 !test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) in i40e_vc_notify_vf_reset()
175 abs_vf_id = vf->vf_id + (int)vf->pf->hw.func_caps.vf_base_id; in i40e_vc_notify_vf_reset()
179 i40e_aq_send_msg_to_vf(&vf->pf->hw, abs_vf_id, VIRTCHNL_OP_EVENT, in i40e_vc_notify_vf_reset()
191 static void i40e_vc_reset_vf(struct i40e_vf *vf, bool notify_vf) in i40e_vc_reset_vf() argument
193 struct i40e_pf *pf = vf->pf; in i40e_vc_reset_vf()
197 i40e_vc_notify_vf_reset(vf); in i40e_vc_reset_vf()
210 if (i40e_reset_vf(vf, false)) in i40e_vc_reset_vf()
216 dev_warn(&vf->pf->pdev->dev, in i40e_vc_reset_vf()
218 vf->vf_id); in i40e_vc_reset_vf()
220 dev_dbg(&vf->pf->pdev->dev, in i40e_vc_reset_vf()
222 vf->vf_id); in i40e_vc_reset_vf()
232 static inline bool i40e_vc_isvalid_vsi_id(struct i40e_vf *vf, u16 vsi_id) in i40e_vc_isvalid_vsi_id() argument
234 struct i40e_pf *pf = vf->pf; in i40e_vc_isvalid_vsi_id()
237 return (vsi && (vsi->vf_id == vf->vf_id)); in i40e_vc_isvalid_vsi_id()
248 static inline bool i40e_vc_isvalid_queue_id(struct i40e_vf *vf, u16 vsi_id, in i40e_vc_isvalid_queue_id() argument
251 struct i40e_pf *pf = vf->pf; in i40e_vc_isvalid_queue_id()
264 static inline bool i40e_vc_isvalid_vector_id(struct i40e_vf *vf, u32 vector_id) in i40e_vc_isvalid_vector_id() argument
266 struct i40e_pf *pf = vf->pf; in i40e_vc_isvalid_vector_id()
281 static u16 i40e_vc_get_pf_queue_id(struct i40e_vf *vf, u16 vsi_id, in i40e_vc_get_pf_queue_id() argument
284 struct i40e_pf *pf = vf->pf; in i40e_vc_get_pf_queue_id()
310 static u16 i40e_get_real_pf_qid(struct i40e_vf *vf, u16 vsi_id, u16 queue_id) in i40e_get_real_pf_qid() argument
314 if (vf->adq_enabled) { in i40e_get_real_pf_qid()
319 for (i = 0; i < vf->num_tc; i++) { in i40e_get_real_pf_qid()
320 if (queue_id < vf->ch[i].num_qps) { in i40e_get_real_pf_qid()
321 vsi_id = vf->ch[i].vsi_id; in i40e_get_real_pf_qid()
327 queue_id -= vf->ch[i].num_qps; in i40e_get_real_pf_qid()
331 return i40e_vc_get_pf_queue_id(vf, vsi_id, queue_id); in i40e_get_real_pf_qid()
342 static void i40e_config_irq_link_list(struct i40e_vf *vf, u16 vsi_id, in i40e_config_irq_link_list() argument
346 struct i40e_pf *pf = vf->pf; in i40e_config_irq_link_list()
357 reg_idx = I40E_VPINT_LNKLST0(vf->vf_id); in i40e_config_irq_link_list()
360 ((pf->hw.func_caps.num_msix_vectors_vf - 1) * vf->vf_id) + in i40e_config_irq_link_list()
387 pf_queue_id = i40e_get_real_pf_qid(vf, vsi_id, vsi_queue_id); in i40e_config_irq_link_list()
410 pf_queue_id = i40e_get_real_pf_qid(vf, in i40e_config_irq_link_list()
430 if ((vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RX_POLLING) && in i40e_config_irq_link_list()
448 static void i40e_release_iwarp_qvlist(struct i40e_vf *vf) in i40e_release_iwarp_qvlist() argument
450 struct i40e_pf *pf = vf->pf; in i40e_release_iwarp_qvlist()
451 struct virtchnl_iwarp_qvlist_info *qvlist_info = vf->qvlist_info; in i40e_release_iwarp_qvlist()
455 if (!vf->qvlist_info) in i40e_release_iwarp_qvlist()
473 reg_idx = (msix_vf - 1) * vf->vf_id + qv_info->ceq_idx; in i40e_release_iwarp_qvlist()
480 reg_idx = ((msix_vf - 1) * vf->vf_id) + (v_idx - 1); in i40e_release_iwarp_qvlist()
489 kfree(vf->qvlist_info); in i40e_release_iwarp_qvlist()
490 vf->qvlist_info = NULL; in i40e_release_iwarp_qvlist()
500 static int i40e_config_iwarp_qvlist(struct i40e_vf *vf, in i40e_config_iwarp_qvlist() argument
503 struct i40e_pf *pf = vf->pf; in i40e_config_iwarp_qvlist()
522 kfree(vf->qvlist_info); in i40e_config_iwarp_qvlist()
523 vf->qvlist_info = kzalloc(struct_size(vf->qvlist_info, qv_info, in i40e_config_iwarp_qvlist()
526 if (!vf->qvlist_info) { in i40e_config_iwarp_qvlist()
530 vf->qvlist_info->num_vectors = qvlist_info->num_vectors; in i40e_config_iwarp_qvlist()
539 if (!i40e_vc_isvalid_vector_id(vf, qv_info->v_idx)) { in i40e_config_iwarp_qvlist()
546 vf->qvlist_info->qv_info[i] = *qv_info; in i40e_config_iwarp_qvlist()
548 reg_idx = ((msix_vf - 1) * vf->vf_id) + (v_idx - 1); in i40e_config_iwarp_qvlist()
560 reg_idx = (msix_vf - 1) * vf->vf_id + qv_info->ceq_idx; in i40e_config_iwarp_qvlist()
568 reg_idx = ((msix_vf - 1) * vf->vf_id) + (v_idx - 1); in i40e_config_iwarp_qvlist()
581 wr32(hw, I40E_VPINT_AEQCTL(vf->vf_id), reg); in i40e_config_iwarp_qvlist()
587 kfree(vf->qvlist_info); in i40e_config_iwarp_qvlist()
588 vf->qvlist_info = NULL; in i40e_config_iwarp_qvlist()
602 static int i40e_config_vsi_tx_queue(struct i40e_vf *vf, u16 vsi_id, in i40e_config_vsi_tx_queue() argument
606 struct i40e_pf *pf = vf->pf; in i40e_config_vsi_tx_queue()
614 if (!i40e_vc_isvalid_vsi_id(vf, info->vsi_id)) { in i40e_config_vsi_tx_queue()
618 pf_queue_id = i40e_vc_get_pf_queue_id(vf, vsi_id, vsi_queue_id); in i40e_config_vsi_tx_queue()
660 qtx_ctl |= (((vf->vf_id + hw->func_caps.vf_base_id) in i40e_config_vsi_tx_queue()
679 static int i40e_config_vsi_rx_queue(struct i40e_vf *vf, u16 vsi_id, in i40e_config_vsi_rx_queue() argument
683 u16 pf_queue_id = i40e_vc_get_pf_queue_id(vf, vsi_id, vsi_queue_id); in i40e_config_vsi_rx_queue()
684 struct i40e_pf *pf = vf->pf; in i40e_config_vsi_rx_queue()
685 struct i40e_vsi *vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_config_vsi_rx_queue()
771 static int i40e_alloc_vsi_res(struct i40e_vf *vf, u8 idx) in i40e_alloc_vsi_res() argument
774 struct i40e_pf *pf = vf->pf; in i40e_alloc_vsi_res()
780 vf->vf_id); in i40e_alloc_vsi_res()
785 vf->vf_id, pf->hw.aq.asq_last_status); in i40e_alloc_vsi_res()
794 vf->lan_vsi_idx = vsi->idx; in i40e_alloc_vsi_res()
795 vf->lan_vsi_id = vsi->id; in i40e_alloc_vsi_res()
802 if (vf->port_vlan_id) in i40e_alloc_vsi_res()
803 i40e_vsi_add_pvid(vsi, vf->port_vlan_id); in i40e_alloc_vsi_res()
806 if (is_valid_ether_addr(vf->default_lan_addr.addr)) { in i40e_alloc_vsi_res()
808 vf->default_lan_addr.addr); in i40e_alloc_vsi_res()
812 vf->default_lan_addr.addr, vf->vf_id); in i40e_alloc_vsi_res()
820 wr32(&pf->hw, I40E_VFQF_HENA1(0, vf->vf_id), (u32)hena); in i40e_alloc_vsi_res()
821 wr32(&pf->hw, I40E_VFQF_HENA1(1, vf->vf_id), (u32)(hena >> 32)); in i40e_alloc_vsi_res()
829 if (vf->adq_enabled) { in i40e_alloc_vsi_res()
830 vf->ch[idx].vsi_idx = vsi->idx; in i40e_alloc_vsi_res()
831 vf->ch[idx].vsi_id = vsi->id; in i40e_alloc_vsi_res()
835 if (vf->tx_rate) { in i40e_alloc_vsi_res()
836 max_tx_rate = vf->tx_rate; in i40e_alloc_vsi_res()
837 } else if (vf->ch[idx].max_tx_rate) { in i40e_alloc_vsi_res()
838 max_tx_rate = vf->ch[idx].max_tx_rate; in i40e_alloc_vsi_res()
847 vf->vf_id, ret); in i40e_alloc_vsi_res()
861 static void i40e_map_pf_queues_to_vsi(struct i40e_vf *vf) in i40e_map_pf_queues_to_vsi() argument
863 struct i40e_pf *pf = vf->pf; in i40e_map_pf_queues_to_vsi()
869 if (vf->adq_enabled) in i40e_map_pf_queues_to_vsi()
870 num_tc = vf->num_tc; in i40e_map_pf_queues_to_vsi()
873 if (vf->adq_enabled) { in i40e_map_pf_queues_to_vsi()
874 qps = vf->ch[i].num_qps; in i40e_map_pf_queues_to_vsi()
875 vsi_id = vf->ch[i].vsi_id; in i40e_map_pf_queues_to_vsi()
877 qps = pf->vsi[vf->lan_vsi_idx]->alloc_queue_pairs; in i40e_map_pf_queues_to_vsi()
878 vsi_id = vf->lan_vsi_id; in i40e_map_pf_queues_to_vsi()
886 u16 qid = i40e_vc_get_pf_queue_id(vf, in i40e_map_pf_queues_to_vsi()
890 qid = i40e_vc_get_pf_queue_id(vf, vsi_id, in i40e_map_pf_queues_to_vsi()
908 static void i40e_map_pf_to_vf_queues(struct i40e_vf *vf) in i40e_map_pf_to_vf_queues() argument
910 struct i40e_pf *pf = vf->pf; in i40e_map_pf_to_vf_queues()
917 if (vf->adq_enabled) in i40e_map_pf_to_vf_queues()
918 num_tc = vf->num_tc; in i40e_map_pf_to_vf_queues()
921 if (vf->adq_enabled) { in i40e_map_pf_to_vf_queues()
922 qps = vf->ch[i].num_qps; in i40e_map_pf_to_vf_queues()
923 vsi_id = vf->ch[i].vsi_id; in i40e_map_pf_to_vf_queues()
925 qps = pf->vsi[vf->lan_vsi_idx]->alloc_queue_pairs; in i40e_map_pf_to_vf_queues()
926 vsi_id = vf->lan_vsi_id; in i40e_map_pf_to_vf_queues()
930 qid = i40e_vc_get_pf_queue_id(vf, vsi_id, j); in i40e_map_pf_to_vf_queues()
933 wr32(hw, I40E_VPLAN_QTABLE(total_qps, vf->vf_id), in i40e_map_pf_to_vf_queues()
946 static void i40e_enable_vf_mappings(struct i40e_vf *vf) in i40e_enable_vf_mappings() argument
948 struct i40e_pf *pf = vf->pf; in i40e_enable_vf_mappings()
956 i40e_write_rx_ctl(hw, I40E_VSILAN_QBASE(vf->lan_vsi_id), in i40e_enable_vf_mappings()
961 wr32(hw, I40E_VPLAN_MAPENA(vf->vf_id), reg); in i40e_enable_vf_mappings()
963 i40e_map_pf_to_vf_queues(vf); in i40e_enable_vf_mappings()
964 i40e_map_pf_queues_to_vsi(vf); in i40e_enable_vf_mappings()
975 static void i40e_disable_vf_mappings(struct i40e_vf *vf) in i40e_disable_vf_mappings() argument
977 struct i40e_pf *pf = vf->pf; in i40e_disable_vf_mappings()
982 wr32(hw, I40E_VPLAN_MAPENA(vf->vf_id), 0); in i40e_disable_vf_mappings()
984 wr32(hw, I40E_VPLAN_QTABLE(i, vf->vf_id), in i40e_disable_vf_mappings()
995 static void i40e_free_vf_res(struct i40e_vf *vf) in i40e_free_vf_res() argument
997 struct i40e_pf *pf = vf->pf; in i40e_free_vf_res()
1005 clear_bit(I40E_VF_STATE_INIT, &vf->vf_states); in i40e_free_vf_res()
1010 if (vf->num_queue_pairs > I40E_DEFAULT_QUEUES_PER_VF) { in i40e_free_vf_res()
1011 pf->queues_left += vf->num_queue_pairs - in i40e_free_vf_res()
1016 if (vf->lan_vsi_idx) { in i40e_free_vf_res()
1017 i40e_vsi_release(pf->vsi[vf->lan_vsi_idx]); in i40e_free_vf_res()
1018 vf->lan_vsi_idx = 0; in i40e_free_vf_res()
1019 vf->lan_vsi_id = 0; in i40e_free_vf_res()
1023 if (vf->adq_enabled && vf->ch[0].vsi_idx) { in i40e_free_vf_res()
1024 for (j = 0; j < vf->num_tc; j++) { in i40e_free_vf_res()
1030 i40e_vsi_release(pf->vsi[vf->ch[j].vsi_idx]); in i40e_free_vf_res()
1031 vf->ch[j].vsi_idx = 0; in i40e_free_vf_res()
1032 vf->ch[j].vsi_id = 0; in i40e_free_vf_res()
1041 reg_idx = I40E_VFINT_DYN_CTL0(vf->vf_id); in i40e_free_vf_res()
1044 (vf->vf_id)) in i40e_free_vf_res()
1054 reg_idx = I40E_VPINT_LNKLST0(vf->vf_id); in i40e_free_vf_res()
1057 (vf->vf_id)) in i40e_free_vf_res()
1065 vf->num_queue_pairs = 0; in i40e_free_vf_res()
1066 clear_bit(I40E_VF_STATE_MC_PROMISC, &vf->vf_states); in i40e_free_vf_res()
1067 clear_bit(I40E_VF_STATE_UC_PROMISC, &vf->vf_states); in i40e_free_vf_res()
1076 static int i40e_alloc_vf_res(struct i40e_vf *vf) in i40e_alloc_vf_res() argument
1078 struct i40e_pf *pf = vf->pf; in i40e_alloc_vf_res()
1082 if (vf->num_req_queues && in i40e_alloc_vf_res()
1083 vf->num_req_queues <= pf->queues_left + I40E_DEFAULT_QUEUES_PER_VF) in i40e_alloc_vf_res()
1084 pf->num_vf_qps = vf->num_req_queues; in i40e_alloc_vf_res()
1089 ret = i40e_alloc_vsi_res(vf, 0); in i40e_alloc_vf_res()
1092 total_queue_pairs += pf->vsi[vf->lan_vsi_idx]->alloc_queue_pairs; in i40e_alloc_vf_res()
1095 if (vf->adq_enabled) { in i40e_alloc_vf_res()
1099 for (idx = 1; idx < vf->num_tc; idx++) { in i40e_alloc_vf_res()
1100 ret = i40e_alloc_vsi_res(vf, idx); in i40e_alloc_vf_res()
1108 vf->vf_id); in i40e_alloc_vf_res()
1109 vf->adq_enabled = false; in i40e_alloc_vf_res()
1122 if (vf->trusted) in i40e_alloc_vf_res()
1123 set_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps); in i40e_alloc_vf_res()
1125 clear_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps); in i40e_alloc_vf_res()
1130 vf->num_queue_pairs = total_queue_pairs; in i40e_alloc_vf_res()
1133 set_bit(I40E_VF_STATE_INIT, &vf->vf_states); in i40e_alloc_vf_res()
1137 i40e_free_vf_res(vf); in i40e_alloc_vf_res()
1151 static int i40e_quiesce_vf_pci(struct i40e_vf *vf) in i40e_quiesce_vf_pci() argument
1153 struct i40e_pf *pf = vf->pf; in i40e_quiesce_vf_pci()
1158 vf_abs_id = vf->vf_id + hw->func_caps.vf_base_id; in i40e_quiesce_vf_pci()
1250 i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable, in i40e_set_vsi_promisc() argument
1254 struct i40e_pf *pf = vf->pf; in i40e_set_vsi_promisc()
1268 vf->vf_id, in i40e_set_vsi_promisc()
1284 vf->vf_id, in i40e_set_vsi_promisc()
1301 vf->vf_id, in i40e_set_vsi_promisc()
1317 vf->vf_id, in i40e_set_vsi_promisc()
1342 static i40e_status i40e_config_vf_promiscuous_mode(struct i40e_vf *vf, in i40e_config_vf_promiscuous_mode() argument
1348 struct i40e_pf *pf = vf->pf; in i40e_config_vf_promiscuous_mode()
1354 if (!i40e_vc_isvalid_vsi_id(vf, vsi_id) || !vsi) in i40e_config_vf_promiscuous_mode()
1357 if (vf->port_vlan_id) { in i40e_config_vf_promiscuous_mode()
1358 aq_ret = i40e_set_vsi_promisc(vf, vsi->seid, allmulti, in i40e_config_vf_promiscuous_mode()
1359 alluni, &vf->port_vlan_id, 1); in i40e_config_vf_promiscuous_mode()
1367 aq_ret = i40e_set_vsi_promisc(vf, vsi->seid, allmulti, alluni, in i40e_config_vf_promiscuous_mode()
1374 aq_ret = i40e_set_vsi_promisc(vf, vsi->seid, allmulti, alluni, in i40e_config_vf_promiscuous_mode()
1414 static void i40e_trigger_vf_reset(struct i40e_vf *vf, bool flr) in i40e_trigger_vf_reset() argument
1416 struct i40e_pf *pf = vf->pf; in i40e_trigger_vf_reset()
1423 vf_active = test_and_clear_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states); in i40e_trigger_vf_reset()
1431 clear_bit(I40E_VF_STATE_INIT, &vf->vf_states); in i40e_trigger_vf_reset()
1438 radq = rd32(hw, I40E_VFINT_ICR0_ENA(vf->vf_id)) & in i40e_trigger_vf_reset()
1442 if (i40e_sync_vfr_reset(hw, vf->vf_id)) in i40e_trigger_vf_reset()
1445 vf->vf_id); in i40e_trigger_vf_reset()
1450 reg = rd32(hw, I40E_VPGEN_VFRTRIG(vf->vf_id)); in i40e_trigger_vf_reset()
1452 wr32(hw, I40E_VPGEN_VFRTRIG(vf->vf_id), reg); in i40e_trigger_vf_reset()
1456 reg_idx = (hw->func_caps.vf_base_id + vf->vf_id) / 32; in i40e_trigger_vf_reset()
1457 bit_idx = (hw->func_caps.vf_base_id + vf->vf_id) % 32; in i40e_trigger_vf_reset()
1461 if (i40e_quiesce_vf_pci(vf)) in i40e_trigger_vf_reset()
1463 vf->vf_id); in i40e_trigger_vf_reset()
1474 static void i40e_cleanup_reset_vf(struct i40e_vf *vf) in i40e_cleanup_reset_vf() argument
1476 struct i40e_pf *pf = vf->pf; in i40e_cleanup_reset_vf()
1481 i40e_config_vf_promiscuous_mode(vf, vf->lan_vsi_id, false, false); in i40e_cleanup_reset_vf()
1484 i40e_free_vf_res(vf); in i40e_cleanup_reset_vf()
1496 reg = rd32(hw, I40E_VPGEN_VFRTRIG(vf->vf_id)); in i40e_cleanup_reset_vf()
1498 wr32(hw, I40E_VPGEN_VFRTRIG(vf->vf_id), reg); in i40e_cleanup_reset_vf()
1501 if (!i40e_alloc_vf_res(vf)) { in i40e_cleanup_reset_vf()
1502 int abs_vf_id = vf->vf_id + hw->func_caps.vf_base_id; in i40e_cleanup_reset_vf()
1503 i40e_enable_vf_mappings(vf); in i40e_cleanup_reset_vf()
1504 set_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states); in i40e_cleanup_reset_vf()
1505 clear_bit(I40E_VF_STATE_DISABLED, &vf->vf_states); in i40e_cleanup_reset_vf()
1508 &vf->vf_states)) in i40e_cleanup_reset_vf()
1510 vf->num_vlan = 0; in i40e_cleanup_reset_vf()
1517 wr32(hw, I40E_VFGEN_RSTAT1(vf->vf_id), VIRTCHNL_VFR_VFACTIVE); in i40e_cleanup_reset_vf()
1528 bool i40e_reset_vf(struct i40e_vf *vf, bool flr) in i40e_reset_vf() argument
1530 struct i40e_pf *pf = vf->pf; in i40e_reset_vf()
1545 i40e_trigger_vf_reset(vf, flr); in i40e_reset_vf()
1557 reg = rd32(hw, I40E_VPGEN_VFRSTAT(vf->vf_id)); in i40e_reset_vf()
1569 vf->vf_id); in i40e_reset_vf()
1573 if (vf->lan_vsi_idx != 0) in i40e_reset_vf()
1574 i40e_vsi_stop_rings(pf->vsi[vf->lan_vsi_idx]); in i40e_reset_vf()
1576 i40e_cleanup_reset_vf(vf); in i40e_reset_vf()
1599 struct i40e_vf *vf; in i40e_reset_all_vfs() local
1613 i40e_trigger_vf_reset(&pf->vf[v], flr); in i40e_reset_all_vfs()
1628 vf = &pf->vf[v]; in i40e_reset_all_vfs()
1629 reg = rd32(hw, I40E_VPGEN_VFRSTAT(vf->vf_id)); in i40e_reset_all_vfs()
1648 pf->vf[v].vf_id); in i40e_reset_all_vfs()
1656 if (pf->vf[v].lan_vsi_idx == 0) in i40e_reset_all_vfs()
1659 i40e_vsi_stop_rings_no_wait(pf->vsi[pf->vf[v].lan_vsi_idx]); in i40e_reset_all_vfs()
1667 if (pf->vf[v].lan_vsi_idx == 0) in i40e_reset_all_vfs()
1670 i40e_vsi_wait_queues_disabled(pf->vsi[pf->vf[v].lan_vsi_idx]); in i40e_reset_all_vfs()
1680 i40e_cleanup_reset_vf(&pf->vf[v]); in i40e_reset_all_vfs()
1700 if (!pf->vf) in i40e_free_vfs()
1720 if (test_bit(I40E_VF_STATE_INIT, &pf->vf[i].vf_states)) in i40e_free_vfs()
1723 i40e_vsi_stop_rings_no_wait(pf->vsi[pf->vf[i].lan_vsi_idx]); in i40e_free_vfs()
1727 if (test_bit(I40E_VF_STATE_INIT, &pf->vf[i].vf_states)) in i40e_free_vfs()
1730 i40e_vsi_wait_queues_disabled(pf->vsi[pf->vf[i].lan_vsi_idx]); in i40e_free_vfs()
1737 if (test_bit(I40E_VF_STATE_INIT, &pf->vf[i].vf_states)) in i40e_free_vfs()
1738 i40e_free_vf_res(&pf->vf[i]); in i40e_free_vfs()
1740 i40e_disable_vf_mappings(&pf->vf[i]); in i40e_free_vfs()
1743 kfree(pf->vf); in i40e_free_vfs()
1744 pf->vf = NULL; in i40e_free_vfs()
1795 pf->vf = vfs; in i40e_alloc_vfs()
1929 static int i40e_vc_send_msg_to_vf(struct i40e_vf *vf, u32 v_opcode, in i40e_vc_send_msg_to_vf() argument
1938 if (!vf || vf->vf_id >= vf->pf->num_alloc_vfs) in i40e_vc_send_msg_to_vf()
1941 pf = vf->pf; in i40e_vc_send_msg_to_vf()
1943 abs_vf_id = vf->vf_id + hw->func_caps.vf_base_id; in i40e_vc_send_msg_to_vf()
1950 vf->vf_id, pf->hw.aq.asq_last_status); in i40e_vc_send_msg_to_vf()
1965 static int i40e_vc_send_resp_to_vf(struct i40e_vf *vf, in i40e_vc_send_resp_to_vf() argument
1969 return i40e_vc_send_msg_to_vf(vf, opcode, retval, NULL, 0); in i40e_vc_send_resp_to_vf()
1980 static bool i40e_sync_vf_state(struct i40e_vf *vf, enum i40e_vf_states state) in i40e_sync_vf_state() argument
1990 if (test_bit(state, &vf->vf_states)) in i40e_sync_vf_state()
1995 return test_bit(state, &vf->vf_states); in i40e_sync_vf_state()
2005 static int i40e_vc_get_version_msg(struct i40e_vf *vf, u8 *msg) in i40e_vc_get_version_msg() argument
2011 vf->vf_ver = *(struct virtchnl_version_info *)msg; in i40e_vc_get_version_msg()
2013 if (VF_IS_V10(&vf->vf_ver)) in i40e_vc_get_version_msg()
2015 return i40e_vc_send_msg_to_vf(vf, VIRTCHNL_OP_VERSION, in i40e_vc_get_version_msg()
2024 static void i40e_del_qch(struct i40e_vf *vf) in i40e_del_qch() argument
2026 struct i40e_pf *pf = vf->pf; in i40e_del_qch()
2032 for (i = 1; i < vf->num_tc; i++) { in i40e_del_qch()
2033 if (vf->ch[i].vsi_idx) { in i40e_del_qch()
2034 i40e_vsi_release(pf->vsi[vf->ch[i].vsi_idx]); in i40e_del_qch()
2035 vf->ch[i].vsi_idx = 0; in i40e_del_qch()
2036 vf->ch[i].vsi_id = 0; in i40e_del_qch()
2048 static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg) in i40e_vc_get_vf_resources_msg() argument
2051 struct i40e_pf *pf = vf->pf; in i40e_vc_get_vf_resources_msg()
2058 if (!i40e_sync_vf_state(vf, I40E_VF_STATE_INIT)) { in i40e_vc_get_vf_resources_msg()
2070 if (VF_IS_V11(&vf->vf_ver)) in i40e_vc_get_vf_resources_msg()
2071 vf->driver_caps = *(u32 *)msg; in i40e_vc_get_vf_resources_msg()
2073 vf->driver_caps = VIRTCHNL_VF_OFFLOAD_L2 | in i40e_vc_get_vf_resources_msg()
2079 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_get_vf_resources_msg()
2083 if (i40e_vf_client_capable(pf, vf->vf_id) && in i40e_vc_get_vf_resources_msg()
2084 (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_IWARP)) { in i40e_vc_get_vf_resources_msg()
2086 set_bit(I40E_VF_STATE_IWARPENA, &vf->vf_states); in i40e_vc_get_vf_resources_msg()
2088 clear_bit(I40E_VF_STATE_IWARPENA, &vf->vf_states); in i40e_vc_get_vf_resources_msg()
2091 if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RSS_PF) { in i40e_vc_get_vf_resources_msg()
2095 (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RSS_AQ)) in i40e_vc_get_vf_resources_msg()
2102 if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2) in i40e_vc_get_vf_resources_msg()
2107 if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_ENCAP) in i40e_vc_get_vf_resources_msg()
2111 (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM)) in i40e_vc_get_vf_resources_msg()
2114 if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RX_POLLING) { in i40e_vc_get_vf_resources_msg()
2118 vf->vf_id); in i40e_vc_get_vf_resources_msg()
2126 if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) in i40e_vc_get_vf_resources_msg()
2131 if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_REQ_QUEUES) in i40e_vc_get_vf_resources_msg()
2134 if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_ADQ) in i40e_vc_get_vf_resources_msg()
2138 vfres->num_queue_pairs = vf->num_queue_pairs; in i40e_vc_get_vf_resources_msg()
2143 if (vf->lan_vsi_idx) { in i40e_vc_get_vf_resources_msg()
2144 vfres->vsi_res[0].vsi_id = vf->lan_vsi_id; in i40e_vc_get_vf_resources_msg()
2150 if (!(vf->driver_caps & VIRTCHNL_VF_OFFLOAD_USO) && !vf->pf_set_mac) { in i40e_vc_get_vf_resources_msg()
2151 i40e_del_mac_filter(vsi, vf->default_lan_addr.addr); in i40e_vc_get_vf_resources_msg()
2152 eth_zero_addr(vf->default_lan_addr.addr); in i40e_vc_get_vf_resources_msg()
2155 vf->default_lan_addr.addr); in i40e_vc_get_vf_resources_msg()
2157 set_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states); in i40e_vc_get_vf_resources_msg()
2161 ret = i40e_vc_send_msg_to_vf(vf, VIRTCHNL_OP_GET_VF_RESOURCES, in i40e_vc_get_vf_resources_msg()
2176 static int i40e_vc_config_promiscuous_mode_msg(struct i40e_vf *vf, u8 *msg) in i40e_vc_config_promiscuous_mode_msg() argument
2180 struct i40e_pf *pf = vf->pf; in i40e_vc_config_promiscuous_mode_msg()
2185 if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { in i40e_vc_config_promiscuous_mode_msg()
2189 if (!test_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps)) { in i40e_vc_config_promiscuous_mode_msg()
2192 vf->vf_id); in i40e_vc_config_promiscuous_mode_msg()
2206 if (!i40e_vc_isvalid_vsi_id(vf, info->vsi_id)) { in i40e_vc_config_promiscuous_mode_msg()
2217 aq_ret = i40e_config_vf_promiscuous_mode(vf, info->vsi_id, allmulti, in i40e_vc_config_promiscuous_mode_msg()
2224 &vf->vf_states)) in i40e_vc_config_promiscuous_mode_msg()
2227 vf->vf_id); in i40e_vc_config_promiscuous_mode_msg()
2229 &vf->vf_states)) in i40e_vc_config_promiscuous_mode_msg()
2232 vf->vf_id); in i40e_vc_config_promiscuous_mode_msg()
2236 &vf->vf_states)) in i40e_vc_config_promiscuous_mode_msg()
2239 vf->vf_id); in i40e_vc_config_promiscuous_mode_msg()
2241 &vf->vf_states)) in i40e_vc_config_promiscuous_mode_msg()
2244 vf->vf_id); in i40e_vc_config_promiscuous_mode_msg()
2248 return i40e_vc_send_resp_to_vf(vf, in i40e_vc_config_promiscuous_mode_msg()
2261 static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg) in i40e_vc_config_queues_msg() argument
2267 struct i40e_pf *pf = vf->pf; in i40e_vc_config_queues_msg()
2273 if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { in i40e_vc_config_queues_msg()
2278 if (!i40e_vc_isvalid_vsi_id(vf, qci->vsi_id)) { in i40e_vc_config_queues_msg()
2288 if (vf->adq_enabled) { in i40e_vc_config_queues_msg()
2289 for (i = 0; i < vf->num_tc; i++) in i40e_vc_config_queues_msg()
2290 num_qps_all += vf->ch[i].num_qps; in i40e_vc_config_queues_msg()
2302 if (!vf->adq_enabled) { in i40e_vc_config_queues_msg()
2303 if (!i40e_vc_isvalid_queue_id(vf, vsi_id, in i40e_vc_config_queues_msg()
2319 if (vf->adq_enabled) { in i40e_vc_config_queues_msg()
2320 if (idx >= ARRAY_SIZE(vf->ch)) { in i40e_vc_config_queues_msg()
2324 vsi_id = vf->ch[idx].vsi_id; in i40e_vc_config_queues_msg()
2327 if (i40e_config_vsi_rx_queue(vf, vsi_id, vsi_queue_id, in i40e_vc_config_queues_msg()
2329 i40e_config_vsi_tx_queue(vf, vsi_id, vsi_queue_id, in i40e_vc_config_queues_msg()
2340 if (vf->adq_enabled) { in i40e_vc_config_queues_msg()
2341 if (idx >= ARRAY_SIZE(vf->ch)) { in i40e_vc_config_queues_msg()
2345 if (j == (vf->ch[idx].num_qps - 1)) { in i40e_vc_config_queues_msg()
2356 if (!vf->adq_enabled) { in i40e_vc_config_queues_msg()
2357 pf->vsi[vf->lan_vsi_idx]->num_queue_pairs = in i40e_vc_config_queues_msg()
2360 for (i = 0; i < vf->num_tc; i++) { in i40e_vc_config_queues_msg()
2361 vsi = pf->vsi[vf->ch[i].vsi_idx]; in i40e_vc_config_queues_msg()
2362 vsi->num_queue_pairs = vf->ch[i].num_qps; in i40e_vc_config_queues_msg()
2373 return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_CONFIG_VSI_QUEUES, in i40e_vc_config_queues_msg()
2385 static int i40e_validate_queue_map(struct i40e_vf *vf, u16 vsi_id, in i40e_validate_queue_map() argument
2391 if (vf->adq_enabled) { in i40e_validate_queue_map()
2392 vsi_id = vf->ch[vsi_queue_id / I40E_MAX_VF_VSI].vsi_id; in i40e_validate_queue_map()
2398 if (!i40e_vc_isvalid_queue_id(vf, vsi_id, queue_id)) in i40e_validate_queue_map()
2413 static int i40e_vc_config_irq_map_msg(struct i40e_vf *vf, u8 *msg) in i40e_vc_config_irq_map_msg() argument
2422 if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { in i40e_vc_config_irq_map_msg()
2428 vf->pf->hw.func_caps.num_msix_vectors_vf) { in i40e_vc_config_irq_map_msg()
2436 if (!i40e_vc_isvalid_vector_id(vf, map->vector_id) || in i40e_vc_config_irq_map_msg()
2437 !i40e_vc_isvalid_vsi_id(vf, map->vsi_id)) { in i40e_vc_config_irq_map_msg()
2443 if (i40e_validate_queue_map(vf, vsi_id, map->rxq_map)) { in i40e_vc_config_irq_map_msg()
2448 if (i40e_validate_queue_map(vf, vsi_id, map->txq_map)) { in i40e_vc_config_irq_map_msg()
2453 i40e_config_irq_link_list(vf, vsi_id, map); in i40e_vc_config_irq_map_msg()
2457 return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_CONFIG_IRQ_MAP, in i40e_vc_config_irq_map_msg()
2529 static int i40e_vc_enable_queues_msg(struct i40e_vf *vf, u8 *msg) in i40e_vc_enable_queues_msg() argument
2533 struct i40e_pf *pf = vf->pf; in i40e_vc_enable_queues_msg()
2537 if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) { in i40e_vc_enable_queues_msg()
2542 if (!i40e_vc_isvalid_vsi_id(vf, vqs->vsi_id)) { in i40e_vc_enable_queues_msg()
2553 if (i40e_ctrl_vf_rx_rings(pf->vsi[vf->lan_vsi_idx], vqs->rx_queues, in i40e_vc_enable_queues_msg()
2558 if (i40e_ctrl_vf_tx_rings(pf->vsi[vf->lan_vsi_idx], vqs->tx_queues, in i40e_vc_enable_queues_msg()
2565 if (vf->adq_enabled) { in i40e_vc_enable_queues_msg()
2567 for (i = 1; i < vf->num_tc; i++) { in i40e_vc_enable_queues_msg()
2568 if (i40e_vsi_start_rings(pf->vsi[vf->ch[i].vsi_idx])) in i40e_vc_enable_queues_msg()
2575 return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_ENABLE_QUEUES, in i40e_vc_enable_queues_msg()
2587 static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg) in i40e_vc_disable_queues_msg() argument
2591 struct i40e_pf *pf = vf->pf; in i40e_vc_disable_queues_msg()
2594 if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { in i40e_vc_disable_queues_msg()
2599 if (!i40e_vc_isvalid_vsi_id(vf, vqs->vsi_id)) { in i40e_vc_disable_queues_msg()
2610 if (i40e_ctrl_vf_tx_rings(pf->vsi[vf->lan_vsi_idx], vqs->tx_queues, in i40e_vc_disable_queues_msg()
2615 if (i40e_ctrl_vf_rx_rings(pf->vsi[vf->lan_vsi_idx], vqs->rx_queues, in i40e_vc_disable_queues_msg()
2622 return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_DISABLE_QUEUES, in i40e_vc_disable_queues_msg()
2633 static int i40e_check_enough_queue(struct i40e_vf *vf, u16 needed) in i40e_check_enough_queue() argument
2637 struct i40e_pf *pf = vf->pf; in i40e_check_enough_queue()
2640 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_check_enough_queue()
2689 static int i40e_vc_request_queues_msg(struct i40e_vf *vf, u8 *msg) in i40e_vc_request_queues_msg() argument
2694 u8 cur_pairs = vf->num_queue_pairs; in i40e_vc_request_queues_msg()
2695 struct i40e_pf *pf = vf->pf; in i40e_vc_request_queues_msg()
2697 if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) in i40e_vc_request_queues_msg()
2703 vf->vf_id, in i40e_vc_request_queues_msg()
2709 vf->vf_id, in i40e_vc_request_queues_msg()
2713 } else if (i40e_check_enough_queue(vf, req_pairs) < 0) { in i40e_vc_request_queues_msg()
2716 vf->vf_id, in i40e_vc_request_queues_msg()
2721 vf->num_req_queues = req_pairs; in i40e_vc_request_queues_msg()
2722 i40e_vc_reset_vf(vf, true); in i40e_vc_request_queues_msg()
2726 return i40e_vc_send_msg_to_vf(vf, VIRTCHNL_OP_REQUEST_QUEUES, 0, in i40e_vc_request_queues_msg()
2737 static int i40e_vc_get_stats_msg(struct i40e_vf *vf, u8 *msg) in i40e_vc_get_stats_msg() argument
2741 struct i40e_pf *pf = vf->pf; in i40e_vc_get_stats_msg()
2748 if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { in i40e_vc_get_stats_msg()
2753 if (!i40e_vc_isvalid_vsi_id(vf, vqs->vsi_id)) { in i40e_vc_get_stats_msg()
2758 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_get_stats_msg()
2768 return i40e_vc_send_msg_to_vf(vf, VIRTCHNL_OP_GET_STATS, aq_ret, in i40e_vc_get_stats_msg()
2804 static inline int i40e_check_vf_permission(struct i40e_vf *vf, in i40e_check_vf_permission() argument
2807 struct i40e_pf *pf = vf->pf; in i40e_check_vf_permission()
2808 struct i40e_vsi *vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_check_vf_permission()
2831 if (!test_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps) && in i40e_check_vf_permission()
2832 !is_multicast_ether_addr(addr) && vf->pf_set_mac && in i40e_check_vf_permission()
2833 !ether_addr_equal(addr, vf->default_lan_addr.addr)) { in i40e_check_vf_permission()
2849 if (!test_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps)) { in i40e_check_vf_permission()
2880 static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg) in i40e_vc_add_mac_addr_msg() argument
2884 struct i40e_pf *pf = vf->pf; in i40e_vc_add_mac_addr_msg()
2889 if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) || in i40e_vc_add_mac_addr_msg()
2890 !i40e_vc_isvalid_vsi_id(vf, al->vsi_id)) { in i40e_vc_add_mac_addr_msg()
2895 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_add_mac_addr_msg()
2902 ret = i40e_check_vf_permission(vf, al); in i40e_vc_add_mac_addr_msg()
2919 al->list[i].addr, vf->vf_id); in i40e_vc_add_mac_addr_msg()
2925 is_zero_ether_addr(vf->default_lan_addr.addr)) in i40e_vc_add_mac_addr_msg()
2926 ether_addr_copy(vf->default_lan_addr.addr, in i40e_vc_add_mac_addr_msg()
2936 vf->vf_id, ret); in i40e_vc_add_mac_addr_msg()
2940 return i40e_vc_send_msg_to_vf(vf, VIRTCHNL_OP_ADD_ETH_ADDR, in i40e_vc_add_mac_addr_msg()
2951 static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf, u8 *msg) in i40e_vc_del_mac_addr_msg() argument
2956 struct i40e_pf *pf = vf->pf; in i40e_vc_del_mac_addr_msg()
2961 if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) || in i40e_vc_del_mac_addr_msg()
2962 !i40e_vc_isvalid_vsi_id(vf, al->vsi_id)) { in i40e_vc_del_mac_addr_msg()
2971 al->list[i].addr, vf->vf_id); in i40e_vc_del_mac_addr_msg()
2975 if (ether_addr_equal(al->list[i].addr, vf->default_lan_addr.addr)) in i40e_vc_del_mac_addr_msg()
2978 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_del_mac_addr_msg()
2995 vf->vf_id, ret); in i40e_vc_del_mac_addr_msg()
2997 if (vf->trusted && was_unimac_deleted) { in i40e_vc_del_mac_addr_msg()
3010 ether_addr_copy(vf->default_lan_addr.addr, macaddr); in i40e_vc_del_mac_addr_msg()
3015 return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_DEL_ETH_ADDR, ret); in i40e_vc_del_mac_addr_msg()
3025 static int i40e_vc_add_vlan_msg(struct i40e_vf *vf, u8 *msg) in i40e_vc_add_vlan_msg() argument
3029 struct i40e_pf *pf = vf->pf; in i40e_vc_add_vlan_msg()
3034 if ((vf->num_vlan >= I40E_VC_MAX_VLAN_PER_VF) && in i40e_vc_add_vlan_msg()
3035 !test_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps)) { in i40e_vc_add_vlan_msg()
3040 if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states) || in i40e_vc_add_vlan_msg()
3041 !i40e_vc_isvalid_vsi_id(vf, vfl->vsi_id)) { in i40e_vc_add_vlan_msg()
3054 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_add_vlan_msg()
3065 vf->num_vlan++; in i40e_vc_add_vlan_msg()
3067 if (test_bit(I40E_VF_STATE_UC_PROMISC, &vf->vf_states)) in i40e_vc_add_vlan_msg()
3072 if (test_bit(I40E_VF_STATE_MC_PROMISC, &vf->vf_states)) in i40e_vc_add_vlan_msg()
3081 vfl->vlan_id[i], vf->vf_id, ret); in i40e_vc_add_vlan_msg()
3086 return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_ADD_VLAN, aq_ret); in i40e_vc_add_vlan_msg()
3096 static int i40e_vc_remove_vlan_msg(struct i40e_vf *vf, u8 *msg) in i40e_vc_remove_vlan_msg() argument
3100 struct i40e_pf *pf = vf->pf; in i40e_vc_remove_vlan_msg()
3105 if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) || in i40e_vc_remove_vlan_msg()
3106 !i40e_vc_isvalid_vsi_id(vf, vfl->vsi_id)) { in i40e_vc_remove_vlan_msg()
3118 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_remove_vlan_msg()
3127 vf->num_vlan--; in i40e_vc_remove_vlan_msg()
3129 if (test_bit(I40E_VF_STATE_UC_PROMISC, &vf->vf_states)) in i40e_vc_remove_vlan_msg()
3134 if (test_bit(I40E_VF_STATE_MC_PROMISC, &vf->vf_states)) in i40e_vc_remove_vlan_msg()
3143 return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_DEL_VLAN, aq_ret); in i40e_vc_remove_vlan_msg()
3154 static int i40e_vc_iwarp_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) in i40e_vc_iwarp_msg() argument
3156 struct i40e_pf *pf = vf->pf; in i40e_vc_iwarp_msg()
3157 int abs_vf_id = vf->vf_id + pf->hw.func_caps.vf_base_id; in i40e_vc_iwarp_msg()
3160 if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states) || in i40e_vc_iwarp_msg()
3161 !test_bit(I40E_VF_STATE_IWARPENA, &vf->vf_states)) { in i40e_vc_iwarp_msg()
3171 return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_IWARP, in i40e_vc_iwarp_msg()
3183 static int i40e_vc_iwarp_qvmap_msg(struct i40e_vf *vf, u8 *msg, bool config) in i40e_vc_iwarp_qvmap_msg() argument
3189 if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states) || in i40e_vc_iwarp_qvmap_msg()
3190 !test_bit(I40E_VF_STATE_IWARPENA, &vf->vf_states)) { in i40e_vc_iwarp_qvmap_msg()
3196 if (i40e_config_iwarp_qvlist(vf, qvlist_info)) in i40e_vc_iwarp_qvmap_msg()
3199 i40e_release_iwarp_qvlist(vf); in i40e_vc_iwarp_qvmap_msg()
3204 return i40e_vc_send_resp_to_vf(vf, in i40e_vc_iwarp_qvmap_msg()
3217 static int i40e_vc_config_rss_key(struct i40e_vf *vf, u8 *msg) in i40e_vc_config_rss_key() argument
3221 struct i40e_pf *pf = vf->pf; in i40e_vc_config_rss_key()
3225 if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) || in i40e_vc_config_rss_key()
3226 !i40e_vc_isvalid_vsi_id(vf, vrk->vsi_id) || in i40e_vc_config_rss_key()
3232 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_config_rss_key()
3236 return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_CONFIG_RSS_KEY, in i40e_vc_config_rss_key()
3247 static int i40e_vc_config_rss_lut(struct i40e_vf *vf, u8 *msg) in i40e_vc_config_rss_lut() argument
3251 struct i40e_pf *pf = vf->pf; in i40e_vc_config_rss_lut()
3256 if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) || in i40e_vc_config_rss_lut()
3257 !i40e_vc_isvalid_vsi_id(vf, vrl->vsi_id) || in i40e_vc_config_rss_lut()
3264 if (vrl->lut[i] >= vf->num_queue_pairs) { in i40e_vc_config_rss_lut()
3269 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_vc_config_rss_lut()
3273 return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_CONFIG_RSS_LUT, in i40e_vc_config_rss_lut()
3284 static int i40e_vc_get_rss_hena(struct i40e_vf *vf, u8 *msg) in i40e_vc_get_rss_hena() argument
3287 struct i40e_pf *pf = vf->pf; in i40e_vc_get_rss_hena()
3291 if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { in i40e_vc_get_rss_hena()
3306 aq_ret = i40e_vc_send_msg_to_vf(vf, VIRTCHNL_OP_GET_RSS_HENA_CAPS, in i40e_vc_get_rss_hena()
3319 static int i40e_vc_set_rss_hena(struct i40e_vf *vf, u8 *msg) in i40e_vc_set_rss_hena() argument
3323 struct i40e_pf *pf = vf->pf; in i40e_vc_set_rss_hena()
3327 if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { in i40e_vc_set_rss_hena()
3331 i40e_write_rx_ctl(hw, I40E_VFQF_HENA1(0, vf->vf_id), (u32)vrh->hena); in i40e_vc_set_rss_hena()
3332 i40e_write_rx_ctl(hw, I40E_VFQF_HENA1(1, vf->vf_id), in i40e_vc_set_rss_hena()
3337 return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_SET_RSS_HENA, aq_ret); in i40e_vc_set_rss_hena()
3347 static int i40e_vc_enable_vlan_stripping(struct i40e_vf *vf, u8 *msg) in i40e_vc_enable_vlan_stripping() argument
3352 if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { in i40e_vc_enable_vlan_stripping()
3357 vsi = vf->pf->vsi[vf->lan_vsi_idx]; in i40e_vc_enable_vlan_stripping()
3362 return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_ENABLE_VLAN_STRIPPING, in i40e_vc_enable_vlan_stripping()
3373 static int i40e_vc_disable_vlan_stripping(struct i40e_vf *vf, u8 *msg) in i40e_vc_disable_vlan_stripping() argument
3378 if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { in i40e_vc_disable_vlan_stripping()
3383 vsi = vf->pf->vsi[vf->lan_vsi_idx]; in i40e_vc_disable_vlan_stripping()
3388 return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_DISABLE_VLAN_STRIPPING, in i40e_vc_disable_vlan_stripping()
3399 static int i40e_validate_cloud_filter(struct i40e_vf *vf, in i40e_validate_cloud_filter() argument
3404 struct i40e_pf *pf = vf->pf; in i40e_validate_cloud_filter()
3414 vf->vf_id); in i40e_validate_cloud_filter()
3422 vf->vf_id, tc_filter->action_meta); in i40e_validate_cloud_filter()
3436 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_validate_cloud_filter()
3442 data.dst_mac, vf->vf_id); in i40e_validate_cloud_filter()
3457 vf->vf_id, ntohs(data.vlan_id)); in i40e_validate_cloud_filter()
3463 if (!test_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps)) { in i40e_validate_cloud_filter()
3466 vf->vf_id); in i40e_validate_cloud_filter()
3475 vf->vf_id, data.dst_mac); in i40e_validate_cloud_filter()
3484 vf->vf_id, data.src_mac); in i40e_validate_cloud_filter()
3492 vf->vf_id); in i40e_validate_cloud_filter()
3500 vf->vf_id); in i40e_validate_cloud_filter()
3508 vf->vf_id); in i40e_validate_cloud_filter()
3515 vf->vf_id); in i40e_validate_cloud_filter()
3530 static struct i40e_vsi *i40e_find_vsi_from_seid(struct i40e_vf *vf, u16 seid) in i40e_find_vsi_from_seid() argument
3532 struct i40e_pf *pf = vf->pf; in i40e_find_vsi_from_seid()
3536 for (i = 0; i < vf->num_tc ; i++) { in i40e_find_vsi_from_seid()
3537 vsi = i40e_find_vsi_from_id(pf, vf->ch[i].vsi_id); in i40e_find_vsi_from_seid()
3550 static void i40e_del_all_cloud_filters(struct i40e_vf *vf) in i40e_del_all_cloud_filters() argument
3553 struct i40e_pf *pf = vf->pf; in i40e_del_all_cloud_filters()
3559 &vf->cloud_filter_list, cloud_node) { in i40e_del_all_cloud_filters()
3560 vsi = i40e_find_vsi_from_seid(vf, cfilter->seid); in i40e_del_all_cloud_filters()
3564 vf->vf_id, cfilter->seid); in i40e_del_all_cloud_filters()
3576 vf->vf_id, i40e_stat_str(&pf->hw, ret), in i40e_del_all_cloud_filters()
3582 vf->num_cloud_filters--; in i40e_del_all_cloud_filters()
3593 static int i40e_vc_del_cloud_filter(struct i40e_vf *vf, u8 *msg) in i40e_vc_del_cloud_filter() argument
3599 struct i40e_pf *pf = vf->pf; in i40e_vc_del_cloud_filter()
3605 if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { in i40e_vc_del_cloud_filter()
3610 if (!vf->adq_enabled) { in i40e_vc_del_cloud_filter()
3613 vf->vf_id); in i40e_vc_del_cloud_filter()
3618 if (i40e_validate_cloud_filter(vf, vcf)) { in i40e_vc_del_cloud_filter()
3621 vf->vf_id); in i40e_vc_del_cloud_filter()
3663 vf->vf_id); in i40e_vc_del_cloud_filter()
3667 vsi = pf->vsi[vf->ch[vcf->action_meta].vsi_idx]; in i40e_vc_del_cloud_filter()
3679 vf->vf_id, i40e_stat_str(&pf->hw, ret), in i40e_vc_del_cloud_filter()
3685 &vf->cloud_filter_list, cloud_node) { in i40e_vc_del_cloud_filter()
3710 vf->num_cloud_filters--; in i40e_vc_del_cloud_filter()
3714 return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_DEL_CLOUD_FILTER, in i40e_vc_del_cloud_filter()
3725 static int i40e_vc_add_cloud_filter(struct i40e_vf *vf, u8 *msg) in i40e_vc_add_cloud_filter() argument
3731 struct i40e_pf *pf = vf->pf; in i40e_vc_add_cloud_filter()
3736 if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { in i40e_vc_add_cloud_filter()
3741 if (!vf->adq_enabled) { in i40e_vc_add_cloud_filter()
3744 vf->vf_id); in i40e_vc_add_cloud_filter()
3749 if (i40e_validate_cloud_filter(vf, vcf)) { in i40e_vc_add_cloud_filter()
3752 vf->vf_id); in i40e_vc_add_cloud_filter()
3797 vf->vf_id); in i40e_vc_add_cloud_filter()
3801 vsi = pf->vsi[vf->ch[vcf->action_meta].vsi_idx]; in i40e_vc_add_cloud_filter()
3813 vf->vf_id, i40e_stat_str(&pf->hw, ret), in i40e_vc_add_cloud_filter()
3819 hlist_add_head(&cfilter->cloud_node, &vf->cloud_filter_list); in i40e_vc_add_cloud_filter()
3822 vf->num_cloud_filters++; in i40e_vc_add_cloud_filter()
3826 return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_ADD_CLOUD_FILTER, in i40e_vc_add_cloud_filter()
3835 static int i40e_vc_add_qch_msg(struct i40e_vf *vf, u8 *msg) in i40e_vc_add_qch_msg() argument
3839 struct i40e_pf *pf = vf->pf; in i40e_vc_add_qch_msg()
3845 if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { in i40e_vc_add_qch_msg()
3851 if (vf->spoofchk) { in i40e_vc_add_qch_msg()
3858 if (!(vf->driver_caps & VIRTCHNL_VF_OFFLOAD_ADQ)) { in i40e_vc_add_qch_msg()
3861 vf->vf_id); in i40e_vc_add_qch_msg()
3870 vf->vf_id, tci->num_tc, I40E_MAX_VF_VSI); in i40e_vc_add_qch_msg()
3881 vf->vf_id, i, tci->list[i].count, in i40e_vc_add_qch_msg()
3893 vf->vf_id); in i40e_vc_add_qch_msg()
3901 vf->num_queue_pairs = I40E_MAX_VF_QUEUES; in i40e_vc_add_qch_msg()
3914 vf->num_tc = tci->num_tc; in i40e_vc_add_qch_msg()
3915 for (i = 0; i < vf->num_tc; i++) { in i40e_vc_add_qch_msg()
3921 vf->vf_id); in i40e_vc_add_qch_msg()
3925 vf->ch[i].max_tx_rate = in i40e_vc_add_qch_msg()
3929 vf->ch[i].num_qps = tci->list[i].count; in i40e_vc_add_qch_msg()
3933 vf->adq_enabled = true; in i40e_vc_add_qch_msg()
3936 i40e_vc_reset_vf(vf, true); in i40e_vc_add_qch_msg()
3942 return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_ENABLE_CHANNELS, in i40e_vc_add_qch_msg()
3951 static int i40e_vc_del_qch_msg(struct i40e_vf *vf, u8 *msg) in i40e_vc_del_qch_msg() argument
3953 struct i40e_pf *pf = vf->pf; in i40e_vc_del_qch_msg()
3956 if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { in i40e_vc_del_qch_msg()
3961 if (vf->adq_enabled) { in i40e_vc_del_qch_msg()
3962 i40e_del_all_cloud_filters(vf); in i40e_vc_del_qch_msg()
3963 i40e_del_qch(vf); in i40e_vc_del_qch_msg()
3964 vf->adq_enabled = false; in i40e_vc_del_qch_msg()
3965 vf->num_tc = 0; in i40e_vc_del_qch_msg()
3968 vf->vf_id); in i40e_vc_del_qch_msg()
3971 vf->vf_id); in i40e_vc_del_qch_msg()
3976 i40e_vc_reset_vf(vf, true); in i40e_vc_del_qch_msg()
3981 return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_DISABLE_CHANNELS, in i40e_vc_del_qch_msg()
4002 struct i40e_vf *vf; in i40e_vc_process_vf_msg() local
4008 vf = &(pf->vf[local_vf_id]); in i40e_vc_process_vf_msg()
4011 if (test_bit(I40E_VF_STATE_DISABLED, &vf->vf_states)) in i40e_vc_process_vf_msg()
4015 ret = virtchnl_vc_validate_vf_msg(&vf->vf_ver, v_opcode, msg, msglen); in i40e_vc_process_vf_msg()
4018 i40e_vc_send_resp_to_vf(vf, v_opcode, I40E_ERR_PARAM); in i40e_vc_process_vf_msg()
4031 ret = i40e_vc_get_version_msg(vf, msg); in i40e_vc_process_vf_msg()
4034 ret = i40e_vc_get_vf_resources_msg(vf, msg); in i40e_vc_process_vf_msg()
4035 i40e_vc_notify_vf_link_state(vf); in i40e_vc_process_vf_msg()
4038 i40e_vc_reset_vf(vf, false); in i40e_vc_process_vf_msg()
4042 ret = i40e_vc_config_promiscuous_mode_msg(vf, msg); in i40e_vc_process_vf_msg()
4045 ret = i40e_vc_config_queues_msg(vf, msg); in i40e_vc_process_vf_msg()
4048 ret = i40e_vc_config_irq_map_msg(vf, msg); in i40e_vc_process_vf_msg()
4051 ret = i40e_vc_enable_queues_msg(vf, msg); in i40e_vc_process_vf_msg()
4052 i40e_vc_notify_vf_link_state(vf); in i40e_vc_process_vf_msg()
4055 ret = i40e_vc_disable_queues_msg(vf, msg); in i40e_vc_process_vf_msg()
4058 ret = i40e_vc_add_mac_addr_msg(vf, msg); in i40e_vc_process_vf_msg()
4061 ret = i40e_vc_del_mac_addr_msg(vf, msg); in i40e_vc_process_vf_msg()
4064 ret = i40e_vc_add_vlan_msg(vf, msg); in i40e_vc_process_vf_msg()
4067 ret = i40e_vc_remove_vlan_msg(vf, msg); in i40e_vc_process_vf_msg()
4070 ret = i40e_vc_get_stats_msg(vf, msg); in i40e_vc_process_vf_msg()
4073 ret = i40e_vc_iwarp_msg(vf, msg, msglen); in i40e_vc_process_vf_msg()
4076 ret = i40e_vc_iwarp_qvmap_msg(vf, msg, true); in i40e_vc_process_vf_msg()
4079 ret = i40e_vc_iwarp_qvmap_msg(vf, msg, false); in i40e_vc_process_vf_msg()
4082 ret = i40e_vc_config_rss_key(vf, msg); in i40e_vc_process_vf_msg()
4085 ret = i40e_vc_config_rss_lut(vf, msg); in i40e_vc_process_vf_msg()
4088 ret = i40e_vc_get_rss_hena(vf, msg); in i40e_vc_process_vf_msg()
4091 ret = i40e_vc_set_rss_hena(vf, msg); in i40e_vc_process_vf_msg()
4094 ret = i40e_vc_enable_vlan_stripping(vf, msg); in i40e_vc_process_vf_msg()
4097 ret = i40e_vc_disable_vlan_stripping(vf, msg); in i40e_vc_process_vf_msg()
4100 ret = i40e_vc_request_queues_msg(vf, msg); in i40e_vc_process_vf_msg()
4103 ret = i40e_vc_add_qch_msg(vf, msg); in i40e_vc_process_vf_msg()
4106 ret = i40e_vc_del_qch_msg(vf, msg); in i40e_vc_process_vf_msg()
4109 ret = i40e_vc_add_cloud_filter(vf, msg); in i40e_vc_process_vf_msg()
4112 ret = i40e_vc_del_cloud_filter(vf, msg); in i40e_vc_process_vf_msg()
4118 ret = i40e_vc_send_resp_to_vf(vf, v_opcode, in i40e_vc_process_vf_msg()
4137 struct i40e_vf *vf; in i40e_vc_process_vflr_event() local
4158 vf = &pf->vf[vf_id]; in i40e_vc_process_vflr_event()
4162 i40e_reset_vf(vf, true); in i40e_vc_process_vflr_event()
4180 struct i40e_vf *vf; in i40e_validate_vf() local
4189 vf = &pf->vf[vf_id]; in i40e_validate_vf()
4190 vsi = i40e_find_vsi_from_id(pf, vf->lan_vsi_id); in i40e_validate_vf()
4211 struct i40e_vf *vf; in i40e_ndo_set_vf_mac() local
4227 vf = &pf->vf[vf_id]; in i40e_ndo_set_vf_mac()
4236 if (test_bit(I40E_VF_STATE_INIT, &vf->vf_states)) in i40e_ndo_set_vf_mac()
4240 if (!test_bit(I40E_VF_STATE_INIT, &vf->vf_states)) { in i40e_ndo_set_vf_mac()
4246 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_ndo_set_vf_mac()
4261 if (!is_zero_ether_addr(vf->default_lan_addr.addr)) in i40e_ndo_set_vf_mac()
4262 i40e_del_mac_filter(vsi, vf->default_lan_addr.addr); in i40e_ndo_set_vf_mac()
4278 ether_addr_copy(vf->default_lan_addr.addr, mac); in i40e_ndo_set_vf_mac()
4281 vf->pf_set_mac = false; in i40e_ndo_set_vf_mac()
4284 vf->pf_set_mac = true; in i40e_ndo_set_vf_mac()
4292 i40e_vc_reset_vf(vf, true); in i40e_ndo_set_vf_mac()
4318 struct i40e_vf *vf; in i40e_ndo_set_vf_port_vlan() local
4343 vf = &pf->vf[vf_id]; in i40e_ndo_set_vf_port_vlan()
4344 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_ndo_set_vf_port_vlan()
4345 if (!test_bit(I40E_VF_STATE_INIT, &vf->vf_states)) { in i40e_ndo_set_vf_port_vlan()
4356 i40e_vc_reset_vf(vf, true); in i40e_ndo_set_vf_port_vlan()
4358 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_ndo_set_vf_port_vlan()
4392 ret = i40e_config_vf_promiscuous_mode(vf, vf->lan_vsi_id, in i40e_ndo_set_vf_port_vlan()
4425 if (test_bit(I40E_VF_STATE_UC_PROMISC, &vf->vf_states)) in i40e_ndo_set_vf_port_vlan()
4428 if (test_bit(I40E_VF_STATE_MC_PROMISC, &vf->vf_states)) in i40e_ndo_set_vf_port_vlan()
4442 vf->port_vlan_id = le16_to_cpu(vsi->info.pvid); in i40e_ndo_set_vf_port_vlan()
4444 ret = i40e_config_vf_promiscuous_mode(vf, vsi->id, allmulti, alluni); in i40e_ndo_set_vf_port_vlan()
4472 struct i40e_vf *vf; in i40e_ndo_set_vf_bw() local
4492 vf = &pf->vf[vf_id]; in i40e_ndo_set_vf_bw()
4493 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_ndo_set_vf_bw()
4494 if (!test_bit(I40E_VF_STATE_INIT, &vf->vf_states)) { in i40e_ndo_set_vf_bw()
4505 vf->tx_rate = max_tx_rate; in i40e_ndo_set_vf_bw()
4525 struct i40e_vf *vf; in i40e_ndo_get_vf_config() local
4538 vf = &pf->vf[vf_id]; in i40e_ndo_get_vf_config()
4540 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_ndo_get_vf_config()
4546 ivi->vf = vf_id; in i40e_ndo_get_vf_config()
4548 ether_addr_copy(ivi->mac, vf->default_lan_addr.addr); in i40e_ndo_get_vf_config()
4550 ivi->max_tx_rate = vf->tx_rate; in i40e_ndo_get_vf_config()
4555 if (vf->link_forced == false) in i40e_ndo_get_vf_config()
4557 else if (vf->link_up == true) in i40e_ndo_get_vf_config()
4561 ivi->spoofchk = vf->spoofchk; in i40e_ndo_get_vf_config()
4562 ivi->trusted = vf->trusted; in i40e_ndo_get_vf_config()
4585 struct i40e_vf *vf; in i40e_ndo_set_vf_link_state() local
4601 vf = &pf->vf[vf_id]; in i40e_ndo_set_vf_link_state()
4602 abs_vf_id = vf->vf_id + hw->func_caps.vf_base_id; in i40e_ndo_set_vf_link_state()
4609 vf->link_forced = false; in i40e_ndo_set_vf_link_state()
4610 i40e_set_vf_link_state(vf, &pfe, ls); in i40e_ndo_set_vf_link_state()
4613 vf->link_forced = true; in i40e_ndo_set_vf_link_state()
4614 vf->link_up = true; in i40e_ndo_set_vf_link_state()
4615 i40e_set_vf_link_state(vf, &pfe, ls); in i40e_ndo_set_vf_link_state()
4618 vf->link_forced = true; in i40e_ndo_set_vf_link_state()
4619 vf->link_up = false; in i40e_ndo_set_vf_link_state()
4620 i40e_set_vf_link_state(vf, &pfe, ls); in i40e_ndo_set_vf_link_state()
4650 struct i40e_vf *vf; in i40e_ndo_set_vf_spoofchk() local
4665 vf = &(pf->vf[vf_id]); in i40e_ndo_set_vf_spoofchk()
4666 if (!test_bit(I40E_VF_STATE_INIT, &vf->vf_states)) { in i40e_ndo_set_vf_spoofchk()
4673 if (enable == vf->spoofchk) in i40e_ndo_set_vf_spoofchk()
4676 vf->spoofchk = enable; in i40e_ndo_set_vf_spoofchk()
4678 ctxt.seid = pf->vsi[vf->lan_vsi_idx]->seid; in i40e_ndo_set_vf_spoofchk()
4707 struct i40e_vf *vf; in i40e_ndo_set_vf_trust() local
4728 vf = &pf->vf[vf_id]; in i40e_ndo_set_vf_trust()
4730 if (setting == vf->trusted) in i40e_ndo_set_vf_trust()
4733 vf->trusted = setting; in i40e_ndo_set_vf_trust()
4734 i40e_vc_reset_vf(vf, true); in i40e_ndo_set_vf_trust()
4738 if (vf->adq_enabled) { in i40e_ndo_set_vf_trust()
4739 if (!vf->trusted) { in i40e_ndo_set_vf_trust()
4743 i40e_del_all_cloud_filters(vf); in i40e_ndo_set_vf_trust()
4765 struct i40e_vf *vf; in i40e_get_vf_stats() local
4771 vf = &pf->vf[vf_id]; in i40e_get_vf_stats()
4772 if (!test_bit(I40E_VF_STATE_INIT, &vf->vf_states)) { in i40e_get_vf_stats()
4777 vsi = pf->vsi[vf->lan_vsi_idx]; in i40e_get_vf_stats()