From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f178.google.com (mail-wr0-f178.google.com [209.85.128.178]) by dpdk.org (Postfix) with ESMTP id C48312BA1 for ; Thu, 8 Jun 2017 13:38:13 +0200 (CEST) Received: by mail-wr0-f178.google.com with SMTP id g76so17298308wrd.1 for ; Thu, 08 Jun 2017 04:38:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=Gk2C76v9CbzSKkKhi9xrXabhxEetuaZ6eY4UP2jmaII=; b=OJFjT/Zpl3h53RreHvU9uOKH0JvuBsWsnWYZteEktny4XV3YQHr3pNW61CR/PT1g0u oxYl6AiLZ+9TCjPoi1NUv3QtIH/OXRWa8f4MxDps6EwwoKji8nnB4decpl+Oloq4kMQV 2h8yjWqTG4uzszugJVzmap8uxmsgEsy019VkRSRZtRzluejR4OPXgGno8+2JVXOOiieG oiDQjk05EuQeZlCs0Y0Fvy0bTRTOAbZQzM72dncLaNrPtXoyM6zGZUZX3AgZ7gHC0Ajj MCoAY29bxed/4VpFtUQ72poLQhwsDS2ybmoaJqc3yj6TdcX/9wPZY7/UWjHfINH/FDzJ /IRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=Gk2C76v9CbzSKkKhi9xrXabhxEetuaZ6eY4UP2jmaII=; b=RmjaHLk4PxaF/dkU+NOZxaWStdsybCcK9YgMDw12hN0DfbjpEu4TXfQBeSb1iYY9rG Y1CfKSmxDYG6Ya8q9IejqDpUqvoIqSd/h6YWKpsvtCcDgrZeQ0Z38j5d/HIrvH+YxZx/ 6AV+W/YnHY5VynEqEjawIOm7X3ZF0h+x1HAZ1Ty6QeREu4Xab+08FrSjArtUgU3pj7tc sIKlspkAw/Yuhg3w9aDM2wHyaYKnvXeDiS0x9pteXSqM2KDxjjPFpNMFYzEt9Yg+CbD4 gvPgNViRgD7tMyJM4mc3vzZCXMvFBhnvuUNHbP2ZHKk1CsAqVG1LYMg9u4znd9SJPZ9G QtOw== X-Gm-Message-State: AODbwcDXJ5hx2GUu5gcpKm0ZOOdmrMAFqTRxeGkymbeMwdC/rSH7FhLq E+WEcAnAAcH4Wede3wp5wOg4JiDv3Q== X-Received: by 10.223.143.11 with SMTP id p11mr24887119wrb.3.1496921893353; Thu, 08 Jun 2017 04:38:13 -0700 (PDT) MIME-Version: 1.0 Sender: jblunck@gmail.com Received: by 10.28.25.65 with HTTP; Thu, 8 Jun 2017 04:38:12 -0700 (PDT) In-Reply-To: <20170607195531.GT18840@bidouze.vm.6wind.com> References: <20170607195531.GT18840@bidouze.vm.6wind.com> From: Jan Blunck Date: Thu, 8 Jun 2017 13:38:12 +0200 X-Google-Sender-Auth: M8ctHySFFhBJQvJigexq5M0_Z2M Message-ID: To: =?UTF-8?Q?Ga=C3=ABtan_Rivet?= Cc: dev , Stephen Hemminger , Maxime Coquelin , Jerin Jacob , David Marchand Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH 0/9] rte_bus parse API 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: Thu, 08 Jun 2017 11:38:14 -0000 On Wed, Jun 7, 2017 at 9:55 PM, Ga=C3=ABtan Rivet = wrote: > On Wed, Jun 07, 2017 at 07:22:05PM +0200, Jan Blunck wrote: >> On Wed, May 24, 2017 at 5:12 PM, Gaetan Rivet w= rote: >> > Following the evolutions announced in [1], here is the first part of >> > the rte_devargs rework planned for 17.08. The rationale has been parti= ally >> > explained in [2]. >> > >> > This first part covers the introduction of the necessary facilities in >> > rte_bus to allow for generic device parsing. This API is implemented f= or >> > the virtual and PCI buses. Additionally, this rte_bus evolution is bei= ng >> > used within rte_devargs to characterize a device type by its bus. >> > This work is the first of two parts to reduce the dependency of the EA= L >> > upon specific bus implementations. >> > >> > Two public functions are added to rte_bus to help bus recognition: >> > >> > - rte_bus_from_name >> > - rte_bus_from_dev >> > >> > These functions are made public because the bus handle within devargs >> > becomes the generic device type. Recognizing device types is useful fo= r >> > buses and PMDs alike. >> > The modified rte_devargs parsing allows declaring on the EAL command l= ine >> > explicit buses to handle a device. The format is as follow: >> > >> > --vdev=3D"virtual:net_ring0" --vdev=3D"net_tap0,iface=3Dtap0" >> > -w PCI:00:02.0 -w 00:03.0 >> > >> >> I don't see the point of doing this. The --vdev parameter implicitly >> defines the bus by its name (--vdev aka virtual device). >> >> Why don't you add a commandline "--dev" parameter that supports a >> "bus=3D" devarg? You would need to clarify what that means for other >> busses than the virtual one. Is the bus switched into whitelist mode >> by that? >> >> > > We cannot keep the current -w, -b and --vdev parameter. Those are > processed by the EAL, and use specifics from the virtual and PCI buses. > > The rte_devargs rework has been to make the same functionality generic > to all rte_bus. As seen quickly in [2], rte_devargs has two functions: > > * Validating a device declaration > * Keeping the relevant device info until it has been processed. > I don't agree with the validation step. This is highly device/driver/bus specific and I don't believe that just because you have created a rte_devargs it is a guarantee that the device is valid. Besides that it makes statically embedding rte_devargs into other structures impossible. As I see it rte_devargs is a key-value list with some keys that are generic. This would make application development much easier. > Both functionalities have been genericized. This results in all parameter= s > being able to be used with all types of devices. This is inherent to the > EAL becoming bus-agnostic. > > Now, it is absolutely possible to rename for example -w as --dev, as it > is the expected behavior from users. This however should be discussed by > the community, last time I talked about the possibility of switching the > default of the PCI bus to whitelist mode the community wasn't all that > enthused by the prospect. > > Finally, I do not like the idea of a special devarg just for declaring > explicitly buses for devices. The bus is not a device modifier, nor is > it a driver parameter. The bus is a way to define the location of the > device on the system. Adding a special "bus=3D" devargs means having some > preprocessing done on devargs upon rte_devargs allocation. This was > already abused by the bonding PMD with the driver=3D parameter. I do not > support this and did not want to repeat it. Passing down the device args > is a simple process and we should keep it as simple as possible. > > I know you do not like having the bus as part of the device name. > As a compromise, I made the current system flexible and allowed the legac= y > device definition to be kept. > > However with a purely generic process, it is necessary to at least offer > the possibility to the user to explicitly use a bus, as nothing prevents > conflicting device names from existing. > >> > [2]: http://dpdk.org/ml/archives/dev/2017-May/065670.html > >> > This explicit bus designation is optional; no evolution is currently >> > forced on users to migrate to this new format. The separating characte= r is >> > arbitrary and can be any character illegal within a bus name. >> > Subsequently, what is allowed within a bus name has been formally >> > defined and is now enforced. >> > >> > [1]: http://dpdk.org/ml/archives/dev/2017-May/065634.html >> > [2]: http://dpdk.org/ml/archives/dev/2017-May/065670.html >> > >> > This patchset depends on: >> > >> > bus: attach / detach API >> > http://dpdk.org/ml/archives/dev/2017-May/066330.html >> > http://dpdk.org/dev/patchwork/patch/24489/ >> > >> > Gaetan Rivet (9): >> > bus: fix bus name registration >> > bus: verify bus name on registration >> > bus: introduce parsing functionality >> > vdev: implement parse bus operation >> > pci: implement parse bus operation >> > bus: add helper to find bus from a name >> > bus: add helper to find a bus from a device name >> > vdev: expose bus name >> > devargs: parse bus info >> > >> > lib/librte_eal/bsdapp/eal/rte_eal_version.map | 8 +++ >> > lib/librte_eal/common/eal_common_bus.c | 47 ++++++++++++++++= + >> > lib/librte_eal/common/eal_common_devargs.c | 17 +++++- >> > lib/librte_eal/common/eal_common_pci.c | 19 +++++++ >> > lib/librte_eal/common/eal_common_vdev.c | 70 ++++++++++++++--= --------- >> > lib/librte_eal/common/eal_private.h | 16 ++++++ >> > lib/librte_eal/common/include/rte_bus.h | 49 ++++++++++++++++= - >> > lib/librte_eal/common/include/rte_devargs.h | 3 ++ >> > lib/librte_eal/common/include/rte_vdev.h | 2 + >> > lib/librte_eal/linuxapp/eal/rte_eal_version.map | 8 +++ >> > 10 files changed, 205 insertions(+), 34 deletions(-) >> > >> > -- >> > 2.1.4 >> > > > -- > Ga=C4=97tan Rivet > 6WIND