From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by dpdk.org (Postfix) with ESMTP id A1D7E271 for ; Tue, 5 Dec 2017 12:04:59 +0100 (CET) Received: by mail-wm0-f50.google.com with SMTP id i11so474723wmf.4 for ; Tue, 05 Dec 2017 03:04:59 -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; bh=tOy+qxlC5OdyCdLc7rlkuNdEpSyt300dEeb9hHM71BU=; b=Wj9vPUmuLalPHol7mL5MJAm5FTGFK2E2pRn5xItLMXZ53ST8JcRmz0395V8oOrNgB3 HuYudHtdciEwV/yPc4KHqKEZ1KETjKxZp4S3jMROnfvzeOb1SKX5Tw9H9vUFOmoqATZM 3b/V6Gt1CL9lT9VHrbjJDbPfbEJAnNer7ewiOaM8z8GOkIB4iRdA9WbAL9Py/0dboK/f SUMGHbztYfqntFKK4FxJMSdQiszbDUCb9tBfFkIe1XHgVCPeOmWpJhizvghl5i7GtZD5 dlykcwD2YZm0XjJb3WsiMHIX/WoxIF9nq08Tqd0EKnuFLbDB7zRU3f44rEqkSBH/3Idm AhFA== 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; bh=tOy+qxlC5OdyCdLc7rlkuNdEpSyt300dEeb9hHM71BU=; b=RfrKfm7fnOs5D9w7POhYOX1Mnm7Mr6iB2BHMvRvgsFk6pjshA4+KyJp6LFNjERwYoA xn/lh7b6ykE92K3/yBLRP28g40Id6JF46kujCrdqJseSVQJdwXnnr4kzJgDXmqxG9/pC FS9ogEaPLiPz4cqihj7QlcIc05DXQ7yXrhXlAM898rJCvgHZFen3ROTZpccQO6bOPVm2 0LUyFlekmVBUxeHiRmYU4MyaZYoedu6+cCGyMfWr4baoc3LhNlg4/uMqcqNiOGuiXWqL z5wlSKT7YaX4GvytzAOuczkEnAZ0hcf7XOBKioTJtF8Tu4Mnyegq3OWKEzASeRiw9d4h Yygw== X-Gm-Message-State: AKGB3mIXpjkYB/K/Wfee5zhk5ECYEDnQB5Yg/0D0Rv4LJZCaayAjuAQY POzO7HZsWnkbzZbpnZO3MTry/ijR X-Google-Smtp-Source: AGs4zMYy6O00DrWOosr5zXH0eH3q3mdVDOrnlo35hmpQ/UVyotLK42Tv/SKK+IfYX2slNlSqxh2mBw== X-Received: by 10.28.128.73 with SMTP id b70mr5358360wmd.53.1512471899020; Tue, 05 Dec 2017 03:04:59 -0800 (PST) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id f56sm21702657wra.75.2017.12.05.03.04.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Dec 2017 03:04:57 -0800 (PST) Date: Tue, 5 Dec 2017 12:04:46 +0100 From: Adrien Mazarguil To: Yuanhan Liu Cc: =?utf-8?Q?Ga=C3=ABtan?= Rivet , Thomas Monjalon , Stephen Hemminger , dev@dpdk.org, Ciara Loftus , Kevin Traynor , hemant.agrawal@nxp.com Message-ID: <20171205110446.GN4062@6wind.com> References: <1512027330-30030-1-git-send-email-yliu@fridaylinux.org> <6035648.0D6NuDDM7V@xps> <20171130132126.13761c50@xeon-e3> <1581666.Z35b0Iulko@xps> <20171201094750.tpsbovk6julcyzrm@bidouze.vm.6wind.com> <20171204135531.GB13614@yliu-dev> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20171204135531.GB13614@yliu-dev> Subject: Re: [dpdk-dev] [PATCH] [RFC] ether: standardize getting the port by name 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: Tue, 05 Dec 2017 11:04:59 -0000 Hi Yuanhan, On Mon, Dec 04, 2017 at 09:55:31PM +0800, Yuanhan Liu wrote: > On Fri, Dec 01, 2017 at 10:47:50AM +0100, Gaƫtan Rivet wrote: > > On Thu, Nov 30, 2017 at 10:44:58PM +0100, Thomas Monjalon wrote: > > > 30/11/2017 22:21, Stephen Hemminger: > > > > On Thu, 30 Nov 2017 18:35:11 +0100 > > > > Thomas Monjalon wrote: > > > > > > > > > 30/11/2017 18:15, Stephen Hemminger: > > > > > > Some thoughts. > > > > > > 1) Not all devices are PCI; look at recent VMBUS > > > > > > > > > > Yes, we need a syntax which works for every devices. > > > > > I suggest to use the prefix "pci:" before the PCI id. > > > > > We need also a prefix and ids for NXP buses. > > > > > We could use "vmbus:" before VMBUS ids. > > > > > How VMBUS ids look like? > > > > > > > > > rte_devargs are easily accessible, user-readable. Only thing missing > > would be requiring a 1-1 mapping between an rte_devargs and a port, thus > > requiring PMDs to have at least one version of a device string that > > would probe a single port (as is done with port= in mlx4). > > > > Implementing an rte_devargs to rte_device in rte_bus is simple enough, > > and this would allow implementing an rte_devargs to port_id in rte_eth. > > > > What am I missing? > > rte_devargs is identified by the name (pci id for pci device). It also > includes other driver specific key-value options. It's not clear for the > user to know which one (or few) of them should be used together with the > PCI id to identify a specific port. For example, as you mentioned, in > mlx4, it's "pci_id,port=x". It could be something else in other drivers. Just for information, this "port=x" argument in mlx4 is consistent with the value found in /sys/class/net/ethX/dev_port under Linux. If we choose to use a port index (instead of a MAC or something else), it would make sense to standardize it on the same order as given by the host OS for consistency across all PMDs. Devices with a single port per PCI address would simply use/allow "0". > Actually, this patch also proposes a devarg like naming style: "name[,mac]". > What it does try to do is to define a standard syntax, so that the user > doesn't have to know any driver specific options. > > However, the mac address is changeable, leaving this naming inconsistent. > Well, in practice, PCI id is also changeable. > > OTOH, having a consistent naming seems a bit far away from this patch's > goal: define a standard ethdev naming and leave less harassment to the users. I'm not a fan of the MAC naming scheme either, a kind of per-device physical port index seems more robust and doesn't require much initialization to determine how many ports are supported by the device and whether the index is known/valid (particularly given the vast majority exposes only one per bus address). Would it make sense to have this name usable unmodified as a valid device (-w) argument, including parameters? If so, PMDs could append parameters while probing the underlying device, by appending ",port=x", ",mac=x" followed by other unspecified parameters with default values. This could uniquely identify the port _and_ its configuration in a reusable fashion. Otherwise if all we need is unique names, we can use the opposite and much simpler approach. Let librte_ether assign them sequentially (e.g. "rte_eth%d", no need for consistency with OS netdevices), applications can figure the rest based on data structures if needed. Thoughts? > > > > > > 2) The name may have to be set before MAC address is determined on boot. > > > > > > > > > > I don't understand this comment. > > > > > Do you mean MAC may be unknown when starting DPDK? > > > > > > > > The MAC be known by the hardware, but the device would have to be > > > > created before using hardware to read it. > > > > > > Indeed, it is a problem if we want to use this syntax for blacklist. > > > > > > > > > > > > 3) The names themselves are not persistent or human friendly. This is hard > > > > > > see the effort udev goes to. > > > > > > > > > > Yes udev has a syntax to identify devices. It can be inspiring. > > > > > Qemu may also be inspiring: > > > > > https://github.com/qemu/qemu/blob/master/docs/qdev-device-use.txt -- Adrien Mazarguil 6WIND