From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH 3/4] net/sfc: report correct link status when port is not started
Date: Thu, 12 Jan 2017 09:03:22 +0000 [thread overview]
Message-ID: <1484211803-21449-4-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1484211803-21449-1-git-send-email-arybchenko@solarflare.com>
Fixes: 215e8b89d8a8 ("net/sfc: implement device operation to retrieve link info")
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
---
drivers/net/sfc/sfc_ethdev.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index d13b6d6..3ad9ada 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -188,14 +188,17 @@
sfc_log_init(sa, "entry");
- if (sa->state != SFC_ADAPTER_STARTED)
- return 0;
-
retry:
EFX_STATIC_ASSERT(sizeof(*dev_link) == sizeof(rte_atomic64_t));
*(int64_t *)&old_link = rte_atomic64_read((rte_atomic64_t *)dev_link);
- if (wait_to_complete) {
+ if (sa->state != SFC_ADAPTER_STARTED) {
+ sfc_port_link_mode_to_info(EFX_LINK_UNKNOWN, ¤t_link);
+ if (!rte_atomic64_cmpset((volatile uint64_t *)dev_link,
+ *(uint64_t *)&old_link,
+ *(uint64_t *)¤t_link))
+ goto retry;
+ } else if (wait_to_complete) {
efx_link_mode_t link_mode;
if (efx_port_poll(sa->nic, &link_mode) != 0)
--
1.8.2.3
next prev parent reply other threads:[~2017-01-12 9:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-12 9:03 [dpdk-dev] [PATCH 0/4] Solarflare PMD link status and flow control fixes Andrew Rybchenko
2017-01-12 9:03 ` [dpdk-dev] [PATCH 1/4] net/sfc: avoid usage of possibly uninitialized link_mode Andrew Rybchenko
2017-01-12 9:03 ` [dpdk-dev] [PATCH 2/4] net/sfc: sync link status knowledge with HW on start Andrew Rybchenko
2017-01-12 9:03 ` Andrew Rybchenko [this message]
2017-01-12 9:03 ` [dpdk-dev] [PATCH 4/4] net/sfc: fix flow control settings set on port start Andrew Rybchenko
2017-01-16 17:07 ` [dpdk-dev] [PATCH 0/4] Solarflare PMD link status and flow control fixes Ferruh Yigit
2017-01-18 19:23 ` Ferruh Yigit
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=1484211803-21449-4-git-send-email-arybchenko@solarflare.com \
--to=arybchenko@solarflare.com \
--cc=dev@dpdk.org \
/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 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).