Lines Matching refs:vf

28 	struct ice_vf *vf;  in ice_free_vf_entries()  local
37 hash_for_each_safe(vfs->table, bkt, tmp, vf, entry) { in ice_free_vf_entries()
38 hash_del_rcu(&vf->entry); in ice_free_vf_entries()
39 ice_deinitialize_vf_entry(vf); in ice_free_vf_entries()
40 ice_put_vf(vf); in ice_free_vf_entries()
48 static void ice_free_vf_res(struct ice_vf *vf) in ice_free_vf_res() argument
50 struct ice_pf *pf = vf->pf; in ice_free_vf_res()
56 clear_bit(ICE_VF_STATE_INIT, vf->vf_states); in ice_free_vf_res()
57 ice_vf_fdir_exit(vf); in ice_free_vf_res()
59 if (vf->ctrl_vsi_idx != ICE_NO_VSI) in ice_free_vf_res()
60 ice_vf_ctrl_vsi_release(vf); in ice_free_vf_res()
63 if (vf->lan_vsi_idx != ICE_NO_VSI) { in ice_free_vf_res()
64 ice_vf_vsi_release(vf); in ice_free_vf_res()
65 vf->num_mac = 0; in ice_free_vf_res()
68 last_vector_idx = vf->first_vector_idx + vf->num_msix - 1; in ice_free_vf_res()
71 memset(&vf->mdd_tx_events, 0, sizeof(vf->mdd_tx_events)); in ice_free_vf_res()
72 memset(&vf->mdd_rx_events, 0, sizeof(vf->mdd_rx_events)); in ice_free_vf_res()
75 for (i = vf->first_vector_idx; i <= last_vector_idx; i++) { in ice_free_vf_res()
80 clear_bit(ICE_VF_STATE_MC_PROMISC, vf->vf_states); in ice_free_vf_res()
81 clear_bit(ICE_VF_STATE_UC_PROMISC, vf->vf_states); in ice_free_vf_res()
88 static void ice_dis_vf_mappings(struct ice_vf *vf) in ice_dis_vf_mappings() argument
90 struct ice_pf *pf = vf->pf; in ice_dis_vf_mappings()
97 vsi = ice_get_vf_vsi(vf); in ice_dis_vf_mappings()
102 wr32(hw, VPINT_ALLOC(vf->vf_id), 0); in ice_dis_vf_mappings()
103 wr32(hw, VPINT_ALLOC_PCI(vf->vf_id), 0); in ice_dis_vf_mappings()
105 first = vf->first_vector_idx; in ice_dis_vf_mappings()
106 last = first + vf->num_msix - 1; in ice_dis_vf_mappings()
116 wr32(hw, VPLAN_TX_QBASE(vf->vf_id), 0); in ice_dis_vf_mappings()
121 wr32(hw, VPLAN_RX_QBASE(vf->vf_id), 0); in ice_dis_vf_mappings()
156 struct ice_vf *vf; in ice_free_vfs() local
176 ice_for_each_vf(pf, bkt, vf) { in ice_free_vfs()
177 mutex_lock(&vf->cfg_lock); in ice_free_vfs()
179 ice_eswitch_detach_vf(pf, vf); in ice_free_vfs()
180 ice_dis_vf_qs(vf); in ice_free_vfs()
182 if (test_bit(ICE_VF_STATE_INIT, vf->vf_states)) { in ice_free_vfs()
184 ice_dis_vf_mappings(vf); in ice_free_vfs()
185 set_bit(ICE_VF_STATE_DIS, vf->vf_states); in ice_free_vfs()
186 ice_free_vf_res(vf); in ice_free_vfs()
192 reg_idx = (hw->func_caps.vf_base_id + vf->vf_id) / 32; in ice_free_vfs()
193 bit_idx = (hw->func_caps.vf_base_id + vf->vf_id) % 32; in ice_free_vfs()
197 mutex_unlock(&vf->cfg_lock); in ice_free_vfs()
219 static struct ice_vsi *ice_vf_vsi_setup(struct ice_vf *vf) in ice_vf_vsi_setup() argument
222 struct ice_pf *pf = vf->pf; in ice_vf_vsi_setup()
226 params.port_info = ice_vf_get_port_info(vf); in ice_vf_vsi_setup()
227 params.vf = vf; in ice_vf_vsi_setup()
234 ice_vf_invalidate_vsi(vf); in ice_vf_vsi_setup()
238 vf->lan_vsi_idx = vsi->idx; in ice_vf_vsi_setup()
252 static void ice_ena_vf_msix_mappings(struct ice_vf *vf) in ice_ena_vf_msix_mappings() argument
256 struct ice_pf *pf = vf->pf; in ice_ena_vf_msix_mappings()
262 pf_based_first_msix = vf->first_vector_idx; in ice_ena_vf_msix_mappings()
263 pf_based_last_msix = (pf_based_first_msix + vf->num_msix) - 1; in ice_ena_vf_msix_mappings()
268 (device_based_first_msix + vf->num_msix) - 1; in ice_ena_vf_msix_mappings()
269 device_based_vf_id = vf->vf_id + hw->func_caps.vf_base_id; in ice_ena_vf_msix_mappings()
274 wr32(hw, VPINT_ALLOC(vf->vf_id), reg); in ice_ena_vf_msix_mappings()
279 wr32(hw, VPINT_ALLOC_PCI(vf->vf_id), reg); in ice_ena_vf_msix_mappings()
298 static void ice_ena_vf_q_mappings(struct ice_vf *vf, u16 max_txq, u16 max_rxq) in ice_ena_vf_q_mappings() argument
300 struct device *dev = ice_pf_to_dev(vf->pf); in ice_ena_vf_q_mappings()
301 struct ice_vsi *vsi = ice_get_vf_vsi(vf); in ice_ena_vf_q_mappings()
302 struct ice_hw *hw = &vf->pf->hw; in ice_ena_vf_q_mappings()
309 wr32(hw, VPLAN_TXQ_MAPENA(vf->vf_id), VPLAN_TXQ_MAPENA_TX_ENA_M); in ice_ena_vf_q_mappings()
319 wr32(hw, VPLAN_TX_QBASE(vf->vf_id), reg); in ice_ena_vf_q_mappings()
325 wr32(hw, VPLAN_RXQ_MAPENA(vf->vf_id), VPLAN_RXQ_MAPENA_RX_ENA_M); in ice_ena_vf_q_mappings()
335 wr32(hw, VPLAN_RX_QBASE(vf->vf_id), reg); in ice_ena_vf_q_mappings()
345 static void ice_ena_vf_mappings(struct ice_vf *vf) in ice_ena_vf_mappings() argument
347 struct ice_vsi *vsi = ice_get_vf_vsi(vf); in ice_ena_vf_mappings()
352 ice_ena_vf_msix_mappings(vf); in ice_ena_vf_mappings()
353 ice_ena_vf_q_mappings(vf, vsi->alloc_txq, vsi->alloc_rxq); in ice_ena_vf_mappings()
361 void ice_calc_vf_reg_idx(struct ice_vf *vf, struct ice_q_vector *q_vector) in ice_calc_vf_reg_idx() argument
363 if (!vf || !q_vector) in ice_calc_vf_reg_idx()
368 q_vector->reg_idx = vf->first_vector_idx + q_vector->vf_reg_idx; in ice_calc_vf_reg_idx()
534 static void ice_sriov_free_irqs(struct ice_pf *pf, struct ice_vf *vf) in ice_sriov_free_irqs() argument
537 int bm_i = pf->sriov_irq_size - vf->first_vector_idx - vf->num_msix; in ice_sriov_free_irqs()
539 bitmap_clear(pf->sriov_irq_bm, bm_i, vf->num_msix); in ice_sriov_free_irqs()
540 vf->first_vector_idx = 0; in ice_sriov_free_irqs()
550 static int ice_init_vf_vsi_res(struct ice_vf *vf) in ice_init_vf_vsi_res() argument
552 struct ice_pf *pf = vf->pf; in ice_init_vf_vsi_res()
556 vf->first_vector_idx = ice_sriov_get_irqs(pf, vf->num_msix); in ice_init_vf_vsi_res()
557 if (vf->first_vector_idx < 0) in ice_init_vf_vsi_res()
560 vsi = ice_vf_vsi_setup(vf); in ice_init_vf_vsi_res()
564 err = ice_vf_init_host_cfg(vf, vsi); in ice_init_vf_vsi_res()
571 ice_vf_vsi_release(vf); in ice_init_vf_vsi_res()
583 struct ice_vf *vf; in ice_start_vfs() local
589 ice_for_each_vf(pf, bkt, vf) { in ice_start_vfs()
590 vf->vf_ops->clear_reset_trigger(vf); in ice_start_vfs()
592 retval = ice_init_vf_vsi_res(vf); in ice_start_vfs()
595 vf->vf_id, retval); in ice_start_vfs()
599 retval = ice_eswitch_attach_vf(pf, vf); in ice_start_vfs()
602 vf->vf_id, retval); in ice_start_vfs()
603 ice_vf_vsi_release(vf); in ice_start_vfs()
607 set_bit(ICE_VF_STATE_INIT, vf->vf_states); in ice_start_vfs()
608 ice_ena_vf_mappings(vf); in ice_start_vfs()
609 wr32(hw, VFGEN_RSTAT(vf->vf_id), VIRTCHNL_VFR_VFACTIVE); in ice_start_vfs()
617 ice_for_each_vf(pf, bkt, vf) { in ice_start_vfs()
621 ice_dis_vf_mappings(vf); in ice_start_vfs()
622 ice_vf_vsi_release(vf); in ice_start_vfs()
636 static void ice_sriov_free_vf(struct ice_vf *vf) in ice_sriov_free_vf() argument
638 mutex_destroy(&vf->cfg_lock); in ice_sriov_free_vf()
640 kfree_rcu(vf, rcu); in ice_sriov_free_vf()
647 static void ice_sriov_clear_reset_state(struct ice_vf *vf) in ice_sriov_clear_reset_state() argument
649 struct ice_hw *hw = &vf->pf->hw; in ice_sriov_clear_reset_state()
655 wr32(hw, VFGEN_RSTAT(vf->vf_id), VIRTCHNL_VFR_INPROGRESS); in ice_sriov_clear_reset_state()
662 static void ice_sriov_clear_mbx_register(struct ice_vf *vf) in ice_sriov_clear_mbx_register() argument
664 struct ice_pf *pf = vf->pf; in ice_sriov_clear_mbx_register()
666 wr32(&pf->hw, VF_MBX_ARQLEN(vf->vf_id), 0); in ice_sriov_clear_mbx_register()
667 wr32(&pf->hw, VF_MBX_ATQLEN(vf->vf_id), 0); in ice_sriov_clear_mbx_register()
677 static void ice_sriov_trigger_reset_register(struct ice_vf *vf, bool is_vflr) in ice_sriov_trigger_reset_register() argument
679 struct ice_pf *pf = vf->pf; in ice_sriov_trigger_reset_register()
687 vf_abs_id = vf->vf_id + hw->func_caps.vf_base_id; in ice_sriov_trigger_reset_register()
694 reg = rd32(hw, VPGEN_VFRTRIG(vf->vf_id)); in ice_sriov_trigger_reset_register()
696 wr32(hw, VPGEN_VFRTRIG(vf->vf_id), reg); in ice_sriov_trigger_reset_register()
713 dev_err(dev, "VF %u PCI transactions stuck\n", vf->vf_id); in ice_sriov_trigger_reset_register()
724 static bool ice_sriov_poll_reset_status(struct ice_vf *vf) in ice_sriov_poll_reset_status() argument
726 struct ice_pf *pf = vf->pf; in ice_sriov_poll_reset_status()
735 reg = rd32(&pf->hw, VPGEN_VFRSTAT(vf->vf_id)); in ice_sriov_poll_reset_status()
749 static void ice_sriov_clear_reset_trigger(struct ice_vf *vf) in ice_sriov_clear_reset_trigger() argument
751 struct ice_hw *hw = &vf->pf->hw; in ice_sriov_clear_reset_trigger()
754 reg = rd32(hw, VPGEN_VFRTRIG(vf->vf_id)); in ice_sriov_clear_reset_trigger()
756 wr32(hw, VPGEN_VFRTRIG(vf->vf_id), reg); in ice_sriov_clear_reset_trigger()
764 static void ice_sriov_post_vsi_rebuild(struct ice_vf *vf) in ice_sriov_post_vsi_rebuild() argument
766 ice_ena_vf_mappings(vf); in ice_sriov_post_vsi_rebuild()
767 wr32(&vf->pf->hw, VFGEN_RSTAT(vf->vf_id), VIRTCHNL_VFR_VFACTIVE); in ice_sriov_post_vsi_rebuild()
800 struct ice_vf *vf; in ice_create_vf_entries() local
810 vf = kzalloc(sizeof(*vf), GFP_KERNEL); in ice_create_vf_entries()
811 if (!vf) { in ice_create_vf_entries()
815 kref_init(&vf->refcnt); in ice_create_vf_entries()
817 vf->pf = pf; in ice_create_vf_entries()
818 vf->vf_id = vf_id; in ice_create_vf_entries()
821 vf->vf_ops = &ice_sriov_vf_ops; in ice_create_vf_entries()
823 ice_initialize_vf_entry(vf); in ice_create_vf_entries()
828 vf->vfdev = vfdev; in ice_create_vf_entries()
829 vf->vf_sw_id = pf->first_sw; in ice_create_vf_entries()
833 hash_add_rcu(vfs->table, &vf->entry, vf_id); in ice_create_vf_entries()
1062 struct ice_vf *vf; in ice_sriov_set_msix_vec_count() local
1091 vf = ice_get_vf_by_id(pf, id); in ice_sriov_set_msix_vec_count()
1093 if (!vf) in ice_sriov_set_msix_vec_count()
1096 vsi = ice_get_vf_vsi(vf); in ice_sriov_set_msix_vec_count()
1098 ice_put_vf(vf); in ice_sriov_set_msix_vec_count()
1102 prev_msix = vf->num_msix; in ice_sriov_set_msix_vec_count()
1103 prev_queues = vf->num_vf_qs; in ice_sriov_set_msix_vec_count()
1106 ice_put_vf(vf); in ice_sriov_set_msix_vec_count()
1110 ice_dis_vf_mappings(vf); in ice_sriov_set_msix_vec_count()
1111 ice_sriov_free_irqs(pf, vf); in ice_sriov_set_msix_vec_count()
1114 ice_sriov_remap_vectors(pf, vf->vf_id); in ice_sriov_set_msix_vec_count()
1116 vf->num_msix = msix_vec_count; in ice_sriov_set_msix_vec_count()
1117 vf->num_vf_qs = queues; in ice_sriov_set_msix_vec_count()
1118 vf->first_vector_idx = ice_sriov_get_irqs(pf, vf->num_msix); in ice_sriov_set_msix_vec_count()
1119 if (vf->first_vector_idx < 0) in ice_sriov_set_msix_vec_count()
1133 vf->vf_id, vf->num_msix, vf->num_vf_qs); in ice_sriov_set_msix_vec_count()
1135 ice_ena_vf_mappings(vf); in ice_sriov_set_msix_vec_count()
1136 ice_put_vf(vf); in ice_sriov_set_msix_vec_count()
1143 vf->num_msix, vf->vf_id, prev_msix); in ice_sriov_set_msix_vec_count()
1145 vf->num_msix = prev_msix; in ice_sriov_set_msix_vec_count()
1146 vf->num_vf_qs = prev_queues; in ice_sriov_set_msix_vec_count()
1147 vf->first_vector_idx = ice_sriov_get_irqs(pf, vf->num_msix); in ice_sriov_set_msix_vec_count()
1148 if (vf->first_vector_idx < 0) { in ice_sriov_set_msix_vec_count()
1149 ice_put_vf(vf); in ice_sriov_set_msix_vec_count()
1160 ice_ena_vf_mappings(vf); in ice_sriov_set_msix_vec_count()
1161 ice_put_vf(vf); in ice_sriov_set_msix_vec_count()
1212 struct ice_vf *vf; in ice_process_vflr_event() local
1221 ice_for_each_vf(pf, bkt, vf) { in ice_process_vflr_event()
1224 reg_idx = (hw->func_caps.vf_base_id + vf->vf_id) / 32; in ice_process_vflr_event()
1225 bit_idx = (hw->func_caps.vf_base_id + vf->vf_id) % 32; in ice_process_vflr_event()
1230 ice_reset_vf(vf, ICE_VF_RESET_VFLR | ICE_VF_RESET_LOCK); in ice_process_vflr_event()
1249 struct ice_vf *vf; in ice_get_vf_from_pfq() local
1253 ice_for_each_vf_rcu(pf, bkt, vf) { in ice_get_vf_from_pfq()
1257 vsi = ice_get_vf_vsi(vf); in ice_get_vf_from_pfq()
1265 if (kref_get_unless_zero(&vf->refcnt)) in ice_get_vf_from_pfq()
1266 found = vf; in ice_get_vf_from_pfq()
1301 struct ice_vf *vf; in ice_vf_lan_overflow_event() local
1309 vf = ice_get_vf_from_pfq(pf, ice_globalq_to_pfq(pf, queue)); in ice_vf_lan_overflow_event()
1310 if (!vf) in ice_vf_lan_overflow_event()
1313 ice_reset_vf(vf, ICE_VF_RESET_NOTIFY | ICE_VF_RESET_LOCK); in ice_vf_lan_overflow_event()
1314 ice_put_vf(vf); in ice_vf_lan_overflow_event()
1331 struct ice_vf *vf; in ice_set_vf_spoofchk() local
1336 vf = ice_get_vf_by_id(pf, vf_id); in ice_set_vf_spoofchk()
1337 if (!vf) in ice_set_vf_spoofchk()
1340 ret = ice_check_vf_ready_for_cfg(vf); in ice_set_vf_spoofchk()
1344 vf_vsi = ice_get_vf_vsi(vf); in ice_set_vf_spoofchk()
1347 vf->lan_vsi_idx, vf->vf_id); in ice_set_vf_spoofchk()
1354 vf_vsi->type, vf_vsi->vsi_num, vf->vf_id); in ice_set_vf_spoofchk()
1359 if (ena == vf->spoofchk) { in ice_set_vf_spoofchk()
1368 ena ? "ON" : "OFF", vf->vf_id, vf_vsi->vsi_num, ret); in ice_set_vf_spoofchk()
1370 vf->spoofchk = ena; in ice_set_vf_spoofchk()
1373 ice_put_vf(vf); in ice_set_vf_spoofchk()
1389 struct ice_vf *vf; in ice_get_vf_cfg() local
1392 vf = ice_get_vf_by_id(pf, vf_id); in ice_get_vf_cfg()
1393 if (!vf) in ice_get_vf_cfg()
1396 ret = ice_check_vf_ready_for_cfg(vf); in ice_get_vf_cfg()
1400 ivi->vf = vf_id; in ice_get_vf_cfg()
1401 ether_addr_copy(ivi->mac, vf->hw_lan_addr); in ice_get_vf_cfg()
1404 ivi->vlan = ice_vf_get_port_vlan_id(vf); in ice_get_vf_cfg()
1405 ivi->qos = ice_vf_get_port_vlan_prio(vf); in ice_get_vf_cfg()
1406 if (ice_vf_is_port_vlan_ena(vf)) in ice_get_vf_cfg()
1407 ivi->vlan_proto = cpu_to_be16(ice_vf_get_port_vlan_tpid(vf)); in ice_get_vf_cfg()
1409 ivi->trusted = vf->trusted; in ice_get_vf_cfg()
1410 ivi->spoofchk = vf->spoofchk; in ice_get_vf_cfg()
1411 if (!vf->link_forced) in ice_get_vf_cfg()
1413 else if (vf->link_up) in ice_get_vf_cfg()
1417 ivi->max_tx_rate = vf->max_tx_rate; in ice_get_vf_cfg()
1418 ivi->min_tx_rate = vf->min_tx_rate; in ice_get_vf_cfg()
1421 ice_put_vf(vf); in ice_get_vf_cfg()
1437 struct ice_vf *vf; in __ice_set_vf_mac() local
1446 vf = ice_get_vf_by_id(pf, vf_id); in __ice_set_vf_mac()
1447 if (!vf) in __ice_set_vf_mac()
1451 if (ether_addr_equal(vf->dev_lan_addr, mac) && in __ice_set_vf_mac()
1452 ether_addr_equal(vf->hw_lan_addr, mac)) { in __ice_set_vf_mac()
1457 ret = ice_check_vf_ready_for_cfg(vf); in __ice_set_vf_mac()
1461 mutex_lock(&vf->cfg_lock); in __ice_set_vf_mac()
1466 ether_addr_copy(vf->dev_lan_addr, mac); in __ice_set_vf_mac()
1467 ether_addr_copy(vf->hw_lan_addr, mac); in __ice_set_vf_mac()
1470 vf->pf_set_mac = false; in __ice_set_vf_mac()
1472 vf->vf_id); in __ice_set_vf_mac()
1475 vf->pf_set_mac = true; in __ice_set_vf_mac()
1480 ice_reset_vf(vf, ICE_VF_RESET_NOTIFY); in __ice_set_vf_mac()
1481 mutex_unlock(&vf->cfg_lock); in __ice_set_vf_mac()
1484 ice_put_vf(vf); in __ice_set_vf_mac()
1513 struct ice_vf *vf; in ice_set_vf_trust() local
1516 vf = ice_get_vf_by_id(pf, vf_id); in ice_set_vf_trust()
1517 if (!vf) in ice_set_vf_trust()
1525 ret = ice_check_vf_ready_for_cfg(vf); in ice_set_vf_trust()
1530 if (trusted == vf->trusted) { in ice_set_vf_trust()
1535 mutex_lock(&vf->cfg_lock); in ice_set_vf_trust()
1537 vf->trusted = trusted; in ice_set_vf_trust()
1538 ice_reset_vf(vf, ICE_VF_RESET_NOTIFY); in ice_set_vf_trust()
1542 mutex_unlock(&vf->cfg_lock); in ice_set_vf_trust()
1545 ice_put_vf(vf); in ice_set_vf_trust()
1560 struct ice_vf *vf; in ice_set_vf_link_state() local
1563 vf = ice_get_vf_by_id(pf, vf_id); in ice_set_vf_link_state()
1564 if (!vf) in ice_set_vf_link_state()
1567 ret = ice_check_vf_ready_for_cfg(vf); in ice_set_vf_link_state()
1573 vf->link_forced = false; in ice_set_vf_link_state()
1576 vf->link_forced = true; in ice_set_vf_link_state()
1577 vf->link_up = true; in ice_set_vf_link_state()
1580 vf->link_forced = true; in ice_set_vf_link_state()
1581 vf->link_up = false; in ice_set_vf_link_state()
1588 ice_vc_notify_vf_link_state(vf); in ice_set_vf_link_state()
1591 ice_put_vf(vf); in ice_set_vf_link_state()
1601 struct ice_vf *vf; in ice_calc_all_vfs_min_tx_rate() local
1606 ice_for_each_vf_rcu(pf, bkt, vf) in ice_calc_all_vfs_min_tx_rate()
1607 rate += vf->min_tx_rate; in ice_calc_all_vfs_min_tx_rate()
1626 ice_min_tx_rate_oversubscribed(struct ice_vf *vf, int min_tx_rate) in ice_min_tx_rate_oversubscribed() argument
1628 struct ice_vsi *vsi = ice_get_vf_vsi(vf); in ice_min_tx_rate_oversubscribed()
1636 all_vfs_min_tx_rate = ice_calc_all_vfs_min_tx_rate(vf->pf); in ice_min_tx_rate_oversubscribed()
1639 all_vfs_min_tx_rate -= vf->min_tx_rate; in ice_min_tx_rate_oversubscribed()
1642 …dev_err(ice_pf_to_dev(vf->pf), "min_tx_rate of %d Mbps on VF %u would cause oversubscription of %d… in ice_min_tx_rate_oversubscribed()
1643 min_tx_rate, vf->vf_id, in ice_min_tx_rate_oversubscribed()
1666 struct ice_vf *vf; in ice_set_vf_bw() local
1671 vf = ice_get_vf_by_id(pf, vf_id); in ice_set_vf_bw()
1672 if (!vf) in ice_set_vf_bw()
1675 ret = ice_check_vf_ready_for_cfg(vf); in ice_set_vf_bw()
1679 vsi = ice_get_vf_vsi(vf); in ice_set_vf_bw()
1691 if (ice_min_tx_rate_oversubscribed(vf, min_tx_rate)) { in ice_set_vf_bw()
1696 if (vf->min_tx_rate != (unsigned int)min_tx_rate) { in ice_set_vf_bw()
1700 vf->vf_id); in ice_set_vf_bw()
1704 vf->min_tx_rate = min_tx_rate; in ice_set_vf_bw()
1707 if (vf->max_tx_rate != (unsigned int)max_tx_rate) { in ice_set_vf_bw()
1711 vf->vf_id); in ice_set_vf_bw()
1715 vf->max_tx_rate = max_tx_rate; in ice_set_vf_bw()
1719 ice_put_vf(vf); in ice_set_vf_bw()
1735 struct ice_vf *vf; in ice_get_vf_stats() local
1738 vf = ice_get_vf_by_id(pf, vf_id); in ice_get_vf_stats()
1739 if (!vf) in ice_get_vf_stats()
1742 ret = ice_check_vf_ready_for_cfg(vf); in ice_get_vf_stats()
1746 vsi = ice_get_vf_vsi(vf); in ice_get_vf_stats()
1769 ice_put_vf(vf); in ice_get_vf_stats()
1817 struct ice_vf *vf; in ice_set_vf_port_vlan() local
1834 vf = ice_get_vf_by_id(pf, vf_id); in ice_set_vf_port_vlan()
1835 if (!vf) in ice_set_vf_port_vlan()
1838 ret = ice_check_vf_ready_for_cfg(vf); in ice_set_vf_port_vlan()
1842 if (ice_vf_get_port_vlan_prio(vf) == qos && in ice_set_vf_port_vlan()
1843 ice_vf_get_port_vlan_tpid(vf) == local_vlan_proto && in ice_set_vf_port_vlan()
1844 ice_vf_get_port_vlan_id(vf) == vlan_id) { in ice_set_vf_port_vlan()
1852 mutex_lock(&vf->cfg_lock); in ice_set_vf_port_vlan()
1854 vf->port_vlan_info = ICE_VLAN(local_vlan_proto, vlan_id, qos); in ice_set_vf_port_vlan()
1855 if (ice_vf_is_port_vlan_ena(vf)) in ice_set_vf_port_vlan()
1861 ice_reset_vf(vf, ICE_VF_RESET_NOTIFY); in ice_set_vf_port_vlan()
1862 mutex_unlock(&vf->cfg_lock); in ice_set_vf_port_vlan()
1865 ice_put_vf(vf); in ice_set_vf_port_vlan()
1873 void ice_print_vf_rx_mdd_event(struct ice_vf *vf) in ice_print_vf_rx_mdd_event() argument
1875 struct ice_pf *pf = vf->pf; in ice_print_vf_rx_mdd_event()
1881 vf->mdd_rx_events.count, pf->hw.pf_id, vf->vf_id, in ice_print_vf_rx_mdd_event()
1882 vf->dev_lan_addr, in ice_print_vf_rx_mdd_event()
1891 void ice_print_vf_tx_mdd_event(struct ice_vf *vf) in ice_print_vf_tx_mdd_event() argument
1893 struct ice_pf *pf = vf->pf; in ice_print_vf_tx_mdd_event()
1899 vf->mdd_tx_events.count, pf->hw.pf_id, vf->vf_id, in ice_print_vf_tx_mdd_event()
1900 vf->dev_lan_addr, in ice_print_vf_tx_mdd_event()
1913 struct ice_vf *vf; in ice_print_vfs_mdd_events() local
1927 ice_for_each_vf(pf, bkt, vf) { in ice_print_vfs_mdd_events()
1929 if (vf->mdd_rx_events.count != vf->mdd_rx_events.last_printed) { in ice_print_vfs_mdd_events()
1930 vf->mdd_rx_events.last_printed = in ice_print_vfs_mdd_events()
1931 vf->mdd_rx_events.count; in ice_print_vfs_mdd_events()
1932 ice_print_vf_rx_mdd_event(vf); in ice_print_vfs_mdd_events()
1936 if (vf->mdd_tx_events.count != vf->mdd_tx_events.last_printed) { in ice_print_vfs_mdd_events()
1937 vf->mdd_tx_events.last_printed = in ice_print_vfs_mdd_events()
1938 vf->mdd_tx_events.count; in ice_print_vfs_mdd_events()
1939 ice_print_vf_tx_mdd_event(vf); in ice_print_vfs_mdd_events()
1954 struct ice_vf *vf; in ice_restore_all_vfs_msi_state() local
1957 ice_for_each_vf(pf, bkt, vf) in ice_restore_all_vfs_msi_state()
1958 pci_restore_msi_state(vf->vfdev); in ice_restore_all_vfs_msi_state()