From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost.localdomain (unknown [50.58.84.238]) by dpdk.org (Postfix) with ESMTP id B0BEC5A64 for ; Tue, 27 Oct 2015 22:39:37 +0100 (CET) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.14.3/8.14.3) with ESMTP id t9RLdZ0R003634; Tue, 27 Oct 2015 17:39:35 -0400 Received: (from tim.shearer@localhost) by localhost.localdomain (8.14.3/8.14.3/Submit) id t9RLdYSd003633; Tue, 27 Oct 2015 17:39:34 -0400 From: Tim Shearer To: dev@dpdk.org Date: Tue, 27 Oct 2015 17:38:55 -0400 Message-Id: <1445981935-3559-1-git-send-email-tim.shearer@overturenetworks.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <5406727.UN0rhZ0d4I@xps13> References: <5406727.UN0rhZ0d4I@xps13> Cc: Tim Shearer Subject: [dpdk-dev] [PATCH] lib/librte_ether: Prevent link status race condition when LSI enabled X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2015 21:39:38 -0000 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 --- 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