]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
qed: FLR of active VFs might lead to FW assert
authorYuval Mintz <Yuval.Mintz@qlogic.com>
Mon, 22 Aug 2016 09:03:29 +0000 (12:03 +0300)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 6 Mar 2017 04:59:37 +0000 (20:59 -0800)
Orabug: 25477939

Driver never bothered marking the VF's vport with the VF's sw_fid.
As a result, FLR flows are not going to clean those vports.

If the vport was active when FLRed, re-activating it would lead
to a FW assertion.

Fixes: dacd88d6f6851 ("qed: IOV l2 functionality")
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4870e704d901602e4ae5de462c4e65732cf2ed6c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/qlogic/qed/qed.h

index 9ba7a7ee3357c1d721558d0ee6e637f0f44ae38f..2d67469eb8f6ce66fcde615e6730bc42f2f21aa4 100644 (file)
@@ -563,9 +563,18 @@ struct qed_dev {
 static inline u8 qed_concrete_to_sw_fid(struct qed_dev *cdev,
                                        u32 concrete_fid)
 {
+       u8 vfid = GET_FIELD(concrete_fid, PXP_CONCRETE_FID_VFID);
        u8 pfid = GET_FIELD(concrete_fid, PXP_CONCRETE_FID_PFID);
+       u8 vf_valid = GET_FIELD(concrete_fid,
+                               PXP_CONCRETE_FID_VFVALID);
+       u8 sw_fid;
 
-       return pfid;
+       if (vf_valid)
+               sw_fid = vfid + MAX_NUM_PFS;
+       else
+               sw_fid = pfid;
+
+       return sw_fid;
 }
 
 #define PURE_LB_TC 8