From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BBEC5A034F; Wed, 31 Mar 2021 12:19:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 40874140E50; Wed, 31 Mar 2021 12:19:56 +0200 (CEST) Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by mails.dpdk.org (Postfix) with ESMTP id E4C27406A3 for ; Wed, 31 Mar 2021 12:19:54 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id 21F945805C8; Wed, 31 Mar 2021 06:19:54 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 31 Mar 2021 06:19:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm3; bh= y1KPYk/awHY0YeBNdg2hHztb83tqPJqzPESDtztCV4M=; b=xIBG0Rfc4LnIFPoI ra2S8AGMGLA0YmPMZsOzKUDgmzTLehVLTAt5ef2dtCJR9wXqB4+PxIdq82j0/OBJ /Ie/wgbJAjSaFdvrykuxVjXHKTLmJdje3UnlfUwgXlph6KoF0Mknb2VzCMxptxvF jbdsSC5VTdwziGFwWJmg9CGeqn5QV6CqH48gdK62h7D2mGwt7cl4S/2TFIkZsoBv 6iLU2668D8bOF0et6myT1nFZYGktx54d/a514k60VLNnsQa+/ldK/4DyKxXon2Ft lwb/AxD4rkRBNbFG8RdpXupzGUPwO9w4KNEsrPLW9TyBnHZM+TCN192NCXiNcCc4 yRKBdw== 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-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=y1KPYk/awHY0YeBNdg2hHztb83tqPJqzPESDtztCV 4M=; b=j9YyMEYrBTueJINh3QCCIv4ETG9gu8Mfc+YwNZQH8MzG9KshtwW4fZ3P6 eHlTO3ck+DzNrlg16jVVAYzNyDLJXvOxbQt80b3ZiN6keadXScdkGLy7nHVVykcs UkYJYIUbQB5thTCHD5eI27O7Lc+L6qcg9gAJkJ3Fa48XlGiyaWFPz8ZtdgU+pocb zt+uWz5Q8UfpNMQMi3ZVBXkRi8IOmUfQSUWZBGiIcKEk9W+jAFhhvqPrAGE2vmH2 b+mjtCE7FLog3+W1PhHOIee5/AihU6HWr0C/NDJgciwjQR0LFuZmc5js++utM6W5 g9toKHa8p9a/fvfB72qrhbvHdA8Dg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudeivddgfedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 65653108005F; Wed, 31 Mar 2021 06:19:51 -0400 (EDT) From: Thomas Monjalon To: Xueming Li Cc: Gaetan Rivet , dev@dpdk.org, Asaf Penso , david.marchand@redhat.com, ferruh.yigit@intel.com, andrew.rybchenko@oktetlabs.ru, hemant.agrawal@nxp.com, stephen@networkplumber.org, rosen.xu@intel.com, ajit.khaparde@broadcom.com, jerinj@marvell.com Date: Wed, 31 Mar 2021 12:19:48 +0200 Message-ID: <5906599.tKcfDlsr6y@thomas> In-Reply-To: <1617106521-25931-5-git-send-email-xuemingl@nvidia.com> References: <1617106521-25931-1-git-send-email-xuemingl@nvidia.com> <1617106521-25931-5-git-send-email-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3 4/5] bus: add device arguments name parsing API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The commit log should start by explaining it is adding a callback to the bus drivers for the new devargs syntax. 30/03/2021 14:15, Xueming Li: > To use Global Device Syntax as devargs, name is required for device > management. Context is missing. You mean the argument "name" for the vdev bus? > > In legacy parsing API, devargs name was extracted after bus name: > bus:name,kv_params,,, > > To parse new Global Device Syntax, this patch introduces new bus API to > parse devargs and update name, different bus driver might choose > different keys from parameters with unified formating, example: > -a bus=pci,addr=83:00.0/class=eth/driver=mlx5,... > name: 0000:03:00.0 > -a bus=vdev,name=pcap0/class=eth/driver=pcap,... > name:pcap0 Only PCI and vdev buses are implemented. What can be the plan for others? We should track the progress somewhere, maybe with TODO comments. This commit log could also state what is the status of the global syntax support, talking about class and device drivers. We could update this comment in ethdev: * A new syntax is in development (not yet supported): * - bus=X,paramX=x/class=Y,paramY=y/driver=Z,paramZ=z [...] > +int > +rte_pci_devargs_parse(struct rte_devargs *da) > +{ > + struct rte_kvargs *kvargs; > + const char *addr_str; > + struct rte_pci_addr addr; > + int ret; > + > + if (da == NULL) > + return 0; > + RTE_ASSERT(da->bus_str != NULL); > + > + kvargs = rte_kvargs_parse(da->bus_str, NULL); > + if (kvargs == NULL) { > + RTE_LOG(ERR, EAL, "cannot parse argument list: %s\n", > + da->bus_str); > + ret = -ENODEV; > + goto out; > + } > + > + addr_str = rte_kvargs_get(kvargs, pci_params_keys[RTE_PCI_PARAM_ADDR]); > + if (addr_str == NULL) { > + RTE_LOG(ERR, EAL, "No PCI address specified using '%s=' in: %s\n", > + pci_params_keys[RTE_PCI_PARAM_ADDR], da->bus_str); > + ret = -ENODEV; > + goto out; > + } > + > + ret = rte_pci_addr_parse(addr_str, &addr); > + if (ret != 0) { > + RTE_LOG(ERR, EAL, "PCI address invalid: %s\n", da->bus_str); > + ret = -EINVAL; > + goto out; > + } > + > + rte_pci_device_name(&addr, da->name, sizeof(da->name)); > + > + /* TODO: class parse -> driver parse */ Please could you give a longer explanation of what is missing?