From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id E8138DE0 for ; Tue, 26 Nov 2013 11:38:16 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 26 Nov 2013 02:35:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,773,1378882800"; d="scan'208";a="442097236" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by orsmga002.jf.intel.com with ESMTP; 26 Nov 2013 02:39:14 -0800 Received: from irsmsx151.ger.corp.intel.com (163.33.192.59) by IRSMSX102.ger.corp.intel.com (163.33.3.155) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 26 Nov 2013 10:38:53 +0000 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.66]) by IRSMSX151.ger.corp.intel.com ([169.254.4.126]) with mapi id 14.03.0123.003; Tue, 26 Nov 2013 10:38:53 +0000 From: "Richardson, Bruce" To: Tetsuya.Mukawa , "dev@dpdk.org" Thread-Topic: [dpdk-dev] How to know corresponding device from port number Thread-Index: AQHO6pCJMQM0WY5u70qJVbeTGrIi6Jo3UHkw Date: Tue, 26 Nov 2013 10:38:53 +0000 Message-ID: <59AF69C657FD0841A61C55336867B5B01A9778E3@IRSMSX103.ger.corp.intel.com> References: <529474D5.80306@igel.co.jp> In-Reply-To: <529474D5.80306@igel.co.jp> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] How to know corresponding device from port number X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Nov 2013 10:38:17 -0000 >=20 > Hi, >=20 > I have a question about how to know corresponding device from port > number. > For example, if I have 4 Ethernet devices and 2 Ring PMDs, I will get 6 p= orts > during initialization. > In the case, how can I know which port corresponds last Ring PMD? [BR] Firstly, to identify the ring PMD's vs the ethernet device PMDs you ca= n use the information in the rte_eth_dev structure. For each device x, (0 <= =3D x <=3D5), if you check rte_eth_devices[x], the ring pmd's will have a N= ULL driver pointer and the pci address given in the pci_dev structure will = be all-zeros. As for distinguishing two different ring ethdevs from each other, I'm not a= ware of any way to do this, they will just have different eth_dev indexes.