Skip to content

Commit 1d3cb90

Browse files
gsiwikanguy11
authored andcommitted
igb: Add double-check MTA_REGISTER for i210 and i211
Add new function which checks MTA_REGISTER if its filled correctly. If not then writes again to same register. There is possibility that i210 and i211 could not accept MTA_REGISTER settings, specially when you add and remove many of multicast addresses in short time. Without this patch there is possibility that multicast settings will be not always set correctly in hardware. Signed-off-by: Grzegorz Siwik <[email protected]> Tested-by: Dave Switzer <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 26b67f5 commit 1d3cb90

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

drivers/net/ethernet/intel/igb/e1000_mac.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,31 @@ static u32 igb_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)
483483
return hash_value;
484484
}
485485

486+
/**
487+
* igb_i21x_hw_doublecheck - double checks potential HW issue in i21X
488+
* @hw: pointer to the HW structure
489+
*
490+
* Checks if multicast array is wrote correctly
491+
* If not then rewrites again to register
492+
**/
493+
static void igb_i21x_hw_doublecheck(struct e1000_hw *hw)
494+
{
495+
bool is_failed;
496+
int i;
497+
498+
do {
499+
is_failed = false;
500+
for (i = hw->mac.mta_reg_count - 1; i >= 0; i--) {
501+
if (array_rd32(E1000_MTA, i) != hw->mac.mta_shadow[i]) {
502+
is_failed = true;
503+
array_wr32(E1000_MTA, i, hw->mac.mta_shadow[i]);
504+
wrfl();
505+
break;
506+
}
507+
}
508+
} while (is_failed);
509+
}
510+
486511
/**
487512
* igb_update_mc_addr_list - Update Multicast addresses
488513
* @hw: pointer to the HW structure
@@ -516,6 +541,8 @@ void igb_update_mc_addr_list(struct e1000_hw *hw,
516541
for (i = hw->mac.mta_reg_count - 1; i >= 0; i--)
517542
array_wr32(E1000_MTA, i, hw->mac.mta_shadow[i]);
518543
wrfl();
544+
if (hw->mac.type == e1000_i210 || hw->mac.type == e1000_i211)
545+
igb_i21x_hw_doublecheck(hw);
519546
}
520547

521548
/**

0 commit comments

Comments
 (0)