From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id EB7D0A05D3 for ; Fri, 24 May 2019 11:31:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3AA012C16; Fri, 24 May 2019 11:31:19 +0200 (CEST) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by dpdk.org (Postfix) with ESMTP id F2B5925D9 for ; Fri, 24 May 2019 11:31:17 +0200 (CEST) Received: by mail-wm1-f65.google.com with SMTP id v22so1237363wml.1 for ; Fri, 24 May 2019 02:31:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=from:to:cc:subject:date:message-id; bh=/l81aeLHt1l8h66Bu3OmvIuKKjGqc5HgsZMn0PYuVtQ=; b=frkhSgOSBK1VWL+ewa6gcxM8TH7c5gdxiR4TEgyfGsr1DMpfY15lRrDg2UZVhCV4rI IZoQ4T/5q4FIuaBgzqNo45CtaJx/nsTk9p6+EgdUMMPBM4kgJ1e/xUON5O31EQeqKppU UH4ptKh1vK96K41uXEkLwLdyHhL71wnfT5Jddt2SShvdL2UGOSg1Y9fmB6iYvh5+bFmg SDVMTLMmtxLomtTc1x3qt4Z4NVFBAQLw4mCAthv10N67hGF6fX4kybVuJtEWnWrEW3Qk 3vPj7NiZCqxLxrc59vlrX9Ik0wWc0c26EutxAdnFOtqCZH7lG1sz8Vg6eNY/u7rY2mZW IWPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=/l81aeLHt1l8h66Bu3OmvIuKKjGqc5HgsZMn0PYuVtQ=; b=ZwiC9j7OFxniMVtQYJkLFfu35FFFMYrE/j+KEnckvUYZ4N0eWKWdzsBOfYCMHXAbkT dQ3IVd6ubujMz07NEBk+GnmfO4QDCD6BlsQU8Et6YgNA/viWezqcdN0iHYHcU4caPP/N mt0UQPJYLISoiLTsCh2oyc9d0sQ+x+gXAXkx8zoWZOz3GyAcVbHo9f1W94vQEWkCwsNG 5AI5yLpt0r1J/xpMOGy/a4GlR0Kby15g6FLyDTyZAUHEhWCcuZwqoBgTiU9DZUPPczdc uz1pWwtOfChVZLX+EfwV+dgs/LVfsVEfraRMAtI0dGxDBrSAf5aP/vK9cLTZYQD/O9xB CIHA== X-Gm-Message-State: APjAAAWUO3bw1PRK9h5RqjMoDTfE5tPjXK0Vz8e0qHFz7UKX32nyA1cJ zmtlJXuy9Ou72F8mLFUughVp8dAEQhk= X-Google-Smtp-Source: APXvYqxFuJERmSM2Cemq6s6koyrHX2J7K0BWTuX8zAqHEwKBPmZAGcx3ZVD+LuOgQbSlsAXO2GwjYA== X-Received: by 2002:a7b:c301:: with SMTP id k1mr15412234wmj.43.1558690277471; Fri, 24 May 2019 02:31:17 -0700 (PDT) Received: from lima.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id p17sm1896603wrq.95.2019.05.24.02.31.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 May 2019 02:31:16 -0700 (PDT) From: Ashijeet Acharya To: dev@dpdk.org Cc: wenzhuo.lu@intel.com, konstantin.ananyev@intel.com Date: Fri, 24 May 2019 11:30:15 +0200 Message-Id: <20190524093015.20025-1-ashijeet.acharya@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH] net/ixgbe/base: wait for link after copper MAC setup X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" After setting up the link on x552/X557-AT 10GBASE-T NICs, sometimes the link does not get set up properly and as a result all the subsequent calls to ixgbe_check_link() from ixgbe_dev_link_update_share() fail. Introduce a delay time of 1s in ixgbe_setup_mac_link_t_X550em() before beginning to set up the external PHY link speed to ensure that the controller can acquire the link. Signed-off-by: Ashijeet Acharya --- Hello, This patch makes changes in the base driver. Similar patch was introduced in case of fiber link MAC setup earlier http://patchwork.dpdk.org/patch/43119/ Bugzilla: https://bugs.dpdk.org/show_bug.cgi?id=69 drivers/net/ixgbe/base/ixgbe_x550.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c index a920a146e..930a61a20 100644 --- a/drivers/net/ixgbe/base/ixgbe_x550.c +++ b/drivers/net/ixgbe/base/ixgbe_x550.c @@ -4440,6 +4440,8 @@ s32 ixgbe_setup_mac_link_t_X550em(struct ixgbe_hw *hw, { s32 status; ixgbe_link_speed force_speed; + u32 i; + bool link_up = false; DEBUGFUNC("ixgbe_setup_mac_link_t_X550em"); @@ -4459,6 +4461,19 @@ s32 ixgbe_setup_mac_link_t_X550em(struct ixgbe_hw *hw, if (status != IXGBE_SUCCESS) return status; + + /* Wait for the controller to acquire link */ + for (i = 0; i < 10; i++) { + msec_delay(100); + + status = ixgbe_check_link(hw, &force_speed, &link_up, + false); + if (status != IXGBE_SUCCESS) + return status; + + if (link_up) + break; + } } return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait_to_complete); -- 2.11.0