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

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 <grzegorz.siwik@intel.com>
Tested-by: Dave Switzer <david.switzer@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>

authored by

Grzegorz Siwik and committed by
Tony Nguyen
1d3cb90c 26b67f5a

+27
+27
drivers/net/ethernet/intel/igb/e1000_mac.c
··· 484 484 } 485 485 486 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 + 511 + /** 487 512 * igb_update_mc_addr_list - Update Multicast addresses 488 513 * @hw: pointer to the HW structure 489 514 * @mc_addr_list: array of multicast addresses to program ··· 541 516 for (i = hw->mac.mta_reg_count - 1; i >= 0; i--) 542 517 array_wr32(E1000_MTA, i, hw->mac.mta_shadow[i]); 543 518 wrfl(); 519 + if (hw->mac.type == e1000_i210 || hw->mac.type == e1000_i211) 520 + igb_i21x_hw_doublecheck(hw); 544 521 } 545 522 546 523 /**