Commit b0409fa0 authored by Yuval Mintz's avatar Yuval Mintz Committed by David S. Miller

qed: Correct PF-sanity check

Seems like something broke in commit 1408cc1f ("qed: Introduce VFs")
and the function no longer verifies that the vf is indeed a valid one.
Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2bb07e15
...@@ -476,12 +476,12 @@ int qed_iov_hw_info(struct qed_hwfn *p_hwfn) ...@@ -476,12 +476,12 @@ int qed_iov_hw_info(struct qed_hwfn *p_hwfn)
static bool qed_iov_pf_sanity_check(struct qed_hwfn *p_hwfn, int vfid) static bool qed_iov_pf_sanity_check(struct qed_hwfn *p_hwfn, int vfid)
{ {
/* Check PF supports sriov */ /* Check PF supports sriov */
if (!IS_QED_SRIOV(p_hwfn->cdev) || !IS_PF_SRIOV_ALLOC(p_hwfn)) if (IS_VF(p_hwfn->cdev) || !IS_QED_SRIOV(p_hwfn->cdev) ||
!IS_PF_SRIOV_ALLOC(p_hwfn))
return false; return false;
/* Check VF validity */ /* Check VF validity */
if (IS_VF(p_hwfn->cdev) || !IS_QED_SRIOV(p_hwfn->cdev) || if (!qed_iov_is_valid_vfid(p_hwfn, vfid, true))
!IS_PF_SRIOV_ALLOC(p_hwfn))
return false; return false;
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment