From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id B7ED725B3 for ; Thu, 25 Oct 2018 11:51:38 +0200 (CEST) Received: by mail-wr1-f65.google.com with SMTP id q6-v6so8601647wrw.11 for ; Thu, 25 Oct 2018 02:51:38 -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=DlBpu47Y5mVj/AV1UdoLZAhIlblsz4jNTBjtDxFJBqw=; b=YlqoinBCew5Gti5uZ/tu+SSd3MmXihTB3tgX3juZFnaubYzG7aeSV+kGu68C5wsHjB ZS7OZgJ9RM4voTavNsUwpOPXq5arSRM5YzU9n14JT3fWT/+Gf8fFQ++6dZfSEpRTvxTR AidQIw1HKHzhXPpjIG7bQ5TAVpcgkfMYxsDkLOM0O7AXCNkmfti0AGdaBJaZq0fGXzqE xICHbm2RMf80ttsQpNkdUn2fl0FvSXEx85AunZflWE29EHDkBTrFvcAA47vXJhHQDlKl sADk5pj90yPI/xG78hnZXH4V0FVG+rO4ivtj0MdjU1GmKvVh2+BzwZx8gRvPc05pud/O 5wzA== 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=DlBpu47Y5mVj/AV1UdoLZAhIlblsz4jNTBjtDxFJBqw=; b=fDtHH7QRNwce30/jsJcRlz2kF/WTbZCTxxGmagrR7dqvxM4pB849KxTJ7l/NtySwL4 8UtsgT9V0nL8ZpUew/CGF08SMbFfn5KpRxqE7d9Cbxnfa5T5SojfhZvUz3bCmyT9Qv1D 3DEeosc9cBAXdEvmFNOt0r73EV6/QhEh+EORNuVKaFj+1E15o2YMhl80lARa+bjcGIuG T0hWMMhVx8W7L5Wwyvc3+3HZ9Ps/W6DJoZtOgX+kQaYzsSKmbHJSGTBmo4Bo6SXQ6T0o iPnGzIefh0p7uUOpYeU4XXNsTbFo1Bd9qY8Chf5bUvjXKQUuJpNgJFcy3legMyw10lcW yLXg== X-Gm-Message-State: AGRZ1gIkjYOc4HbS2xgk5TQ0Z+Lsidz3p6UI1hfZy/7/Z7AkawdVXNp6 P6ytud4kI3Oj969MYBoJnnCfSg== X-Google-Smtp-Source: AJdET5dGjWfbSX5vVZb4Y/8u6hz4UC6XiNn43wcPos+e0q27Fd+E4Dj6nAEfTftUDP9zxorRIfi5/Q== X-Received: by 2002:adf:a285:: with SMTP id s5-v6mr1160585wra.100.1540461097948; Thu, 25 Oct 2018 02:51:37 -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 y76-v6sm728887wmd.37.2018.10.25.02.51.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Oct 2018 02:51:37 -0700 (PDT) Date: Thu, 25 Oct 2018 11:51:18 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Qi Zhang Cc: thomas@monjalon.net, dev@dpdk.org, stable@dpdk.org Message-ID: <20181025095118.gnc75zvkuvfajtha@bidouze.vm.6wind.com> References: <20181025033036.23680-1-qi.z.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20181025033036.23680-1-qi.z.zhang@intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-stable] [PATCH] bus/vdev: fix device argument corrupt after bus scan 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: Thu, 25 Oct 2018 09:51:38 -0000 On Thu, Oct 25, 2018 at 11:30:36AM +0800, Qi Zhang wrote: > It's not necessary to insert device argment to devargs_list > during bus scan, but this happens when we try to attach a > device on secondary process. The patch fix the issue. > > Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel") > Cc: stable@dpdk.org > > Signed-off-by: Qi Zhang > --- > drivers/bus/vdev/vdev.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c > index 688e31c21..818a2bfc2 100644 > --- a/drivers/bus/vdev/vdev.c > +++ b/drivers/bus/vdev/vdev.c > @@ -202,7 +202,9 @@ alloc_devargs(const char *name, const char *args) > } > > static int > -insert_vdev(const char *name, const char *args, struct rte_vdev_device **p_dev) > +insert_vdev(const char *name, const char *args, > + struct rte_vdev_device **p_dev, > + bool init) Why is vdev the only bus not using hotplug API itself and reimplementing it on its own? It should not have to insert devargs at all, not even in the primary process. If it called rte_dev_probe(), this would normally already be properly handled I think. > { > struct rte_vdev_device *dev; > struct rte_devargs *devargs; > @@ -237,7 +239,8 @@ insert_vdev(const char *name, const char *args, struct rte_vdev_device **p_dev) > } > > TAILQ_INSERT_TAIL(&vdev_device_list, dev, next); > - rte_devargs_insert(devargs); > + if (init) > + rte_devargs_insert(devargs); > > if (p_dev) > *p_dev = dev; > @@ -257,7 +260,7 @@ rte_vdev_init(const char *name, const char *args) > int ret; > > rte_spinlock_recursive_lock(&vdev_device_list_lock); > - ret = insert_vdev(name, args, &dev); > + ret = insert_vdev(name, args, &dev, true); > if (ret == 0) { > ret = vdev_probe_all_drivers(dev); > if (ret) { > @@ -383,7 +386,7 @@ vdev_action(const struct rte_mp_msg *mp_msg, const void *peer) > break; > case VDEV_SCAN_ONE: > VDEV_LOG(INFO, "receive vdev, %s", in->name); > - ret = insert_vdev(in->name, NULL, NULL); > + ret = insert_vdev(in->name, NULL, NULL, false); > if (ret == -EEXIST) > VDEV_LOG(DEBUG, "device already exist, %s", in->name); > else if (ret < 0) > -- > 2.13.6 > -- Gaëtan Rivet 6WIND