Lines Matching refs:vport

31 static int hclge_gen_resp_to_vf(struct hclge_vport *vport,  in hclge_gen_resp_to_vf()  argument
36 struct hclge_dev *hdev = vport->back; in hclge_gen_resp_to_vf()
91 static int hclge_send_mbx_msg(struct hclge_vport *vport, u8 *msg, u16 msg_len, in hclge_send_mbx_msg() argument
95 struct hclge_dev *hdev = vport->back; in hclge_send_mbx_msg()
127 int hclge_inform_vf_reset(struct hclge_vport *vport, u16 reset_type) in hclge_inform_vf_reset() argument
132 dest_vfid = (u8)vport->vport_id; in hclge_inform_vf_reset()
136 return hclge_send_mbx_msg(vport, (u8 *)&msg_data, sizeof(msg_data), in hclge_inform_vf_reset()
140 int hclge_inform_reset_assert_to_vf(struct hclge_vport *vport) in hclge_inform_reset_assert_to_vf() argument
142 struct hclge_dev *hdev = vport->back; in hclge_inform_reset_assert_to_vf()
154 return hclge_inform_vf_reset(vport, reset_type); in hclge_inform_reset_assert_to_vf()
183 struct hclge_vport *vport) in hclge_get_ring_chain_from_mbx() argument
186 struct hclge_dev *hdev = vport->back; in hclge_get_ring_chain_from_mbx()
196 if (req->msg.param[i].tqp_index >= vport->nic.kinfo.rss_size) { in hclge_get_ring_chain_from_mbx()
199 vport->nic.kinfo.rss_size - 1U); in hclge_get_ring_chain_from_mbx()
207 hclge_get_queue_id(vport->nic.kinfo.tqp in hclge_get_ring_chain_from_mbx()
223 hclge_get_queue_id(vport->nic.kinfo.tqp in hclge_get_ring_chain_from_mbx()
240 static int hclge_map_unmap_ring_to_vf_vector(struct hclge_vport *vport, bool en, in hclge_map_unmap_ring_to_vf_vector() argument
248 ret = hclge_get_ring_chain_from_mbx(req, &ring_chain, vport); in hclge_map_unmap_ring_to_vf_vector()
252 ret = hclge_bind_ring_with_vector(vport, vector_id, en, &ring_chain); in hclge_map_unmap_ring_to_vf_vector()
259 static int hclge_query_ring_vector_map(struct hclge_vport *vport, in hclge_query_ring_vector_map() argument
265 struct hclge_dev *hdev = vport->back; in hclge_query_ring_vector_map()
277 req->vfid = vport->vport_id; in hclge_query_ring_vector_map()
288 static int hclge_get_vf_ring_vector_map(struct hclge_vport *vport, in hclge_get_vf_ring_vector_map() argument
309 ret = hclge_get_ring_chain_from_mbx(req, &ring_chain, vport); in hclge_get_vf_ring_vector_map()
313 ret = hclge_query_ring_vector_map(vport, &ring_chain, &desc); in hclge_get_vf_ring_vector_map()
334 static void hclge_set_vf_promisc_mode(struct hclge_vport *vport, in hclge_set_vf_promisc_mode() argument
337 struct hnae3_handle *handle = &vport->nic; in hclge_set_vf_promisc_mode()
338 struct hclge_dev *hdev = vport->back; in hclge_set_vf_promisc_mode()
340 vport->vf_info.request_uc_en = req->msg.en_uc; in hclge_set_vf_promisc_mode()
341 vport->vf_info.request_mc_en = req->msg.en_mc; in hclge_set_vf_promisc_mode()
342 vport->vf_info.request_bc_en = req->msg.en_bc; in hclge_set_vf_promisc_mode()
350 set_bit(HCLGE_VPORT_STATE_PROMISC_CHANGE, &vport->state); in hclge_set_vf_promisc_mode()
354 static int hclge_set_vf_uc_mac_addr(struct hclge_vport *vport, in hclge_set_vf_uc_mac_addr() argument
360 struct hclge_dev *hdev = vport->back; in hclge_set_vf_uc_mac_addr()
370 if (!is_zero_ether_addr(vport->vf_info.mac) && in hclge_set_vf_uc_mac_addr()
371 !ether_addr_equal(mac_addr, vport->vf_info.mac)) in hclge_set_vf_uc_mac_addr()
377 spin_lock_bh(&vport->mac_list_lock); in hclge_set_vf_uc_mac_addr()
378 status = hclge_update_mac_node_for_dev_addr(vport, old_addr, in hclge_set_vf_uc_mac_addr()
380 spin_unlock_bh(&vport->mac_list_lock); in hclge_set_vf_uc_mac_addr()
383 status = hclge_update_mac_list(vport, HCLGE_MAC_TO_ADD, in hclge_set_vf_uc_mac_addr()
386 status = hclge_update_mac_list(vport, HCLGE_MAC_TO_DEL, in hclge_set_vf_uc_mac_addr()
398 static int hclge_set_vf_mc_mac_addr(struct hclge_vport *vport, in hclge_set_vf_mc_mac_addr() argument
402 struct hclge_dev *hdev = vport->back; in hclge_set_vf_mc_mac_addr()
405 hclge_update_mac_list(vport, HCLGE_MAC_TO_ADD, in hclge_set_vf_mc_mac_addr()
408 hclge_update_mac_list(vport, HCLGE_MAC_TO_DEL, in hclge_set_vf_mc_mac_addr()
420 int hclge_push_vf_port_base_vlan_info(struct hclge_vport *vport, u8 vfid, in hclge_push_vf_port_base_vlan_info() argument
431 return hclge_send_mbx_msg(vport, (u8 *)&base_vlan, sizeof(base_vlan), in hclge_push_vf_port_base_vlan_info()
435 static int hclge_set_vf_vlan_cfg(struct hclge_vport *vport, in hclge_set_vf_vlan_cfg() argument
442 struct hnae3_handle *handle = &vport->nic; in hclge_set_vf_vlan_cfg()
443 struct hclge_dev *hdev = vport->back; in hclge_set_vf_vlan_cfg()
466 vport->port_base_vlan_cfg.state; in hclge_set_vf_vlan_cfg()
470 return hclge_enable_vport_vlan_filter(vport, msg_cmd->enable); in hclge_set_vf_vlan_cfg()
476 static int hclge_set_vf_alive(struct hclge_vport *vport, in hclge_set_vf_alive() argument
483 ret = hclge_vport_start(vport); in hclge_set_vf_alive()
485 hclge_vport_stop(vport); in hclge_set_vf_alive()
490 static void hclge_get_basic_info(struct hclge_vport *vport, in hclge_get_basic_info() argument
493 struct hnae3_knic_private_info *kinfo = &vport->nic.kinfo; in hclge_get_basic_info()
494 struct hnae3_ae_dev *ae_dev = vport->back->ae_dev; in hclge_get_basic_info()
511 static void hclge_get_vf_queue_info(struct hclge_vport *vport, in hclge_get_vf_queue_info() argument
517 struct hclge_dev *hdev = vport->back; in hclge_get_vf_queue_info()
521 queue_info->num_tqps = cpu_to_le16(vport->alloc_tqps); in hclge_get_vf_queue_info()
522 queue_info->rss_size = cpu_to_le16(vport->nic.kinfo.rss_size); in hclge_get_vf_queue_info()
527 static void hclge_get_vf_mac_addr(struct hclge_vport *vport, in hclge_get_vf_mac_addr() argument
530 ether_addr_copy(resp_msg->data, vport->vf_info.mac); in hclge_get_vf_mac_addr()
534 static void hclge_get_vf_queue_depth(struct hclge_vport *vport, in hclge_get_vf_queue_depth() argument
540 struct hclge_dev *hdev = vport->back; in hclge_get_vf_queue_depth()
550 static void hclge_get_vf_media_type(struct hclge_vport *vport, in hclge_get_vf_media_type() argument
557 struct hclge_dev *hdev = vport->back; in hclge_get_vf_media_type()
566 int hclge_push_vf_link_status(struct hclge_vport *vport) in hclge_push_vf_link_status() argument
572 struct hclge_dev *hdev = vport->back; in hclge_push_vf_link_status()
576 switch (vport->vf_info.link_state) { in hclge_push_vf_link_status()
595 return hclge_send_mbx_msg(vport, (u8 *)&link_info, sizeof(link_info), in hclge_push_vf_link_status()
596 HCLGE_MBX_LINK_STAT_CHANGE, vport->vport_id); in hclge_push_vf_link_status()
599 static void hclge_get_link_mode(struct hclge_vport *vport, in hclge_get_link_mode() argument
604 struct hclge_dev *hdev = vport->back; in hclge_get_link_mode()
618 hclge_send_mbx_msg(vport, (u8 *)&link_mode, sizeof(link_mode), in hclge_get_link_mode()
622 static int hclge_mbx_reset_vf_queue(struct hclge_vport *vport, in hclge_mbx_reset_vf_queue() argument
627 struct hnae3_handle *handle = &vport->nic; in hclge_mbx_reset_vf_queue()
628 struct hclge_dev *hdev = vport->back; in hclge_mbx_reset_vf_queue()
645 vport->vport_id - HCLGE_VF_VPORT_START_NUM, ret); in hclge_mbx_reset_vf_queue()
650 static int hclge_reset_vf(struct hclge_vport *vport) in hclge_reset_vf() argument
652 struct hclge_dev *hdev = vport->back; in hclge_reset_vf()
655 vport->vport_id - HCLGE_VF_VPORT_START_NUM); in hclge_reset_vf()
657 return hclge_func_reset_cmd(hdev, vport->vport_id); in hclge_reset_vf()
660 static void hclge_notify_vf_config(struct hclge_vport *vport) in hclge_notify_vf_config() argument
662 struct hclge_dev *hdev = vport->back; in hclge_notify_vf_config()
667 hclge_push_vf_link_status(vport); in hclge_notify_vf_config()
668 if (test_bit(HCLGE_VPORT_NEED_NOTIFY_RESET, &vport->need_notify)) { in hclge_notify_vf_config()
669 ret = hclge_inform_vf_reset(vport, HNAE3_VF_PF_FUNC_RESET); in hclge_notify_vf_config()
673 vport->vport_id - HCLGE_VF_VPORT_START_NUM); in hclge_notify_vf_config()
676 vport->need_notify = 0; in hclge_notify_vf_config()
681 test_bit(HCLGE_VPORT_NEED_NOTIFY_VF_VLAN, &vport->need_notify)) { in hclge_notify_vf_config()
682 vlan_cfg = &vport->port_base_vlan_cfg; in hclge_notify_vf_config()
683 ret = hclge_push_vf_port_base_vlan_info(&hdev->vport[0], in hclge_notify_vf_config()
684 vport->vport_id, in hclge_notify_vf_config()
690 vport->vport_id - HCLGE_VF_VPORT_START_NUM); in hclge_notify_vf_config()
693 clear_bit(HCLGE_VPORT_NEED_NOTIFY_VF_VLAN, &vport->need_notify); in hclge_notify_vf_config()
697 static void hclge_vf_keep_alive(struct hclge_vport *vport) in hclge_vf_keep_alive() argument
699 struct hclge_dev *hdev = vport->back; in hclge_vf_keep_alive()
701 vport->last_active_jiffies = jiffies; in hclge_vf_keep_alive()
703 if (test_bit(HCLGE_VPORT_STATE_INITED, &vport->state) && in hclge_vf_keep_alive()
704 !test_bit(HCLGE_VPORT_STATE_ALIVE, &vport->state)) { in hclge_vf_keep_alive()
705 set_bit(HCLGE_VPORT_STATE_ALIVE, &vport->state); in hclge_vf_keep_alive()
707 vport->vport_id - HCLGE_VF_VPORT_START_NUM); in hclge_vf_keep_alive()
708 hclge_notify_vf_config(vport); in hclge_vf_keep_alive()
712 static int hclge_set_vf_mtu(struct hclge_vport *vport, in hclge_set_vf_mtu() argument
721 return hclge_set_vport_mtu(vport, mtu); in hclge_set_vf_mtu()
724 static int hclge_get_queue_id_in_pf(struct hclge_vport *vport, in hclge_get_queue_id_in_pf() argument
728 struct hnae3_handle *handle = &vport->nic; in hclge_get_queue_id_in_pf()
729 struct hclge_dev *hdev = vport->back; in hclge_get_queue_id_in_pf()
739 qid_in_pf = hclge_covert_handle_qid_global(&vport->nic, queue_id); in hclge_get_queue_id_in_pf()
745 static int hclge_get_rss_key(struct hclge_vport *vport, in hclge_get_rss_key() argument
750 struct hclge_dev *hdev = vport->back; in hclge_get_rss_key()
817 static void hclge_handle_vf_tbl(struct hclge_vport *vport, in hclge_handle_vf_tbl() argument
820 struct hclge_dev *hdev = vport->back; in hclge_handle_vf_tbl()
825 hclge_rm_vport_all_mac_table(vport, true, HCLGE_MAC_ADDR_UC); in hclge_handle_vf_tbl()
826 hclge_rm_vport_all_mac_table(vport, true, HCLGE_MAC_ADDR_MC); in hclge_handle_vf_tbl()
827 hclge_rm_vport_all_vlan_table(vport, true); in hclge_handle_vf_tbl()
837 return hclge_map_unmap_ring_to_vf_vector(param->vport, true, in hclge_mbx_map_ring_to_vector_handler()
844 return hclge_map_unmap_ring_to_vf_vector(param->vport, false, in hclge_mbx_unmap_ring_to_vector_handler()
853 ret = hclge_get_vf_ring_vector_map(param->vport, param->req, in hclge_mbx_get_ring_vector_map_handler()
856 dev_err(&param->vport->back->pdev->dev, in hclge_mbx_get_ring_vector_map_handler()
864 hclge_set_vf_promisc_mode(param->vport, param->req); in hclge_mbx_set_promisc_mode_handler()
872 ret = hclge_set_vf_uc_mac_addr(param->vport, param->req); in hclge_mbx_set_unicast_handler()
874 dev_err(&param->vport->back->pdev->dev, in hclge_mbx_set_unicast_handler()
884 ret = hclge_set_vf_mc_mac_addr(param->vport, param->req); in hclge_mbx_set_multicast_handler()
886 dev_err(&param->vport->back->pdev->dev, in hclge_mbx_set_multicast_handler()
896 ret = hclge_set_vf_vlan_cfg(param->vport, param->req, param->resp_msg); in hclge_mbx_set_vlan_handler()
898 dev_err(&param->vport->back->pdev->dev, in hclge_mbx_set_vlan_handler()
908 ret = hclge_set_vf_alive(param->vport, param->req); in hclge_mbx_set_alive_handler()
910 dev_err(&param->vport->back->pdev->dev, in hclge_mbx_set_alive_handler()
918 hclge_get_vf_queue_info(param->vport, param->resp_msg); in hclge_mbx_get_qinfo_handler()
924 hclge_get_vf_queue_depth(param->vport, param->resp_msg); in hclge_mbx_get_qdepth_handler()
930 hclge_get_basic_info(param->vport, param->resp_msg); in hclge_mbx_get_basic_info_handler()
938 ret = hclge_push_vf_link_status(param->vport); in hclge_mbx_get_link_status_handler()
940 dev_err(&param->vport->back->pdev->dev, in hclge_mbx_get_link_status_handler()
948 return hclge_mbx_reset_vf_queue(param->vport, param->req, in hclge_mbx_queue_reset_handler()
954 return hclge_reset_vf(param->vport); in hclge_mbx_reset_handler()
959 hclge_vf_keep_alive(param->vport); in hclge_mbx_keep_alive_handler()
967 ret = hclge_set_vf_mtu(param->vport, param->req); in hclge_mbx_set_mtu_handler()
969 dev_err(&param->vport->back->pdev->dev, in hclge_mbx_set_mtu_handler()
976 return hclge_get_queue_id_in_pf(param->vport, param->req, in hclge_mbx_get_qid_in_pf_handler()
982 return hclge_get_rss_key(param->vport, param->req, param->resp_msg); in hclge_mbx_get_rss_key_handler()
987 hclge_get_link_mode(param->vport, param->req); in hclge_mbx_get_link_mode_handler()
994 hclge_rm_vport_all_mac_table(param->vport, false, in hclge_mbx_get_vf_flr_status_handler()
996 hclge_rm_vport_all_mac_table(param->vport, false, in hclge_mbx_get_vf_flr_status_handler()
998 hclge_rm_vport_all_vlan_table(param->vport, false); in hclge_mbx_get_vf_flr_status_handler()
1004 hclge_rm_vport_all_mac_table(param->vport, true, in hclge_mbx_vf_uninit_handler()
1006 hclge_rm_vport_all_mac_table(param->vport, true, in hclge_mbx_vf_uninit_handler()
1008 hclge_rm_vport_all_vlan_table(param->vport, true); in hclge_mbx_vf_uninit_handler()
1009 param->vport->mps = 0; in hclge_mbx_vf_uninit_handler()
1015 hclge_get_vf_media_type(param->vport, param->resp_msg); in hclge_mbx_get_media_type_handler()
1021 hclge_handle_link_change_event(param->vport->back, param->req); in hclge_mbx_push_link_status_handler()
1027 hclge_get_vf_mac_addr(param->vport, param->resp_msg); in hclge_mbx_get_mac_addr_handler()
1033 hclge_handle_ncsi_error(param->vport->back); in hclge_mbx_ncsi_error_handler()
1039 hclge_handle_vf_tbl(param->vport, param->req); in hclge_mbx_handle_vf_tbl_handler()
1078 hdev = param->vport->back; in hclge_mbx_request_handling()
1100 hclge_gen_resp_to_vf(param->vport, param->req, param->resp_msg); in hclge_mbx_request_handling()
1143 param.vport = &hdev->vport[req->mbx_src_vfid]; in hclge_mbx_handler()