From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 19CAA1B6FA for ; Wed, 9 May 2018 17:29:15 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from shahafs@mellanox.com) with ESMTPS (AES256-SHA encrypted); 9 May 2018 18:06:12 +0300 Received: from unicorn01.mtl.labs.mlnx. (unicorn01.mtl.labs.mlnx [10.7.12.62]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id w49F4SrV008373; Wed, 9 May 2018 18:04:29 +0300 From: Shahaf Shuler To: bluca@debian.org Cc: stable@dpdk.org, nelio.laranjeiro@6wind.com, adrien.mazarguil@6wind.com, yskoh@mellanox.com Date: Wed, 9 May 2018 18:04:06 +0300 Message-Id: <9d27555deea66781608164583cec06ca95e7681f.1525878119.git.shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: References: Subject: [dpdk-stable] [PATCH v2 14/20] net/mlx5: fix link status initialization X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 May 2018 15:29:15 -0000 [ upstream commit a85a606ca501296c81c4b3a5e6b359c7ad7e0a77 ] Following commit 7ba5320baa32 ("net/mlx5: fix link status behavior") The initial link status is no longer set as part of the port start. When LSC interrupts are enabled, ethdev layer reads the link status directly from the device data instead of using the PMD callback. This may cause application to query the link as down while in fact it was already up before the DPDK application start (and no interrupt to fix it). Fixes: 7ba5320baa32 ("net/mlx5: fix link status behavior") Cc: stable@dpdk.org Signed-off-by: Shahaf Shuler Acked-by: Yongseok Koh Acked-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index fc934b8018..fad367e850 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -928,6 +928,12 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, /* Bring Ethernet device up. */ DEBUG("forcing Ethernet interface up"); mlx5_set_link_up(eth_dev); + /* + * Even though the interrupt handler is not installed yet, + * interrupts will still trigger on the asyn_fd from + * Verbs context returned by ibv_open_device(). + */ + mlx5_link_update(eth_dev, 0); /* Store device configuration on private structure. */ priv->config = config; continue; -- 2.12.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id DCF2D1B6FA for ; Wed, 9 May 2018 17:29:32 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from shahafs@mellanox.com) with ESMTPS (AES256-SHA encrypted); 9 May 2018 18:19:34 +0300 Received: from unicorn01.mtl.labs.mlnx. (unicorn01.mtl.labs.mlnx [10.7.12.62]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id w49FHoVL003207; Wed, 9 May 2018 18:17:51 +0300 From: Shahaf Shuler To: shahafs@mellanox.com Cc: yskoh@mellanox.com, stable@dpdk.org Date: Wed, 9 May 2018 18:17:42 +0300 Message-Id: <9d27555deea66781608164583cec06ca95e7681f.1525878119.git.shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: References: Subject: [dpdk-stable] [PATCH v2 14/20] net/mlx5: fix link status initialization X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 May 2018 15:29:33 -0000 Content-Type: text/plain; charset="UTF-8" Message-ID: <20180509151742.Oy_hT1eZqgkhgAv-jGvs_023bJzmPqeoHwQiD0K47ow@z> [ upstream commit a85a606ca501296c81c4b3a5e6b359c7ad7e0a77 ] Following commit 7ba5320baa32 ("net/mlx5: fix link status behavior") The initial link status is no longer set as part of the port start. When LSC interrupts are enabled, ethdev layer reads the link status directly from the device data instead of using the PMD callback. This may cause application to query the link as down while in fact it was already up before the DPDK application start (and no interrupt to fix it). Fixes: 7ba5320baa32 ("net/mlx5: fix link status behavior") Cc: stable@dpdk.org Signed-off-by: Shahaf Shuler Acked-by: Yongseok Koh Acked-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index fc934b8018..fad367e850 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -928,6 +928,12 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, /* Bring Ethernet device up. */ DEBUG("forcing Ethernet interface up"); mlx5_set_link_up(eth_dev); + /* + * Even though the interrupt handler is not installed yet, + * interrupts will still trigger on the asyn_fd from + * Verbs context returned by ibv_open_device(). + */ + mlx5_link_update(eth_dev, 0); /* Store device configuration on private structure. */ priv->config = config; continue; -- 2.12.0