From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 68931A0096 for ; Wed, 10 Apr 2019 18:45:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5CE5A1B105; Wed, 10 Apr 2019 18:45:45 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 7D8401B12B for ; Wed, 10 Apr 2019 18:45:43 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DE2C4308CF85; Wed, 10 Apr 2019 16:45:42 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-94.ams2.redhat.com [10.36.117.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id AE6FC5D962; Wed, 10 Apr 2019 16:45:41 +0000 (UTC) From: Kevin Traynor To: Raslan Darawsheh Cc: Thomas Monjalon , Andrew Rybchenko , dpdk stable Date: Wed, 10 Apr 2019 17:43:55 +0100 Message-Id: <20190410164411.10546-47-ktraynor@redhat.com> In-Reply-To: <20190410164411.10546-1-ktraynor@redhat.com> References: <20190410164411.10546-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 10 Apr 2019 16:45:42 +0000 (UTC) Subject: [dpdk-stable] patch 'bus/vdev: fix hotplug twice' has been queued to LTS release 18.11.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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.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 04/16/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Kevin Traynor --- >From b7990ead49884629573a644041748d4b455b873b Mon Sep 17 00:00:00 2001 From: Raslan Darawsheh Date: Thu, 21 Feb 2019 20:01:25 +0100 Subject: [PATCH] bus/vdev: fix hotplug twice [ upstream commit e892fa595e19b5cce315045444b3b7e31130ef19 ] In case vdev was already probed, it shouldn't be probed again, and it should return -EEXIST as error. There are some checks in vdev_probe() and insert_vdev(), but a check was missing in vdev_plug(). The check is moved in vdev_probe_all_drivers() which is called in all code paths. Fixes: e9d159c3d534 ("eal: allow probing a device again") Signed-off-by: Raslan Darawsheh Signed-off-by: Thomas Monjalon Reviewed-by: Andrew Rybchenko --- drivers/bus/vdev/vdev.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index 722541179..87f0e2b6b 100644 --- a/drivers/bus/vdev/vdev.c +++ b/drivers/bus/vdev/vdev.c @@ -144,4 +144,7 @@ vdev_probe_all_drivers(struct rte_vdev_device *dev) int ret; + if (rte_dev_is_probed(&dev->device)) + return -EEXIST; + name = rte_vdev_device_name(dev); VDEV_LOG(DEBUG, "Search driver to probe device %s", name); @@ -481,5 +484,5 @@ vdev_probe(void) { struct rte_vdev_device *dev; - int ret = 0; + int r, ret = 0; /* call the init function for each virtual device */ @@ -490,8 +493,8 @@ vdev_probe(void) */ - if (rte_dev_is_probed(&dev->device)) - continue; - - if (vdev_probe_all_drivers(dev)) { + r = vdev_probe_all_drivers(dev); + if (r != 0) { + if (r == -EEXIST) + continue; VDEV_LOG(ERR, "failed to initialize %s device", rte_vdev_device_name(dev)); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-04-10 14:06:11.488146624 +0100 +++ 0047-bus-vdev-fix-hotplug-twice.patch 2019-04-10 14:06:07.986291450 +0100 @@ -1,8 +1,10 @@ -From e892fa595e19b5cce315045444b3b7e31130ef19 Mon Sep 17 00:00:00 2001 +From b7990ead49884629573a644041748d4b455b873b Mon Sep 17 00:00:00 2001 From: Raslan Darawsheh Date: Thu, 21 Feb 2019 20:01:25 +0100 Subject: [PATCH] bus/vdev: fix hotplug twice +[ upstream commit e892fa595e19b5cce315045444b3b7e31130ef19 ] + In case vdev was already probed, it shouldn't be probed again, and it should return -EEXIST as error. There are some checks in vdev_probe() and insert_vdev(), @@ -11,7 +13,6 @@ in all code paths. Fixes: e9d159c3d534 ("eal: allow probing a device again") -Cc: stable@dpdk.org Signed-off-by: Raslan Darawsheh Signed-off-by: Thomas Monjalon