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 475E4456F3; Tue, 30 Jul 2024 10:56:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3474840261; Tue, 30 Jul 2024 10:56:29 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by mails.dpdk.org (Postfix) with ESMTP id 1C64240041 for ; Tue, 30 Jul 2024 10:15:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1722327324; x=1753863324; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=9suVaEOqgD8zZjm3Uc1XyVXIYfAzN2Mij9YUJfWeLHA=; b=nNLY96qorje4531BEcd7/67atgvzomYFdzh6N6OA0UuX4t7yCtDadpjC 5bAtC8w2R9H+jDZpe7MxPYQo00LL5+swG+Y0pGvRJ0jov9w+wRSyn0mRl J31Ivur2V4/wwKLEBwhnM9+wAKjrInLZttyQT4kLl2Sxs15b/exwR0m7j NaY7WLV2MwGjP4FjAzdOgtAgDMAvHf4vfuS9GghySJw/NidnM+252kEas ++20coCaL34x3KTvU6xG2toIsnAkKytlurhgbUKgO50osuj7IAkjgc2Qu h7AMYqElF4nnf1nUJEMXKH1d+K6CbP1eJmiOsElA+oWin+GJQ8fWOmXBW g==; X-CSE-ConnectionGUID: hSeOTMYXSmSvYI0J/Hp6TA== X-CSE-MsgGUID: iJza6uTeSYySAjLVYVJdWQ== X-IronPort-AV: E=McAfee;i="6700,10204,11148"; a="37637922" X-IronPort-AV: E=Sophos;i="6.09,248,1716274800"; d="scan'208";a="37637922" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2024 01:15:19 -0700 X-CSE-ConnectionGUID: i9NaY97SRyaKG4S/MD8OEQ== X-CSE-MsgGUID: lZv3I8lqSTmLWHbotoALNw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,248,1716274800"; d="scan'208";a="85212680" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmviesa001.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 30 Jul 2024 01:15:19 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 30 Jul 2024 01:15:18 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 30 Jul 2024 01:15:17 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Tue, 30 Jul 2024 01:15:17 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.41) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 30 Jul 2024 01:15:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YGqxDeO4oGn5qPuM4hEedY0TDKlvuC4+UxeDggXH/UN+vsnV8NhhLjUysSDo6Yqu0ulT07tlG0u036k3TvcntnwynkNkDvmE+p4kJCm//4MPAyzeQGsdl0bK+mw21Qx28QL+qSbeDitTafVGPiyvQa3AdO7gE2FG84lRNTBJf8TzBu0eI2HEh5YfT258ehM45eT/tnVOAnHlEJyYXe3Lm8wG75yXJAi1sPwYSI4wQ2urUOW04WkFb65VMEtZgrxfrJID85IBqpaPd/gxZw7iskwxFRuOw3u2PHqItSS22MI9th+vnbWp/U4kfwStaMskPbUOaOe4LTgHBjch19b5Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NMVv9oQ9AUdLQvS6nHWFv3VXNdWBNIbPnbZyIlgkT9Y=; b=UqfOJRhVABun0ODBSSXI306sCgiEP8izCCDh3S3+5Zep5r2HeO3fNBYrC0+jtGffDFzTRFbCb3EI2bMAXQDIg70Keo+/IlUL4+oH4I72TrWTQ57L7AEOF4a3fliZR2wRHRdjwqEctNOAK2iNM0CGfxYpoNr1D9hH/nFJOPmHBs3P0YwGIqvBBDyFnODOt4b7SoF1DpHbmXD/NMrPafb2vjwLA6Z5sVygVbnIgCywUDsZw8jwaX2Auzn88fY/l4YRM/hX4V2tX31WTvpYrZfjtUaowMum9yD3BZIBSiGY+RXBsdDt2z71HqI//AlZZqLK7ERcSJPzStQFMPCof0I2tQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by SN7PR11MB7017.namprd11.prod.outlook.com (2603:10b6:806:2ac::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.27; Tue, 30 Jul 2024 08:15:15 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b%2]) with mapi id 15.20.7807.026; Tue, 30 Jul 2024 08:15:15 +0000 Date: Tue, 30 Jul 2024 09:15:09 +0100 From: Bruce Richardson To: Prashant Upadhyaya CC: Dmitry Kozlyuk , Subject: Re: Regarding port numbers assigned by DPDK for PCI devices Message-ID: References: <20240729204329.58b888fe@sovereign> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: DUZPR01CA0045.eurprd01.prod.exchangelabs.com (2603:10a6:10:468::20) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|SN7PR11MB7017:EE_ X-MS-Office365-Filtering-Correlation-Id: 4cbb79ea-c46d-4ccb-6629-08dcb06fbde0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?fYSM3SVg91nSCrkIPA0eFWAHAxDGKQyf9daZ2ftuXYwfTDvSQcXZDZiyPyuO?= =?us-ascii?Q?uDL3PCDrUzSuW2JAXp6v9QtgvU0hUHdrBAiWrwony+x0/IS+Xx7kZAKiVKTh?= =?us-ascii?Q?bcEXA67/Gf1xncuHzT0NzHC+gDbCH2ob6SVmcG6hUGQV7UvcnX4uA7ofY78J?= =?us-ascii?Q?X5G0/Hv8L5r5ulQTflxY5I+EO46aEUGy/VT5aViaFG4qqfv3ERhHOXnhkQa3?= =?us-ascii?Q?jpqhbvSRE+jKc+PoyD5/MhMBi+l3fH0MCN6okP5qHRbJsasFP0zWB7UelXx2?= =?us-ascii?Q?h21VRyQZCI6pb6OniOV/64JGbNoe540dGoCV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8qbrpVaUZ2orvj8w8VmB92eIjPiCEd1RDuQWRkJGAaniJU/NX8R?= =?us-ascii?Q?atfqo7q6hOa6ISlpkLN+6EQwTTU3+HPaX5LCsab8uThCRYMgDv10rFdhG3mX?= =?us-ascii?Q?BYUYZvbqZH7QDdZR4Y4czkzcEZwt9I3SfW5crICitte2jg=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?MYtS5qz7hbx65CN4ubtjewDavGQka9vPMNT+Jl+2HLcNWvwnXkw7TzaI0gZb?= =?us-ascii?Q?zmZyR5ZGSHJh8IIJ8J5BQz2QYku7qt2W6U5fcEZZJSxfQXJFHtF61ZGLQ7Ex?= =?us-ascii?Q?q+Sz+RyK9Jz6qucZ9Y1KRML3y/MX4cuP09kfBgxTOpBmxRvxYGB7GtwmwBMb?= =?us-ascii?Q?vh2lEGi/NccTvLuAp5tfcBunUj8UkN6pimc2udf/Qczv6KWOMxaSTnYtbybD?= =?us-ascii?Q?fDGWHohJa16DGPtQolkBH4Pfu/DEhkMvNfYYPrJj5vKj1t65Mn610WmlrrTW?= =?us-ascii?Q?lBMImECW841y8AB3SXinZ1dSms/dgT/mdP8yVVuNeRE1xLIxoPIJzMxnxkq2?= =?us-ascii?Q?ADsyQL6ADOlq+FLbaQLSOCYlAHyqOqtewUMIPQl1elwb+2sCx1ABAxSUEpUb?= =?us-ascii?Q?h+WL2e0GM4QyqRLI9JiAi2v+opqyfJ5I0H5SEzrPw++fEzwgjGvGdOXMx24j?= =?us-ascii?Q?yFXd4gh8YhBG69CLf5j/K516s3Po9/q7uhJVrRdOG7RNk/OxAdPhLBcNCxIW?= =?us-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bWbggawrlg28lw5Jb?= =?us-ascii?Q?cB+uWEW56YovE0cvNE5Aulsi69TwrvEW0JJloKO9AVL2VtqUUiy5MvvYBJsp?= =?us-ascii?Q?+VkHf8HXVIHxfPxg8Q5VOrjavrjvkOpxZPbHCQuvN2oN4iMDudvMUxg4bY8c?= =?us-ascii?Q?cG7AmkSKaR4rGq/S3fi1xvwOI6ardK69IZWIauR9oUhzck2VZ/Q09xHuaAPm?= =?us-ascii?Q?Xg=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 4cbb79ea-c46d-4ccb-6629-08dcb06fbde0 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2024 08:15:15.5151 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ypLeudXDYD+9oS4lUX4P/GXUrGDKSALk10267FIEm2Km1WicqPOPMcVb7aHQFBlv6hnpAp/1aGgYDTUNMJ/HF3v0O9OKNrzlZLKhTVjQMDo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7017 X-OriginatorOrg: intel.com 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 On Tue, Jul 30, 2024 at 11:06:56AM +0530, Prashant Upadhyaya wrote: > On Mon, 29 Jul 2024 at 23:13, Dmitry Kozlyuk > <[1]dmitry.kozliuk@gmail.com> wrote: > > 2024-07-29 22:18 (UTC+0530), Prashant Upadhyaya: > > Hi, > > > > I have 4 ethernet interfaces available as PCI devices. > > The PCI addresses are known. > > When I start my DPDK application, it starts up properly and > assigns the > > port numbers to them as 0, 1, 2, 3 expectedly. > > > > However, is there a way I can force that a particular PCI address > should be > > identified as port 0 by DPDK, another one as port 1 and so forth ? > > Does passing the arguments like -a -a to > rte_eal_init > > ensure that, or is there any other way, or is there no way ? > > > > I am on 24.03 > > > > Regards > > -Prashant > Hi, > Why do you need specific port numbers assigned to devices? > If you're going to use devices for different purposes, > you'd better have an application-level configuration > to specify PCI addresses to use for each purpose. > Iterate devices to match the address and find the port number. > It is also possible to disable automatic probing with "-a 0:0.0", > then to use rte_dev_probe() + rte_dev_event_callback_register() > to add devices and to get their port numbers. > However, this API, strictly speaking, does not guarantee > that the numbers will be assigned sequentially. > One advantage of using hot-plug is that you can build devargs > from within the application (or from configuration). > Refer to "rte_dev.h" in any case. > Multiple "-a" don't work the way you've described. > > Thanks Dmitry. Ok, so if I have the port number with me, and I know it > corresponds to a PCI device, how do I find out the PCI address of this > device corresponding to this port number. I believe I can > do rte_eth_dev_info_get to get the struct rte_eth_dev_info and from > there the rte_device, but what after that ? I saw some references > to RTE_DEV_TO_PCI but that macro isn't available for compilation after > DPDK is installed as it is an internal header file and thus not a macro > for application usage and wouldn't compile at application level. > Regards > -Prashant > The PCI device id is used as the device name in that case so rte_dev_name should get you what you want. I'd also +1 the suggestion of having your app hotplug in the devices post-init, if you want specific devices to have specific ids. Although it is not guaranteed, DPDK does currently assign the ids sequentially. I've used this approach myself in the past in some test apps where I wanted ports in a particular sequence. /Bruce