All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: davem@davemloft.net, kuba@kernel.org
Cc: Grzegorz Siwik <grzegorz.siwik@intel.com>,
	netdev@vger.kernel.org, sassmann@redhat.com,
	anthony.l.nguyen@intel.com,
	Dave Switzer <david.switzer@intel.com>
Subject: [PATCH net-next 2/6] igb: Add double-check MTA_REGISTER for i210 and i211
Date: Fri, 16 Apr 2021 13:44:56 -0700	[thread overview]
Message-ID: <20210416204500.2012073-3-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20210416204500.2012073-1-anthony.l.nguyen@intel.com>

From: Grzegorz Siwik <grzegorz.siwik@intel.com>

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>
---
 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 fd8eb2f9ab9d..e63ee3cca5ea 100644
--- a/drivers/net/ethernet/intel/igb/e1000_mac.c
+++ b/drivers/net/ethernet/intel/igb/e1000_mac.c
@@ -483,6 +483,31 @@ static u32 igb_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)
 	return hash_value;
 }
 
+/**
+ * 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
@@ -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);
 }
 
 /**
-- 
2.26.2


  parent reply	other threads:[~2021-04-16 20:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-16 20:44 [PATCH net-next 0/6][pull request] 1GbE Intel Wired LAN Driver Updates 2021-04-16 Tony Nguyen
2021-04-16 20:44 ` [PATCH net-next 1/6] igb: Redistribute memory for transmit packet buffers when in Qav mode Tony Nguyen
2021-04-16 20:44 ` Tony Nguyen [this message]
2021-04-16 21:12   ` [PATCH net-next 2/6] igb: Add double-check MTA_REGISTER for i210 and i211 Jakub Kicinski
2021-04-20 16:22     ` Nguyen, Anthony L
2021-05-10 13:43       ` Nick Lowe
2021-05-10 14:01         ` Nick Lowe
2021-05-13 12:19         ` Siwik, Grzegorz
2021-04-16 20:44 ` [PATCH net-next 3/6] igc: Enable internal i225 PPS Tony Nguyen
2021-04-16 20:44 ` [PATCH net-next 4/6] igc: enable auxiliary PHC functions for the i225 Tony Nguyen
2021-04-16 20:44 ` [PATCH net-next 5/6] igc: Fix overwrites return value Tony Nguyen
2021-04-16 20:45 ` [PATCH net-next 6/6] igc: Expose LPI counters Tony Nguyen
2021-04-17  0:20 ` [PATCH net-next 0/6][pull request] 1GbE Intel Wired LAN Driver Updates 2021-04-16 patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210416204500.2012073-3-anthony.l.nguyen@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=david.switzer@intel.com \
    --cc=grzegorz.siwik@intel.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sassmann@redhat.com \
    --subject='Re: [PATCH net-next 2/6] igb: Add double-check MTA_REGISTER for i210 and i211' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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.