All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ashijeet Acharya <ashijeet.acharya@6wind.com>
To: dev@dpdk.org
Cc: wenzhuo.lu@intel.com, konstantin.ananyev@intel.com
Subject: [dpdk-dev] [PATCH] net/ixgbe/base: wait for link after copper MAC setup
Date: Fri, 24 May 2019 11:30:15 +0200	[thread overview]
Message-ID: <20190524093015.20025-1-ashijeet.acharya@6wind.com> (raw)

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 <ashijeet.acharya@6wind.com>
---
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


             reply	other threads:[~2019-05-24  9:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-24  9:30 Ashijeet Acharya [this message]
2019-05-27 16:45 ` [dpdk-dev] [PATCH] net/ixgbe/base: wait for link after copper MAC setup Zhang, Qi Z

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=20190524093015.20025-1-ashijeet.acharya@6wind.com \
    --to=ashijeet.acharya@6wind.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@intel.com \
    --cc=wenzhuo.lu@intel.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.