intel-wired-lan.lists.osuosl.org archive mirror
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH net-next v1] ixgbe: Filter out spurious link up indication
@ 2022-12-12  9:59 Sebastian Czapla
  2022-12-20 23:01 ` Mekala, SunithaX D
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Czapla @ 2022-12-12  9:59 UTC (permalink / raw)
  To: intel-wired-lan; +Cc: Sebastian Czapla

Add delayed link state recheck to filter false link up indication
caused by transceiver with no fiber cable attached.

Signed-off-by: Sebastian Czapla <sebastianx.czapla@intel.com>
---
 .../net/ethernet/intel/ixgbe/ixgbe_common.c   | 21 ++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
index 38c4609bd429..878dd8dff528 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
@@ -3292,13 +3292,14 @@ static bool ixgbe_need_crosstalk_fix(struct ixgbe_hw *hw)
 s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 				 bool *link_up, bool link_up_wait_to_complete)
 {
+	bool crosstalk_fix_active = ixgbe_need_crosstalk_fix(hw);
 	u32 links_reg, links_orig;
 	u32 i;
 
 	/* If Crosstalk fix enabled do the sanity check of making sure
 	 * the SFP+ cage is full.
 	 */
-	if (ixgbe_need_crosstalk_fix(hw)) {
+	if (crosstalk_fix_active) {
 		u32 sfp_cage_full;
 
 		switch (hw->mac.type) {
@@ -3346,10 +3347,24 @@ s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 			links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS);
 		}
 	} else {
-		if (links_reg & IXGBE_LINKS_UP)
+		if (links_reg & IXGBE_LINKS_UP) {
+			if (crosstalk_fix_active) {
+				/* Check the link state again after a delay
+				 * to filter out spurious link up
+				 * notifications.
+				 */
+				mdelay(5);
+				links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS);
+				if (!(links_reg & IXGBE_LINKS_UP)) {
+					*link_up = false;
+					*speed = IXGBE_LINK_SPEED_UNKNOWN;
+					return 0;
+				}
+			}
 			*link_up = true;
-		else
+		} else {
 			*link_up = false;
+		}
 	}
 
 	switch (links_reg & IXGBE_LINKS_SPEED_82599) {
-- 
2.31.1

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

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

* Re: [Intel-wired-lan] [PATCH net-next v1] ixgbe: Filter out spurious link up indication
  2022-12-12  9:59 [Intel-wired-lan] [PATCH net-next v1] ixgbe: Filter out spurious link up indication Sebastian Czapla
@ 2022-12-20 23:01 ` Mekala, SunithaX D
  0 siblings, 0 replies; 2+ messages in thread
From: Mekala, SunithaX D @ 2022-12-20 23:01 UTC (permalink / raw)
  To: Czapla, SebastianX, intel-wired-lan; +Cc: Czapla, SebastianX

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Sebastian Czapla
> Sent: Monday, December 12, 2022 2:00 AM
> To: intel-wired-lan@lists.osuosl.org
> Cc: Czapla, SebastianX <sebastianx.czapla@intel.com>
> Subject: [Intel-wired-lan] [PATCH net-next v1] ixgbe: Filter out spurious link up indication
>
> Add delayed link state recheck to filter false link up indication caused by transceiver with no fiber cable attached.
>
> Signed-off-by: Sebastian Czapla <sebastianx.czapla@intel.com>
> ---
>  .../net/ethernet/intel/ixgbe/ixgbe_common.c   | 21 ++++++++++++++++---
>  1 file changed, 18 insertions(+), 3 deletions(-)
>
Tested-by: Sunitha Mekala <sunithax.d.mekala@intel.com> (A Contingent worker at Intel)
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

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

end of thread, other threads:[~2022-12-20 23:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-12  9:59 [Intel-wired-lan] [PATCH net-next v1] ixgbe: Filter out spurious link up indication Sebastian Czapla
2022-12-20 23:01 ` Mekala, SunithaX D

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).