From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 263064410E; Thu, 30 May 2024 13:16:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 549CD41153; Thu, 30 May 2024 13:15:01 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id C16A84113C for ; Thu, 30 May 2024 13:14:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717067693; x=1748603693; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pGIAgsVSnCsBr0uCmf5KfzmGfU5QPV0DkdvoQ51t2M8=; b=U6RxryFVHhmG4MmX5tMpYts4HsIRRYh1jnd8mLsVZJkgT/61xTwNd8xd txRKLs2gfdJiENIv3lYNjFMVKTDg+BIiqjLyr/NzAoHbNU1vtmTFwcclu X2xIoJ2ayiF/5/2E+ewosZSWBhpUxm/9LYi58NSPpj6WK60pKh/kokr9f 2yXQXEoa0fEDhMNmsY8IlADil3ocXza1IWK+OFFXEMCCURhKpyuwKepRS FtuFBpmwdNUUmwfaqfYctAp3UDgJzUyO7Coe3KWySYP/gCQKM3DCWj4+G d7kOrSPYmZGwMyThq7oxWbvIcxP6qnXuMhWP8dstkogCvCDd3sQL/EHKR Q==; X-CSE-ConnectionGUID: MkaY/3HqRsiC4puDcW2W9Q== X-CSE-MsgGUID: Re/q+q1BTSeG4WRilD4g4w== X-IronPort-AV: E=McAfee;i="6600,9927,11087"; a="36063821" X-IronPort-AV: E=Sophos;i="6.08,201,1712646000"; d="scan'208";a="36063821" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2024 04:14:52 -0700 X-CSE-ConnectionGUID: nAPspiQPRVqeBIFgEDP6gA== X-CSE-MsgGUID: 3wpPUg0ETIicS8vjEdREjQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,201,1712646000"; d="scan'208";a="36419423" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa007.jf.intel.com with ESMTP; 30 May 2024 04:14:50 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Krzysztof Galazka , vladimir.medvedkin@intel.com, bruce.richardson@intel.com, Jan Sokolowski Subject: [PATCH v3 14/30] net/ixgbe/base: filter out spurious link up indication Date: Thu, 30 May 2024 12:13:47 +0100 Message-ID: <4ca87a16a4ac4cbae75c018f7c6524a6c896df7f.1717067519.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Krzysztof Galazka Extend SFP+ cage crosstalk fix by re-checking link state after 5ms delay to filter out spurious link up indication by transceiver with no fibre cable connected. Signed-off-by: Krzysztof Galazka Reviewed-by: Jan Sokolowski --- drivers/net/ixgbe/base/ixgbe_common.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/net/ixgbe/base/ixgbe_common.c b/drivers/net/ixgbe/base/ixgbe_common.c index bb6e72fbe6..a19f4d715c 100644 --- a/drivers/net/ixgbe/base/ixgbe_common.c +++ b/drivers/net/ixgbe/base/ixgbe_common.c @@ -4194,10 +4194,25 @@ 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 (ixgbe_need_crosstalk_fix(hw)) { + /* Check the link state again after a delay + * to filter out spurious link up + * notifications. + */ + msec_delay(5); + links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS); + if (!(links_reg & IXGBE_LINKS_UP)) { + *link_up = false; + *speed = IXGBE_LINK_SPEED_UNKNOWN; + return IXGBE_SUCCESS; + } + + } *link_up = true; - else + } else { *link_up = false; + } } switch (links_reg & IXGBE_LINKS_SPEED_82599) { -- 2.43.0