Lines Matching refs:hwfn

2979 static int qed_iov_pre_update_vport(struct qed_hwfn *hwfn,  in qed_iov_pre_update_vport()  argument
2999 vf_info = qed_iov_get_public_vf_info(hwfn, vfid, true); in qed_iov_pre_update_vport()
3242 static int qed_iov_chk_ucast(struct qed_hwfn *hwfn, in qed_iov_chk_ucast() argument
3247 vf = qed_iov_get_public_vf_info(hwfn, vfid, true); in qed_iov_chk_ucast()
3257 qed_iov_bulletin_set_mac(hwfn, vf->mac, vfid); in qed_iov_chk_ucast()
3260 qed_schedule_iov(hwfn, QED_IOV_WQ_BULLETIN_UPDATE_FLAG); in qed_iov_chk_ucast()
4434 void qed_schedule_iov(struct qed_hwfn *hwfn, enum qed_iov_wq_flag flag) in qed_schedule_iov() argument
4438 set_bit(flag, &hwfn->iov_task_flags); in qed_schedule_iov()
4441 DP_VERBOSE(hwfn, QED_MSG_IOV, "Scheduling iov task [Flag: %d]\n", flag); in qed_schedule_iov()
4442 queue_delayed_work(hwfn->iov_wq, &hwfn->iov_task, 0); in qed_schedule_iov()
4476 struct qed_hwfn *hwfn = &cdev->hwfns[i]; in qed_sriov_disable() local
4477 struct qed_ptt *ptt = qed_ptt_acquire(hwfn); in qed_sriov_disable()
4483 DP_ERR(hwfn, "Failed to acquire ptt\n"); in qed_sriov_disable()
4488 qed_clean_wfq_db(hwfn, ptt); in qed_sriov_disable()
4490 qed_for_each_vf(hwfn, j) { in qed_sriov_disable()
4493 if (!qed_iov_is_valid_vfid(hwfn, j, true, false)) in qed_sriov_disable()
4498 if (!qed_iov_is_vf_stopped(hwfn, j)) in qed_sriov_disable()
4508 DP_ERR(hwfn, in qed_sriov_disable()
4512 qed_ptt_release(hwfn, ptt); in qed_sriov_disable()
4520 static void qed_sriov_enable_qid_config(struct qed_hwfn *hwfn, in qed_sriov_enable_qid_config() argument
4530 base = FEAT_NUM(hwfn, QED_PF_L2_QUE) + vfid * params->num_queues; in qed_sriov_enable_qid_config()
4542 struct qed_hwfn *hwfn; in qed_sriov_enable() local
4556 hwfn = &cdev->hwfns[j]; in qed_sriov_enable()
4557 ptt = qed_ptt_acquire(hwfn); in qed_sriov_enable()
4561 FEAT_NUM(hwfn, QED_VF_L2_QUE) / num, in qed_sriov_enable()
4565 DP_ERR(hwfn, "Failed to acquire ptt\n"); in qed_sriov_enable()
4571 if (!qed_iov_is_valid_vfid(hwfn, i, false, true)) in qed_sriov_enable()
4574 qed_sriov_enable_qid_config(hwfn, i, &params); in qed_sriov_enable()
4575 rc = qed_iov_init_hw_for_vf(hwfn, ptt, &params); in qed_sriov_enable()
4578 qed_ptt_release(hwfn, ptt); in qed_sriov_enable()
4583 qed_ptt_release(hwfn, ptt); in qed_sriov_enable()
4593 hwfn = QED_LEADING_HWFN(cdev); in qed_sriov_enable()
4594 ptt = qed_ptt_acquire(hwfn); in qed_sriov_enable()
4596 DP_ERR(hwfn, "Failed to acquire ptt\n"); in qed_sriov_enable()
4601 rc = qed_mcp_ov_update_eswitch(hwfn, ptt, QED_OV_ESWITCH_VEB); in qed_sriov_enable()
4604 qed_ptt_release(hwfn, ptt); in qed_sriov_enable()
4643 struct qed_hwfn *hwfn = &cdev->hwfns[i]; in qed_sriov_pf_set_mac() local
4646 vf_info = qed_iov_get_public_vf_info(hwfn, vfid, true); in qed_sriov_pf_set_mac()
4656 qed_schedule_iov(hwfn, QED_IOV_WQ_SET_UNICAST_FILTER_FLAG); in qed_sriov_pf_set_mac()
4679 struct qed_hwfn *hwfn = &cdev->hwfns[i]; in qed_sriov_pf_set_vlan() local
4682 vf_info = qed_iov_get_public_vf_info(hwfn, vfid, true); in qed_sriov_pf_set_vlan()
4688 qed_schedule_iov(hwfn, QED_IOV_WQ_SET_UNICAST_FILTER_FLAG); in qed_sriov_pf_set_vlan()
4697 struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev); in qed_get_vf_config() local
4713 vf_info = qed_iov_get_public_vf_info(hwfn, vf_id, true); in qed_get_vf_config()
4715 ret = qed_iov_get_link(hwfn, vf_id, NULL, &link, NULL); in qed_get_vf_config()
4728 ivi->spoofchk = qed_iov_spoofchk_get(hwfn, vf_id); in qed_get_vf_config()
4732 ivi->min_tx_rate = qed_iov_get_vf_min_rate(hwfn, vf_id); in qed_get_vf_config()
4738 void qed_inform_vf_link_state(struct qed_hwfn *hwfn) in qed_inform_vf_link_state() argument
4740 struct qed_hwfn *lead_hwfn = QED_LEADING_HWFN(hwfn->cdev); in qed_inform_vf_link_state()
4746 if (!hwfn->pf_iov_info) in qed_inform_vf_link_state()
4750 for (i = 0; i < hwfn->cdev->p_iov_info->total_vfs; i++) { in qed_inform_vf_link_state()
4753 vf_info = qed_iov_get_public_vf_info(hwfn, i, false); in qed_inform_vf_link_state()
4779 link.speed = (hwfn->cdev->num_hwfns > 1) ? in qed_inform_vf_link_state()
4793 ptt = qed_ptt_acquire(hwfn); in qed_inform_vf_link_state()
4795 DP_NOTICE(hwfn, "Failed to acquire PTT\n"); in qed_inform_vf_link_state()
4799 if (!qed_iov_configure_tx_rate(hwfn, ptt, i, rate)) { in qed_inform_vf_link_state()
4804 qed_ptt_release(hwfn, ptt); in qed_inform_vf_link_state()
4807 qed_iov_set_link(hwfn, i, &params, &link, &caps); in qed_inform_vf_link_state()
4810 qed_schedule_iov(hwfn, QED_IOV_WQ_BULLETIN_UPDATE_FLAG); in qed_inform_vf_link_state()
4830 struct qed_hwfn *hwfn = &cdev->hwfns[i]; in qed_set_vf_link_state() local
4833 vf = qed_iov_get_public_vf_info(hwfn, vf_id, true); in qed_set_vf_link_state()
4908 struct qed_hwfn *hwfn = &cdev->hwfns[i]; in qed_set_vf_trust() local
4911 if (!qed_iov_pf_sanity_check(hwfn, vfid)) { in qed_set_vf_trust()
4912 DP_NOTICE(hwfn, in qed_set_vf_trust()
4917 vf = qed_iov_get_public_vf_info(hwfn, vfid, true); in qed_set_vf_trust()
4923 qed_schedule_iov(hwfn, QED_IOV_WQ_TRUST_FLAG); in qed_set_vf_trust()
4929 static void qed_handle_vf_msg(struct qed_hwfn *hwfn) in qed_handle_vf_msg() argument
4935 ptt = qed_ptt_acquire(hwfn); in qed_handle_vf_msg()
4937 DP_VERBOSE(hwfn, QED_MSG_IOV, in qed_handle_vf_msg()
4939 qed_schedule_iov(hwfn, QED_IOV_WQ_MSG_FLAG); in qed_handle_vf_msg()
4943 qed_iov_pf_get_pending_events(hwfn, events); in qed_handle_vf_msg()
4945 DP_VERBOSE(hwfn, QED_MSG_IOV, in qed_handle_vf_msg()
4949 qed_for_each_vf(hwfn, i) { in qed_handle_vf_msg()
4954 DP_VERBOSE(hwfn, QED_MSG_IOV, in qed_handle_vf_msg()
4956 i, hwfn->cdev->p_iov_info->first_vf_in_pf + i); in qed_handle_vf_msg()
4959 if (qed_iov_copy_vf_msg(hwfn, ptt, i)) in qed_handle_vf_msg()
4962 qed_iov_process_mbx_req(hwfn, ptt, i); in qed_handle_vf_msg()
4965 qed_ptt_release(hwfn, ptt); in qed_handle_vf_msg()
4968 static bool qed_pf_validate_req_vf_mac(struct qed_hwfn *hwfn, in qed_pf_validate_req_vf_mac() argument
4985 static void qed_set_bulletin_mac(struct qed_hwfn *hwfn, in qed_set_bulletin_mac() argument
4990 qed_iov_bulletin_set_mac(hwfn, info->mac, vfid); in qed_set_bulletin_mac()
4992 qed_iov_bulletin_set_forced_mac(hwfn, info->forced_mac, vfid); in qed_set_bulletin_mac()
4995 static void qed_handle_pf_set_vf_unicast(struct qed_hwfn *hwfn) in qed_handle_pf_set_vf_unicast() argument
4999 qed_for_each_vf(hwfn, i) { in qed_handle_pf_set_vf_unicast()
5004 info = qed_iov_get_public_vf_info(hwfn, i, true); in qed_handle_pf_set_vf_unicast()
5010 mac = qed_iov_bulletin_get_mac(hwfn, i); in qed_handle_pf_set_vf_unicast()
5012 mac = qed_iov_bulletin_get_forced_mac(hwfn, i); in qed_handle_pf_set_vf_unicast()
5014 if (qed_pf_validate_req_vf_mac(hwfn, mac, info)) { in qed_handle_pf_set_vf_unicast()
5015 DP_VERBOSE(hwfn, in qed_handle_pf_set_vf_unicast()
5019 hwfn->cdev->p_iov_info->first_vf_in_pf + i); in qed_handle_pf_set_vf_unicast()
5022 qed_set_bulletin_mac(hwfn, info, i); in qed_handle_pf_set_vf_unicast()
5026 if (qed_iov_bulletin_get_forced_vlan(hwfn, i) ^ in qed_handle_pf_set_vf_unicast()
5028 DP_VERBOSE(hwfn, in qed_handle_pf_set_vf_unicast()
5033 hwfn->cdev->p_iov_info->first_vf_in_pf + i); in qed_handle_pf_set_vf_unicast()
5034 qed_iov_bulletin_set_forced_vlan(hwfn, in qed_handle_pf_set_vf_unicast()
5040 qed_schedule_iov(hwfn, QED_IOV_WQ_BULLETIN_UPDATE_FLAG); in qed_handle_pf_set_vf_unicast()
5044 static void qed_handle_bulletin_post(struct qed_hwfn *hwfn) in qed_handle_bulletin_post() argument
5049 ptt = qed_ptt_acquire(hwfn); in qed_handle_bulletin_post()
5051 DP_NOTICE(hwfn, "Failed allocating a ptt entry\n"); in qed_handle_bulletin_post()
5052 qed_schedule_iov(hwfn, QED_IOV_WQ_BULLETIN_UPDATE_FLAG); in qed_handle_bulletin_post()
5056 qed_for_each_vf(hwfn, i) in qed_handle_bulletin_post()
5057 qed_iov_post_vf_bulletin(hwfn, i, ptt); in qed_handle_bulletin_post()
5059 qed_ptt_release(hwfn, ptt); in qed_handle_bulletin_post()
5062 static void qed_update_mac_for_vf_trust_change(struct qed_hwfn *hwfn, int vf_id) in qed_update_mac_for_vf_trust_change() argument
5069 vf_info = qed_iov_get_public_vf_info(hwfn, vf_id, true); in qed_update_mac_for_vf_trust_change()
5070 vf = qed_iov_get_vf_info(hwfn, vf_id, true); in qed_update_mac_for_vf_trust_change()
5078 force_mac = qed_iov_bulletin_get_forced_mac(hwfn, vf_id); in qed_update_mac_for_vf_trust_change()
5088 DP_VERBOSE(hwfn, QED_MSG_IOV, in qed_update_mac_for_vf_trust_change()
5099 qed_schedule_iov(hwfn, QED_IOV_WQ_BULLETIN_UPDATE_FLAG); in qed_update_mac_for_vf_trust_change()
5113 DP_VERBOSE(hwfn, QED_MSG_IOV, in qed_update_mac_for_vf_trust_change()
5122 qed_iov_bulletin_set_mac(hwfn, empty_mac, vf_id); in qed_update_mac_for_vf_trust_change()
5123 qed_schedule_iov(hwfn, QED_IOV_WQ_BULLETIN_UPDATE_FLAG); in qed_update_mac_for_vf_trust_change()
5127 static void qed_iov_handle_trust_change(struct qed_hwfn *hwfn) in qed_iov_handle_trust_change() argument
5139 qed_for_each_vf(hwfn, i) { in qed_iov_handle_trust_change()
5144 vf_info = qed_iov_get_public_vf_info(hwfn, i, true); in qed_iov_handle_trust_change()
5151 qed_update_mac_for_vf_trust_change(hwfn, i); in qed_iov_handle_trust_change()
5154 vf = qed_iov_get_vf_info(hwfn, i, true); in qed_iov_handle_trust_change()
5192 DP_VERBOSE(hwfn, QED_MSG_IOV, in qed_iov_handle_trust_change()
5196 qed_sp_vport_update(hwfn, &params, in qed_iov_handle_trust_change()
5205 struct qed_hwfn *hwfn = container_of(work, struct qed_hwfn, in qed_iov_pf_task() local
5209 if (test_and_clear_bit(QED_IOV_WQ_STOP_WQ_FLAG, &hwfn->iov_task_flags)) in qed_iov_pf_task()
5212 if (test_and_clear_bit(QED_IOV_WQ_FLR_FLAG, &hwfn->iov_task_flags)) { in qed_iov_pf_task()
5213 struct qed_ptt *ptt = qed_ptt_acquire(hwfn); in qed_iov_pf_task()
5216 qed_schedule_iov(hwfn, QED_IOV_WQ_FLR_FLAG); in qed_iov_pf_task()
5220 rc = qed_iov_vf_flr_cleanup(hwfn, ptt); in qed_iov_pf_task()
5222 qed_schedule_iov(hwfn, QED_IOV_WQ_FLR_FLAG); in qed_iov_pf_task()
5224 qed_ptt_release(hwfn, ptt); in qed_iov_pf_task()
5227 if (test_and_clear_bit(QED_IOV_WQ_MSG_FLAG, &hwfn->iov_task_flags)) in qed_iov_pf_task()
5228 qed_handle_vf_msg(hwfn); in qed_iov_pf_task()
5231 &hwfn->iov_task_flags)) in qed_iov_pf_task()
5232 qed_handle_pf_set_vf_unicast(hwfn); in qed_iov_pf_task()
5235 &hwfn->iov_task_flags)) in qed_iov_pf_task()
5236 qed_handle_bulletin_post(hwfn); in qed_iov_pf_task()
5238 if (test_and_clear_bit(QED_IOV_WQ_TRUST_FLAG, &hwfn->iov_task_flags)) in qed_iov_pf_task()
5239 qed_iov_handle_trust_change(hwfn); in qed_iov_pf_task()