All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH net-next v1] igb: Add double-check MTA_REGISTER for i210 and i211
@ 2021-02-23 14:15 Grzegorz Siwik
  2021-03-30 20:27 ` Switzer, David
  0 siblings, 1 reply; 2+ messages in thread
From: Grzegorz Siwik @ 2021-02-23 14:15 UTC (permalink / raw)
  To: intel-wired-lan

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>
---
 drivers/net/ethernet/intel/igb/e1000_mac.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/drivers/net/ethernet/intel/igb/e1000_mac.c b/drivers/net/ethernet/intel/igb/e1000_mac.c
index fd8eb2f..2ed6a00 100644
--- a/drivers/net/ethernet/intel/igb/e1000_mac.c
+++ b/drivers/net/ethernet/intel/igb/e1000_mac.c
@@ -484,6 +484,31 @@ static u32 igb_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)
 }
 
 /**
+* igb_i21x_hw_doublecheck - double checks potential HW issue in i21X
+* @hw: pointer to the HW structure
+*
+* Checks if multicast array is wrote correctly
+* If not then rewrites again to register
+**/
+static void igb_i21x_hw_doublecheck(struct e1000_hw *hw)
+{
+	bool is_failed;
+	int i;
+
+	do {
+		is_failed = false;
+		for (i = hw->mac.mta_reg_count - 1; i >= 0; i--) {
+			if (array_rd32(E1000_MTA, i) != hw->mac.mta_shadow[i]) {
+				is_failed = true;
+				array_wr32(E1000_MTA, i, hw->mac.mta_shadow[i]);
+				wrfl();
+				break;
+			}
+		}
+	} while (is_failed);
+}
+
+/**
  *  igb_update_mc_addr_list - Update Multicast addresses
  *  @hw: pointer to the HW structure
  *  @mc_addr_list: array of multicast addresses to program
@@ -516,6 +541,8 @@ void igb_update_mc_addr_list(struct e1000_hw *hw,
 	for (i = hw->mac.mta_reg_count - 1; i >= 0; i--)
 		array_wr32(E1000_MTA, i, hw->mac.mta_shadow[i]);
 	wrfl();
+	if (hw->mac.type == e1000_i210 || hw->mac.type == e1000_i211)
+		igb_i21x_hw_doublecheck(hw);
 }
 
 /**
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Intel-wired-lan] [PATCH net-next v1] igb: Add double-check MTA_REGISTER for i210 and i211
  2021-02-23 14:15 [Intel-wired-lan] [PATCH net-next v1] igb: Add double-check MTA_REGISTER for i210 and i211 Grzegorz Siwik
@ 2021-03-30 20:27 ` Switzer, David
  0 siblings, 0 replies; 2+ messages in thread
From: Switzer, David @ 2021-03-30 20:27 UTC (permalink / raw)
  To: intel-wired-lan



>-----Original Message-----
>From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
>Siwik, Grzegorz
>Sent: Tuesday, February 23, 2021 6:15 AM
To: intel-wired-lan@lists.osuosl.org
>Cc: Siwik, Grzegorz <grzegorz.siwik@intel.com>
>Subject: [Intel-wired-lan] [PATCH net-next v1] 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>
>---
> drivers/net/ethernet/intel/igb/e1000_mac.c | 27
>+++++++++++++++++++++++++++
> 1 file changed, 27 insertions(+)
Tested-by: Dave Switzer <david.switzer@intel.com>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-30 20:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-23 14:15 [Intel-wired-lan] [PATCH net-next v1] igb: Add double-check MTA_REGISTER for i210 and i211 Grzegorz Siwik
2021-03-30 20:27 ` Switzer, David

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.