From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id 204792B99 for ; Tue, 5 Dec 2017 14:20:08 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 768FF20C85; Tue, 5 Dec 2017 08:20:06 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 05 Dec 2017 08:20:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=rm7hYEw2OOG2OSchReJSbURQkT IuZ5+msDLW5d24Zys=; b=OgrQ80ikfOsbRs45mg0DvRw6QzJbyxSwrz/tx8otlC NL6uTAKSDNV/94+Kqa/STXENNxkKxjocGnROMT0b74D/ZvGelSV9gqhBc2XWcZZi mO9SgWpTF/dzXfLJ5DLo1Io5+yR6A7iFTsF0qVMpLmj1q7WnLlAHWKxVWKkFAUD5 c= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=rm7hYE w2OOG2OSchReJSbURQkTIuZ5+msDLW5d24Zys=; b=YI2xSGBQN4SympHyrZ2SG8 b50Kb96L7PRTTGtNT8WGpSrP8dWRjbNxWPDosrgBt+dIdh5ComzblJgimmNgCw0W tWagLDa4iJ5lh949GIDazjxhzfQkzwPfqA5gb0H7Rdbt6PKOy0E84Gd62x2NsLOb NAQnFUe1IkSpH6Y3yJgAqUWCNXm2f1ulr9+vJqNFpDG+yRftMYV1zn6hdxJ50sWi pawkxnxAb6A69fv7Fv8DC38meEQ9gT6vbrj1WKplmmQHhanfisQqkG82jsyqx9Fg YfReAvKyNyzCxOgBQL1c3MikKZJZ06pP6Pzoo5Hoxmtg4Q7pKHFA+fwOHSbH5VnA == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 0353B2489B; Tue, 5 Dec 2017 08:20:06 -0500 (EST) From: Thomas Monjalon To: Adrien Mazarguil Cc: Yuanhan Liu , =?ISO-8859-1?Q?Ga=EBtan?= Rivet , Stephen Hemminger , dev@dpdk.org, Ciara Loftus , Kevin Traynor , hemant.agrawal@nxp.com Date: Tue, 05 Dec 2017 14:20:05 +0100 Message-ID: <4433948.XFY0rnHxgs@xps> In-Reply-To: <20171205110446.GN4062@6wind.com> References: <1512027330-30030-1-git-send-email-yliu@fridaylinux.org> <20171204135531.GB13614@yliu-dev> <20171205110446.GN4062@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 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 13:20:09 -0000 05/12/2017 12:04, Adrien Mazarguil: > Hi Yuanhan, > > On Mon, Dec 04, 2017 at 09:55:31PM +0800, Yuanhan Liu wrote: > > 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. Good idea, thanks. I think we will MAC in some cases and port number in others. It is important to have identifiers available even without initializing the device. > 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? Yes we must provide some new key/value arguments for devargs. So it can be used anywhere, including -w/-b options in DPDK or port configuration in OVS. > 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. Question: should we separate device identification and configuration in the syntax? > 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. No, unique names are not useful / not usable by users.