Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

qed: FLR of active VFs might lead to FW assert

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>

authored by

Yuval Mintz and committed by
David S. Miller
4870e704 c0451fe1

+10 -1
+10 -1
drivers/net/ethernet/qlogic/qed/qed.h
··· 561 561 static inline u8 qed_concrete_to_sw_fid(struct qed_dev *cdev, 562 562 u32 concrete_fid) 563 563 { 564 + u8 vfid = GET_FIELD(concrete_fid, PXP_CONCRETE_FID_VFID); 564 565 u8 pfid = GET_FIELD(concrete_fid, PXP_CONCRETE_FID_PFID); 566 + u8 vf_valid = GET_FIELD(concrete_fid, 567 + PXP_CONCRETE_FID_VFVALID); 568 + u8 sw_fid; 565 569 566 - return pfid; 570 + if (vf_valid) 571 + sw_fid = vfid + MAX_NUM_PFS; 572 + else 573 + sw_fid = pfid; 574 + 575 + return sw_fid; 567 576 } 568 577 569 578 #define PURE_LB_TC 8