From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f49.google.com (mail-pg0-f49.google.com [74.125.83.49]) by dpdk.org (Postfix) with ESMTP id 0BB359968 for ; Mon, 21 Aug 2017 11:37:58 +0200 (CEST) Received: by mail-pg0-f49.google.com with SMTP id n4so33267822pgn.1 for ; Mon, 21 Aug 2017 02:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bHZozv9+Ju5GRgCBw1MRJ3sfYomM6P2hIuotzPFed3o=; b=CGjzh++jYAm1QPxYn8CyReF50iueNyHHuPu/6BwtUV1gObPKekbPm50pN+k/3n9Rhf KD8Gf7nTftK6YeeQtN1VmDyBjP5HUz8W3jKo9ohjqnUhsRyTa+zDIMbqADQVEKbv2pY2 QUewdaDs4IdIaCqoDxqKkS3FrFU+hK7fjbKLGBYyPA3MMdJz1zuNEMUMxwUHI98cRhjL 7/pkxZLVaHZoZJ97EJflSIHniWswH9yCP/Hoxyhz8VE/7n2OzAViZxA8Dw8rnOkcM5qE Ua4IvSg3/yrlTbPG5Fz8fGIk+D6tmv1farD03QiqGX4SR5D3REwv7HfmJoCG+AUK8Dts XgIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bHZozv9+Ju5GRgCBw1MRJ3sfYomM6P2hIuotzPFed3o=; b=D17bbPlqiP+0mYazXrgo0VlHJ4WAMgWZhDH8CVYfSn5Xa1ckmbblKvtANPYs4hAmNY CdVOiAxUTqlFf6ZLKa2WbhEhX9JmABdRL5TA/aVF6r003T4llodI567VXrqbg51LfDlt 2bFX7xx01cd1Vt/ObiWy/BLRKN9+aK/1j6NydU1eaX3kLZjWCzObQgXPCwH3X6Pblor4 P+Of292DR7ZVhQ1EpKke4mNfQAgOyVdpNSkvkIL13L8TrPOEHXAKJqPxrllN0nEKDPxG y2fJmIieBQErN87XUQ4LBAzKCWSrTCbaTI7VVkwZ2nmNXPYm2e+9Yqc+rKDe2bFBALCd 3qUg== X-Gm-Message-State: AHYfb5h+oWMABMRAaydkPYxZsaJqcKh8EAhSmqBruxwihVUH9ufhRqNn sc/lUD9T++8A3ate X-Received: by 10.98.18.195 with SMTP id 64mr4381207pfs.204.1503308277363; Mon, 21 Aug 2017 02:37:57 -0700 (PDT) Received: from localhost.localdomain ([45.63.61.64]) by smtp.gmail.com with ESMTPSA id 69sm23355087pfh.186.2017.08.21.02.37.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Aug 2017 02:37:56 -0700 (PDT) From: Yuanhan Liu To: Matan Azrad Cc: Adrien Mazarguil , dpdk stable , Yuanhan Liu Date: Mon, 21 Aug 2017 17:31:10 +0800 Message-Id: <1503307878-16728-56-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503307878-16728-1-git-send-email-yliu@fridaylinux.org> References: <1503307878-16728-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/mlx4: fix probe failure report' has been queued to stable release 17.05.2 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: Mon, 21 Aug 2017 09:37:58 -0000 Hi, FYI, your patch has been queued to stable release 17.05.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/24/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 8873f35f344b4ae5377265469d810dc923c3c19e Mon Sep 17 00:00:00 2001 From: Matan Azrad Date: Mon, 31 Jul 2017 17:30:29 +0300 Subject: [PATCH] net/mlx4: fix probe failure report [ upstream commit 8d0f80167d43949bd24374bcf294a149246dfd1c ] 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 mlx4 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. Fixes: 7fae69eeff13 ("mlx4: new poll mode driver") Fixes: 001a520e419f ("net/mlx4: add port parameter") Fixes: 7b0661539229 ("mlx4: check if port is configured for ethernet") Fixes: fec3608673e6 ("mlx4: query netdevice to get initial MAC address") Signed-off-by: Matan Azrad Acked-by: Adrien Mazarguil --- drivers/net/mlx4/mlx4.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index c983bc8..02e5a1f 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -5767,12 +5767,15 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) ibv_dev = list[i]; DEBUG("device opened"); - if (ibv_query_device(attr_ctx, &device_attr)) + if (ibv_query_device(attr_ctx, &device_attr)) { + err = ENODEV; goto error; + } INFO("%u port(s) detected", device_attr.phys_port_cnt); if (mlx4_args(pci_dev->device.devargs, &conf)) { ERROR("failed to process device arguments"); + err = EINVAL; goto error; } /* Use all ports when none are defined */ @@ -5806,19 +5809,23 @@ mlx4_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); if (err) { ERROR("port query failed: %s", strerror(err)); + err = ENODEV; goto port_error; } if (port_attr.link_layer != IBV_LINK_LAYER_ETHERNET) { ERROR("port %d is not configured in Ethernet mode", port); + err = EINVAL; goto port_error; } @@ -5855,6 +5862,7 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) #ifdef HAVE_EXP_QUERY_DEVICE if (ibv_exp_query_device(ctx, &exp_device_attr)) { ERROR("ibv_exp_query_device() failed"); + err = ENODEV; goto port_error; } #ifdef RSS_SUPPORT @@ -5930,6 +5938,7 @@ mlx4_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 mlx4_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