DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tim Shearer <tim.shearer@overturenetworks.com>
To: dev@dpdk.org
Cc: Tim Shearer <tim.shearer@overturenetworks.com>
Subject: [dpdk-dev] [PATCH] lib/librte_ether: Prevent link status race condition when LSI enabled
Date: Tue, 27 Oct 2015 17:38:55 -0400	[thread overview]
Message-ID: <1445981935-3559-1-git-send-email-tim.shearer@overturenetworks.com> (raw)
In-Reply-To: <5406727.UN0rhZ0d4I@xps13>

Calling the Ethernet driver's link_update function from rte_eth_dev_start can result in a race condition if the NIC raises the link interrupt at the same time. Depending on the interrupt handler implementation, the race can cause the it to think that it received two consecutive link up interrupts, and it exits without calling the user callback. Appears to impact E1000/IGB and virtio drivers only.

Signed-off-by: Tim Shearer <tim.shearer@overturenetworks.com>
---
 lib/librte_ether/rte_ethdev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index f593f6e..a821a1f 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -1300,7 +1300,7 @@ rte_eth_dev_start(uint8_t port_id)
 
 	rte_eth_dev_config_restore(port_id);
 
-	if (dev->data->dev_conf.intr_conf.lsc != 0) {
+	if (dev->data->dev_conf.intr_conf.lsc == 0) {
 		FUNC_PTR_OR_ERR_RET(*dev->dev_ops->link_update, -ENOTSUP);
 		(*dev->dev_ops->link_update)(dev, 0);
 	}
-- 
1.7.2.3

  reply	other threads:[~2015-10-27 21:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-24 20:44 [dpdk-dev] [PATCH] librte: Link status interrupt race condition, IGB E1000 Tim Shearer
2015-10-25 22:55 ` Thomas Monjalon
2015-10-26  5:25   ` Lu, Wenzhuo
2015-10-27 17:45     ` Thomas Monjalon
2015-10-27 21:38       ` Tim Shearer [this message]
2015-11-04 22:13         ` [dpdk-dev] [PATCH] lib/librte_ether: Prevent link status race condition when LSI enabled Thomas Monjalon

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=1445981935-3559-1-git-send-email-tim.shearer@overturenetworks.com \
    --to=tim.shearer@overturenetworks.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).