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()
4437 void qed_schedule_iov(struct qed_hwfn *hwfn, enum qed_iov_wq_flag flag) in qed_schedule_iov() argument
4441 set_bit(flag, &hwfn->iov_task_flags); in qed_schedule_iov()
4444 DP_VERBOSE(hwfn, QED_MSG_IOV, "Scheduling iov task [Flag: %d]\n", flag); in qed_schedule_iov()
4445 queue_delayed_work(hwfn->iov_wq, &hwfn->iov_task, 0); in qed_schedule_iov()
4479 struct qed_hwfn *hwfn = &cdev->hwfns[i]; in qed_sriov_disable() local
4480 struct qed_ptt *ptt = qed_ptt_acquire(hwfn); in qed_sriov_disable()
4486 DP_ERR(hwfn, "Failed to acquire ptt\n"); in qed_sriov_disable()
4491 qed_clean_wfq_db(hwfn, ptt); in qed_sriov_disable()
4493 qed_for_each_vf(hwfn, j) { in qed_sriov_disable()
4496 if (!qed_iov_is_valid_vfid(hwfn, j, true, false)) in qed_sriov_disable()
4501 if (!qed_iov_is_vf_stopped(hwfn, j)) in qed_sriov_disable()
4511 DP_ERR(hwfn, in qed_sriov_disable()
4515 qed_ptt_release(hwfn, ptt); in qed_sriov_disable()
4523 static void qed_sriov_enable_qid_config(struct qed_hwfn *hwfn, in qed_sriov_enable_qid_config() argument
4533 base = FEAT_NUM(hwfn, QED_PF_L2_QUE) + vfid * params->num_queues; in qed_sriov_enable_qid_config()
4545 struct qed_hwfn *hwfn; in qed_sriov_enable() local
4559 hwfn = &cdev->hwfns[j]; in qed_sriov_enable()
4560 ptt = qed_ptt_acquire(hwfn); in qed_sriov_enable()
4564 FEAT_NUM(hwfn, QED_VF_L2_QUE) / num, in qed_sriov_enable()
4568 DP_ERR(hwfn, "Failed to acquire ptt\n"); in qed_sriov_enable()
4574 if (!qed_iov_is_valid_vfid(hwfn, i, false, true)) in qed_sriov_enable()
4577 qed_sriov_enable_qid_config(hwfn, i, ¶ms); in qed_sriov_enable()
4578 rc = qed_iov_init_hw_for_vf(hwfn, ptt, ¶ms); in qed_sriov_enable()
4581 qed_ptt_release(hwfn, ptt); in qed_sriov_enable()
4586 qed_ptt_release(hwfn, ptt); in qed_sriov_enable()
4596 hwfn = QED_LEADING_HWFN(cdev); in qed_sriov_enable()
4597 ptt = qed_ptt_acquire(hwfn); in qed_sriov_enable()
4599 DP_ERR(hwfn, "Failed to acquire ptt\n"); in qed_sriov_enable()
4604 rc = qed_mcp_ov_update_eswitch(hwfn, ptt, QED_OV_ESWITCH_VEB); in qed_sriov_enable()
4607 qed_ptt_release(hwfn, ptt); in qed_sriov_enable()
4646 struct qed_hwfn *hwfn = &cdev->hwfns[i]; in qed_sriov_pf_set_mac() local
4649 vf_info = qed_iov_get_public_vf_info(hwfn, vfid, true); in qed_sriov_pf_set_mac()
4659 qed_schedule_iov(hwfn, QED_IOV_WQ_SET_UNICAST_FILTER_FLAG); in qed_sriov_pf_set_mac()
4682 struct qed_hwfn *hwfn = &cdev->hwfns[i]; in qed_sriov_pf_set_vlan() local
4685 vf_info = qed_iov_get_public_vf_info(hwfn, vfid, true); in qed_sriov_pf_set_vlan()
4691 qed_schedule_iov(hwfn, QED_IOV_WQ_SET_UNICAST_FILTER_FLAG); in qed_sriov_pf_set_vlan()
4700 struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev); in qed_get_vf_config() local
4716 vf_info = qed_iov_get_public_vf_info(hwfn, vf_id, true); in qed_get_vf_config()
4718 ret = qed_iov_get_link(hwfn, vf_id, NULL, &link, NULL); in qed_get_vf_config()
4731 ivi->spoofchk = qed_iov_spoofchk_get(hwfn, vf_id); in qed_get_vf_config()
4735 ivi->min_tx_rate = qed_iov_get_vf_min_rate(hwfn, vf_id); in qed_get_vf_config()
4741 void qed_inform_vf_link_state(struct qed_hwfn *hwfn) in qed_inform_vf_link_state() argument
4743 struct qed_hwfn *lead_hwfn = QED_LEADING_HWFN(hwfn->cdev); in qed_inform_vf_link_state()
4749 if (!hwfn->pf_iov_info) in qed_inform_vf_link_state()
4753 for (i = 0; i < hwfn->cdev->p_iov_info->total_vfs; i++) { in qed_inform_vf_link_state()
4756 vf_info = qed_iov_get_public_vf_info(hwfn, i, false); in qed_inform_vf_link_state()
4782 link.speed = (hwfn->cdev->num_hwfns > 1) ? in qed_inform_vf_link_state()
4796 ptt = qed_ptt_acquire(hwfn); in qed_inform_vf_link_state()
4798 DP_NOTICE(hwfn, "Failed to acquire PTT\n"); in qed_inform_vf_link_state()
4802 if (!qed_iov_configure_tx_rate(hwfn, ptt, i, rate)) { in qed_inform_vf_link_state()
4807 qed_ptt_release(hwfn, ptt); in qed_inform_vf_link_state()
4810 qed_iov_set_link(hwfn, i, ¶ms, &link, &caps); in qed_inform_vf_link_state()
4813 qed_schedule_iov(hwfn, QED_IOV_WQ_BULLETIN_UPDATE_FLAG); in qed_inform_vf_link_state()
4833 struct qed_hwfn *hwfn = &cdev->hwfns[i]; in qed_set_vf_link_state() local
4836 vf = qed_iov_get_public_vf_info(hwfn, vf_id, true); in qed_set_vf_link_state()
4911 struct qed_hwfn *hwfn = &cdev->hwfns[i]; in qed_set_vf_trust() local
4914 if (!qed_iov_pf_sanity_check(hwfn, vfid)) { in qed_set_vf_trust()
4915 DP_NOTICE(hwfn, in qed_set_vf_trust()
4920 vf = qed_iov_get_public_vf_info(hwfn, vfid, true); in qed_set_vf_trust()
4926 qed_schedule_iov(hwfn, QED_IOV_WQ_TRUST_FLAG); in qed_set_vf_trust()
4932 static void qed_handle_vf_msg(struct qed_hwfn *hwfn) in qed_handle_vf_msg() argument
4938 ptt = qed_ptt_acquire(hwfn); in qed_handle_vf_msg()
4940 DP_VERBOSE(hwfn, QED_MSG_IOV, in qed_handle_vf_msg()
4942 qed_schedule_iov(hwfn, QED_IOV_WQ_MSG_FLAG); in qed_handle_vf_msg()
4946 qed_iov_pf_get_pending_events(hwfn, events); in qed_handle_vf_msg()
4948 DP_VERBOSE(hwfn, QED_MSG_IOV, in qed_handle_vf_msg()
4952 qed_for_each_vf(hwfn, i) { in qed_handle_vf_msg()
4957 DP_VERBOSE(hwfn, QED_MSG_IOV, in qed_handle_vf_msg()
4959 i, hwfn->cdev->p_iov_info->first_vf_in_pf + i); in qed_handle_vf_msg()
4962 if (qed_iov_copy_vf_msg(hwfn, ptt, i)) in qed_handle_vf_msg()
4965 qed_iov_process_mbx_req(hwfn, ptt, i); in qed_handle_vf_msg()
4968 qed_ptt_release(hwfn, ptt); in qed_handle_vf_msg()
4971 static bool qed_pf_validate_req_vf_mac(struct qed_hwfn *hwfn, in qed_pf_validate_req_vf_mac() argument
4988 static void qed_set_bulletin_mac(struct qed_hwfn *hwfn, in qed_set_bulletin_mac() argument
4993 qed_iov_bulletin_set_mac(hwfn, info->mac, vfid); in qed_set_bulletin_mac()
4995 qed_iov_bulletin_set_forced_mac(hwfn, info->forced_mac, vfid); in qed_set_bulletin_mac()
4998 static void qed_handle_pf_set_vf_unicast(struct qed_hwfn *hwfn) in qed_handle_pf_set_vf_unicast() argument
5002 qed_for_each_vf(hwfn, i) { in qed_handle_pf_set_vf_unicast()
5007 info = qed_iov_get_public_vf_info(hwfn, i, true); in qed_handle_pf_set_vf_unicast()
5013 mac = qed_iov_bulletin_get_mac(hwfn, i); in qed_handle_pf_set_vf_unicast()
5015 mac = qed_iov_bulletin_get_forced_mac(hwfn, i); in qed_handle_pf_set_vf_unicast()
5017 if (qed_pf_validate_req_vf_mac(hwfn, mac, info)) { in qed_handle_pf_set_vf_unicast()
5018 DP_VERBOSE(hwfn, in qed_handle_pf_set_vf_unicast()
5022 hwfn->cdev->p_iov_info->first_vf_in_pf + i); in qed_handle_pf_set_vf_unicast()
5025 qed_set_bulletin_mac(hwfn, info, i); in qed_handle_pf_set_vf_unicast()
5029 if (qed_iov_bulletin_get_forced_vlan(hwfn, i) ^ in qed_handle_pf_set_vf_unicast()
5031 DP_VERBOSE(hwfn, in qed_handle_pf_set_vf_unicast()
5036 hwfn->cdev->p_iov_info->first_vf_in_pf + i); in qed_handle_pf_set_vf_unicast()
5037 qed_iov_bulletin_set_forced_vlan(hwfn, in qed_handle_pf_set_vf_unicast()
5043 qed_schedule_iov(hwfn, QED_IOV_WQ_BULLETIN_UPDATE_FLAG); in qed_handle_pf_set_vf_unicast()
5047 static void qed_handle_bulletin_post(struct qed_hwfn *hwfn) in qed_handle_bulletin_post() argument
5052 ptt = qed_ptt_acquire(hwfn); in qed_handle_bulletin_post()
5054 DP_NOTICE(hwfn, "Failed allocating a ptt entry\n"); in qed_handle_bulletin_post()
5055 qed_schedule_iov(hwfn, QED_IOV_WQ_BULLETIN_UPDATE_FLAG); in qed_handle_bulletin_post()
5059 qed_for_each_vf(hwfn, i) in qed_handle_bulletin_post()
5060 qed_iov_post_vf_bulletin(hwfn, i, ptt); in qed_handle_bulletin_post()
5062 qed_ptt_release(hwfn, ptt); in qed_handle_bulletin_post()
5065 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
5072 vf_info = qed_iov_get_public_vf_info(hwfn, vf_id, true); in qed_update_mac_for_vf_trust_change()
5073 vf = qed_iov_get_vf_info(hwfn, vf_id, true); in qed_update_mac_for_vf_trust_change()
5081 force_mac = qed_iov_bulletin_get_forced_mac(hwfn, vf_id); in qed_update_mac_for_vf_trust_change()
5091 DP_VERBOSE(hwfn, QED_MSG_IOV, in qed_update_mac_for_vf_trust_change()
5102 qed_schedule_iov(hwfn, QED_IOV_WQ_BULLETIN_UPDATE_FLAG); in qed_update_mac_for_vf_trust_change()
5116 DP_VERBOSE(hwfn, QED_MSG_IOV, in qed_update_mac_for_vf_trust_change()
5125 qed_iov_bulletin_set_mac(hwfn, empty_mac, vf_id); in qed_update_mac_for_vf_trust_change()
5126 qed_schedule_iov(hwfn, QED_IOV_WQ_BULLETIN_UPDATE_FLAG); in qed_update_mac_for_vf_trust_change()
5130 static void qed_iov_handle_trust_change(struct qed_hwfn *hwfn) in qed_iov_handle_trust_change() argument
5142 qed_for_each_vf(hwfn, i) { in qed_iov_handle_trust_change()
5147 vf_info = qed_iov_get_public_vf_info(hwfn, i, true); in qed_iov_handle_trust_change()
5154 qed_update_mac_for_vf_trust_change(hwfn, i); in qed_iov_handle_trust_change()
5157 vf = qed_iov_get_vf_info(hwfn, i, true); in qed_iov_handle_trust_change()
5195 DP_VERBOSE(hwfn, QED_MSG_IOV, in qed_iov_handle_trust_change()
5199 qed_sp_vport_update(hwfn, ¶ms, in qed_iov_handle_trust_change()
5208 struct qed_hwfn *hwfn = container_of(work, struct qed_hwfn, in qed_iov_pf_task() local
5212 if (test_and_clear_bit(QED_IOV_WQ_STOP_WQ_FLAG, &hwfn->iov_task_flags)) in qed_iov_pf_task()
5215 if (test_and_clear_bit(QED_IOV_WQ_FLR_FLAG, &hwfn->iov_task_flags)) { in qed_iov_pf_task()
5216 struct qed_ptt *ptt = qed_ptt_acquire(hwfn); in qed_iov_pf_task()
5219 qed_schedule_iov(hwfn, QED_IOV_WQ_FLR_FLAG); in qed_iov_pf_task()
5223 rc = qed_iov_vf_flr_cleanup(hwfn, ptt); in qed_iov_pf_task()
5225 qed_schedule_iov(hwfn, QED_IOV_WQ_FLR_FLAG); in qed_iov_pf_task()
5227 qed_ptt_release(hwfn, ptt); in qed_iov_pf_task()
5230 if (test_and_clear_bit(QED_IOV_WQ_MSG_FLAG, &hwfn->iov_task_flags)) in qed_iov_pf_task()
5231 qed_handle_vf_msg(hwfn); in qed_iov_pf_task()
5234 &hwfn->iov_task_flags)) in qed_iov_pf_task()
5235 qed_handle_pf_set_vf_unicast(hwfn); in qed_iov_pf_task()
5238 &hwfn->iov_task_flags)) in qed_iov_pf_task()
5239 qed_handle_bulletin_post(hwfn); in qed_iov_pf_task()
5241 if (test_and_clear_bit(QED_IOV_WQ_TRUST_FLAG, &hwfn->iov_task_flags)) in qed_iov_pf_task()
5242 qed_iov_handle_trust_change(hwfn); in qed_iov_pf_task()