Skip to content

Commit 939b701

Browse files
sebastianbasierskiJeff Kirsher
authored andcommitted
ixgbe: fix driver behaviour after issuing VFLR
Since VFLR doesn't clear VFMBMEM (VF Mailbox Memory) and is not re-enabling queues correctly we should fix this behavior. Signed-off-by: Sebastian Basierski <sebastianx.basierski@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent fabf1bc commit 939b701

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,8 +693,13 @@ static int ixgbe_set_vf_macvlan(struct ixgbe_adapter *adapter,
693693
static inline void ixgbe_vf_reset_event(struct ixgbe_adapter *adapter, u32 vf)
694694
{
695695
struct ixgbe_hw *hw = &adapter->hw;
696+
struct ixgbe_ring_feature *vmdq = &adapter->ring_feature[RING_F_VMDQ];
696697
struct vf_data_storage *vfinfo = &adapter->vfinfo[vf];
698+
u32 q_per_pool = __ALIGN_MASK(1, ~vmdq->mask);
697699
u8 num_tcs = adapter->hw_tcs;
700+
u32 reg_val;
701+
u32 queue;
702+
u32 word;
698703

699704
/* remove VLAN filters beloning to this VF */
700705
ixgbe_clear_vf_vlans(adapter, vf);
@@ -731,6 +736,27 @@ static inline void ixgbe_vf_reset_event(struct ixgbe_adapter *adapter, u32 vf)
731736

732737
/* reset VF api back to unknown */
733738
adapter->vfinfo[vf].vf_api = ixgbe_mbox_api_10;
739+
740+
/* Restart each queue for given VF */
741+
for (queue = 0; queue < q_per_pool; queue++) {
742+
unsigned int reg_idx = (vf * q_per_pool) + queue;
743+
744+
reg_val = IXGBE_READ_REG(hw, IXGBE_PVFTXDCTL(reg_idx));
745+
746+
/* Re-enabling only configured queues */
747+
if (reg_val) {
748+
reg_val |= IXGBE_TXDCTL_ENABLE;
749+
IXGBE_WRITE_REG(hw, IXGBE_PVFTXDCTL(reg_idx), reg_val);
750+
reg_val &= ~IXGBE_TXDCTL_ENABLE;
751+
IXGBE_WRITE_REG(hw, IXGBE_PVFTXDCTL(reg_idx), reg_val);
752+
}
753+
}
754+
755+
/* Clear VF's mailbox memory */
756+
for (word = 0; word < IXGBE_VFMAILBOX_SIZE; word++)
757+
IXGBE_WRITE_REG_ARRAY(hw, IXGBE_PFMBMEM(vf), word, 0);
758+
759+
IXGBE_WRITE_FLUSH(hw);
734760
}
735761

736762
static int ixgbe_set_vf_mac(struct ixgbe_adapter *adapter,

drivers/net/ethernet/intel/ixgbe/ixgbe_type.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2518,6 +2518,7 @@ enum {
25182518
/* Translated register #defines */
25192519
#define IXGBE_PVFTDH(P) (0x06010 + (0x40 * (P)))
25202520
#define IXGBE_PVFTDT(P) (0x06018 + (0x40 * (P)))
2521+
#define IXGBE_PVFTXDCTL(P) (0x06028 + (0x40 * (P)))
25212522
#define IXGBE_PVFTDWBAL(P) (0x06038 + (0x40 * (P)))
25222523
#define IXGBE_PVFTDWBAH(P) (0x0603C + (0x40 * (P)))
25232524

0 commit comments

Comments
 (0)