From patchwork Fri May 3 13:57:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 139843 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 661A043F76; Fri, 3 May 2024 16:00:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2A83D40DDE; Fri, 3 May 2024 15:58:54 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by mails.dpdk.org (Postfix) with ESMTP id F038A40E09 for ; Fri, 3 May 2024 15:58: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=1714744732; x=1746280732; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pGIAgsVSnCsBr0uCmf5KfzmGfU5QPV0DkdvoQ51t2M8=; b=L3I0Afz6XA2OSxxs/myyk4Z6USP+wIuOt6gCX01yn5WoEsTIdST+/32S y5NFhBlG+fG+5aifLojME4RDYs6JOouTqNctNXWKTZsJfXHX4OJ9gtWt0 XzPabOzWR+J2HuqhJmptwaQGf/nI5pQkpViJNyOV9FLFuBHayK49ZgJvw OBcM3PIbcSNRwCzPxXTKXIksN0SYC/ZJoSGp9PM5XgTknGGy0KglEmxWP mt9wbY65mO2Kip3734FV9+GZDtYqZxuOKYrxODU7n0NhF0tBPUhZv2COx 8elM/uFKwYGk7ZRb9eSVXi72lk2MPi2Yam7jRMRVxFs/6ummnVKJPqHJ4 w==; X-CSE-ConnectionGUID: 6/T21L5lRcudwtgw8We7XQ== X-CSE-MsgGUID: 7zlKt1pEQ4CBS0xGeU03KQ== X-IronPort-AV: E=McAfee;i="6600,9927,11063"; a="10714955" X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="10714955" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2024 06:58:51 -0700 X-CSE-ConnectionGUID: Gh2EExLqTy+FxKcmG057pg== X-CSE-MsgGUID: A0Kp1D3fTmWTCsJc356MNA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="50642026" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa002.fm.intel.com with ESMTP; 03 May 2024 06:58:50 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Krzysztof Galazka , bruce.richardson@intel.com, vladimir.medvedkin@intel.com, Jan Sokolowski Subject: [PATCH v2 15/27] net/ixgbe/base: filter out spurious link up indication Date: Fri, 3 May 2024 14:57:46 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 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) {