From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id F140316E for ; Wed, 2 May 2018 10:26:24 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id x12so17774980wmc.0 for ; Wed, 02 May 2018 01:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=9J8AojDxQ6dl9sA8P6y/WvmEKdRJ0ELTYe0DdOU1EPo=; b=cb9bCGLjfAaYGy1QnzIuqD9BqJxez8IQRhoIql9+FX80WgtoFVzmM+ZU4/4RCe6FEE HPuAjfyF6RNi/Jxi03pP9J9b6I3KlmCi1j2iv2QwHlbx5FOgFxbIwWN5zriHue27RWm2 rzaRNCAkfKJ3oYU8QAfJihHTBiFmHiRCzTpblnpZf5b0MwVgfjIAyDbuLDI/3qFFmeA+ RRh8x1mW3/xbRqDvFVkTgnRXwGik0Q6Qp2bNCa9LrhZxb8MJvczu+qpfJ7AEmIM4s7Gv vqxM3KYJaOYcyUZu9jqKWhT/+XekUAdBUJ/9EAWKnhAngNugWo0MLoHN3N1fyvoEDOKv zTXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=9J8AojDxQ6dl9sA8P6y/WvmEKdRJ0ELTYe0DdOU1EPo=; b=dNtkDuyJUVudnTYCzYGA3RVCJTfXaOpZJlOH40wULsZL/Sy6Axvr1R1Q27JdxU/YNZ wYje3yBpuFqK3bv9KLIOL0qiuRO8xZqb+gCGPpaqqsdsfNHF6lCswDgV98MrEOvPrjPe 50gQDKgnFRHm7iVKR1eOSnGRW7/AsmBFcyVUw5B6mE+74zrZxG4GFd7tn/M0+LT7vrFv s1dcK7CYcb9Xe3TD1h/tnnfbwrBYNJAw/gN1YjZYVkfat5pFD6T9bz1gyCwqCwaOtTbj hBEpI4eUkdaYi4LKXGwpehhOu6KJ0ek2dhSW8SkuvSycU+idngrI6mqxNgucxW39dOEq yHNQ== X-Gm-Message-State: ALQs6tC8AJIvrM4/bYWgIU2SfwxFt278Utpe0VUHjYehamhKWulLQCF4 9UtubcvHqzS5YReK7BXyQrkVE+rN X-Google-Smtp-Source: AB8JxZohFwHj7mhHPWzmhIYku+wdunY7HrAJJoTmRdoOVhzX6oKiPkAn8G9QHhbpw0DYp3TdgoYYMQ== X-Received: by 10.28.68.137 with SMTP id r131mr12859065wma.140.1525249584535; Wed, 02 May 2018 01:26:24 -0700 (PDT) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id k23-v6sm13952309wrc.59.2018.05.02.01.26.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 May 2018 01:26:23 -0700 (PDT) Date: Wed, 2 May 2018 10:26:02 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: luca.boccassi@gmail.com Cc: dpdk stable Message-ID: <20180502082602.bqg4ctdkyyaom6g2@bidouze.vm.6wind.com> References: <20180430144223.18657-85-luca.boccassi@gmail.com> <20180430145402.23057-1-luca.boccassi@gmail.com> <20180430145402.23057-2-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180430145402.23057-2-luca.boccassi@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-stable] patch 'bus/vdev: fix find device implementation' has been queued to stable release 18.02.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: Wed, 02 May 2018 08:26:25 -0000 Hi Luca, On Mon, Apr 30, 2018 at 03:53:21PM +0100, luca.boccassi@gmail.com wrote: > Hi, > > FYI, your patch has been queued to stable release 18.02.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 05/02/18. So please > shout if anyone has objections. This patch will be bogus while still compiling in a stable release, without the commit: 35f462839b69 ("bus/vdev: add lock on device list"). It should be slightly reworked to function without. The previous version of this patch [1] could be used instead. [1]: https://dpdk.org/ml/archives/dev/2018-April/098822.html Regards, > > Thanks. > > Luca Boccassi > > --- > From c2afaf6b85b6d55dee13c3742baf2052d7994a9d Mon Sep 17 00:00:00 2001 > From: Gaetan Rivet > Date: Fri, 27 Apr 2018 16:13:06 +0200 > Subject: [PATCH] bus/vdev: fix find device implementation > > [ upstream commit 3701b792a8a3bce519adc979d5cc8d127231fd48 ] > > If start is set and a device before it matches the data, > this device is returned. > > This induces potentially infinite loops. > > Fixes: c7fe1eea8a74 ("bus: simplify finding starting point") > > Signed-off-by: Gaetan Rivet > --- > drivers/bus/vdev/rte_bus_vdev.h | 3 +++ > drivers/bus/vdev/vdev.c | 16 ++++++++++------ > 2 files changed, 13 insertions(+), 6 deletions(-) > > diff --git a/drivers/bus/vdev/rte_bus_vdev.h b/drivers/bus/vdev/rte_bus_vdev.h > index f9d8a2383..4da9967c6 100644 > --- a/drivers/bus/vdev/rte_bus_vdev.h > +++ b/drivers/bus/vdev/rte_bus_vdev.h > @@ -53,6 +53,9 @@ struct rte_vdev_device { > #define RTE_DEV_TO_VDEV(ptr) \ > container_of(ptr, struct rte_vdev_device, device) > > +#define RTE_DEV_TO_VDEV_CONST(ptr) \ > + container_of(ptr, const struct rte_vdev_device, device) > + > static inline const char * > rte_vdev_device_name(const struct rte_vdev_device *dev) > { > diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c > index 7eae319cb..914073d12 100644 > --- a/drivers/bus/vdev/vdev.c > +++ b/drivers/bus/vdev/vdev.c > @@ -386,15 +386,19 @@ static struct rte_device * > vdev_find_device(const struct rte_device *start, rte_dev_cmp_t cmp, > const void *data) > { > + const struct rte_vdev_device *vstart; > struct rte_vdev_device *dev; > > - TAILQ_FOREACH(dev, &vdev_device_list, next) { > - if (start && &dev->device == start) { > - start = NULL; > - continue; > - } > + if (start != NULL) { > + vstart = RTE_DEV_TO_VDEV_CONST(start); > + dev = TAILQ_NEXT(vstart, next); > + } else { > + dev = TAILQ_FIRST(&vdev_device_list); > + } > + while (dev != NULL) { > if (cmp(&dev->device, data) == 0) > - return &dev->device; > + break; > + dev = TAILQ_NEXT(dev, next); > } > return NULL; > } > -- > 2.14.2 > -- Gaëtan Rivet 6WIND