From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 7F23E235 for ; Tue, 21 Nov 2017 14:20:52 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id DCA1020B53; Tue, 21 Nov 2017 08:20:51 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 21 Nov 2017 08:20:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=0yBbzHXc0fpGqQ1Zi IMRG9lNjP6zF0HDNhfB9nlUJO8=; b=r/B8XP3Y//w3MnEoDOMYwUdZbioWUi+e+ UIKDqjMX2Kl0J9LQqt6s9dpO3s37/2zlpYvaW313c/Lml0Aj5PPhlNO1SfPSm7fu aWWOVT7RBZhEigm8/QVdKeO+MIzo0z26wM8wV7F8wyklXywpSJgcif6Mis7DRIqX QZHeheYRWoh2V68zxp++K8oQfY1XQY9Raqmfty2uC8qIIu3tbPhn9+wm2/BM2t93 hzdLURZR+5cvfi6Fj78oN2dnomIAp876RIAQorkTG3M2FLbBtWLOqQmQhhPM7Gv0 733SScqAbSoyN5cl1XdNscAC77VfOQGLPcZbw0LEb5oR0DEBRshqQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=0yBbzHXc0fpGqQ1ZiIMRG9lNjP6zF0HDNhfB9nlUJO8=; b=FeDTiG7T CeI4BlDbrvF8J4LjVuU7n0SahKVDdyW8tqc7rWjt+OHAf0NlQLLuga5atKBSSsGn IEsNrI3/IdoNzXi0gb4wfLxEIqmlVB37ZSxGe7P+h/sgyNsSN0S+WYzP8A10jNig Zj766fWxiNAEv9HYV6Q3mUAOXnBBVoJ5Kjqkg+EEw376geH0zmz07CmzSXAuui4U 9BqJR0GTmgYvHxdlVVacrBz81N99c+7l70ErQ/joEzJflDMwTv8hHsbySnAexg6j Pb1PtsWAGZpbsVc5Ax74t0lF3CK6k7TyU8SO2fzgBof875t5UylDxm+QeG08HmAg PoreC8UhWxiq7w== X-ME-Sender: Received: from localhost.localdomain (unknown [180.158.62.0]) by mail.messagingengine.com (Postfix) with ESMTPA id 1D46524631; Tue, 21 Nov 2017 08:20:47 -0500 (EST) From: Yuanhan Liu To: Matan Azrad Cc: Nelio Laranjeiro , dpdk stable Date: Tue, 21 Nov 2017 21:16:06 +0800 Message-Id: <1511270333-31002-24-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> References: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/mlx5: fix probe failure report' has been queued to stable release 17.08.1 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: Tue, 21 Nov 2017 13:20:52 -0000 Hi, FYI, your patch has been queued to stable release 17.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/24/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 2882817e044d61aaa1e66914d124acab9e162382 Mon Sep 17 00:00:00 2001 From: Matan Azrad Date: Sun, 13 Aug 2017 15:25:12 +0300 Subject: [PATCH] net/mlx5: fix probe failure report [ upstream commit e1c3e30508e1c73697a78900cb9004edc83711af ] The corrupted code doesn't return error when probe function fails due to error in device mac address getting. By this way, the probe function may return success even if the ETH dev is not allocated. Hence, the probe caller, for example failsafe PMD, fails when it tries to get ETH dev after the device was plugged out while mlx5 was probing it. The fix adds error report to the probe caller when priv_get_mac fails and in all other failure options which are missing it. By this way, it prevents the unexpected behavior to miss ETH device after the device was probed successfully. This bug was already present in the original code taken from mlx4. Fixes: 771fa900b73a ("mlx5: introduce new driver for Mellanox ConnectX-4 adapters") Fixes: 1371f4df16bc ("mlx5: check port is configured as ethernet device") Signed-off-by: Matan Azrad Acked-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index b7e5046..508b799 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -586,8 +586,10 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) DEBUG("using port %u (%08" PRIx32 ")", port, test); ctx = ibv_open_device(ibv_dev); - if (ctx == NULL) + if (ctx == NULL) { + err = ENODEV; goto port_error; + } /* Check port status. */ err = ibv_query_port(ctx, port, &port_attr); @@ -599,6 +601,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) if (port_attr.link_layer != IBV_LINK_LAYER_ETHERNET) { ERROR("port %d is not configured in Ethernet mode", port); + err = EINVAL; goto port_error; } @@ -647,6 +650,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) mlx5_args_assign(priv, &args); if (ibv_exp_query_device(ctx, &exp_device_attr)) { ERROR("ibv_exp_query_device() failed"); + err = ENODEV; goto port_error; } @@ -735,6 +739,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) if (priv_get_mac(priv, &mac.addr_bytes)) { ERROR("cannot get MAC address, is mlx5_en loaded?" " (errno: %s)", strerror(errno)); + err = ENODEV; goto port_error; } INFO("port %u MAC address is %02x:%02x:%02x:%02x:%02x:%02x", -- 2.7.4