Lines Matching refs:p_hwfn
23 static int qed_iov_bulletin_set_mac(struct qed_hwfn *p_hwfn, u8 *mac, int vfid);
46 static int qed_sp_vf_start(struct qed_hwfn *p_hwfn, struct qed_vf_info *p_vf) in qed_sp_vf_start() argument
56 init_data.cid = qed_spq_get_cid(p_hwfn); in qed_sp_vf_start()
60 rc = qed_sp_init_request(p_hwfn, &p_ent, in qed_sp_vf_start()
71 switch (p_hwfn->hw_info.personality) { in qed_sp_vf_start()
80 DP_NOTICE(p_hwfn, "Unknown VF personality %d\n", in qed_sp_vf_start()
81 p_hwfn->hw_info.personality); in qed_sp_vf_start()
82 qed_sp_destroy_request(p_hwfn, p_ent); in qed_sp_vf_start()
89 DP_VERBOSE(p_hwfn, in qed_sp_vf_start()
101 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_sp_vf_start()
105 return qed_spq_post(p_hwfn, p_ent, NULL); in qed_sp_vf_start()
108 static int qed_sp_vf_stop(struct qed_hwfn *p_hwfn, in qed_sp_vf_stop() argument
118 init_data.cid = qed_spq_get_cid(p_hwfn); in qed_sp_vf_stop()
122 rc = qed_sp_init_request(p_hwfn, &p_ent, in qed_sp_vf_stop()
132 return qed_spq_post(p_hwfn, p_ent, NULL); in qed_sp_vf_stop()
135 bool qed_iov_is_valid_vfid(struct qed_hwfn *p_hwfn, in qed_iov_is_valid_vfid() argument
139 if (!p_hwfn->pf_iov_info) { in qed_iov_is_valid_vfid()
140 DP_NOTICE(p_hwfn->cdev, "No iov info\n"); in qed_iov_is_valid_vfid()
144 if ((rel_vf_id >= p_hwfn->cdev->p_iov_info->total_vfs) || in qed_iov_is_valid_vfid()
148 if ((!p_hwfn->pf_iov_info->vfs_array[rel_vf_id].b_init) && in qed_iov_is_valid_vfid()
152 if ((p_hwfn->pf_iov_info->vfs_array[rel_vf_id].b_malicious) && in qed_iov_is_valid_vfid()
159 static struct qed_vf_info *qed_iov_get_vf_info(struct qed_hwfn *p_hwfn, in qed_iov_get_vf_info() argument
165 if (!p_hwfn->pf_iov_info) { in qed_iov_get_vf_info()
166 DP_NOTICE(p_hwfn->cdev, "No iov info\n"); in qed_iov_get_vf_info()
170 if (qed_iov_is_valid_vfid(p_hwfn, relative_vf_id, in qed_iov_get_vf_info()
172 vf = &p_hwfn->pf_iov_info->vfs_array[relative_vf_id]; in qed_iov_get_vf_info()
174 DP_ERR(p_hwfn, "%s: VF[%d] is not enabled\n", in qed_iov_get_vf_info()
199 static bool qed_iov_validate_queue_mode(struct qed_hwfn *p_hwfn, in qed_iov_validate_queue_mode() argument
228 static bool qed_iov_validate_rxq(struct qed_hwfn *p_hwfn, in qed_iov_validate_rxq() argument
234 DP_VERBOSE(p_hwfn, in qed_iov_validate_rxq()
241 return qed_iov_validate_queue_mode(p_hwfn, p_vf, rx_qid, mode, false); in qed_iov_validate_rxq()
244 static bool qed_iov_validate_txq(struct qed_hwfn *p_hwfn, in qed_iov_validate_txq() argument
250 DP_VERBOSE(p_hwfn, in qed_iov_validate_txq()
257 return qed_iov_validate_queue_mode(p_hwfn, p_vf, tx_qid, mode, true); in qed_iov_validate_txq()
260 static bool qed_iov_validate_sb(struct qed_hwfn *p_hwfn, in qed_iov_validate_sb() argument
269 DP_VERBOSE(p_hwfn, in qed_iov_validate_sb()
277 static bool qed_iov_validate_active_rxq(struct qed_hwfn *p_hwfn, in qed_iov_validate_active_rxq() argument
283 if (qed_iov_validate_queue_mode(p_hwfn, p_vf, i, in qed_iov_validate_active_rxq()
291 static bool qed_iov_validate_active_txq(struct qed_hwfn *p_hwfn, in qed_iov_validate_active_txq() argument
297 if (qed_iov_validate_queue_mode(p_hwfn, p_vf, i, in qed_iov_validate_active_txq()
305 static int qed_iov_post_vf_bulletin(struct qed_hwfn *p_hwfn, in qed_iov_post_vf_bulletin() argument
313 p_vf = qed_iov_get_vf_info(p_hwfn, (u16)vfid, true); in qed_iov_post_vf_bulletin()
327 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_post_vf_bulletin()
335 return qed_dmae_host2host(p_hwfn, p_ptt, p_vf->bulletin.phys, in qed_iov_post_vf_bulletin()
405 static void qed_iov_setup_vfdb(struct qed_hwfn *p_hwfn) in qed_iov_setup_vfdb() argument
407 struct qed_hw_sriov_info *p_iov = p_hwfn->cdev->p_iov_info; in qed_iov_setup_vfdb()
408 struct qed_pf_iov *p_iov_info = p_hwfn->pf_iov_info; in qed_iov_setup_vfdb()
424 DP_ERR(p_hwfn, in qed_iov_setup_vfdb()
449 concrete = qed_vfid_to_concrete(p_hwfn, vf->abs_vf_id); in qed_iov_setup_vfdb()
451 vf->opaque_fid = (p_hwfn->hw_info.opaque_fid & 0xff) | in qed_iov_setup_vfdb()
460 static int qed_iov_allocate_vfdb(struct qed_hwfn *p_hwfn) in qed_iov_allocate_vfdb() argument
462 struct qed_pf_iov *p_iov_info = p_hwfn->pf_iov_info; in qed_iov_allocate_vfdb()
466 num_vfs = p_hwfn->cdev->p_iov_info->total_vfs; in qed_iov_allocate_vfdb()
468 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_allocate_vfdb()
474 *p_v_addr = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev, in qed_iov_allocate_vfdb()
484 *p_v_addr = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev, in qed_iov_allocate_vfdb()
494 *p_v_addr = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev, in qed_iov_allocate_vfdb()
501 DP_VERBOSE(p_hwfn, in qed_iov_allocate_vfdb()
513 static void qed_iov_free_vfdb(struct qed_hwfn *p_hwfn) in qed_iov_free_vfdb() argument
515 struct qed_pf_iov *p_iov_info = p_hwfn->pf_iov_info; in qed_iov_free_vfdb()
517 if (p_hwfn->pf_iov_info->mbx_msg_virt_addr) in qed_iov_free_vfdb()
518 dma_free_coherent(&p_hwfn->cdev->pdev->dev, in qed_iov_free_vfdb()
523 if (p_hwfn->pf_iov_info->mbx_reply_virt_addr) in qed_iov_free_vfdb()
524 dma_free_coherent(&p_hwfn->cdev->pdev->dev, in qed_iov_free_vfdb()
530 dma_free_coherent(&p_hwfn->cdev->pdev->dev, in qed_iov_free_vfdb()
536 int qed_iov_alloc(struct qed_hwfn *p_hwfn) in qed_iov_alloc() argument
540 if (!IS_PF_SRIOV(p_hwfn)) { in qed_iov_alloc()
541 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_alloc()
550 p_hwfn->pf_iov_info = p_sriov; in qed_iov_alloc()
552 qed_spq_register_async_cb(p_hwfn, PROTOCOLID_COMMON, in qed_iov_alloc()
555 return qed_iov_allocate_vfdb(p_hwfn); in qed_iov_alloc()
558 void qed_iov_setup(struct qed_hwfn *p_hwfn) in qed_iov_setup() argument
560 if (!IS_PF_SRIOV(p_hwfn) || !IS_PF_SRIOV_ALLOC(p_hwfn)) in qed_iov_setup()
563 qed_iov_setup_vfdb(p_hwfn); in qed_iov_setup()
566 void qed_iov_free(struct qed_hwfn *p_hwfn) in qed_iov_free() argument
568 qed_spq_unregister_async_cb(p_hwfn, PROTOCOLID_COMMON); in qed_iov_free()
570 if (IS_PF_SRIOV_ALLOC(p_hwfn)) { in qed_iov_free()
571 qed_iov_free_vfdb(p_hwfn); in qed_iov_free()
572 kfree(p_hwfn->pf_iov_info); in qed_iov_free()
582 int qed_iov_hw_info(struct qed_hwfn *p_hwfn) in qed_iov_hw_info() argument
584 struct qed_dev *cdev = p_hwfn->cdev; in qed_iov_hw_info()
591 if (IS_VF(p_hwfn->cdev)) in qed_iov_hw_info()
595 pos = pci_find_ext_capability(p_hwfn->cdev->pdev, in qed_iov_hw_info()
598 DP_VERBOSE(p_hwfn, QED_MSG_IOV, "No PCIe IOV support\n"); in qed_iov_hw_info()
618 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_hw_info()
635 if (p_hwfn->cdev->p_iov_info->offset < (256 - p_hwfn->abs_pf_id)) { in qed_iov_hw_info()
636 u32 first = p_hwfn->cdev->p_iov_info->offset + in qed_iov_hw_info()
637 p_hwfn->abs_pf_id - 16; in qed_iov_hw_info()
641 if (QED_PATH_ID(p_hwfn)) in qed_iov_hw_info()
644 u32 first = p_hwfn->cdev->p_iov_info->offset + in qed_iov_hw_info()
645 p_hwfn->abs_pf_id - 256; in qed_iov_hw_info()
650 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_hw_info()
657 static bool _qed_iov_pf_sanity_check(struct qed_hwfn *p_hwfn, in _qed_iov_pf_sanity_check() argument
661 if (IS_VF(p_hwfn->cdev) || !IS_QED_SRIOV(p_hwfn->cdev) || in _qed_iov_pf_sanity_check()
662 !IS_PF_SRIOV_ALLOC(p_hwfn)) in _qed_iov_pf_sanity_check()
666 if (!qed_iov_is_valid_vfid(p_hwfn, vfid, true, b_fail_malicious)) in _qed_iov_pf_sanity_check()
672 static bool qed_iov_pf_sanity_check(struct qed_hwfn *p_hwfn, int vfid) in qed_iov_pf_sanity_check() argument
674 return _qed_iov_pf_sanity_check(p_hwfn, vfid, true); in qed_iov_pf_sanity_check()
684 struct qed_hwfn *p_hwfn = &cdev->hwfns[i]; in qed_iov_set_vf_to_disable() local
686 vf = qed_iov_get_vf_info(p_hwfn, rel_vf_id, false); in qed_iov_set_vf_to_disable()
705 static void qed_iov_vf_pglue_clear_err(struct qed_hwfn *p_hwfn, in qed_iov_vf_pglue_clear_err() argument
708 qed_wr(p_hwfn, p_ptt, in qed_iov_vf_pglue_clear_err()
713 static void qed_iov_vf_igu_reset(struct qed_hwfn *p_hwfn, in qed_iov_vf_igu_reset() argument
719 qed_fid_pretend(p_hwfn, p_ptt, (u16)vf->concrete_fid); in qed_iov_vf_igu_reset()
721 qed_wr(p_hwfn, p_ptt, IGU_REG_STATISTIC_NUM_VF_MSG_SENT, 0); in qed_iov_vf_igu_reset()
724 qed_fid_pretend(p_hwfn, p_ptt, (u16)p_hwfn->hw_info.concrete_fid); in qed_iov_vf_igu_reset()
728 qed_int_igu_init_pure_rt_single(p_hwfn, p_ptt, in qed_iov_vf_igu_reset()
733 static void qed_iov_vf_igu_set_int(struct qed_hwfn *p_hwfn, in qed_iov_vf_igu_set_int() argument
739 qed_fid_pretend(p_hwfn, p_ptt, (u16)vf->concrete_fid); in qed_iov_vf_igu_set_int()
741 igu_vf_conf = qed_rd(p_hwfn, p_ptt, IGU_REG_VF_CONFIGURATION); in qed_iov_vf_igu_set_int()
748 qed_wr(p_hwfn, p_ptt, IGU_REG_VF_CONFIGURATION, igu_vf_conf); in qed_iov_vf_igu_set_int()
751 qed_fid_pretend(p_hwfn, p_ptt, (u16)p_hwfn->hw_info.concrete_fid); in qed_iov_vf_igu_set_int()
755 qed_iov_enable_vf_access_msix(struct qed_hwfn *p_hwfn, in qed_iov_enable_vf_access_msix() argument
764 if (!QED_IS_BB(p_hwfn->cdev)) { in qed_iov_enable_vf_access_msix()
765 qed_for_each_vf(p_hwfn, i) { in qed_iov_enable_vf_access_msix()
768 p_vf = qed_iov_get_vf_info(p_hwfn, (u16)i, true); in qed_iov_enable_vf_access_msix()
777 return qed_mcp_config_vf_msix(p_hwfn, p_ptt, in qed_iov_enable_vf_access_msix()
783 static int qed_iov_enable_vf_access(struct qed_hwfn *p_hwfn, in qed_iov_enable_vf_access() argument
798 DP_VERBOSE(p_hwfn, in qed_iov_enable_vf_access()
801 vf->abs_vf_id, QED_VF_ABS_ID(p_hwfn, vf)); in qed_iov_enable_vf_access()
803 qed_iov_vf_pglue_clear_err(p_hwfn, p_ptt, QED_VF_ABS_ID(p_hwfn, vf)); in qed_iov_enable_vf_access()
805 qed_iov_vf_igu_reset(p_hwfn, p_ptt, vf); in qed_iov_enable_vf_access()
807 rc = qed_iov_enable_vf_access_msix(p_hwfn, p_ptt, in qed_iov_enable_vf_access()
812 qed_fid_pretend(p_hwfn, p_ptt, (u16)vf->concrete_fid); in qed_iov_enable_vf_access()
814 SET_FIELD(igu_vf_conf, IGU_VF_CONF_PARENT, p_hwfn->rel_pf_id); in qed_iov_enable_vf_access()
815 STORE_RT_REG(p_hwfn, IGU_REG_VF_CONFIGURATION_RT_OFFSET, igu_vf_conf); in qed_iov_enable_vf_access()
817 qed_init_run(p_hwfn, p_ptt, PHASE_VF, vf->abs_vf_id, in qed_iov_enable_vf_access()
818 p_hwfn->hw_info.hw_mode); in qed_iov_enable_vf_access()
821 qed_fid_pretend(p_hwfn, p_ptt, (u16)p_hwfn->hw_info.concrete_fid); in qed_iov_enable_vf_access()
841 static void qed_iov_config_perm_table(struct qed_hwfn *p_hwfn, in qed_iov_config_perm_table() argument
850 qed_fw_l2_queue(p_hwfn, vf->vf_queues[qid].fw_rx_qid, in qed_iov_config_perm_table()
855 qed_wr(p_hwfn, p_ptt, reg_addr, val); in qed_iov_config_perm_table()
859 static void qed_iov_enable_vf_traffic(struct qed_hwfn *p_hwfn, in qed_iov_enable_vf_traffic() argument
864 qed_iov_vf_igu_reset(p_hwfn, p_ptt, vf); in qed_iov_enable_vf_traffic()
866 qed_iov_vf_igu_set_int(p_hwfn, p_ptt, vf, 1); in qed_iov_enable_vf_traffic()
869 qed_iov_config_perm_table(p_hwfn, p_ptt, vf, true); in qed_iov_enable_vf_traffic()
872 static u8 qed_iov_alloc_vf_igu_sbs(struct qed_hwfn *p_hwfn, in qed_iov_alloc_vf_igu_sbs() argument
881 if (num_rx_queues > p_hwfn->hw_info.p_igu_info->usage.free_cnt_iov) in qed_iov_alloc_vf_igu_sbs()
882 num_rx_queues = p_hwfn->hw_info.p_igu_info->usage.free_cnt_iov; in qed_iov_alloc_vf_igu_sbs()
883 p_hwfn->hw_info.p_igu_info->usage.free_cnt_iov -= num_rx_queues; in qed_iov_alloc_vf_igu_sbs()
890 p_block = qed_get_igu_free_sb(p_hwfn, false); in qed_iov_alloc_vf_igu_sbs()
895 qed_wr(p_hwfn, p_ptt, in qed_iov_alloc_vf_igu_sbs()
900 qed_init_cau_sb_entry(p_hwfn, &sb_entry, in qed_iov_alloc_vf_igu_sbs()
901 p_hwfn->rel_pf_id, vf->abs_vf_id, 1); in qed_iov_alloc_vf_igu_sbs()
903 qed_dmae_host2grc(p_hwfn, p_ptt, in qed_iov_alloc_vf_igu_sbs()
914 static void qed_iov_free_vf_igu_sbs(struct qed_hwfn *p_hwfn, in qed_iov_free_vf_igu_sbs() argument
918 struct qed_igu_info *p_info = p_hwfn->hw_info.p_igu_info; in qed_iov_free_vf_igu_sbs()
927 val = qed_rd(p_hwfn, p_ptt, addr); in qed_iov_free_vf_igu_sbs()
929 qed_wr(p_hwfn, p_ptt, addr, val); in qed_iov_free_vf_igu_sbs()
932 p_hwfn->hw_info.p_igu_info->usage.free_cnt_iov++; in qed_iov_free_vf_igu_sbs()
938 static void qed_iov_set_link(struct qed_hwfn *p_hwfn, in qed_iov_set_link() argument
944 struct qed_vf_info *p_vf = qed_iov_get_vf_info(p_hwfn, in qed_iov_set_link()
977 static int qed_iov_init_hw_for_vf(struct qed_hwfn *p_hwfn, in qed_iov_init_hw_for_vf() argument
991 vf = qed_iov_get_vf_info(p_hwfn, p_params->rel_vf_id, false); in qed_iov_init_hw_for_vf()
993 DP_ERR(p_hwfn, "%s : vf is NULL\n", __func__); in qed_iov_init_hw_for_vf()
998 DP_NOTICE(p_hwfn, "VF[%d] is already active.\n", in qed_iov_init_hw_for_vf()
1005 u16 min_vf_qzone = FEAT_NUM(p_hwfn, QED_PF_L2_QUE); in qed_iov_init_hw_for_vf()
1007 FEAT_NUM(p_hwfn, QED_VF_L2_QUE) - 1; in qed_iov_init_hw_for_vf()
1011 DP_NOTICE(p_hwfn, in qed_iov_init_hw_for_vf()
1021 DP_NOTICE(p_hwfn, in qed_iov_init_hw_for_vf()
1029 DP_VERBOSE(p_hwfn, in qed_iov_init_hw_for_vf()
1036 qed_cxt_get_proto_cid_count(p_hwfn, PROTOCOLID_ETH, &cids); in qed_iov_init_hw_for_vf()
1037 DP_VERBOSE(p_hwfn, in qed_iov_init_hw_for_vf()
1043 num_of_vf_avaiable_chains = qed_iov_alloc_vf_igu_sbs(p_hwfn, in qed_iov_init_hw_for_vf()
1047 DP_ERR(p_hwfn, "no available igu sbs\n"); in qed_iov_init_hw_for_vf()
1061 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_init_hw_for_vf()
1068 memcpy(&link_params, qed_mcp_get_link_params(p_hwfn), in qed_iov_init_hw_for_vf()
1070 memcpy(&link_state, qed_mcp_get_link_state(p_hwfn), sizeof(link_state)); in qed_iov_init_hw_for_vf()
1071 memcpy(&link_caps, qed_mcp_get_link_capabilities(p_hwfn), in qed_iov_init_hw_for_vf()
1073 qed_iov_set_link(p_hwfn, p_params->rel_vf_id, in qed_iov_init_hw_for_vf()
1076 rc = qed_iov_enable_vf_access(p_hwfn, p_ptt, vf); in qed_iov_init_hw_for_vf()
1080 if (IS_LEAD_HWFN(p_hwfn)) in qed_iov_init_hw_for_vf()
1081 p_hwfn->cdev->p_iov_info->num_vfs++; in qed_iov_init_hw_for_vf()
1087 static int qed_iov_release_hw_for_vf(struct qed_hwfn *p_hwfn, in qed_iov_release_hw_for_vf() argument
1095 vf = qed_iov_get_vf_info(p_hwfn, rel_vf_id, true); in qed_iov_release_hw_for_vf()
1097 DP_ERR(p_hwfn, "%s : vf is NULL\n", __func__); in qed_iov_release_hw_for_vf()
1110 memcpy(¶ms, qed_mcp_get_link_params(p_hwfn), sizeof(params)); in qed_iov_release_hw_for_vf()
1111 memcpy(&link, qed_mcp_get_link_state(p_hwfn), sizeof(link)); in qed_iov_release_hw_for_vf()
1112 memcpy(&caps, qed_mcp_get_link_capabilities(p_hwfn), sizeof(caps)); in qed_iov_release_hw_for_vf()
1113 qed_iov_set_link(p_hwfn, rel_vf_id, ¶ms, &link, &caps); in qed_iov_release_hw_for_vf()
1122 qed_iov_vf_igu_set_int(p_hwfn, p_ptt, vf, 0); in qed_iov_release_hw_for_vf()
1125 qed_iov_config_perm_table(p_hwfn, p_ptt, vf, 0); in qed_iov_release_hw_for_vf()
1129 qed_iov_free_vf_igu_sbs(p_hwfn, p_ptt, vf); in qed_iov_release_hw_for_vf()
1134 if (IS_LEAD_HWFN(p_hwfn)) in qed_iov_release_hw_for_vf()
1135 p_hwfn->cdev->p_iov_info->num_vfs--; in qed_iov_release_hw_for_vf()
1147 void *qed_add_tlv(struct qed_hwfn *p_hwfn, u8 **offset, u16 type, u16 length) in qed_add_tlv() argument
1162 void qed_dp_tlv_list(struct qed_hwfn *p_hwfn, void *tlvs_list) in qed_dp_tlv_list() argument
1171 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_dp_tlv_list()
1180 DP_NOTICE(p_hwfn, "TLV of length 0 found\n"); in qed_dp_tlv_list()
1187 DP_NOTICE(p_hwfn, "TLV ==> Buffer overflow\n"); in qed_dp_tlv_list()
1195 static void qed_iov_send_response(struct qed_hwfn *p_hwfn, in qed_iov_send_response() argument
1206 qed_dp_tlv_list(p_hwfn, mbx->reply_virt); in qed_iov_send_response()
1214 qed_dmae_host2host(p_hwfn, p_ptt, mbx->reply_phys + sizeof(u64), in qed_iov_send_response()
1224 REG_WR(p_hwfn, in qed_iov_send_response()
1228 qed_dmae_host2host(p_hwfn, p_ptt, mbx->reply_phys, in qed_iov_send_response()
1233 static u16 qed_iov_vport_to_tlv(struct qed_hwfn *p_hwfn, in qed_iov_vport_to_tlv() argument
1258 static u16 qed_iov_prep_vp_update_resp_tlvs(struct qed_hwfn *p_hwfn, in qed_iov_prep_vp_update_resp_tlvs() argument
1272 qed_add_tlv(p_hwfn, &p_mbx->offset, CHANNEL_TLV_VPORT_UPDATE, size); in qed_iov_prep_vp_update_resp_tlvs()
1279 resp = qed_add_tlv(p_hwfn, &p_mbx->offset, in qed_iov_prep_vp_update_resp_tlvs()
1280 qed_iov_vport_to_tlv(p_hwfn, i), size); in qed_iov_prep_vp_update_resp_tlvs()
1287 DP_VERBOSE(p_hwfn, in qed_iov_prep_vp_update_resp_tlvs()
1291 qed_iov_vport_to_tlv(p_hwfn, i), resp->hdr.status); in qed_iov_prep_vp_update_resp_tlvs()
1296 qed_add_tlv(p_hwfn, &p_mbx->offset, CHANNEL_TLV_LIST_END, in qed_iov_prep_vp_update_resp_tlvs()
1302 static void qed_iov_prepare_resp(struct qed_hwfn *p_hwfn, in qed_iov_prepare_resp() argument
1311 qed_add_tlv(p_hwfn, &mbx->offset, type, length); in qed_iov_prepare_resp()
1312 qed_add_tlv(p_hwfn, &mbx->offset, CHANNEL_TLV_LIST_END, in qed_iov_prepare_resp()
1315 qed_iov_send_response(p_hwfn, p_ptt, vf_info, length, status); in qed_iov_prepare_resp()
1319 qed_public_vf_info *qed_iov_get_public_vf_info(struct qed_hwfn *p_hwfn, in qed_iov_get_public_vf_info() argument
1325 vf = qed_iov_get_vf_info(p_hwfn, relative_vf_id, b_enabled_only); in qed_iov_get_public_vf_info()
1332 static void qed_iov_clean_vf(struct qed_hwfn *p_hwfn, u8 vfid) in qed_iov_clean_vf() argument
1336 vf_info = qed_iov_get_public_vf_info(p_hwfn, vfid, false); in qed_iov_clean_vf()
1348 static void qed_iov_vf_cleanup(struct qed_hwfn *p_hwfn, in qed_iov_vf_cleanup() argument
1370 qed_eth_queue_cid_release(p_hwfn, in qed_iov_vf_cleanup()
1378 qed_iov_clean_vf(p_hwfn, p_vf->relative_vf_id); in qed_iov_vf_cleanup()
1382 static u32 qed_iov_vf_db_bar_size(struct qed_hwfn *p_hwfn, in qed_iov_vf_db_bar_size() argument
1385 u32 val = qed_rd(p_hwfn, p_ptt, PGLUE_B_REG_VF_BAR1_SIZE); in qed_iov_vf_db_bar_size()
1393 qed_iov_vf_mbx_acquire_resc_cids(struct qed_hwfn *p_hwfn, in qed_iov_vf_mbx_acquire_resc_cids() argument
1399 u8 num_vf_cons = p_hwfn->pf_params.eth_pf_params.num_vf_cons; in qed_iov_vf_mbx_acquire_resc_cids()
1420 bar_size = qed_iov_vf_db_bar_size(p_hwfn, p_ptt); in qed_iov_vf_mbx_acquire_resc_cids()
1424 if (p_hwfn->cdev->num_hwfns > 1) in qed_iov_vf_mbx_acquire_resc_cids()
1435 static u8 qed_iov_vf_mbx_acquire_resc(struct qed_hwfn *p_hwfn, in qed_iov_vf_mbx_acquire_resc() argument
1457 qed_fw_l2_queue(p_hwfn, p_vf->vf_queues[i].fw_rx_qid, in qed_iov_vf_mbx_acquire_resc()
1468 qed_iov_vf_mbx_acquire_resc_cids(p_hwfn, p_ptt, p_vf, p_req, p_resp); in qed_iov_vf_mbx_acquire_resc()
1483 DP_VERBOSE(p_hwfn, in qed_iov_vf_mbx_acquire_resc()
1516 static void qed_iov_vf_mbx_acquire_stats(struct qed_hwfn *p_hwfn, in qed_iov_vf_mbx_acquire_stats() argument
1535 static void qed_iov_vf_mbx_acquire(struct qed_hwfn *p_hwfn, in qed_iov_vf_mbx_acquire() argument
1557 DP_VERBOSE(p_hwfn, in qed_iov_vf_mbx_acquire()
1570 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_vf_mbx_acquire()
1576 DP_INFO(p_hwfn, in qed_iov_vf_mbx_acquire()
1588 if ((p_hwfn->cdev->num_hwfns > 1) && in qed_iov_vf_mbx_acquire()
1590 DP_INFO(p_hwfn, in qed_iov_vf_mbx_acquire()
1606 pfdev_info->chip_num = p_hwfn->cdev->chip_num; in qed_iov_vf_mbx_acquire()
1612 if (p_hwfn->cdev->num_hwfns > 1) in qed_iov_vf_mbx_acquire()
1622 resp->pfdev_info.bar_size = qed_iov_vf_db_bar_size(p_hwfn, p_ptt); in qed_iov_vf_mbx_acquire()
1624 qed_iov_vf_mbx_acquire_stats(p_hwfn, &pfdev_info->stats_info); in qed_iov_vf_mbx_acquire()
1626 memcpy(pfdev_info->port_mac, p_hwfn->hw_info.hw_mac_addr, ETH_ALEN); in qed_iov_vf_mbx_acquire()
1639 qed_mcp_get_mfw_ver(p_hwfn, p_ptt, &pfdev_info->mfw_ver, NULL); in qed_iov_vf_mbx_acquire()
1641 pfdev_info->dev_type = p_hwfn->cdev->type; in qed_iov_vf_mbx_acquire()
1642 pfdev_info->chip_rev = p_hwfn->cdev->chip_rev; in qed_iov_vf_mbx_acquire()
1647 vfpf_status = qed_iov_vf_mbx_acquire_resc(p_hwfn, p_ptt, vf, in qed_iov_vf_mbx_acquire()
1653 rc = qed_sp_vf_start(p_hwfn, vf); in qed_iov_vf_mbx_acquire()
1655 DP_NOTICE(p_hwfn, "Failed to start VF[%02x]\n", vf->abs_vf_id); in qed_iov_vf_mbx_acquire()
1662 qed_iov_post_vf_bulletin(p_hwfn, vf->relative_vf_id, p_ptt); in qed_iov_vf_mbx_acquire()
1664 DP_VERBOSE(p_hwfn, in qed_iov_vf_mbx_acquire()
1682 qed_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_ACQUIRE, in qed_iov_vf_mbx_acquire()
1686 static int __qed_iov_spoofchk_set(struct qed_hwfn *p_hwfn, in __qed_iov_spoofchk_set() argument
1693 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in __qed_iov_spoofchk_set()
1704 rc = qed_sp_vport_update(p_hwfn, ¶ms, QED_SPQ_MODE_EBLOCK, NULL); in __qed_iov_spoofchk_set()
1708 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in __qed_iov_spoofchk_set()
1711 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in __qed_iov_spoofchk_set()
1719 static int qed_iov_reconfigure_unicast_vlan(struct qed_hwfn *p_hwfn, in qed_iov_reconfigure_unicast_vlan() argument
1739 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_reconfigure_unicast_vlan()
1742 rc = qed_sp_eth_filter_ucast(p_hwfn, p_vf->opaque_fid, in qed_iov_reconfigure_unicast_vlan()
1745 DP_NOTICE(p_hwfn, in qed_iov_reconfigure_unicast_vlan()
1756 qed_iov_reconfigure_unicast_shadow(struct qed_hwfn *p_hwfn, in qed_iov_reconfigure_unicast_shadow() argument
1763 rc = qed_iov_reconfigure_unicast_vlan(p_hwfn, p_vf); in qed_iov_reconfigure_unicast_shadow()
1768 static int qed_iov_configure_vport_forced(struct qed_hwfn *p_hwfn, in qed_iov_configure_vport_forced() argument
1790 rc = qed_sp_eth_filter_ucast(p_hwfn, p_vf->opaque_fid, in qed_iov_configure_vport_forced()
1793 DP_NOTICE(p_hwfn, in qed_iov_configure_vport_forced()
1820 rc = qed_sp_eth_filter_ucast(p_hwfn, p_vf->opaque_fid, in qed_iov_configure_vport_forced()
1823 DP_NOTICE(p_hwfn, in qed_iov_configure_vport_forced()
1842 rc = qed_sp_vport_update(p_hwfn, in qed_iov_configure_vport_forced()
1846 DP_NOTICE(p_hwfn, in qed_iov_configure_vport_forced()
1861 rc = qed_sp_eth_rx_queues_update(p_hwfn, in qed_iov_configure_vport_forced()
1867 DP_NOTICE(p_hwfn, in qed_iov_configure_vport_forced()
1884 qed_iov_reconfigure_unicast_shadow(p_hwfn, p_vf, events); in qed_iov_configure_vport_forced()
1889 static void qed_iov_vf_mbx_start_vport(struct qed_hwfn *p_hwfn, in qed_iov_vf_mbx_start_vport() argument
1902 vf_info = qed_iov_get_vf_info(p_hwfn, (u16)vf->relative_vf_id, true); in qed_iov_vf_mbx_start_vport()
1904 DP_NOTICE(p_hwfn->cdev, in qed_iov_vf_mbx_start_vport()
1913 qed_iov_enable_vf_traffic(p_hwfn, p_ptt, vf); in qed_iov_vf_mbx_start_vport()
1918 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_vf_mbx_start_vport()
1924 qed_int_cau_conf_sb(p_hwfn, p_ptt, in qed_iov_vf_mbx_start_vport()
1959 rc = qed_sp_eth_vport_start(p_hwfn, ¶ms); in qed_iov_vf_mbx_start_vport()
1961 DP_ERR(p_hwfn, in qed_iov_vf_mbx_start_vport()
1968 qed_iov_configure_vport_forced(p_hwfn, vf, *p_bitmap); in qed_iov_vf_mbx_start_vport()
1970 __qed_iov_spoofchk_set(p_hwfn, vf, vf->req_spoofchk_val); in qed_iov_vf_mbx_start_vport()
1972 qed_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_VPORT_START, in qed_iov_vf_mbx_start_vport()
1976 static void qed_iov_vf_mbx_stop_vport(struct qed_hwfn *p_hwfn, in qed_iov_vf_mbx_stop_vport() argument
1986 if ((qed_iov_validate_active_rxq(p_hwfn, vf)) || in qed_iov_vf_mbx_stop_vport()
1987 (qed_iov_validate_active_txq(p_hwfn, vf))) { in qed_iov_vf_mbx_stop_vport()
1989 DP_NOTICE(p_hwfn, in qed_iov_vf_mbx_stop_vport()
1996 rc = qed_sp_vport_stop(p_hwfn, vf->opaque_fid, vf->vport_id); in qed_iov_vf_mbx_stop_vport()
1998 DP_ERR(p_hwfn, "%s returned error %d\n", in qed_iov_vf_mbx_stop_vport()
2008 qed_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_VPORT_TEARDOWN, in qed_iov_vf_mbx_stop_vport()
2012 static void qed_iov_vf_mbx_start_rxq_resp(struct qed_hwfn *p_hwfn, in qed_iov_vf_mbx_start_rxq_resp() argument
2033 p_tlv = qed_add_tlv(p_hwfn, &mbx->offset, CHANNEL_TLV_START_RXQ, in qed_iov_vf_mbx_start_rxq_resp()
2035 qed_add_tlv(p_hwfn, &mbx->offset, CHANNEL_TLV_LIST_END, in qed_iov_vf_mbx_start_rxq_resp()
2047 qed_iov_send_response(p_hwfn, p_ptt, vf, length, status); in qed_iov_vf_mbx_start_rxq_resp()
2050 static u8 qed_iov_vf_mbx_qid(struct qed_hwfn *p_hwfn, in qed_iov_vf_mbx_qid() argument
2066 qed_iov_search_list_tlvs(p_hwfn, p_mbx->req_virt, in qed_iov_vf_mbx_qid()
2069 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_vf_mbx_qid()
2077 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_vf_mbx_qid()
2086 static void qed_iov_vf_mbx_start_rxq(struct qed_hwfn *p_hwfn, in qed_iov_vf_mbx_start_rxq() argument
2103 if (!qed_iov_validate_rxq(p_hwfn, vf, req->rx_qid, in qed_iov_vf_mbx_start_rxq()
2105 !qed_iov_validate_sb(p_hwfn, vf, req->hw_sb)) in qed_iov_vf_mbx_start_rxq()
2108 qid_usage_idx = qed_iov_vf_mbx_qid(p_hwfn, vf, false); in qed_iov_vf_mbx_start_rxq()
2134 p_cid = qed_eth_queue_to_cid(p_hwfn, vf->opaque_fid, in qed_iov_vf_mbx_start_rxq()
2143 qed_wr(p_hwfn, p_ptt, MSEM_REG_FAST_MEMORY + in qed_iov_vf_mbx_start_rxq()
2148 rc = qed_eth_rxq_start_ramrod(p_hwfn, p_cid, in qed_iov_vf_mbx_start_rxq()
2154 qed_eth_queue_cid_release(p_hwfn, p_cid); in qed_iov_vf_mbx_start_rxq()
2163 qed_iov_vf_mbx_start_rxq_resp(p_hwfn, p_ptt, vf, status, in qed_iov_vf_mbx_start_rxq()
2239 qed_pf_validate_modify_tunn_config(struct qed_hwfn *p_hwfn, in qed_pf_validate_modify_tunn_config() argument
2243 struct qed_eth_cb_ops *ops = p_hwfn->cdev->protocol_ops.eth; in qed_pf_validate_modify_tunn_config()
2244 struct qed_tunnel_info *tun = &p_hwfn->cdev->tunnel; in qed_pf_validate_modify_tunn_config()
2246 void *cookie = p_hwfn->cdev->ops_cookie; in qed_pf_validate_modify_tunn_config()
2249 *tun_features = p_hwfn->cdev->tunn_feature_mask; in qed_pf_validate_modify_tunn_config()
2287 qed_for_each_vf(p_hwfn, i) { in qed_pf_validate_modify_tunn_config()
2288 qed_iov_bulletin_set_udp_ports(p_hwfn, i, bultn_vxlan_port, in qed_pf_validate_modify_tunn_config()
2292 qed_schedule_iov(p_hwfn, QED_IOV_WQ_BULLETIN_UPDATE_FLAG); in qed_pf_validate_modify_tunn_config()
2298 static void qed_iov_vf_mbx_update_tunn_param(struct qed_hwfn *p_hwfn, in qed_iov_vf_mbx_update_tunn_param() argument
2302 struct qed_tunnel_info *p_tun = &p_hwfn->cdev->tunnel; in qed_iov_vf_mbx_update_tunn_param()
2318 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_vf_mbx_update_tunn_param()
2348 rc = qed_pf_validate_modify_tunn_config(p_hwfn, &tunn_feature_mask, in qed_iov_vf_mbx_update_tunn_param()
2358 rc = qed_sp_pf_update_tunn_cfg(p_hwfn, p_ptt, &tunn, in qed_iov_vf_mbx_update_tunn_param()
2364 qed_for_each_vf(p_hwfn, i) { in qed_iov_vf_mbx_update_tunn_param()
2365 qed_iov_bulletin_set_udp_ports(p_hwfn, i, in qed_iov_vf_mbx_update_tunn_param()
2372 p_resp = qed_add_tlv(p_hwfn, &mbx->offset, in qed_iov_vf_mbx_update_tunn_param()
2376 qed_add_tlv(p_hwfn, &mbx->offset, CHANNEL_TLV_LIST_END, in qed_iov_vf_mbx_update_tunn_param()
2379 qed_iov_send_response(p_hwfn, p_ptt, p_vf, sizeof(*p_resp), status); in qed_iov_vf_mbx_update_tunn_param()
2382 static void qed_iov_vf_mbx_start_txq_resp(struct qed_hwfn *p_hwfn, in qed_iov_vf_mbx_start_txq_resp() argument
2407 p_tlv = qed_add_tlv(p_hwfn, &mbx->offset, CHANNEL_TLV_START_TXQ, in qed_iov_vf_mbx_start_txq_resp()
2409 qed_add_tlv(p_hwfn, &mbx->offset, CHANNEL_TLV_LIST_END, in qed_iov_vf_mbx_start_txq_resp()
2416 qed_iov_send_response(p_hwfn, p_ptt, p_vf, length, status); in qed_iov_vf_mbx_start_txq_resp()
2419 static void qed_iov_vf_mbx_start_txq(struct qed_hwfn *p_hwfn, in qed_iov_vf_mbx_start_txq() argument
2439 if (!qed_iov_validate_txq(p_hwfn, vf, req->tx_qid, in qed_iov_vf_mbx_start_txq()
2441 !qed_iov_validate_sb(p_hwfn, vf, req->hw_sb)) in qed_iov_vf_mbx_start_txq()
2444 qid_usage_idx = qed_iov_vf_mbx_qid(p_hwfn, vf, true); in qed_iov_vf_mbx_start_txq()
2471 p_cid = qed_eth_queue_to_cid(p_hwfn, vf->opaque_fid, in qed_iov_vf_mbx_start_txq()
2476 pq = qed_get_cm_pq_idx_vf(p_hwfn, vf->relative_vf_id); in qed_iov_vf_mbx_start_txq()
2477 rc = qed_eth_txq_start_ramrod(p_hwfn, p_cid, in qed_iov_vf_mbx_start_txq()
2481 qed_eth_queue_cid_release(p_hwfn, p_cid); in qed_iov_vf_mbx_start_txq()
2490 qed_iov_vf_mbx_start_txq_resp(p_hwfn, p_ptt, vf, cid, status); in qed_iov_vf_mbx_start_txq()
2493 static int qed_iov_vf_stop_rxqs(struct qed_hwfn *p_hwfn, in qed_iov_vf_stop_rxqs() argument
2501 if (!qed_iov_validate_rxq(p_hwfn, vf, rxq_id, QED_IOV_VALIDATE_Q_NA)) { in qed_iov_vf_stop_rxqs()
2502 DP_VERBOSE(p_hwfn, in qed_iov_vf_stop_rxqs()
2519 DP_VERBOSE(p_hwfn, in qed_iov_vf_stop_rxqs()
2528 rc = qed_eth_rx_queue_stop(p_hwfn, in qed_iov_vf_stop_rxqs()
2540 static int qed_iov_vf_stop_txqs(struct qed_hwfn *p_hwfn, in qed_iov_vf_stop_txqs() argument
2547 if (!qed_iov_validate_txq(p_hwfn, vf, txq_id, QED_IOV_VALIDATE_Q_NA)) in qed_iov_vf_stop_txqs()
2555 rc = qed_eth_tx_queue_stop(p_hwfn, p_queue->cids[qid_usage_idx].p_cid); in qed_iov_vf_stop_txqs()
2563 static void qed_iov_vf_mbx_stop_rxqs(struct qed_hwfn *p_hwfn, in qed_iov_vf_mbx_stop_rxqs() argument
2580 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_vf_mbx_stop_rxqs()
2588 qid_usage_idx = qed_iov_vf_mbx_qid(p_hwfn, vf, false); in qed_iov_vf_mbx_stop_rxqs()
2592 rc = qed_iov_vf_stop_rxqs(p_hwfn, vf, req->rx_qid, in qed_iov_vf_mbx_stop_rxqs()
2597 qed_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_STOP_RXQS, in qed_iov_vf_mbx_stop_rxqs()
2601 static void qed_iov_vf_mbx_stop_txqs(struct qed_hwfn *p_hwfn, in qed_iov_vf_mbx_stop_txqs() argument
2618 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_vf_mbx_stop_txqs()
2626 qid_usage_idx = qed_iov_vf_mbx_qid(p_hwfn, vf, true); in qed_iov_vf_mbx_stop_txqs()
2630 rc = qed_iov_vf_stop_txqs(p_hwfn, vf, req->tx_qid, qid_usage_idx); in qed_iov_vf_mbx_stop_txqs()
2635 qed_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_STOP_TXQS, in qed_iov_vf_mbx_stop_txqs()
2639 static void qed_iov_vf_mbx_update_rxqs(struct qed_hwfn *p_hwfn, in qed_iov_vf_mbx_update_rxqs() argument
2658 qid_usage_idx = qed_iov_vf_mbx_qid(p_hwfn, vf, false); in qed_iov_vf_mbx_update_rxqs()
2667 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_vf_mbx_update_rxqs()
2677 if (!qed_iov_validate_rxq(p_hwfn, vf, i, in qed_iov_vf_mbx_update_rxqs()
2681 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_vf_mbx_update_rxqs()
2696 rc = qed_sp_eth_rx_queues_update(p_hwfn, (void **)&handlers, in qed_iov_vf_mbx_update_rxqs()
2706 qed_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_UPDATE_RXQ, in qed_iov_vf_mbx_update_rxqs()
2710 void *qed_iov_search_list_tlvs(struct qed_hwfn *p_hwfn, in qed_iov_search_list_tlvs() argument
2718 DP_NOTICE(p_hwfn, "Zero length TLV found\n"); in qed_iov_search_list_tlvs()
2723 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_search_list_tlvs()
2733 DP_NOTICE(p_hwfn, "TLVs has overrun the buffer size\n"); in qed_iov_search_list_tlvs()
2742 qed_iov_vp_update_act_param(struct qed_hwfn *p_hwfn, in qed_iov_vp_update_act_param() argument
2750 qed_iov_search_list_tlvs(p_hwfn, p_mbx->req_virt, tlv); in qed_iov_vp_update_act_param()
2762 qed_iov_vp_update_vlan_param(struct qed_hwfn *p_hwfn, in qed_iov_vp_update_vlan_param() argument
2771 qed_iov_search_list_tlvs(p_hwfn, p_mbx->req_virt, tlv); in qed_iov_vp_update_vlan_param()
2787 qed_iov_vp_update_tx_switch(struct qed_hwfn *p_hwfn, in qed_iov_vp_update_tx_switch() argument
2795 qed_iov_search_list_tlvs(p_hwfn, p_mbx->req_virt, in qed_iov_vp_update_tx_switch()
2806 qed_iov_vp_update_mcast_bin_param(struct qed_hwfn *p_hwfn, in qed_iov_vp_update_mcast_bin_param() argument
2814 qed_iov_search_list_tlvs(p_hwfn, p_mbx->req_virt, tlv); in qed_iov_vp_update_mcast_bin_param()
2825 qed_iov_vp_update_accept_flag(struct qed_hwfn *p_hwfn, in qed_iov_vp_update_accept_flag() argument
2834 qed_iov_search_list_tlvs(p_hwfn, p_mbx->req_virt, tlv); in qed_iov_vp_update_accept_flag()
2846 qed_iov_vp_update_accept_any_vlan(struct qed_hwfn *p_hwfn, in qed_iov_vp_update_accept_any_vlan() argument
2854 qed_iov_search_list_tlvs(p_hwfn, p_mbx->req_virt, in qed_iov_vp_update_accept_any_vlan()
2866 qed_iov_vp_update_rss_param(struct qed_hwfn *p_hwfn, in qed_iov_vp_update_rss_param() argument
2880 qed_iov_search_list_tlvs(p_hwfn, p_mbx->req_virt, tlv); in qed_iov_vp_update_rss_param()
2910 if (!qed_iov_validate_rxq(p_hwfn, vf, q_idx, in qed_iov_vp_update_rss_param()
2912 DP_VERBOSE(p_hwfn, in qed_iov_vp_update_rss_param()
2932 qed_iov_vp_update_sge_tpa_param(struct qed_hwfn *p_hwfn, in qed_iov_vp_update_sge_tpa_param() argument
2942 qed_iov_search_list_tlvs(p_hwfn, p_mbx->req_virt, tlv); in qed_iov_vp_update_sge_tpa_param()
3023 static void qed_iov_vf_mbx_vport_update(struct qed_hwfn *p_hwfn, in qed_iov_vf_mbx_vport_update() argument
3038 DP_VERBOSE(p_hwfn, in qed_iov_vf_mbx_vport_update()
3059 qed_iov_vp_update_act_param(p_hwfn, ¶ms, mbx, &tlvs_mask); in qed_iov_vf_mbx_vport_update()
3060 qed_iov_vp_update_vlan_param(p_hwfn, ¶ms, vf, mbx, &tlvs_mask); in qed_iov_vf_mbx_vport_update()
3061 qed_iov_vp_update_tx_switch(p_hwfn, ¶ms, mbx, &tlvs_mask); in qed_iov_vf_mbx_vport_update()
3062 qed_iov_vp_update_mcast_bin_param(p_hwfn, ¶ms, mbx, &tlvs_mask); in qed_iov_vf_mbx_vport_update()
3063 qed_iov_vp_update_accept_flag(p_hwfn, ¶ms, mbx, &tlvs_mask); in qed_iov_vf_mbx_vport_update()
3064 qed_iov_vp_update_accept_any_vlan(p_hwfn, ¶ms, mbx, &tlvs_mask); in qed_iov_vf_mbx_vport_update()
3065 qed_iov_vp_update_sge_tpa_param(p_hwfn, vf, ¶ms, in qed_iov_vf_mbx_vport_update()
3074 qed_iov_vp_update_rss_param(p_hwfn, vf, ¶ms, p_rss_params, in qed_iov_vf_mbx_vport_update()
3077 if (qed_iov_pre_update_vport(p_hwfn, vf->relative_vf_id, in qed_iov_vf_mbx_vport_update()
3086 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_vf_mbx_vport_update()
3089 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_vf_mbx_vport_update()
3095 rc = qed_sp_vport_update(p_hwfn, ¶ms, QED_SPQ_MODE_EBLOCK, NULL); in qed_iov_vf_mbx_vport_update()
3102 length = qed_iov_prep_vp_update_resp_tlvs(p_hwfn, vf, mbx, status, in qed_iov_vf_mbx_vport_update()
3104 qed_iov_send_response(p_hwfn, p_ptt, vf, length, status); in qed_iov_vf_mbx_vport_update()
3107 static int qed_iov_vf_update_vlan_shadow(struct qed_hwfn *p_hwfn, in qed_iov_vf_update_vlan_shadow() argument
3123 DP_VERBOSE(p_hwfn, in qed_iov_vf_update_vlan_shadow()
3153 DP_VERBOSE(p_hwfn, in qed_iov_vf_update_vlan_shadow()
3165 static int qed_iov_vf_update_mac_shadow(struct qed_hwfn *p_hwfn, in qed_iov_vf_update_mac_shadow() argument
3190 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_vf_update_mac_shadow()
3209 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_vf_update_mac_shadow()
3216 DP_VERBOSE(p_hwfn, QED_MSG_IOV, "No available place for MAC\n"); in qed_iov_vf_update_mac_shadow()
3224 qed_iov_vf_update_unicast_shadow(struct qed_hwfn *p_hwfn, in qed_iov_vf_update_unicast_shadow() argument
3231 rc = qed_iov_vf_update_mac_shadow(p_hwfn, p_vf, p_params); in qed_iov_vf_update_unicast_shadow()
3237 rc = qed_iov_vf_update_vlan_shadow(p_hwfn, p_vf, p_params); in qed_iov_vf_update_unicast_shadow()
3267 static void qed_iov_vf_mbx_ucast_filter(struct qed_hwfn *p_hwfn, in qed_iov_vf_mbx_ucast_filter() argument
3291 DP_VERBOSE(p_hwfn, in qed_iov_vf_mbx_ucast_filter()
3301 DP_VERBOSE(p_hwfn, in qed_iov_vf_mbx_ucast_filter()
3310 if (qed_iov_vf_update_unicast_shadow(p_hwfn, vf, ¶ms)) { in qed_iov_vf_mbx_ucast_filter()
3338 rc = qed_iov_chk_ucast(p_hwfn, vf->relative_vf_id, ¶ms); in qed_iov_vf_mbx_ucast_filter()
3344 rc = qed_sp_eth_filter_ucast(p_hwfn, vf->opaque_fid, ¶ms, in qed_iov_vf_mbx_ucast_filter()
3350 qed_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_UCAST_FILTER, in qed_iov_vf_mbx_ucast_filter()
3354 static void qed_iov_vf_mbx_int_cleanup(struct qed_hwfn *p_hwfn, in qed_iov_vf_mbx_int_cleanup() argument
3362 qed_int_igu_init_pure_rt_single(p_hwfn, p_ptt, in qed_iov_vf_mbx_int_cleanup()
3366 qed_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_INT_CLEANUP, in qed_iov_vf_mbx_int_cleanup()
3371 static void qed_iov_vf_mbx_close(struct qed_hwfn *p_hwfn, in qed_iov_vf_mbx_close() argument
3378 qed_iov_vf_igu_set_int(p_hwfn, p_ptt, vf, 0); in qed_iov_vf_mbx_close()
3381 qed_iov_config_perm_table(p_hwfn, p_ptt, vf, 0); in qed_iov_vf_mbx_close()
3383 qed_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_CLOSE, in qed_iov_vf_mbx_close()
3387 static void qed_iov_vf_mbx_release(struct qed_hwfn *p_hwfn, in qed_iov_vf_mbx_release() argument
3395 qed_iov_vf_cleanup(p_hwfn, p_vf); in qed_iov_vf_mbx_release()
3399 rc = qed_sp_vf_stop(p_hwfn, p_vf->concrete_fid, in qed_iov_vf_mbx_release()
3403 DP_ERR(p_hwfn, "qed_sp_vf_stop returned error %d\n", in qed_iov_vf_mbx_release()
3411 qed_iov_prepare_resp(p_hwfn, p_ptt, p_vf, CHANNEL_TLV_RELEASE, in qed_iov_vf_mbx_release()
3415 static void qed_iov_vf_pf_get_coalesce(struct qed_hwfn *p_hwfn, in qed_iov_vf_pf_get_coalesce() argument
3436 if (!qed_iov_validate_rxq(p_hwfn, p_vf, qid, in qed_iov_vf_pf_get_coalesce()
3438 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_vf_pf_get_coalesce()
3445 rc = qed_get_rxq_coalesce(p_hwfn, p_ptt, p_cid, &coal); in qed_iov_vf_pf_get_coalesce()
3449 if (!qed_iov_validate_txq(p_hwfn, p_vf, qid, in qed_iov_vf_pf_get_coalesce()
3451 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_vf_pf_get_coalesce()
3464 rc = qed_get_txq_coalesce(p_hwfn, p_ptt, p_cid, &coal); in qed_iov_vf_pf_get_coalesce()
3474 p_resp = qed_add_tlv(p_hwfn, &mbx->offset, CHANNEL_TLV_COALESCE_READ, in qed_iov_vf_pf_get_coalesce()
3478 qed_add_tlv(p_hwfn, &mbx->offset, CHANNEL_TLV_LIST_END, in qed_iov_vf_pf_get_coalesce()
3481 qed_iov_send_response(p_hwfn, p_ptt, p_vf, sizeof(*p_resp), status); in qed_iov_vf_pf_get_coalesce()
3484 static void qed_iov_vf_pf_set_coalesce(struct qed_hwfn *p_hwfn, in qed_iov_vf_pf_set_coalesce() argument
3502 if (!qed_iov_validate_rxq(p_hwfn, vf, qid, in qed_iov_vf_pf_set_coalesce()
3504 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_vf_pf_set_coalesce()
3510 if (!qed_iov_validate_txq(p_hwfn, vf, qid, in qed_iov_vf_pf_set_coalesce()
3512 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_vf_pf_set_coalesce()
3518 DP_VERBOSE(p_hwfn, in qed_iov_vf_pf_set_coalesce()
3526 rc = qed_set_rxq_coalesce(p_hwfn, p_ptt, rx_coal, p_cid); in qed_iov_vf_pf_set_coalesce()
3528 DP_VERBOSE(p_hwfn, in qed_iov_vf_pf_set_coalesce()
3547 rc = qed_set_txq_coalesce(p_hwfn, p_ptt, tx_coal, in qed_iov_vf_pf_set_coalesce()
3551 DP_VERBOSE(p_hwfn, in qed_iov_vf_pf_set_coalesce()
3563 qed_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_COALESCE_UPDATE, in qed_iov_vf_pf_set_coalesce()
3568 qed_iov_vf_flr_poll_dorq(struct qed_hwfn *p_hwfn, in qed_iov_vf_flr_poll_dorq() argument
3574 qed_fid_pretend(p_hwfn, p_ptt, (u16)p_vf->concrete_fid); in qed_iov_vf_flr_poll_dorq()
3577 val = qed_rd(p_hwfn, p_ptt, DORQ_REG_VF_USAGE_CNT); in qed_iov_vf_flr_poll_dorq()
3582 qed_fid_pretend(p_hwfn, p_ptt, (u16)p_hwfn->hw_info.concrete_fid); in qed_iov_vf_flr_poll_dorq()
3585 DP_ERR(p_hwfn, in qed_iov_vf_flr_poll_dorq()
3597 qed_iov_vf_flr_poll_pbf(struct qed_hwfn *p_hwfn, in qed_iov_vf_flr_poll_pbf() argument
3601 u8 max_phys_tcs_per_port = p_hwfn->qm_info.max_phys_tcs_per_port; in qed_iov_vf_flr_poll_pbf()
3602 u8 max_ports_per_engine = p_hwfn->cdev->num_ports_in_engine; in qed_iov_vf_flr_poll_pbf()
3617 cons[voq] = qed_rd(p_hwfn, p_ptt, in qed_iov_vf_flr_poll_pbf()
3619 prod = qed_rd(p_hwfn, p_ptt, in qed_iov_vf_flr_poll_pbf()
3636 tmp = qed_rd(p_hwfn, p_ptt, in qed_iov_vf_flr_poll_pbf()
3655 DP_ERR(p_hwfn, "VF[%d]: pbf poll failed on VOQ%d\n", in qed_iov_vf_flr_poll_pbf()
3658 DP_ERR(p_hwfn, "VOQ %d has port_id as %d and tc_id as %d]\n", in qed_iov_vf_flr_poll_pbf()
3667 static int qed_iov_vf_flr_poll(struct qed_hwfn *p_hwfn, in qed_iov_vf_flr_poll() argument
3672 rc = qed_iov_vf_flr_poll_dorq(p_hwfn, p_vf, p_ptt); in qed_iov_vf_flr_poll()
3676 rc = qed_iov_vf_flr_poll_pbf(p_hwfn, p_vf, p_ptt); in qed_iov_vf_flr_poll()
3684 qed_iov_execute_vf_flr_cleanup(struct qed_hwfn *p_hwfn, in qed_iov_execute_vf_flr_cleanup() argument
3691 p_vf = qed_iov_get_vf_info(p_hwfn, rel_vf_id, false); in qed_iov_execute_vf_flr_cleanup()
3695 if (p_hwfn->pf_iov_info->pending_flr[rel_vf_id / 64] & in qed_iov_execute_vf_flr_cleanup()
3699 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_execute_vf_flr_cleanup()
3702 qed_iov_vf_cleanup(p_hwfn, p_vf); in qed_iov_execute_vf_flr_cleanup()
3708 rc = qed_iov_vf_flr_poll(p_hwfn, p_vf, p_ptt); in qed_iov_execute_vf_flr_cleanup()
3712 rc = qed_final_cleanup(p_hwfn, p_ptt, vfid, true); in qed_iov_execute_vf_flr_cleanup()
3714 DP_ERR(p_hwfn, "Failed handle FLR of VF[%d]\n", vfid); in qed_iov_execute_vf_flr_cleanup()
3721 REG_WR(p_hwfn, in qed_iov_execute_vf_flr_cleanup()
3730 rc = qed_iov_enable_vf_access(p_hwfn, p_ptt, p_vf); in qed_iov_execute_vf_flr_cleanup()
3732 DP_ERR(p_hwfn, "Failed to re-enable VF[%d] acces\n", in qed_iov_execute_vf_flr_cleanup()
3741 p_hwfn->pf_iov_info->pending_flr[rel_vf_id / 64] &= in qed_iov_execute_vf_flr_cleanup()
3750 qed_iov_vf_flr_cleanup(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) in qed_iov_vf_flr_cleanup() argument
3764 for (i = 0; i < p_hwfn->cdev->p_iov_info->total_vfs; i++) in qed_iov_vf_flr_cleanup()
3765 qed_iov_execute_vf_flr_cleanup(p_hwfn, p_ptt, i, ack_vfs); in qed_iov_vf_flr_cleanup()
3767 rc = qed_mcp_ack_vf_flr(p_hwfn, p_ptt, ack_vfs); in qed_iov_vf_flr_cleanup()
3771 bool qed_iov_mark_vf_flr(struct qed_hwfn *p_hwfn, u32 *p_disabled_vfs) in qed_iov_mark_vf_flr() argument
3776 DP_VERBOSE(p_hwfn, QED_MSG_IOV, "Marking FLR-ed VFs\n"); in qed_iov_mark_vf_flr()
3778 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_mark_vf_flr()
3782 if (!p_hwfn->cdev->p_iov_info) { in qed_iov_mark_vf_flr()
3783 DP_NOTICE(p_hwfn, "VF flr but no IOV\n"); in qed_iov_mark_vf_flr()
3788 for (i = 0; i < p_hwfn->cdev->p_iov_info->total_vfs; i++) { in qed_iov_mark_vf_flr()
3792 p_vf = qed_iov_get_vf_info(p_hwfn, i, false); in qed_iov_mark_vf_flr()
3798 u64 *p_flr = p_hwfn->pf_iov_info->pending_flr; in qed_iov_mark_vf_flr()
3801 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_mark_vf_flr()
3820 static int qed_iov_get_link(struct qed_hwfn *p_hwfn, in qed_iov_get_link() argument
3826 struct qed_vf_info *p_vf = qed_iov_get_vf_info(p_hwfn, in qed_iov_get_link()
3837 __qed_vf_get_link_params(p_hwfn, p_params, p_bulletin); in qed_iov_get_link()
3839 __qed_vf_get_link_state(p_hwfn, p_link, p_bulletin); in qed_iov_get_link()
3841 __qed_vf_get_link_caps(p_hwfn, p_caps, p_bulletin); in qed_iov_get_link()
3846 qed_iov_vf_pf_bulletin_update_mac(struct qed_hwfn *p_hwfn, in qed_iov_vf_pf_bulletin_update_mac() argument
3857 DP_VERBOSE(p_hwfn, in qed_iov_vf_pf_bulletin_update_mac()
3868 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_vf_pf_bulletin_update_mac()
3873 qed_iov_prepare_resp(p_hwfn, p_ptt, p_vf, in qed_iov_vf_pf_bulletin_update_mac()
3879 static void qed_iov_process_mbx_req(struct qed_hwfn *p_hwfn, in qed_iov_process_mbx_req() argument
3885 p_vf = qed_iov_get_vf_info(p_hwfn, (u16)vfid, true); in qed_iov_process_mbx_req()
3893 DP_NOTICE(p_hwfn, in qed_iov_process_mbx_req()
3902 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_process_mbx_req()
3911 qed_iov_vf_mbx_acquire(p_hwfn, p_ptt, p_vf); in qed_iov_process_mbx_req()
3914 qed_iov_vf_mbx_start_vport(p_hwfn, p_ptt, p_vf); in qed_iov_process_mbx_req()
3917 qed_iov_vf_mbx_stop_vport(p_hwfn, p_ptt, p_vf); in qed_iov_process_mbx_req()
3920 qed_iov_vf_mbx_start_rxq(p_hwfn, p_ptt, p_vf); in qed_iov_process_mbx_req()
3923 qed_iov_vf_mbx_start_txq(p_hwfn, p_ptt, p_vf); in qed_iov_process_mbx_req()
3926 qed_iov_vf_mbx_stop_rxqs(p_hwfn, p_ptt, p_vf); in qed_iov_process_mbx_req()
3929 qed_iov_vf_mbx_stop_txqs(p_hwfn, p_ptt, p_vf); in qed_iov_process_mbx_req()
3932 qed_iov_vf_mbx_update_rxqs(p_hwfn, p_ptt, p_vf); in qed_iov_process_mbx_req()
3935 qed_iov_vf_mbx_vport_update(p_hwfn, p_ptt, p_vf); in qed_iov_process_mbx_req()
3938 qed_iov_vf_mbx_ucast_filter(p_hwfn, p_ptt, p_vf); in qed_iov_process_mbx_req()
3941 qed_iov_vf_mbx_close(p_hwfn, p_ptt, p_vf); in qed_iov_process_mbx_req()
3944 qed_iov_vf_mbx_int_cleanup(p_hwfn, p_ptt, p_vf); in qed_iov_process_mbx_req()
3947 qed_iov_vf_mbx_release(p_hwfn, p_ptt, p_vf); in qed_iov_process_mbx_req()
3950 qed_iov_vf_mbx_update_tunn_param(p_hwfn, p_ptt, p_vf); in qed_iov_process_mbx_req()
3953 qed_iov_vf_pf_set_coalesce(p_hwfn, p_ptt, p_vf); in qed_iov_process_mbx_req()
3956 qed_iov_vf_pf_get_coalesce(p_hwfn, p_ptt, p_vf); in qed_iov_process_mbx_req()
3959 qed_iov_vf_pf_bulletin_update_mac(p_hwfn, p_ptt, p_vf); in qed_iov_process_mbx_req()
3963 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_process_mbx_req()
3967 qed_iov_prepare_resp(p_hwfn, p_ptt, p_vf, in qed_iov_process_mbx_req()
3978 DP_NOTICE(p_hwfn, in qed_iov_process_mbx_req()
3991 qed_iov_prepare_resp(p_hwfn, p_ptt, p_vf, in qed_iov_process_mbx_req()
3996 DP_VERBOSE(p_hwfn, in qed_iov_process_mbx_req()
4004 static void qed_iov_pf_get_pending_events(struct qed_hwfn *p_hwfn, u64 *events) in qed_iov_pf_get_pending_events() argument
4010 qed_for_each_vf(p_hwfn, i) { in qed_iov_pf_get_pending_events()
4013 p_vf = &p_hwfn->pf_iov_info->vfs_array[i]; in qed_iov_pf_get_pending_events()
4019 static struct qed_vf_info *qed_sriov_get_vf_from_absid(struct qed_hwfn *p_hwfn, in qed_sriov_get_vf_from_absid() argument
4022 u8 min = (u8)p_hwfn->cdev->p_iov_info->first_vf_in_pf; in qed_sriov_get_vf_from_absid()
4024 if (!_qed_iov_pf_sanity_check(p_hwfn, (int)abs_vfid - min, false)) { in qed_sriov_get_vf_from_absid()
4025 DP_VERBOSE(p_hwfn, in qed_sriov_get_vf_from_absid()
4032 return &p_hwfn->pf_iov_info->vfs_array[(u8)abs_vfid - min]; in qed_sriov_get_vf_from_absid()
4035 static int qed_sriov_vfpf_msg(struct qed_hwfn *p_hwfn, in qed_sriov_vfpf_msg() argument
4038 struct qed_vf_info *p_vf = qed_sriov_get_vf_from_absid(p_hwfn, in qed_sriov_vfpf_msg()
4051 qed_schedule_iov(p_hwfn, QED_IOV_WQ_MSG_FLAG); in qed_sriov_vfpf_msg()
4056 void qed_sriov_vfpf_malicious(struct qed_hwfn *p_hwfn, in qed_sriov_vfpf_malicious() argument
4061 p_vf = qed_sriov_get_vf_from_absid(p_hwfn, qed_vf_from_entity_id in qed_sriov_vfpf_malicious()
4067 DP_NOTICE(p_hwfn, in qed_sriov_vfpf_malicious()
4073 DP_INFO(p_hwfn, in qed_sriov_vfpf_malicious()
4079 int qed_sriov_eqe_event(struct qed_hwfn *p_hwfn, u8 opcode, __le16 echo, in qed_sriov_eqe_event() argument
4084 return qed_sriov_vfpf_msg(p_hwfn, le16_to_cpu(echo), in qed_sriov_eqe_event()
4087 DP_INFO(p_hwfn->cdev, "Unknown sriov eqe event 0x%02x\n", in qed_sriov_eqe_event()
4093 u16 qed_iov_get_next_active_vf(struct qed_hwfn *p_hwfn, u16 rel_vf_id) in qed_iov_get_next_active_vf() argument
4095 struct qed_hw_sriov_info *p_iov = p_hwfn->cdev->p_iov_info; in qed_iov_get_next_active_vf()
4102 if (qed_iov_is_valid_vfid(p_hwfn, rel_vf_id, true, false)) in qed_iov_get_next_active_vf()
4109 static int qed_iov_copy_vf_msg(struct qed_hwfn *p_hwfn, struct qed_ptt *ptt, in qed_iov_copy_vf_msg() argument
4115 vf_info = qed_iov_get_vf_info(p_hwfn, (u16)vfid, true); in qed_iov_copy_vf_msg()
4124 if (qed_dmae_host2host(p_hwfn, ptt, in qed_iov_copy_vf_msg()
4128 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_copy_vf_msg()
4137 static void qed_iov_bulletin_set_forced_mac(struct qed_hwfn *p_hwfn, in qed_iov_bulletin_set_forced_mac() argument
4143 vf_info = qed_iov_get_vf_info(p_hwfn, (u16)vfid, true); in qed_iov_bulletin_set_forced_mac()
4145 DP_NOTICE(p_hwfn->cdev, in qed_iov_bulletin_set_forced_mac()
4151 DP_NOTICE(p_hwfn->cdev, in qed_iov_bulletin_set_forced_mac()
4172 qed_iov_configure_vport_forced(p_hwfn, vf_info, feature); in qed_iov_bulletin_set_forced_mac()
4175 static int qed_iov_bulletin_set_mac(struct qed_hwfn *p_hwfn, u8 *mac, int vfid) in qed_iov_bulletin_set_mac() argument
4180 vf_info = qed_iov_get_vf_info(p_hwfn, (u16)vfid, true); in qed_iov_bulletin_set_mac()
4182 DP_NOTICE(p_hwfn->cdev, "Can not set MAC, invalid vfid [%d]\n", in qed_iov_bulletin_set_mac()
4188 DP_NOTICE(p_hwfn->cdev, "Can't set MAC to malicious VF [%d]\n", in qed_iov_bulletin_set_mac()
4194 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_bulletin_set_mac()
4205 qed_iov_configure_vport_forced(p_hwfn, vf_info, feature); in qed_iov_bulletin_set_mac()
4210 static void qed_iov_bulletin_set_forced_vlan(struct qed_hwfn *p_hwfn, in qed_iov_bulletin_set_forced_vlan() argument
4216 vf_info = qed_iov_get_vf_info(p_hwfn, (u16)vfid, true); in qed_iov_bulletin_set_forced_vlan()
4218 DP_NOTICE(p_hwfn->cdev, in qed_iov_bulletin_set_forced_vlan()
4224 DP_NOTICE(p_hwfn->cdev, in qed_iov_bulletin_set_forced_vlan()
4236 qed_iov_configure_vport_forced(p_hwfn, vf_info, feature); in qed_iov_bulletin_set_forced_vlan()
4239 void qed_iov_bulletin_set_udp_ports(struct qed_hwfn *p_hwfn, in qed_iov_bulletin_set_udp_ports() argument
4244 vf_info = qed_iov_get_vf_info(p_hwfn, (u16)vfid, true); in qed_iov_bulletin_set_udp_ports()
4246 DP_NOTICE(p_hwfn->cdev, in qed_iov_bulletin_set_udp_ports()
4252 DP_VERBOSE(p_hwfn, QED_MSG_IOV, in qed_iov_bulletin_set_udp_ports()
4262 static bool qed_iov_vf_has_vport_instance(struct qed_hwfn *p_hwfn, int vfid) in qed_iov_vf_has_vport_instance() argument
4266 p_vf_info = qed_iov_get_vf_info(p_hwfn, (u16)vfid, true); in qed_iov_vf_has_vport_instance()
4273 static bool qed_iov_is_vf_stopped(struct qed_hwfn *p_hwfn, int vfid) in qed_iov_is_vf_stopped() argument
4277 p_vf_info = qed_iov_get_vf_info(p_hwfn, (u16)vfid, true); in qed_iov_is_vf_stopped()
4284 static bool qed_iov_spoofchk_get(struct qed_hwfn *p_hwfn, int vfid) in qed_iov_spoofchk_get() argument
4288 vf_info = qed_iov_get_vf_info(p_hwfn, (u16)vfid, true); in qed_iov_spoofchk_get()
4295 static int qed_iov_spoofchk_set(struct qed_hwfn *p_hwfn, int vfid, bool val) in qed_iov_spoofchk_set() argument
4300 if (!qed_iov_pf_sanity_check(p_hwfn, vfid)) { in qed_iov_spoofchk_set()
4301 DP_NOTICE(p_hwfn, in qed_iov_spoofchk_set()
4306 vf = qed_iov_get_vf_info(p_hwfn, (u16)vfid, true); in qed_iov_spoofchk_set()
4310 if (!qed_iov_vf_has_vport_instance(p_hwfn, vfid)) { in qed_iov_spoofchk_set()
4317 rc = __qed_iov_spoofchk_set(p_hwfn, vf, val); in qed_iov_spoofchk_set()
4323 static u8 *qed_iov_bulletin_get_mac(struct qed_hwfn *p_hwfn, u16 rel_vf_id) in qed_iov_bulletin_get_mac() argument
4327 p_vf = qed_iov_get_vf_info(p_hwfn, rel_vf_id, true); in qed_iov_bulletin_get_mac()
4338 static u8 *qed_iov_bulletin_get_forced_mac(struct qed_hwfn *p_hwfn, in qed_iov_bulletin_get_forced_mac() argument
4343 p_vf = qed_iov_get_vf_info(p_hwfn, rel_vf_id, true); in qed_iov_bulletin_get_forced_mac()
4354 qed_iov_bulletin_get_forced_vlan(struct qed_hwfn *p_hwfn, u16 rel_vf_id) in qed_iov_bulletin_get_forced_vlan() argument
4358 p_vf = qed_iov_get_vf_info(p_hwfn, rel_vf_id, true); in qed_iov_bulletin_get_forced_vlan()
4368 static int qed_iov_configure_tx_rate(struct qed_hwfn *p_hwfn, in qed_iov_configure_tx_rate() argument
4376 vf = qed_iov_get_vf_info(p_hwfn, (u16)vfid, true); in qed_iov_configure_tx_rate()
4380 rc = qed_fw_vport(p_hwfn, vf->vport_id, &abs_vp_id); in qed_iov_configure_tx_rate()
4385 return qed_init_global_rl(p_hwfn, p_ptt, rl_id, (u32)val, in qed_iov_configure_tx_rate()
4397 struct qed_hwfn *p_hwfn = &cdev->hwfns[i]; in qed_iov_configure_min_tx_rate() local
4399 if (!qed_iov_pf_sanity_check(p_hwfn, vfid)) { in qed_iov_configure_min_tx_rate()
4400 DP_NOTICE(p_hwfn, in qed_iov_configure_min_tx_rate()
4412 static int qed_iov_get_vf_min_rate(struct qed_hwfn *p_hwfn, int vfid) in qed_iov_get_vf_min_rate() argument
4417 vf_info = qed_iov_get_vf_info(p_hwfn, (u16)vfid, true); in qed_iov_get_vf_min_rate()
4421 vf_vp_wfq = &p_hwfn->qm_info.wfq_data[vf_info->vport_id]; in qed_iov_get_vf_min_rate()
4852 struct qed_hwfn *p_hwfn = &cdev->hwfns[i]; in qed_spoof_configure() local
4854 rc = qed_iov_spoofchk_set(p_hwfn, vfid, val); in qed_spoof_configure()
4867 struct qed_hwfn *p_hwfn = &cdev->hwfns[i]; in qed_configure_max_vf_rate() local
4870 if (!qed_iov_pf_sanity_check(p_hwfn, vfid)) { in qed_configure_max_vf_rate()
4871 DP_NOTICE(p_hwfn, in qed_configure_max_vf_rate()
4876 vf = qed_iov_get_public_vf_info(p_hwfn, vfid, true); in qed_configure_max_vf_rate()
4880 qed_inform_vf_link_state(p_hwfn); in qed_configure_max_vf_rate()
5266 struct qed_hwfn *p_hwfn = &cdev->hwfns[i]; in qed_iov_wq_start() local
5271 if (IS_PF(p_hwfn->cdev) && !IS_PF_SRIOV(p_hwfn)) in qed_iov_wq_start()
5276 PCI_SLOT(cdev->pdev->devfn), p_hwfn->abs_pf_id); in qed_iov_wq_start()
5278 p_hwfn->iov_wq = create_singlethread_workqueue(name); in qed_iov_wq_start()
5279 if (!p_hwfn->iov_wq) { in qed_iov_wq_start()
5280 DP_NOTICE(p_hwfn, "Cannot create iov workqueue\n"); in qed_iov_wq_start()
5285 INIT_DELAYED_WORK(&p_hwfn->iov_task, qed_iov_pf_task); in qed_iov_wq_start()
5287 INIT_DELAYED_WORK(&p_hwfn->iov_task, qed_iov_vf_task); in qed_iov_wq_start()