Skip to content

Commit dbcb419

Browse files
Alexander DuyckZhengShunQian
authored andcommitted
ixgbe: Be more careful when modifying MAC filters
[ Upstream commit d14c780 ] This change makes it so that we are much more explicit about the ordering of updates to the receive address register (RAR) table. Prior to this patch I believe we may have been updating the table while entries were still active, or possibly allowing for reordering of things since we weren't explicitly flushing writes to either the lower or upper portion of the register prior to accessing the other half. Signed-off-by: Alexander Duyck <[email protected]> Reviewed-by: Shannon Nelson <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 30d074e commit dbcb419

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1814,7 +1814,12 @@ s32 ixgbe_set_rar_generic(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
18141814
if (enable_addr != 0)
18151815
rar_high |= IXGBE_RAH_AV;
18161816

1817+
/* Record lower 32 bits of MAC address and then make
1818+
* sure that write is flushed to hardware before writing
1819+
* the upper 16 bits and setting the valid bit.
1820+
*/
18171821
IXGBE_WRITE_REG(hw, IXGBE_RAL(index), rar_low);
1822+
IXGBE_WRITE_FLUSH(hw);
18181823
IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high);
18191824

18201825
return 0;
@@ -1846,8 +1851,13 @@ s32 ixgbe_clear_rar_generic(struct ixgbe_hw *hw, u32 index)
18461851
rar_high = IXGBE_READ_REG(hw, IXGBE_RAH(index));
18471852
rar_high &= ~(0x0000FFFF | IXGBE_RAH_AV);
18481853

1849-
IXGBE_WRITE_REG(hw, IXGBE_RAL(index), 0);
1854+
/* Clear the address valid bit and upper 16 bits of the address
1855+
* before clearing the lower bits. This way we aren't updating
1856+
* a live filter.
1857+
*/
18501858
IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high);
1859+
IXGBE_WRITE_FLUSH(hw);
1860+
IXGBE_WRITE_REG(hw, IXGBE_RAL(index), 0);
18511861

18521862
/* clear VMDq pool/queue selection for this RAR */
18531863
hw->mac.ops.clear_vmdq(hw, index, IXGBE_CLEAR_VMDQ_ALL);

0 commit comments

Comments
 (0)