From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id 95BBD2030 for ; Wed, 13 Dec 2017 15:47:17 +0100 (CET) Received: by mail-wm0-f66.google.com with SMTP id y82so22101466wmg.1 for ; Wed, 13 Dec 2017 06:47:17 -0800 (PST) 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=bIK4KfB/nBDf4yk9XSFuOAqOhSNsRlZCF/7hdtzN8zk=; b=glB4o81D8eeir/UynxSsqhxDDu/ffEvPK/juX2Q3ue0vb8ZD3dVY9D4um0IXrf7Yih foms7cj4GZjhd7GMx21MP8LPttiC/z6IabxEBKGDZGXkmqL+KZxX5TsDzvRV1TXEN3f6 E/n4A7iI7T8kDQtwQXtdhF/WO75F/ciYHQWHhpLIq12pRRiadRAQPIGBJ7T9yYI5+P25 SwQhXg36z5wnja5EHP7ce2umm+7vfHhni4fn/3+/XCe8KFV1mbmEwpETDG4OLxXph70E DJfqq6OSUDO+lW1Tz7fzo0m+UuxlfR0d5tG7V5KlaAk9aypIXe2c5XwJ9u4BApxDy5a/ YzBg== 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=bIK4KfB/nBDf4yk9XSFuOAqOhSNsRlZCF/7hdtzN8zk=; b=BX+VzpAwXd3nKuNOhk+dh7w98SNCTHds014tq5SG/eM26H/YZn9aEHkeg01mMyJFIz 2XqmFFD2jwn+82VE4nxK340zV4SkpUz0s1urv/oRJxetMsFE6KCA6DVAyBasTGL9gkU+ L3s5lTqglP5WChiQp8qf9Oww36nHxbSWvPDTcO1ewWLeya5kslfWlWWP1vRgToHmSYBs zLVTljAaGtf8s9W5Vui1tArWq+m2UOYtl5Ms5I0S7Ru6c+UDVLMFKT1l1TQbvqcZlKFp HnkXIVKkfe6wbU87raxc9tZqBPzNsvDVT7fERM6fSfFsYp9kY/AxoSLWPV0gJIXeskou /BDg== X-Gm-Message-State: AKGB3mJ82jk8fFqqNFvOMV/+E9bth2jVX+OnSphYen+ObO0m4BpptjI1 RZK28/ApnrsEdg7OXKqg4LvIKg== X-Google-Smtp-Source: ACJfBou/WP1zMfDAW7tjP9bleSSkMyqpteAaQjY+FBMMNo8sfWRdJUT8aBtjglUiUE7+0NOqU0fG+Q== X-Received: by 10.80.152.6 with SMTP id g6mr7922775edb.28.1513176436960; Wed, 13 Dec 2017 06:47:16 -0800 (PST) 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 y1sm1532509edl.39.2017.12.13.06.47.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Dec 2017 06:47:16 -0800 (PST) Date: Wed, 13 Dec 2017 15:47:04 +0100 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Shreyansh Jain Cc: dev@dpdk.org Message-ID: <20171213144704.4d7675gw7iaasvtb@bidouze.vm.6wind.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v2 12/18] eal: add generic device declaration parameter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Dec 2017 14:47:17 -0000 On Wed, Dec 13, 2017 at 07:56:42PM +0530, Shreyansh Jain wrote: > On Thursday 12 October 2017 01:51 PM, Gaetan Rivet wrote: > > Add a new generic device declaration parameter: > > > > --dev= > > > > [...] > > > > > diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c > > index 603df27..b7591fd 100644 > > --- a/lib/librte_eal/common/eal_common_options.c > > +++ b/lib/librte_eal/common/eal_common_options.c > > @@ -95,6 +95,7 @@ eal_long_options[] = { > > {OPT_PROC_TYPE, 1, NULL, OPT_PROC_TYPE_NUM }, > > {OPT_SOCKET_MEM, 1, NULL, OPT_SOCKET_MEM_NUM }, > > {OPT_SYSLOG, 1, NULL, OPT_SYSLOG_NUM }, > > + {OPT_DEV, 1, NULL, OPT_DEV_NUM }, > > {OPT_VDEV, 1, NULL, OPT_VDEV_NUM }, > > {OPT_VFIO_INTR, 1, NULL, OPT_VFIO_INTR_NUM }, > > {OPT_VMWARE_TSC_MAP, 0, NULL, OPT_VMWARE_TSC_MAP_NUM }, > > @@ -1120,6 +1121,21 @@ eal_parse_common_option(int opt, const char *optarg, > > } > > break; > > + case OPT_DEV_NUM: { > > + struct rte_devargs da; > > + int ret; > > + > > + if (rte_eal_devargs_parse(&da, optarg) < 0) > > + return -1; > > + ret = rte_bus_probe_mode_set(da.bus->name, > > + RTE_BUS_PROBE_WHITELIST); > > + if (ret < 0 && ret != -ENOTSUP) > > + return -1; > > + if (eal_option_device_add(NULL, optarg) < 0) > > + return -1; > > + } > > Might be a naive question: Any specific reason why we don't add the devices > directly into devargs_list here (eal_parse_args -> eal_parse_common_option > -> OPT_DEV ->) rather than wait for eal to call eal_option_device_parse > again? > > Is it to allow eal_plugins_init() to finish? > Yes. And actually this makes me aware of an issue with this implementation. Calling rte_eal_devargs_parse here is premature, and rte_bus_probe_mode_set as well. eal_plugins_init() must be executed before calling rte_devargs to allow for buses introduced as plugins to be able to recognize their devices. I will reorder a few things in eal_options, thanks for catching this. > > + break; > > + > > case OPT_VDEV_NUM: > > if (eal_option_device_add("vdev", optarg) < 0) > > return -1; > > [...] > -- Gaëtan Rivet 6WIND