Lines Matching refs:hwfn
2997 static int qed_iov_pre_update_vport(struct qed_hwfn *hwfn, in qed_iov_pre_update_vport() argument
3013 vf_info = qed_iov_get_public_vf_info(hwfn, vfid, true); in qed_iov_pre_update_vport()
3249 static int qed_iov_chk_ucast(struct qed_hwfn *hwfn, in qed_iov_chk_ucast() argument
3254 vf = qed_iov_get_public_vf_info(hwfn, vfid, true); in qed_iov_chk_ucast()
3264 qed_iov_bulletin_set_mac(hwfn, vf->mac, vfid); in qed_iov_chk_ucast()
3267 qed_schedule_iov(hwfn, QED_IOV_WQ_BULLETIN_UPDATE_FLAG); in qed_iov_chk_ucast()
4421 void qed_schedule_iov(struct qed_hwfn *hwfn, enum qed_iov_wq_flag flag) in qed_schedule_iov() argument
4424 set_bit(flag, &hwfn->iov_task_flags); in qed_schedule_iov()
4426 DP_VERBOSE(hwfn, QED_MSG_IOV, "Scheduling iov task [Flag: %d]\n", flag); in qed_schedule_iov()
4427 queue_delayed_work(hwfn->iov_wq, &hwfn->iov_task, 0); in qed_schedule_iov()
4461 struct qed_hwfn *hwfn = &cdev->hwfns[i]; in qed_sriov_disable() local
4462 struct qed_ptt *ptt = qed_ptt_acquire(hwfn); in qed_sriov_disable()
4468 DP_ERR(hwfn, "Failed to acquire ptt\n"); in qed_sriov_disable()
4473 qed_clean_wfq_db(hwfn, ptt); in qed_sriov_disable()
4475 qed_for_each_vf(hwfn, j) { in qed_sriov_disable()
4478 if (!qed_iov_is_valid_vfid(hwfn, j, true, false)) in qed_sriov_disable()
4483 if (!qed_iov_is_vf_stopped(hwfn, j)) in qed_sriov_disable()
4493 DP_ERR(hwfn, in qed_sriov_disable()
4497 qed_ptt_release(hwfn, ptt); in qed_sriov_disable()
4505 static void qed_sriov_enable_qid_config(struct qed_hwfn *hwfn, in qed_sriov_enable_qid_config() argument
4515 base = FEAT_NUM(hwfn, QED_PF_L2_QUE) + vfid * params->num_queues; in qed_sriov_enable_qid_config()
4527 struct qed_hwfn *hwfn; in qed_sriov_enable() local
4541 hwfn = &cdev->hwfns[j]; in qed_sriov_enable()
4542 ptt = qed_ptt_acquire(hwfn); in qed_sriov_enable()
4546 FEAT_NUM(hwfn, QED_VF_L2_QUE) / num, in qed_sriov_enable()
4550 DP_ERR(hwfn, "Failed to acquire ptt\n"); in qed_sriov_enable()
4556 if (!qed_iov_is_valid_vfid(hwfn, i, false, true)) in qed_sriov_enable()
4559 qed_sriov_enable_qid_config(hwfn, i, ¶ms); in qed_sriov_enable()
4560 rc = qed_iov_init_hw_for_vf(hwfn, ptt, ¶ms); in qed_sriov_enable()
4563 qed_ptt_release(hwfn, ptt); in qed_sriov_enable()
4568 qed_ptt_release(hwfn, ptt); in qed_sriov_enable()
4578 hwfn = QED_LEADING_HWFN(cdev); in qed_sriov_enable()
4579 ptt = qed_ptt_acquire(hwfn); in qed_sriov_enable()
4581 DP_ERR(hwfn, "Failed to acquire ptt\n"); in qed_sriov_enable()
4586 rc = qed_mcp_ov_update_eswitch(hwfn, ptt, QED_OV_ESWITCH_VEB); in qed_sriov_enable()
4589 qed_ptt_release(hwfn, ptt); in qed_sriov_enable()
4628 struct qed_hwfn *hwfn = &cdev->hwfns[i]; in qed_sriov_pf_set_mac() local
4631 vf_info = qed_iov_get_public_vf_info(hwfn, vfid, true); in qed_sriov_pf_set_mac()
4641 qed_schedule_iov(hwfn, QED_IOV_WQ_SET_UNICAST_FILTER_FLAG); in qed_sriov_pf_set_mac()
4664 struct qed_hwfn *hwfn = &cdev->hwfns[i]; in qed_sriov_pf_set_vlan() local
4667 vf_info = qed_iov_get_public_vf_info(hwfn, vfid, true); in qed_sriov_pf_set_vlan()
4673 qed_schedule_iov(hwfn, QED_IOV_WQ_SET_UNICAST_FILTER_FLAG); in qed_sriov_pf_set_vlan()
4682 struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev); in qed_get_vf_config() local
4697 vf_info = qed_iov_get_public_vf_info(hwfn, vf_id, true); in qed_get_vf_config()
4699 qed_iov_get_link(hwfn, vf_id, NULL, &link, NULL); in qed_get_vf_config()
4710 ivi->spoofchk = qed_iov_spoofchk_get(hwfn, vf_id); in qed_get_vf_config()
4714 ivi->min_tx_rate = qed_iov_get_vf_min_rate(hwfn, vf_id); in qed_get_vf_config()
4719 void qed_inform_vf_link_state(struct qed_hwfn *hwfn) in qed_inform_vf_link_state() argument
4721 struct qed_hwfn *lead_hwfn = QED_LEADING_HWFN(hwfn->cdev); in qed_inform_vf_link_state()
4727 if (!hwfn->pf_iov_info) in qed_inform_vf_link_state()
4731 for (i = 0; i < hwfn->cdev->p_iov_info->total_vfs; i++) { in qed_inform_vf_link_state()
4734 vf_info = qed_iov_get_public_vf_info(hwfn, i, false); in qed_inform_vf_link_state()
4760 link.speed = (hwfn->cdev->num_hwfns > 1) ? in qed_inform_vf_link_state()
4773 ptt = qed_ptt_acquire(hwfn); in qed_inform_vf_link_state()
4775 DP_NOTICE(hwfn, "Failed to acquire PTT\n"); in qed_inform_vf_link_state()
4779 if (!qed_iov_configure_tx_rate(hwfn, ptt, i, rate)) { in qed_inform_vf_link_state()
4784 qed_ptt_release(hwfn, ptt); in qed_inform_vf_link_state()
4787 qed_iov_set_link(hwfn, i, ¶ms, &link, &caps); in qed_inform_vf_link_state()
4790 qed_schedule_iov(hwfn, QED_IOV_WQ_BULLETIN_UPDATE_FLAG); in qed_inform_vf_link_state()
4810 struct qed_hwfn *hwfn = &cdev->hwfns[i]; in qed_set_vf_link_state() local
4813 vf = qed_iov_get_public_vf_info(hwfn, vf_id, true); in qed_set_vf_link_state()
4888 struct qed_hwfn *hwfn = &cdev->hwfns[i]; in qed_set_vf_trust() local
4891 if (!qed_iov_pf_sanity_check(hwfn, vfid)) { in qed_set_vf_trust()
4892 DP_NOTICE(hwfn, in qed_set_vf_trust()
4897 vf = qed_iov_get_public_vf_info(hwfn, vfid, true); in qed_set_vf_trust()
4903 qed_schedule_iov(hwfn, QED_IOV_WQ_TRUST_FLAG); in qed_set_vf_trust()
4909 static void qed_handle_vf_msg(struct qed_hwfn *hwfn) in qed_handle_vf_msg() argument
4915 ptt = qed_ptt_acquire(hwfn); in qed_handle_vf_msg()
4917 DP_VERBOSE(hwfn, QED_MSG_IOV, in qed_handle_vf_msg()
4919 qed_schedule_iov(hwfn, QED_IOV_WQ_MSG_FLAG); in qed_handle_vf_msg()
4923 qed_iov_pf_get_pending_events(hwfn, events); in qed_handle_vf_msg()
4925 DP_VERBOSE(hwfn, QED_MSG_IOV, in qed_handle_vf_msg()
4929 qed_for_each_vf(hwfn, i) { in qed_handle_vf_msg()
4934 DP_VERBOSE(hwfn, QED_MSG_IOV, in qed_handle_vf_msg()
4936 i, hwfn->cdev->p_iov_info->first_vf_in_pf + i); in qed_handle_vf_msg()
4939 if (qed_iov_copy_vf_msg(hwfn, ptt, i)) in qed_handle_vf_msg()
4942 qed_iov_process_mbx_req(hwfn, ptt, i); in qed_handle_vf_msg()
4945 qed_ptt_release(hwfn, ptt); in qed_handle_vf_msg()
4948 static bool qed_pf_validate_req_vf_mac(struct qed_hwfn *hwfn, in qed_pf_validate_req_vf_mac() argument
4965 static void qed_set_bulletin_mac(struct qed_hwfn *hwfn, in qed_set_bulletin_mac() argument
4970 qed_iov_bulletin_set_mac(hwfn, info->mac, vfid); in qed_set_bulletin_mac()
4972 qed_iov_bulletin_set_forced_mac(hwfn, info->forced_mac, vfid); in qed_set_bulletin_mac()
4975 static void qed_handle_pf_set_vf_unicast(struct qed_hwfn *hwfn) in qed_handle_pf_set_vf_unicast() argument
4979 qed_for_each_vf(hwfn, i) { in qed_handle_pf_set_vf_unicast()
4984 info = qed_iov_get_public_vf_info(hwfn, i, true); in qed_handle_pf_set_vf_unicast()
4990 mac = qed_iov_bulletin_get_mac(hwfn, i); in qed_handle_pf_set_vf_unicast()
4992 mac = qed_iov_bulletin_get_forced_mac(hwfn, i); in qed_handle_pf_set_vf_unicast()
4994 if (qed_pf_validate_req_vf_mac(hwfn, mac, info)) { in qed_handle_pf_set_vf_unicast()
4995 DP_VERBOSE(hwfn, in qed_handle_pf_set_vf_unicast()
4999 hwfn->cdev->p_iov_info->first_vf_in_pf + i); in qed_handle_pf_set_vf_unicast()
5002 qed_set_bulletin_mac(hwfn, info, i); in qed_handle_pf_set_vf_unicast()
5006 if (qed_iov_bulletin_get_forced_vlan(hwfn, i) ^ in qed_handle_pf_set_vf_unicast()
5008 DP_VERBOSE(hwfn, in qed_handle_pf_set_vf_unicast()
5013 hwfn->cdev->p_iov_info->first_vf_in_pf + i); in qed_handle_pf_set_vf_unicast()
5014 qed_iov_bulletin_set_forced_vlan(hwfn, in qed_handle_pf_set_vf_unicast()
5020 qed_schedule_iov(hwfn, QED_IOV_WQ_BULLETIN_UPDATE_FLAG); in qed_handle_pf_set_vf_unicast()
5024 static void qed_handle_bulletin_post(struct qed_hwfn *hwfn) in qed_handle_bulletin_post() argument
5029 ptt = qed_ptt_acquire(hwfn); in qed_handle_bulletin_post()
5031 DP_NOTICE(hwfn, "Failed allocating a ptt entry\n"); in qed_handle_bulletin_post()
5032 qed_schedule_iov(hwfn, QED_IOV_WQ_BULLETIN_UPDATE_FLAG); in qed_handle_bulletin_post()
5036 qed_for_each_vf(hwfn, i) in qed_handle_bulletin_post()
5037 qed_iov_post_vf_bulletin(hwfn, i, ptt); in qed_handle_bulletin_post()
5039 qed_ptt_release(hwfn, ptt); in qed_handle_bulletin_post()
5042 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
5049 vf_info = qed_iov_get_public_vf_info(hwfn, vf_id, true); in qed_update_mac_for_vf_trust_change()
5050 vf = qed_iov_get_vf_info(hwfn, vf_id, true); in qed_update_mac_for_vf_trust_change()
5058 force_mac = qed_iov_bulletin_get_forced_mac(hwfn, vf_id); in qed_update_mac_for_vf_trust_change()
5069 DP_VERBOSE(hwfn, QED_MSG_IOV, in qed_update_mac_for_vf_trust_change()
5080 qed_schedule_iov(hwfn, QED_IOV_WQ_BULLETIN_UPDATE_FLAG); in qed_update_mac_for_vf_trust_change()
5094 DP_VERBOSE(hwfn, QED_MSG_IOV, in qed_update_mac_for_vf_trust_change()
5103 qed_iov_bulletin_set_mac(hwfn, empty_mac, vf_id); in qed_update_mac_for_vf_trust_change()
5104 qed_schedule_iov(hwfn, QED_IOV_WQ_BULLETIN_UPDATE_FLAG); in qed_update_mac_for_vf_trust_change()
5108 static void qed_iov_handle_trust_change(struct qed_hwfn *hwfn) in qed_iov_handle_trust_change() argument
5120 qed_for_each_vf(hwfn, i) { in qed_iov_handle_trust_change()
5125 vf_info = qed_iov_get_public_vf_info(hwfn, i, true); in qed_iov_handle_trust_change()
5132 qed_update_mac_for_vf_trust_change(hwfn, i); in qed_iov_handle_trust_change()
5135 vf = qed_iov_get_vf_info(hwfn, i, true); in qed_iov_handle_trust_change()
5165 qed_sp_vport_update(hwfn, ¶ms, in qed_iov_handle_trust_change()
5173 struct qed_hwfn *hwfn = container_of(work, struct qed_hwfn, in qed_iov_pf_task() local
5177 if (test_and_clear_bit(QED_IOV_WQ_STOP_WQ_FLAG, &hwfn->iov_task_flags)) in qed_iov_pf_task()
5180 if (test_and_clear_bit(QED_IOV_WQ_FLR_FLAG, &hwfn->iov_task_flags)) { in qed_iov_pf_task()
5181 struct qed_ptt *ptt = qed_ptt_acquire(hwfn); in qed_iov_pf_task()
5184 qed_schedule_iov(hwfn, QED_IOV_WQ_FLR_FLAG); in qed_iov_pf_task()
5188 rc = qed_iov_vf_flr_cleanup(hwfn, ptt); in qed_iov_pf_task()
5190 qed_schedule_iov(hwfn, QED_IOV_WQ_FLR_FLAG); in qed_iov_pf_task()
5192 qed_ptt_release(hwfn, ptt); in qed_iov_pf_task()
5195 if (test_and_clear_bit(QED_IOV_WQ_MSG_FLAG, &hwfn->iov_task_flags)) in qed_iov_pf_task()
5196 qed_handle_vf_msg(hwfn); in qed_iov_pf_task()
5199 &hwfn->iov_task_flags)) in qed_iov_pf_task()
5200 qed_handle_pf_set_vf_unicast(hwfn); in qed_iov_pf_task()
5203 &hwfn->iov_task_flags)) in qed_iov_pf_task()
5204 qed_handle_bulletin_post(hwfn); in qed_iov_pf_task()
5206 if (test_and_clear_bit(QED_IOV_WQ_TRUST_FLAG, &hwfn->iov_task_flags)) in qed_iov_pf_task()
5207 qed_iov_handle_trust_change(hwfn); in qed_iov_pf_task()