From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 7F93D1B027 for ; Thu, 21 Sep 2017 10:28:33 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP; 21 Sep 2017 01:28:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,424,1500966000"; d="scan'208";a="1197498683" Received: from irsmsx108.ger.corp.intel.com ([163.33.3.3]) by fmsmga001.fm.intel.com with ESMTP; 21 Sep 2017 01:28:30 -0700 Received: from irsmsx106.ger.corp.intel.com ([169.254.8.36]) by IRSMSX108.ger.corp.intel.com ([169.254.11.167]) with mapi id 14.03.0319.002; Thu, 21 Sep 2017 09:28:29 +0100 From: "Loftus, Ciara" To: Thomas Monjalon CC: Kevin Traynor , devendra rawat , "ovs-dev@openvswitch.org" , Adrien Mazarguil , "nelio.laranjeiro@6wind.com" , "users@dpdk.org" , Yuanhan Liu , "olgas@mellanox.com" Thread-Topic: [dpdk-users] [ovs-dev] adding dpdk ports sharing same pci address to ovs-dpdk bridge Thread-Index: AQHTMjbFBSAzK8Ty40aLyMCaG+/JtKK+RNyAgACzFuD///eSgIAAEqNg Date: Thu, 21 Sep 2017 08:28:29 +0000 Message-ID: <74F120C019F4A64C9B78E802F6AD4CC278E0EB69@IRSMSX106.ger.corp.intel.com> References: <1990042.kGnXgAYS5O@xps> <74F120C019F4A64C9B78E802F6AD4CC278E0EB1C@IRSMSX106.ger.corp.intel.com> <1785021.jQYphEuIaN@xps> In-Reply-To: <1785021.jQYphEuIaN@xps> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMGY3OTcxZjYtNjZjMS00OGQ4LWJmYzctNGI1MTQ0MDk4ZDY0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6InlySWtIU2E3YmEzVHVXUEdVU1wvTmFkTFBsWlZ5Znd2MUd5Zk1cL2NiaWZZMD0ifQ== x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-users] [ovs-dev] adding dpdk ports sharing same pci address to ovs-dpdk bridge X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Sep 2017 08:28:34 -0000 > 21/09/2017 10:04, Loftus, Ciara: > > > 20/09/2017 19:33, Kevin Traynor: > > > > On 09/08/2017 10:56 AM, Loftus, Ciara wrote: > > > > > It seems the DPDK function rte_eth_dev_get_port_by_name() will > > > > > always return the port ID of the first port on your NIC, > > > > > when you specify the single PCI address and that's where the > > > > > problem is. There doesn't seem to be a way currently to > > > > > indicate to the calling application that in fact two > > > > > (or more) port IDs are associated with the one PCI address. > > > > > > We have two ports (with the same PCI address) so we should have > > > two different names. > > > Where the names passed to rte_eth_dev_get_port_by_name() come > from? > > > It is the user parameter from options:dpdk-devargs=3D0002:01:00.0, ri= ght? > > > > Yes, we're using the PCI address specified by the user in dpdk-devargs. > > > > > > > I am cc-ing DPDK users mailing list for hopefully some input. > > > > > Are there any plans for the rte_eth_dev_get_port_by_name > function > > > > > to be compatible with NICs with multiple ports under the same PCI > address? > > > > > > We cannot return two different ports for the same name. > > > There are two issues here: > > > - the input should not be the PCI address > > > - the ethdev function should look at ethdev name, not rte_device > > > one > > > > This would require the user having to "guess" the DPDK ethdev name > > which is something we'd like to avoid. >=20 > Yes, but you can provide a way to list the ports with their names > and characteristics. Ok, I see. Maybe something like this could be considered: port A =3D dpdk-devargs=3Dxx:yy:zz 0 port B =3D dpdk-devargs=3Dxx:yy:zz 1 If we detect a value after the PCI address we iterate through the rte_eth_d= ev_info (http://dpdk.org/doc/api/structrte__eth__dev__info.html) for all va= lid port IDs and assign port A to the first ethdev encountered with the pro= vided PCI address, and port B to the second, etc. If we don't detect a value, then we operate as normal. Thoughts? Thanks, Ciara >=20 > > We had the same problem using DPDK port IDs and decided not to use > > them anymore, and use the PCI instead as it took the guesswork out. > > Ethdev names and port IDs can change between tests, unlike the PCI > > address which tends to remain constant for a device. >=20 > We can add a requirement on ethdev names and make sure they remain > constant for a given port. >=20 > > > The idea is that we have only one rte_device object and we instantiat= e > > > two rte_eth_dev ports. > > > An ethdev port can be identified with its id (a number) or its unique > name. > > > Unfortunately, the user cannot guess the port id or the name set by t= he > > > PMD. > > > > Exactly. Thanks for clarifying what's going on under the hood. > > > > Ciara > > > > > > > > > Hi Adrien/Nelio, > > > > > > > > Is this something you can answer? We're wondering how to handle thi= s > in > > > > OVS and whether a temporary or long term solution is needed. > > > > > > I suggest to rely on ethdev name. > > > You will need to show to the user the mapping between the bus > information > > > (PCI id here) and the device names. > > > > > > Another alternative is to add a new function returning all ethdev por= ts > > > associated to a given rte_device resource. > > > So you would get two ports and you could pick one on the first "add- > port", > > > and the other one for the second "add-port" command. > > > It means the user would be forced to add them in the right order if h= e > > > wants a reproducible result.