Lines Matching refs:vf
181 struct ice_vf *vf; in ice_vc_vf_broadcast() local
185 ice_for_each_vf(pf, bkt, vf) { in ice_vc_vf_broadcast()
187 if (!test_bit(ICE_VF_STATE_INIT, vf->vf_states) && in ice_vc_vf_broadcast()
188 !test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) in ice_vc_vf_broadcast()
194 ice_aq_send_msg_to_vf(hw, vf->vf_id, v_opcode, v_retval, msg, in ice_vc_vf_broadcast()
208 ice_set_pfe_link(struct ice_vf *vf, struct virtchnl_pf_event *pfe, in ice_set_pfe_link() argument
211 if (vf->driver_caps & VIRTCHNL_VF_CAP_ADV_LINK_SPEED) { in ice_set_pfe_link()
231 void ice_vc_notify_vf_link_state(struct ice_vf *vf) in ice_vc_notify_vf_link_state() argument
234 struct ice_hw *hw = &vf->pf->hw; in ice_vc_notify_vf_link_state()
239 if (ice_is_vf_link_up(vf)) in ice_vc_notify_vf_link_state()
240 ice_set_pfe_link(vf, &pfe, in ice_vc_notify_vf_link_state()
243 ice_set_pfe_link(vf, &pfe, ICE_AQ_LINK_SPEED_UNKNOWN, false); in ice_vc_notify_vf_link_state()
245 ice_aq_send_msg_to_vf(hw, vf->vf_id, VIRTCHNL_OP_EVENT, in ice_vc_notify_vf_link_state()
256 struct ice_vf *vf; in ice_vc_notify_link_state() local
260 ice_for_each_vf(pf, bkt, vf) in ice_vc_notify_link_state()
261 ice_vc_notify_vf_link_state(vf); in ice_vc_notify_link_state()
295 ice_vc_send_msg_to_vf(struct ice_vf *vf, u32 v_opcode, in ice_vc_send_msg_to_vf() argument
302 pf = vf->pf; in ice_vc_send_msg_to_vf()
305 aq_ret = ice_aq_send_msg_to_vf(&pf->hw, vf->vf_id, v_opcode, v_retval, in ice_vc_send_msg_to_vf()
309 vf->vf_id, aq_ret, in ice_vc_send_msg_to_vf()
324 static int ice_vc_get_ver_msg(struct ice_vf *vf, u8 *msg) in ice_vc_get_ver_msg() argument
330 vf->vf_ver = *(struct virtchnl_version_info *)msg; in ice_vc_get_ver_msg()
332 if (VF_IS_V10(&vf->vf_ver)) in ice_vc_get_ver_msg()
335 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_VERSION, in ice_vc_get_ver_msg()
349 static u16 ice_vc_get_max_frame_size(struct ice_vf *vf) in ice_vc_get_max_frame_size() argument
351 struct ice_port_info *pi = ice_vf_get_port_info(vf); in ice_vc_get_max_frame_size()
356 if (ice_vf_is_port_vlan_ena(vf)) in ice_vc_get_max_frame_size()
372 ice_vc_get_vlan_caps(struct ice_hw *hw, struct ice_vf *vf, struct ice_vsi *vsi, in ice_vc_get_vlan_caps() argument
375 if (ice_is_eswitch_mode_switchdev(vf->pf)) in ice_vc_get_vlan_caps()
389 if (ice_is_dvm_ena(hw) && ice_vf_is_port_vlan_ena(vf)) { in ice_vc_get_vlan_caps()
392 !ice_vf_is_port_vlan_ena(vf)) { in ice_vc_get_vlan_caps()
417 static int ice_vc_get_vf_res_msg(struct ice_vf *vf, u8 *msg) in ice_vc_get_vf_res_msg() argument
421 struct ice_hw *hw = &vf->pf->hw; in ice_vc_get_vf_res_msg()
426 if (ice_check_vf_init(vf)) { in ice_vc_get_vf_res_msg()
439 if (VF_IS_V11(&vf->vf_ver)) in ice_vc_get_vf_res_msg()
440 vf->driver_caps = *(u32 *)msg; in ice_vc_get_vf_res_msg()
442 vf->driver_caps = VIRTCHNL_VF_OFFLOAD_L2 | in ice_vc_get_vf_res_msg()
446 vsi = ice_get_vf_vsi(vf); in ice_vc_get_vf_res_msg()
452 vfres->vf_cap_flags |= ice_vc_get_vlan_caps(hw, vf, vsi, in ice_vc_get_vf_res_msg()
453 vf->driver_caps); in ice_vc_get_vf_res_msg()
455 if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RSS_PF) in ice_vc_get_vf_res_msg()
458 if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC) in ice_vc_get_vf_res_msg()
461 if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_FDIR_PF) in ice_vc_get_vf_res_msg()
464 if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_TC_U32 && in ice_vc_get_vf_res_msg()
468 if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2) in ice_vc_get_vf_res_msg()
471 if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_ENCAP) in ice_vc_get_vf_res_msg()
474 if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM) in ice_vc_get_vf_res_msg()
477 if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RX_POLLING) in ice_vc_get_vf_res_msg()
480 if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) in ice_vc_get_vf_res_msg()
483 if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_REQ_QUEUES) in ice_vc_get_vf_res_msg()
486 if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_CRC) in ice_vc_get_vf_res_msg()
489 if (vf->driver_caps & VIRTCHNL_VF_CAP_ADV_LINK_SPEED) in ice_vc_get_vf_res_msg()
492 if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF) in ice_vc_get_vf_res_msg()
495 if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_USO) in ice_vc_get_vf_res_msg()
501 vfres->max_vectors = vf->num_msix; in ice_vc_get_vf_res_msg()
504 vfres->max_mtu = ice_vc_get_max_frame_size(vf); in ice_vc_get_vf_res_msg()
510 vf->hw_lan_addr); in ice_vc_get_vf_res_msg()
513 vf->driver_caps = vfres->vf_cap_flags; in ice_vc_get_vf_res_msg()
515 ice_vc_set_caps_allowlist(vf); in ice_vc_get_vf_res_msg()
516 ice_vc_set_working_allowlist(vf); in ice_vc_get_vf_res_msg()
518 set_bit(ICE_VF_STATE_ACTIVE, vf->vf_states); in ice_vc_get_vf_res_msg()
522 ret = ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_GET_VF_RESOURCES, v_ret, in ice_vc_get_vf_res_msg()
537 static void ice_vc_reset_vf_msg(struct ice_vf *vf) in ice_vc_reset_vf_msg() argument
539 if (test_bit(ICE_VF_STATE_INIT, vf->vf_states)) in ice_vc_reset_vf_msg()
540 ice_reset_vf(vf, 0); in ice_vc_reset_vf_msg()
550 bool ice_vc_isvalid_vsi_id(struct ice_vf *vf, u16 vsi_id) in ice_vc_isvalid_vsi_id() argument
593 ice_vc_validate_pattern(struct ice_vf *vf, struct virtchnl_proto_hdrs *proto) in ice_vc_validate_pattern() argument
674 return ice_hw_ptype_ena(&vf->pf->hw, ptype); in ice_vc_validate_pattern()
770 static int ice_vc_handle_rss_cfg(struct ice_vf *vf, u8 *msg, bool add) in ice_vc_handle_rss_cfg() argument
775 struct device *dev = ice_pf_to_dev(vf->pf); in ice_vc_handle_rss_cfg()
776 struct ice_hw *hw = &vf->pf->hw; in ice_vc_handle_rss_cfg()
779 if (!test_bit(ICE_FLAG_RSS_ENA, vf->pf->flags)) { in ice_vc_handle_rss_cfg()
781 vf->vf_id); in ice_vc_handle_rss_cfg()
786 if (!ice_vf_adv_rss_offload_ena(vf->driver_caps)) { in ice_vc_handle_rss_cfg()
788 vf->vf_id); in ice_vc_handle_rss_cfg()
793 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { in ice_vc_handle_rss_cfg()
802 vf->vf_id); in ice_vc_handle_rss_cfg()
807 vsi = ice_get_vf_vsi(vf); in ice_vc_handle_rss_cfg()
813 if (!ice_vc_validate_pattern(vf, &rss_cfg->proto_hdrs)) { in ice_vc_handle_rss_cfg()
860 if (!ice_vc_validate_pattern(vf, &rss_cfg->proto_hdrs)) { in ice_vc_handle_rss_cfg()
890 vf->vf_id, status); in ice_vc_handle_rss_cfg()
896 return ice_vc_send_msg_to_vf(vf, v_opcode, v_ret, NULL, 0); in ice_vc_handle_rss_cfg()
906 static int ice_vc_config_rss_key(struct ice_vf *vf, u8 *msg) in ice_vc_config_rss_key() argument
913 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { in ice_vc_config_rss_key()
918 if (!ice_vc_isvalid_vsi_id(vf, vrk->vsi_id)) { in ice_vc_config_rss_key()
928 if (!test_bit(ICE_FLAG_RSS_ENA, vf->pf->flags)) { in ice_vc_config_rss_key()
933 vsi = ice_get_vf_vsi(vf); in ice_vc_config_rss_key()
942 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_CONFIG_RSS_KEY, v_ret, in ice_vc_config_rss_key()
953 static int ice_vc_config_rss_lut(struct ice_vf *vf, u8 *msg) in ice_vc_config_rss_lut() argument
959 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { in ice_vc_config_rss_lut()
964 if (!ice_vc_isvalid_vsi_id(vf, vrl->vsi_id)) { in ice_vc_config_rss_lut()
974 if (!test_bit(ICE_FLAG_RSS_ENA, vf->pf->flags)) { in ice_vc_config_rss_lut()
979 vsi = ice_get_vf_vsi(vf); in ice_vc_config_rss_lut()
988 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_CONFIG_RSS_LUT, v_ret, in ice_vc_config_rss_lut()
999 static int ice_vc_config_rss_hfunc(struct ice_vf *vf, u8 *msg) in ice_vc_config_rss_hfunc() argument
1006 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { in ice_vc_config_rss_hfunc()
1011 if (!ice_vc_isvalid_vsi_id(vf, vrh->vsi_id)) { in ice_vc_config_rss_hfunc()
1016 if (!test_bit(ICE_FLAG_RSS_ENA, vf->pf->flags)) { in ice_vc_config_rss_hfunc()
1021 vsi = ice_get_vf_vsi(vf); in ice_vc_config_rss_hfunc()
1033 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_CONFIG_RSS_HFUNC, v_ret, in ice_vc_config_rss_hfunc()
1044 static int ice_vc_cfg_promiscuous_mode_msg(struct ice_vf *vf, u8 *msg) in ice_vc_cfg_promiscuous_mode_msg() argument
1052 struct ice_pf *pf = vf->pf; in ice_vc_cfg_promiscuous_mode_msg()
1058 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { in ice_vc_cfg_promiscuous_mode_msg()
1063 if (!ice_vc_isvalid_vsi_id(vf, info->vsi_id)) { in ice_vc_cfg_promiscuous_mode_msg()
1068 vsi = ice_get_vf_vsi(vf); in ice_vc_cfg_promiscuous_mode_msg()
1075 if (!ice_is_vf_trusted(vf)) { in ice_vc_cfg_promiscuous_mode_msg()
1077 vf->vf_id); in ice_vc_cfg_promiscuous_mode_msg()
1101 ice_vf_get_promisc_masks(vf, vsi, &ucast_m, &mcast_m); in ice_vc_cfg_promiscuous_mode_msg()
1117 mcast_err = ice_vf_set_vsi_promisc(vf, vsi, mcast_m); in ice_vc_cfg_promiscuous_mode_msg()
1119 mcast_err = ice_vf_clear_vsi_promisc(vf, vsi, mcast_m); in ice_vc_cfg_promiscuous_mode_msg()
1123 vf->vf_id, ret); in ice_vc_cfg_promiscuous_mode_msg()
1129 ucast_err = ice_vf_set_vsi_promisc(vf, vsi, ucast_m); in ice_vc_cfg_promiscuous_mode_msg()
1131 ucast_err = ice_vf_clear_vsi_promisc(vf, vsi, ucast_m); in ice_vc_cfg_promiscuous_mode_msg()
1134 mcast_err = ice_vf_set_vsi_promisc(vf, vsi, mcast_m); in ice_vc_cfg_promiscuous_mode_msg()
1136 mcast_err = ice_vf_clear_vsi_promisc(vf, vsi, mcast_m); in ice_vc_cfg_promiscuous_mode_msg()
1144 !test_and_set_bit(ICE_VF_STATE_MC_PROMISC, vf->vf_states)) in ice_vc_cfg_promiscuous_mode_msg()
1146 vf->vf_id); in ice_vc_cfg_promiscuous_mode_msg()
1149 vf->vf_states)) in ice_vc_cfg_promiscuous_mode_msg()
1151 vf->vf_id); in ice_vc_cfg_promiscuous_mode_msg()
1154 vf->vf_id, mcast_err); in ice_vc_cfg_promiscuous_mode_msg()
1159 !test_and_set_bit(ICE_VF_STATE_UC_PROMISC, vf->vf_states)) in ice_vc_cfg_promiscuous_mode_msg()
1161 vf->vf_id); in ice_vc_cfg_promiscuous_mode_msg()
1164 vf->vf_states)) in ice_vc_cfg_promiscuous_mode_msg()
1166 vf->vf_id); in ice_vc_cfg_promiscuous_mode_msg()
1169 vf->vf_id, ucast_err); in ice_vc_cfg_promiscuous_mode_msg()
1173 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE, in ice_vc_cfg_promiscuous_mode_msg()
1184 static int ice_vc_get_stats_msg(struct ice_vf *vf, u8 *msg) in ice_vc_get_stats_msg() argument
1192 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { in ice_vc_get_stats_msg()
1197 if (!ice_vc_isvalid_vsi_id(vf, vqs->vsi_id)) { in ice_vc_get_stats_msg()
1202 vsi = ice_get_vf_vsi(vf); in ice_vc_get_stats_msg()
1214 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_GET_STATS, v_ret, in ice_vc_get_stats_msg()
1287 static int ice_vc_ena_qs_msg(struct ice_vf *vf, u8 *msg) in ice_vc_ena_qs_msg() argument
1296 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { in ice_vc_ena_qs_msg()
1301 if (!ice_vc_isvalid_vsi_id(vf, vqs->vsi_id)) { in ice_vc_ena_qs_msg()
1311 vsi = ice_get_vf_vsi(vf); in ice_vc_ena_qs_msg()
1329 if (test_bit(vf_q_id, vf->rxq_ena)) in ice_vc_ena_qs_msg()
1340 set_bit(vf_q_id, vf->rxq_ena); in ice_vc_ena_qs_msg()
1351 if (test_bit(vf_q_id, vf->txq_ena)) in ice_vc_ena_qs_msg()
1355 set_bit(vf_q_id, vf->txq_ena); in ice_vc_ena_qs_msg()
1360 set_bit(ICE_VF_STATE_QS_ENA, vf->vf_states); in ice_vc_ena_qs_msg()
1364 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_ENABLE_QUEUES, v_ret, in ice_vc_ena_qs_msg()
1379 ice_vf_vsi_dis_single_txq(struct ice_vf *vf, struct ice_vsi *vsi, u16 q_id) in ice_vf_vsi_dis_single_txq() argument
1385 if (!test_bit(q_id, vf->txq_ena)) in ice_vf_vsi_dis_single_txq()
1395 err = ice_vsi_stop_tx_ring(vsi, ICE_NO_RESET, vf->vf_id, ring, &txq_meta); in ice_vf_vsi_dis_single_txq()
1403 clear_bit(q_id, vf->txq_ena); in ice_vf_vsi_dis_single_txq()
1415 static int ice_vc_dis_qs_msg(struct ice_vf *vf, u8 *msg) in ice_vc_dis_qs_msg() argument
1424 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states) && in ice_vc_dis_qs_msg()
1425 !test_bit(ICE_VF_STATE_QS_ENA, vf->vf_states)) { in ice_vc_dis_qs_msg()
1430 if (!ice_vc_isvalid_vsi_id(vf, vqs->vsi_id)) { in ice_vc_dis_qs_msg()
1440 vsi = ice_get_vf_vsi(vf); in ice_vc_dis_qs_msg()
1455 if (ice_vf_vsi_dis_single_txq(vf, vsi, vf_q_id)) { in ice_vc_dis_qs_msg()
1465 bitmap_equal(&q_map, vf->rxq_ena, ICE_MAX_RSS_QS_PER_VF)) { in ice_vc_dis_qs_msg()
1473 bitmap_zero(vf->rxq_ena, ICE_MAX_RSS_QS_PER_VF); in ice_vc_dis_qs_msg()
1482 if (!test_bit(vf_q_id, vf->rxq_ena)) in ice_vc_dis_qs_msg()
1494 clear_bit(vf_q_id, vf->rxq_ena); in ice_vc_dis_qs_msg()
1499 if (v_ret == VIRTCHNL_STATUS_SUCCESS && ice_vf_has_no_qs_ena(vf)) in ice_vc_dis_qs_msg()
1500 clear_bit(ICE_VF_STATE_QS_ENA, vf->vf_states); in ice_vc_dis_qs_msg()
1504 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_DISABLE_QUEUES, v_ret, in ice_vc_dis_qs_msg()
1517 ice_cfg_interrupt(struct ice_vf *vf, struct ice_vsi *vsi, in ice_cfg_interrupt() argument
1567 static int ice_vc_cfg_irq_map_msg(struct ice_vf *vf, u8 *msg) in ice_vc_cfg_irq_map_msg() argument
1583 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states) || in ice_vc_cfg_irq_map_msg()
1584 vf->num_msix < num_q_vectors_mapped || in ice_vc_cfg_irq_map_msg()
1590 vsi = ice_get_vf_vsi(vf); in ice_vc_cfg_irq_map_msg()
1606 if (!(vector_id < vf->num_msix) || in ice_vc_cfg_irq_map_msg()
1607 !ice_vc_isvalid_vsi_id(vf, vsi_id) || in ice_vc_cfg_irq_map_msg()
1627 v_ret = ice_cfg_interrupt(vf, vsi, map, q_vector); in ice_vc_cfg_irq_map_msg()
1634 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_CONFIG_IRQ_MAP, v_ret, in ice_vc_cfg_irq_map_msg()
1645 static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg) in ice_vc_cfg_qs_msg() argument
1650 struct ice_pf *pf = vf->pf; in ice_vc_cfg_qs_msg()
1669 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) in ice_vc_cfg_qs_msg()
1672 if (!ice_vc_isvalid_vsi_id(vf, qci->vsi_id)) in ice_vc_cfg_qs_msg()
1675 vsi = ice_get_vf_vsi(vf); in ice_vc_cfg_qs_msg()
1682 vf->vf_id, min_t(u16, vsi->alloc_txq, vsi->alloc_rxq)); in ice_vc_cfg_qs_msg()
1690 if (!(vf->driver_caps & VIRTCHNL_VF_OFFLOAD_CRC) || in ice_vc_cfg_qs_msg()
1691 vf->vlan_strip_ena) in ice_vc_cfg_qs_msg()
1722 if (ice_vf_vsi_dis_single_txq(vf, vsi, q_idx)) in ice_vc_cfg_qs_msg()
1728 vf->vf_id, i); in ice_vc_cfg_qs_msg()
1735 u16 max_frame_size = ice_vc_get_max_frame_size(vf); in ice_vc_cfg_qs_msg()
1763 if (ice_vf_is_port_vlan_ena(vf)) in ice_vc_cfg_qs_msg()
1768 vf->vf_id, i); in ice_vc_cfg_qs_msg()
1777 if (vf->driver_caps & in ice_vc_cfg_qs_msg()
1798 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_CONFIG_VSI_QUEUES, in ice_vc_cfg_qs_msg()
1805 vf->vf_id, i); in ice_vc_cfg_qs_msg()
1806 if (ice_vf_vsi_dis_single_txq(vf, vsi, i)) in ice_vc_cfg_qs_msg()
1808 vf->vf_id, i); in ice_vc_cfg_qs_msg()
1816 ice_lag_move_new_vf_nodes(vf); in ice_vc_cfg_qs_msg()
1819 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_CONFIG_VSI_QUEUES, in ice_vc_cfg_qs_msg()
1829 static bool ice_can_vf_change_mac(struct ice_vf *vf) in ice_can_vf_change_mac() argument
1835 if (vf->pf_set_mac && !ice_is_vf_trusted(vf)) in ice_can_vf_change_mac()
1884 ice_vfhw_mac_add(struct ice_vf *vf, struct virtchnl_ether_addr *vc_ether_addr) in ice_vfhw_mac_add() argument
1896 is_zero_ether_addr(vf->hw_lan_addr)) || in ice_vfhw_mac_add()
1898 ether_addr_copy(vf->dev_lan_addr, mac_addr); in ice_vfhw_mac_add()
1899 ether_addr_copy(vf->hw_lan_addr, mac_addr); in ice_vfhw_mac_add()
1909 ether_addr_copy(vf->legacy_last_added_umac.addr, in ice_vfhw_mac_add()
1911 vf->legacy_last_added_umac.time_modified = jiffies; in ice_vfhw_mac_add()
1922 ice_vc_add_mac_addr(struct ice_vf *vf, struct ice_vsi *vsi, in ice_vc_add_mac_addr() argument
1925 struct device *dev = ice_pf_to_dev(vf->pf); in ice_vc_add_mac_addr()
1930 if (ether_addr_equal(mac_addr, vf->dev_lan_addr)) in ice_vc_add_mac_addr()
1933 if (is_unicast_ether_addr(mac_addr) && !ice_can_vf_change_mac(vf)) { in ice_vc_add_mac_addr()
1941 vf->vf_id); in ice_vc_add_mac_addr()
1947 mac_addr, vf->vf_id, ret); in ice_vc_add_mac_addr()
1950 vf->num_mac++; in ice_vc_add_mac_addr()
1953 ice_vfhw_mac_add(vf, vc_ether_addr); in ice_vc_add_mac_addr()
1978 ice_update_legacy_cached_mac(struct ice_vf *vf, in ice_update_legacy_cached_mac() argument
1982 ice_is_legacy_umac_expired(&vf->legacy_last_added_umac)) in ice_update_legacy_cached_mac()
1985 ether_addr_copy(vf->dev_lan_addr, vf->legacy_last_added_umac.addr); in ice_update_legacy_cached_mac()
1986 ether_addr_copy(vf->hw_lan_addr, vf->legacy_last_added_umac.addr); in ice_update_legacy_cached_mac()
1995 ice_vfhw_mac_del(struct ice_vf *vf, struct virtchnl_ether_addr *vc_ether_addr) in ice_vfhw_mac_del() argument
2000 !ether_addr_equal(vf->dev_lan_addr, mac_addr)) in ice_vfhw_mac_del()
2008 eth_zero_addr(vf->dev_lan_addr); in ice_vfhw_mac_del()
2010 ice_update_legacy_cached_mac(vf, vc_ether_addr); in ice_vfhw_mac_del()
2020 ice_vc_del_mac_addr(struct ice_vf *vf, struct ice_vsi *vsi, in ice_vc_del_mac_addr() argument
2023 struct device *dev = ice_pf_to_dev(vf->pf); in ice_vc_del_mac_addr()
2027 if (!ice_can_vf_change_mac(vf) && in ice_vc_del_mac_addr()
2028 ether_addr_equal(vf->dev_lan_addr, mac_addr)) in ice_vc_del_mac_addr()
2034 vf->vf_id); in ice_vc_del_mac_addr()
2038 mac_addr, vf->vf_id, status); in ice_vc_del_mac_addr()
2042 ice_vfhw_mac_del(vf, vc_ether_addr); in ice_vc_del_mac_addr()
2044 vf->num_mac--; in ice_vc_del_mac_addr()
2058 ice_vc_handle_mac_addr_msg(struct ice_vf *vf, u8 *msg, bool set) in ice_vc_handle_mac_addr_msg() argument
2061 (struct ice_vf *vf, struct ice_vsi *vsi, in ice_vc_handle_mac_addr_msg()
2066 struct ice_pf *pf = vf->pf; in ice_vc_handle_mac_addr_msg()
2079 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states) || in ice_vc_handle_mac_addr_msg()
2080 !ice_vc_isvalid_vsi_id(vf, al->vsi_id)) { in ice_vc_handle_mac_addr_msg()
2089 if (set && !ice_is_vf_trusted(vf) && in ice_vc_handle_mac_addr_msg()
2090 (vf->num_mac + al->num_elements) > ICE_MAX_MACADDR_PER_VF) { in ice_vc_handle_mac_addr_msg()
2092 vf->vf_id); in ice_vc_handle_mac_addr_msg()
2097 vsi = ice_get_vf_vsi(vf); in ice_vc_handle_mac_addr_msg()
2111 result = ice_vc_cfg_mac(vf, vsi, &al->list[i]); in ice_vc_handle_mac_addr_msg()
2122 return ice_vc_send_msg_to_vf(vf, vc_op, v_ret, NULL, 0); in ice_vc_handle_mac_addr_msg()
2132 static int ice_vc_add_mac_addr_msg(struct ice_vf *vf, u8 *msg) in ice_vc_add_mac_addr_msg() argument
2134 return ice_vc_handle_mac_addr_msg(vf, msg, true); in ice_vc_add_mac_addr_msg()
2144 static int ice_vc_del_mac_addr_msg(struct ice_vf *vf, u8 *msg) in ice_vc_del_mac_addr_msg() argument
2146 return ice_vc_handle_mac_addr_msg(vf, msg, false); in ice_vc_del_mac_addr_msg()
2159 static int ice_vc_request_qs_msg(struct ice_vf *vf, u8 *msg) in ice_vc_request_qs_msg() argument
2165 struct ice_pf *pf = vf->pf; in ice_vc_request_qs_msg()
2172 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { in ice_vc_request_qs_msg()
2177 cur_queues = vf->num_vf_qs; in ice_vc_request_qs_msg()
2183 vf->vf_id); in ice_vc_request_qs_msg()
2186 vf->vf_id, ICE_MAX_RSS_QS_PER_VF); in ice_vc_request_qs_msg()
2191 vf->vf_id, req_queues - cur_queues, tx_rx_queue_left); in ice_vc_request_qs_msg()
2196 vf->num_req_qs = req_queues; in ice_vc_request_qs_msg()
2197 ice_reset_vf(vf, ICE_VF_RESET_NOTIFY); in ice_vc_request_qs_msg()
2199 vf->vf_id, req_queues); in ice_vc_request_qs_msg()
2205 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_REQUEST_QUEUES, in ice_vc_request_qs_msg()
2224 static bool ice_is_vlan_promisc_allowed(struct ice_vf *vf) in ice_is_vlan_promisc_allowed() argument
2226 if ((test_bit(ICE_VF_STATE_UC_PROMISC, vf->vf_states) || in ice_is_vlan_promisc_allowed()
2227 test_bit(ICE_VF_STATE_MC_PROMISC, vf->vf_states)) && in ice_is_vlan_promisc_allowed()
2228 test_bit(ICE_FLAG_VF_TRUE_PROMISC_ENA, vf->pf->flags)) in ice_is_vlan_promisc_allowed()
2287 static bool ice_vf_has_max_vlans(struct ice_vf *vf, struct ice_vsi *vsi) in ice_vf_has_max_vlans() argument
2289 if (ice_is_vf_trusted(vf)) in ice_vf_has_max_vlans()
2305 static int ice_vc_process_vlan_msg(struct ice_vf *vf, u8 *msg, bool add_v) in ice_vc_process_vlan_msg() argument
2310 struct ice_pf *pf = vf->pf; in ice_vc_process_vlan_msg()
2318 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { in ice_vc_process_vlan_msg()
2323 if (!ice_vf_vlan_offload_ena(vf->driver_caps)) { in ice_vc_process_vlan_msg()
2328 if (!ice_vc_isvalid_vsi_id(vf, vfl->vsi_id)) { in ice_vc_process_vlan_msg()
2342 vsi = ice_get_vf_vsi(vf); in ice_vc_process_vlan_msg()
2348 if (add_v && ice_vf_has_max_vlans(vf, vsi)) { in ice_vc_process_vlan_msg()
2350 vf->vf_id); in ice_vc_process_vlan_msg()
2360 if (ice_vf_is_port_vlan_ena(vf) && !ice_is_dvm_ena(&pf->hw)) { in ice_vc_process_vlan_msg()
2369 vlan_promisc = ice_is_vlan_promisc_allowed(vf) && in ice_vc_process_vlan_msg()
2371 !ice_vf_is_port_vlan_ena(vf); in ice_vc_process_vlan_msg()
2378 if (ice_vf_has_max_vlans(vf, vsi)) { in ice_vc_process_vlan_msg()
2380 vf->vf_id); in ice_vc_process_vlan_msg()
2404 if (vf->spoofchk) { in ice_vc_process_vlan_msg()
2471 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_ADD_VLAN, v_ret, in ice_vc_process_vlan_msg()
2474 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_DEL_VLAN, v_ret, in ice_vc_process_vlan_msg()
2485 static int ice_vc_add_vlan_msg(struct ice_vf *vf, u8 *msg) in ice_vc_add_vlan_msg() argument
2487 return ice_vc_process_vlan_msg(vf, msg, true); in ice_vc_add_vlan_msg()
2497 static int ice_vc_remove_vlan_msg(struct ice_vf *vf, u8 *msg) in ice_vc_remove_vlan_msg() argument
2499 return ice_vc_process_vlan_msg(vf, msg, false); in ice_vc_remove_vlan_msg()
2523 static int ice_vc_ena_vlan_stripping(struct ice_vf *vf) in ice_vc_ena_vlan_stripping() argument
2528 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { in ice_vc_ena_vlan_stripping()
2533 if (!ice_vf_vlan_offload_ena(vf->driver_caps)) { in ice_vc_ena_vlan_stripping()
2538 vsi = ice_get_vf_vsi(vf); in ice_vc_ena_vlan_stripping()
2547 vf->vlan_strip_ena |= ICE_INNER_VLAN_STRIP_ENA; in ice_vc_ena_vlan_stripping()
2550 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_ENABLE_VLAN_STRIPPING, in ice_vc_ena_vlan_stripping()
2560 static int ice_vc_dis_vlan_stripping(struct ice_vf *vf) in ice_vc_dis_vlan_stripping() argument
2565 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { in ice_vc_dis_vlan_stripping()
2570 if (!ice_vf_vlan_offload_ena(vf->driver_caps)) { in ice_vc_dis_vlan_stripping()
2575 vsi = ice_get_vf_vsi(vf); in ice_vc_dis_vlan_stripping()
2584 vf->vlan_strip_ena &= ~ICE_INNER_VLAN_STRIP_ENA; in ice_vc_dis_vlan_stripping()
2587 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_DISABLE_VLAN_STRIPPING, in ice_vc_dis_vlan_stripping()
2595 static int ice_vc_get_rss_hena(struct ice_vf *vf) in ice_vc_get_rss_hena() argument
2601 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { in ice_vc_get_rss_hena()
2606 if (!test_bit(ICE_FLAG_RSS_ENA, vf->pf->flags)) { in ice_vc_get_rss_hena()
2607 dev_err(ice_pf_to_dev(vf->pf), "RSS not supported by PF\n"); in ice_vc_get_rss_hena()
2623 ret = ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_GET_RSS_HENA_CAPS, v_ret, in ice_vc_get_rss_hena()
2634 static int ice_vc_set_rss_hena(struct ice_vf *vf, u8 *msg) in ice_vc_set_rss_hena() argument
2638 struct ice_pf *pf = vf->pf; in ice_vc_set_rss_hena()
2645 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { in ice_vc_set_rss_hena()
2656 vsi = ice_get_vf_vsi(vf); in ice_vc_set_rss_hena()
2679 vf->vf_id); in ice_vc_set_rss_hena()
2689 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_SET_RSS_HENA, v_ret, in ice_vc_set_rss_hena()
2700 static int ice_vc_query_rxdid(struct ice_vf *vf) in ice_vc_query_rxdid() argument
2704 struct ice_hw *hw = &vf->pf->hw; in ice_vc_query_rxdid()
2705 struct ice_pf *pf = vf->pf; in ice_vc_query_rxdid()
2710 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { in ice_vc_query_rxdid()
2715 if (!(vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC)) { in ice_vc_query_rxdid()
2745 ret = ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_GET_SUPPORTED_RXDIDS, in ice_vc_query_rxdid()
2758 static int ice_vf_init_vlan_stripping(struct ice_vf *vf) in ice_vf_init_vlan_stripping() argument
2760 struct ice_vsi *vsi = ice_get_vf_vsi(vf); in ice_vf_init_vlan_stripping()
2762 vf->vlan_strip_ena = 0; in ice_vf_init_vlan_stripping()
2770 if (ice_vf_is_port_vlan_ena(vf) && !ice_is_dvm_ena(&vsi->back->hw)) in ice_vf_init_vlan_stripping()
2773 if (ice_vf_vlan_offload_ena(vf->driver_caps)) { in ice_vf_init_vlan_stripping()
2778 vf->vlan_strip_ena |= ICE_INNER_VLAN_STRIP_ENA; in ice_vf_init_vlan_stripping()
2785 static u16 ice_vc_get_max_vlan_fltrs(struct ice_vf *vf) in ice_vc_get_max_vlan_fltrs() argument
2787 if (vf->trusted) in ice_vc_get_max_vlan_fltrs()
2800 static bool ice_vf_outer_vlan_not_allowed(struct ice_vf *vf) in ice_vf_outer_vlan_not_allowed() argument
2802 if (ice_vf_is_port_vlan_ena(vf)) in ice_vf_outer_vlan_not_allowed()
2819 ice_vc_set_dvm_caps(struct ice_vf *vf, struct virtchnl_vlan_caps *caps) in ice_vc_set_dvm_caps() argument
2823 if (ice_vf_outer_vlan_not_allowed(vf)) { in ice_vc_set_dvm_caps()
2885 caps->filtering.max_filters = ice_vc_get_max_vlan_fltrs(vf); in ice_vc_set_dvm_caps()
2900 ice_vc_set_svm_caps(struct ice_vf *vf, struct virtchnl_vlan_caps *caps) in ice_vc_set_svm_caps() argument
2904 if (ice_vf_is_port_vlan_ena(vf)) { in ice_vc_set_svm_caps()
2941 caps->filtering.max_filters = ice_vc_get_max_vlan_fltrs(vf); in ice_vc_set_svm_caps()
2955 static int ice_vc_get_offload_vlan_v2_caps(struct ice_vf *vf) in ice_vc_get_offload_vlan_v2_caps() argument
2961 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { in ice_vc_get_offload_vlan_v2_caps()
2973 if (ice_is_dvm_ena(&vf->pf->hw)) in ice_vc_get_offload_vlan_v2_caps()
2974 ice_vc_set_dvm_caps(vf, caps); in ice_vc_get_offload_vlan_v2_caps()
2976 ice_vc_set_svm_caps(vf, caps); in ice_vc_get_offload_vlan_v2_caps()
2979 memcpy(&vf->vlan_v2_caps, caps, sizeof(*caps)); in ice_vc_get_offload_vlan_v2_caps()
2982 err = ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS, in ice_vc_get_offload_vlan_v2_caps()
3129 ice_vc_del_vlans(struct ice_vf *vf, struct ice_vsi *vsi, in ice_vc_del_vlans() argument
3132 bool vlan_promisc = ice_is_vlan_promisc_allowed(vf); in ice_vc_del_vlans()
3196 static int ice_vc_remove_vlan_v2_msg(struct ice_vf *vf, u8 *msg) in ice_vc_remove_vlan_v2_msg() argument
3203 if (!ice_vc_validate_vlan_filter_list(&vf->vlan_v2_caps.filtering, in ice_vc_remove_vlan_v2_msg()
3209 if (!ice_vc_isvalid_vsi_id(vf, vfl->vport_id)) { in ice_vc_remove_vlan_v2_msg()
3214 vsi = ice_get_vf_vsi(vf); in ice_vc_remove_vlan_v2_msg()
3220 if (ice_vc_del_vlans(vf, vsi, vfl)) in ice_vc_remove_vlan_v2_msg()
3224 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_DEL_VLAN_V2, v_ret, NULL, in ice_vc_remove_vlan_v2_msg()
3235 ice_vc_add_vlans(struct ice_vf *vf, struct ice_vsi *vsi, in ice_vc_add_vlans() argument
3238 bool vlan_promisc = ice_is_vlan_promisc_allowed(vf); in ice_vc_add_vlans()
3263 if (vf->spoofchk && vlan.vid && ice_is_dvm_ena(&vsi->back->hw)) { in ice_vc_add_vlans()
3291 if (vf->spoofchk && vlan.vid) { in ice_vc_add_vlans()
3332 static int ice_vc_add_vlan_v2_msg(struct ice_vf *vf, u8 *msg) in ice_vc_add_vlan_v2_msg() argument
3339 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { in ice_vc_add_vlan_v2_msg()
3344 if (!ice_vc_isvalid_vsi_id(vf, vfl->vport_id)) { in ice_vc_add_vlan_v2_msg()
3349 vsi = ice_get_vf_vsi(vf); in ice_vc_add_vlan_v2_msg()
3356 &vf->vlan_v2_caps.filtering, in ice_vc_add_vlan_v2_msg()
3362 if (ice_vc_add_vlans(vf, vsi, vfl)) in ice_vc_add_vlan_v2_msg()
3366 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_ADD_VLAN_V2, v_ret, NULL, in ice_vc_add_vlan_v2_msg()
3525 static int ice_vc_ena_vlan_stripping_v2_msg(struct ice_vf *vf, u8 *msg) in ice_vc_ena_vlan_stripping_v2_msg() argument
3534 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { in ice_vc_ena_vlan_stripping_v2_msg()
3539 if (!ice_vc_isvalid_vsi_id(vf, strip_msg->vport_id)) { in ice_vc_ena_vlan_stripping_v2_msg()
3544 vsi = ice_get_vf_vsi(vf); in ice_vc_ena_vlan_stripping_v2_msg()
3550 stripping_support = &vf->vlan_v2_caps.offloads.stripping_support; in ice_vc_ena_vlan_stripping_v2_msg()
3582 vf->vlan_strip_ena |= ICE_OUTER_VLAN_STRIP_ENA; in ice_vc_ena_vlan_stripping_v2_msg()
3595 vf->vlan_strip_ena |= ICE_INNER_VLAN_STRIP_ENA; in ice_vc_ena_vlan_stripping_v2_msg()
3598 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2, in ice_vc_ena_vlan_stripping_v2_msg()
3609 static int ice_vc_dis_vlan_stripping_v2_msg(struct ice_vf *vf, u8 *msg) in ice_vc_dis_vlan_stripping_v2_msg() argument
3618 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { in ice_vc_dis_vlan_stripping_v2_msg()
3623 if (!ice_vc_isvalid_vsi_id(vf, strip_msg->vport_id)) { in ice_vc_dis_vlan_stripping_v2_msg()
3628 vsi = ice_get_vf_vsi(vf); in ice_vc_dis_vlan_stripping_v2_msg()
3634 stripping_support = &vf->vlan_v2_caps.offloads.stripping_support; in ice_vc_dis_vlan_stripping_v2_msg()
3659 vf->vlan_strip_ena &= ~ICE_OUTER_VLAN_STRIP_ENA; in ice_vc_dis_vlan_stripping_v2_msg()
3670 vf->vlan_strip_ena &= ~ICE_INNER_VLAN_STRIP_ENA; in ice_vc_dis_vlan_stripping_v2_msg()
3673 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_DISABLE_VLAN_STRIPPING_V2, in ice_vc_dis_vlan_stripping_v2_msg()
3684 static int ice_vc_ena_vlan_insertion_v2_msg(struct ice_vf *vf, u8 *msg) in ice_vc_ena_vlan_insertion_v2_msg() argument
3693 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { in ice_vc_ena_vlan_insertion_v2_msg()
3698 if (!ice_vc_isvalid_vsi_id(vf, insertion_msg->vport_id)) { in ice_vc_ena_vlan_insertion_v2_msg()
3703 vsi = ice_get_vf_vsi(vf); in ice_vc_ena_vlan_insertion_v2_msg()
3709 insertion_support = &vf->vlan_v2_caps.offloads.insertion_support; in ice_vc_ena_vlan_insertion_v2_msg()
3732 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_ENABLE_VLAN_INSERTION_V2, in ice_vc_ena_vlan_insertion_v2_msg()
3743 static int ice_vc_dis_vlan_insertion_v2_msg(struct ice_vf *vf, u8 *msg) in ice_vc_dis_vlan_insertion_v2_msg() argument
3752 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { in ice_vc_dis_vlan_insertion_v2_msg()
3757 if (!ice_vc_isvalid_vsi_id(vf, insertion_msg->vport_id)) { in ice_vc_dis_vlan_insertion_v2_msg()
3762 vsi = ice_get_vf_vsi(vf); in ice_vc_dis_vlan_insertion_v2_msg()
3768 insertion_support = &vf->vlan_v2_caps.offloads.insertion_support; in ice_vc_dis_vlan_insertion_v2_msg()
3787 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_DISABLE_VLAN_INSERTION_V2, in ice_vc_dis_vlan_insertion_v2_msg()
3830 void ice_virtchnl_set_dflt_ops(struct ice_vf *vf) in ice_virtchnl_set_dflt_ops() argument
3832 vf->virtchnl_ops = &ice_virtchnl_dflt_ops; in ice_virtchnl_set_dflt_ops()
3844 static int ice_vc_repr_add_mac(struct ice_vf *vf, u8 *msg) in ice_vc_repr_add_mac() argument
3853 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states) || in ice_vc_repr_add_mac()
3854 !ice_vc_isvalid_vsi_id(vf, al->vsi_id)) { in ice_vc_repr_add_mac()
3859 pf = vf->pf; in ice_vc_repr_add_mac()
3861 vsi = ice_get_vf_vsi(vf); in ice_vc_repr_add_mac()
3871 ether_addr_equal(mac_addr, vf->hw_lan_addr)) in ice_vc_repr_add_mac()
3874 if (vf->pf_set_mac) { in ice_vc_repr_add_mac()
3880 ice_vfhw_mac_add(vf, &al->list[i]); in ice_vc_repr_add_mac()
3881 vf->num_mac++; in ice_vc_repr_add_mac()
3886 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_ADD_ETH_ADDR, in ice_vc_repr_add_mac()
3899 ice_vc_repr_del_mac(struct ice_vf __always_unused *vf, u8 __always_unused *msg) in ice_vc_repr_del_mac() argument
3904 ice_update_legacy_cached_mac(vf, &al->list[0]); in ice_vc_repr_del_mac()
3906 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_DEL_ETH_ADDR, in ice_vc_repr_del_mac()
3911 ice_vc_repr_cfg_promiscuous_mode(struct ice_vf *vf, u8 __always_unused *msg) in ice_vc_repr_cfg_promiscuous_mode() argument
3913 dev_dbg(ice_pf_to_dev(vf->pf), in ice_vc_repr_cfg_promiscuous_mode()
3915 vf->vf_id); in ice_vc_repr_cfg_promiscuous_mode()
3916 return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE, in ice_vc_repr_cfg_promiscuous_mode()
3960 void ice_virtchnl_set_repr_ops(struct ice_vf *vf) in ice_virtchnl_set_repr_ops() argument
3962 vf->virtchnl_ops = &ice_virtchnl_repr_ops; in ice_virtchnl_set_repr_ops()
3974 ice_is_malicious_vf(struct ice_vf *vf, struct ice_mbx_data *mbxdata) in ice_is_malicious_vf() argument
3981 pf = vf->pf; in ice_is_malicious_vf()
3984 if (test_bit(ICE_VF_STATE_DIS, vf->vf_states)) in ice_is_malicious_vf()
3985 return vf->mbx_info.malicious; in ice_is_malicious_vf()
3988 status = ice_mbx_vf_state_handler(&pf->hw, mbxdata, &vf->mbx_info, in ice_is_malicious_vf()
3992 vf->vf_id, vf->dev_lan_addr, status); in ice_is_malicious_vf()
3999 vf->dev_lan_addr, in ice_is_malicious_vf()
4003 return vf->mbx_info.malicious; in ice_is_malicious_vf()
4023 struct ice_vf *vf = NULL; in ice_vc_process_vf_msg() local
4029 vf = ice_get_vf_by_id(pf, vf_id); in ice_vc_process_vf_msg()
4030 if (!vf) { in ice_vc_process_vf_msg()
4036 mutex_lock(&vf->cfg_lock); in ice_vc_process_vf_msg()
4039 if (ice_is_malicious_vf(vf, mbxdata)) in ice_vc_process_vf_msg()
4043 if (test_bit(ICE_VF_STATE_DIS, vf->vf_states)) { in ice_vc_process_vf_msg()
4048 ops = vf->virtchnl_ops; in ice_vc_process_vf_msg()
4051 err = virtchnl_vc_validate_vf_msg(&vf->vf_ver, v_opcode, msg, msglen); in ice_vc_process_vf_msg()
4061 ice_vc_send_msg_to_vf(vf, v_opcode, VIRTCHNL_STATUS_ERR_PARAM, in ice_vc_process_vf_msg()
4068 if (!ice_vc_is_opcode_allowed(vf, v_opcode)) { in ice_vc_process_vf_msg()
4069 ice_vc_send_msg_to_vf(vf, v_opcode, in ice_vc_process_vf_msg()
4077 err = ops->get_ver_msg(vf, msg); in ice_vc_process_vf_msg()
4080 err = ops->get_vf_res_msg(vf, msg); in ice_vc_process_vf_msg()
4081 if (ice_vf_init_vlan_stripping(vf)) in ice_vc_process_vf_msg()
4083 vf->vf_id); in ice_vc_process_vf_msg()
4084 ice_vc_notify_vf_link_state(vf); in ice_vc_process_vf_msg()
4087 ops->reset_vf(vf); in ice_vc_process_vf_msg()
4090 err = ops->add_mac_addr_msg(vf, msg); in ice_vc_process_vf_msg()
4093 err = ops->del_mac_addr_msg(vf, msg); in ice_vc_process_vf_msg()
4096 err = ops->cfg_qs_msg(vf, msg); in ice_vc_process_vf_msg()
4099 err = ops->ena_qs_msg(vf, msg); in ice_vc_process_vf_msg()
4100 ice_vc_notify_vf_link_state(vf); in ice_vc_process_vf_msg()
4103 err = ops->dis_qs_msg(vf, msg); in ice_vc_process_vf_msg()
4106 err = ops->request_qs_msg(vf, msg); in ice_vc_process_vf_msg()
4109 err = ops->cfg_irq_map_msg(vf, msg); in ice_vc_process_vf_msg()
4112 err = ops->config_rss_key(vf, msg); in ice_vc_process_vf_msg()
4115 err = ops->config_rss_lut(vf, msg); in ice_vc_process_vf_msg()
4118 err = ops->config_rss_hfunc(vf, msg); in ice_vc_process_vf_msg()
4121 err = ops->get_stats_msg(vf, msg); in ice_vc_process_vf_msg()
4124 err = ops->cfg_promiscuous_mode_msg(vf, msg); in ice_vc_process_vf_msg()
4127 err = ops->add_vlan_msg(vf, msg); in ice_vc_process_vf_msg()
4130 err = ops->remove_vlan_msg(vf, msg); in ice_vc_process_vf_msg()
4133 err = ops->query_rxdid(vf); in ice_vc_process_vf_msg()
4136 err = ops->get_rss_hena(vf); in ice_vc_process_vf_msg()
4139 err = ops->set_rss_hena_msg(vf, msg); in ice_vc_process_vf_msg()
4142 err = ops->ena_vlan_stripping(vf); in ice_vc_process_vf_msg()
4145 err = ops->dis_vlan_stripping(vf); in ice_vc_process_vf_msg()
4148 err = ops->add_fdir_fltr_msg(vf, msg); in ice_vc_process_vf_msg()
4151 err = ops->del_fdir_fltr_msg(vf, msg); in ice_vc_process_vf_msg()
4154 err = ops->handle_rss_cfg_msg(vf, msg, true); in ice_vc_process_vf_msg()
4157 err = ops->handle_rss_cfg_msg(vf, msg, false); in ice_vc_process_vf_msg()
4160 err = ops->get_offload_vlan_v2_caps(vf); in ice_vc_process_vf_msg()
4163 err = ops->add_vlan_v2_msg(vf, msg); in ice_vc_process_vf_msg()
4166 err = ops->remove_vlan_v2_msg(vf, msg); in ice_vc_process_vf_msg()
4169 err = ops->ena_vlan_stripping_v2_msg(vf, msg); in ice_vc_process_vf_msg()
4172 err = ops->dis_vlan_stripping_v2_msg(vf, msg); in ice_vc_process_vf_msg()
4175 err = ops->ena_vlan_insertion_v2_msg(vf, msg); in ice_vc_process_vf_msg()
4178 err = ops->dis_vlan_insertion_v2_msg(vf, msg); in ice_vc_process_vf_msg()
4184 err = ice_vc_send_msg_to_vf(vf, v_opcode, in ice_vc_process_vf_msg()
4198 mutex_unlock(&vf->cfg_lock); in ice_vc_process_vf_msg()
4199 ice_put_vf(vf); in ice_vc_process_vf_msg()