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 8CA0446128; Wed, 29 Jan 2025 19:06:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1D0114026F; Wed, 29 Jan 2025 19:06:17 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by mails.dpdk.org (Postfix) with ESMTP id 7510240156 for ; Wed, 29 Jan 2025 19:06:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738173976; x=1769709976; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=3XuhRvV2IMqLUDwRmqmL7i9zVA3tOVczNZn6jme9kvY=; b=UOPGLVhOT6lP0QOvORqSPSc9jYqp29P06mhUZ8bp9B4ptFCOg0767p48 zrqd63yHiHh4ByovEDkqFIg+PPwVAAoIeINdMTJKRbb7CgIOuS1IEfkcI 0JElDDfw82kuKI5eHyDRNVxXkYDidm+98xLDqbvBpeNOEOcJpsFlWbODA fN3hMcdp3x9jB/45eLhUFYliT0XDjwBrTGJdoTdoVK4WhxLfk7aStBko7 LKCKBCvtxLvMNc1JJq9qvh3XjuLgFYqaNUIbtYfrUrqQNHWIfzBliUZgq 41R6Q/4GldfvcUvJfYnyalK0KPNhdrWwV6sM9augzmwRzCtQ15YDL1cdL Q==; X-CSE-ConnectionGUID: c2oCw9zCSmyxvrm4IJN83g== X-CSE-MsgGUID: 1oT+neyCS+y2DvfMSZia+Q== X-IronPort-AV: E=McAfee;i="6700,10204,11330"; a="64064575" X-IronPort-AV: E=Sophos;i="6.13,244,1732608000"; d="scan'208";a="64064575" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jan 2025 10:06:14 -0800 X-CSE-ConnectionGUID: p5eT1XDpTWuLOl0/xtgJbg== X-CSE-MsgGUID: Ta3FjgbhTKqRydTPyF9pYg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="109552299" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orviesa007.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 29 Jan 2025 10:06:14 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44; Wed, 29 Jan 2025 10:06:13 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) 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.44 via Frontend Transport; Wed, 29 Jan 2025 10:06:13 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.46) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.44; Wed, 29 Jan 2025 10:06:13 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=J1VzF/NhMxTbHWjVXarlZbSK73hBwCinwlmVODS8996VhMDKIF0MHWdh5y1ULeSdr9zujzUUAGxfL81ZhrLTOkargPPj10HI0HBGmqPRxthhSg4x4FRjTxCPdgV7EGYseVve0c18fWfE7eHNTh+SOJvzd0cM9naeZrGHlNDofZIl/qrwznTEFfaMEoyFC+5DoQAMrP8sA9AYrgaq4VIwWo+OutBG3lQ8vJ1hM3XBVTYTFwcj7Eeu+6Z8W7QzmTfif5075Uh42nLfFD52facU0xB1+uwmiHoYvqk7FiN27Jw+VX4UBIpCyiIzWCvE2wgYTZi8P3zgikquI57/z9l4GA== 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=MtFTdnGAv3TbdFyH6ZuunAf6DX8H51O/Qr5thC0LJG8=; b=FV3AlZNg3llpmTGEuB9003l4LU2Rit7zesUVSXAli/pHG1QvooiU01t2eMwFRjbpV46kk+0SArt+GqnrL+10TgF1ZeUbl/EdU/8QtAD+KHOx7ZjyITaCQNy1Q6QTqtt2HyjVjmKu8dNEnHSTKFnjPZBE7FCVh+YLd530S3YGnTFCoePWelLE2XY0uxPtdala8nEP28wvp5i7qDnv4kUTuW+XCEwqrrS4F9SnD9gvWPK8poxYggAX48Dx2csg1XOmSszTx7gHMBRlcryAhFiOT0N1D/b8S7yoWRDlyB/HDsyXssfoUXxdNLnpSULflPpZl1GDlNXOfc+fF160bnkomQ== 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 CY5PR11MB6512.namprd11.prod.outlook.com (2603:10b6:930:40::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8398.18; Wed, 29 Jan 2025 18:06:10 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b%5]) with mapi id 15.20.8377.021; Wed, 29 Jan 2025 18:06:10 +0000 Date: Wed, 29 Jan 2025 18:06:03 +0000 From: Bruce Richardson To: Stephen Hemminger CC: Shani Peretz , , , Tyler Retzlaff , Parav Pandit , Xueming Li , Nipun Gupta , Nikhil Agarwal , "Hemant Agrawal" , Sachin Saxena , Rosen Xu , Chenbo Xia , "Tomasz Duszynski" , Chengwen Feng , Long Li , Wei Hu , Kevin Laatz , Jan Blunck Subject: Re: [PATCH v4] bus: fix inconsistent representation of PCI numbers Message-ID: References: <20240708165145.1405107-1-shperetz@nvidia.com> <20250129085416.226718-1-shperetz@nvidia.com> <20250129091738.681777f1@hermes.local> Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20250129091738.681777f1@hermes.local> X-ClientProxiedBy: DU7P190CA0011.EURP190.PROD.OUTLOOK.COM (2603:10a6:10:550::28) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|CY5PR11MB6512:EE_ X-MS-Office365-Filtering-Correlation-Id: 156581a7-a058-4e37-ca19-08dd408f9c26 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|7416014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?YmFvR3FtcS9uY2c3M294a3ZiZVIwTkEzbkV6RjJzMlY5WGw0MEJGR2l6TG5C?= =?utf-8?B?MEZ3M3BCUUk3bTlhdU9LQWdaRnVHdnNMejZOSExJM1o4bGZMcUlJSEVHOUJu?= =?utf-8?B?UjBBV0NhcExVUXdOUElaei9mVS9SRHhaQ3BkOGNQMmVXeDVVck5wQnNTQ2c5?= =?utf-8?B?aEw4T3QzOHduaEx4WFZoazF5SktKaVlWZXNFWVVaeUZXcjRBYmc0YXF1b3FH?= =?utf-8?B?MGNGYkFjelFNVU9aN0ZuMUhSK25wckVSRW5WcG5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Hoxb242SDBUM3JqR0JpZ2tENkZFZ3gzaEtHZEE5a01jaGdtVFI2NXpY?= =?utf-8?B?bjVkS2Q0UHhJYXZVYWhGWlFTS3AzMjZVSHZaSFd3YXV5UkUvQWhYMlBmRTgw?= =?utf-8?B?b1JOR0d5Y0Ntd1c0Y05teEhCSllMcmJwNWgrRzBucFRTelV5eC9pQTE1TVkv?= =?utf-8?B?NDdDUEQ4K3FLcy9DdTR0OFRtOGs4M3gxQ29wU2E1elhIVFBXdVFjOU4yUGR3?= =?utf-8?B?U3laSjN6cGNDbE1UQjUzVG95b05peUV2RjF6VnRsK0JyMXQvK1Mzam5laGQz?= =?utf-8?B?Qm5NVnRVTFo4TEEwaW03M3EzY05mbnF4dU5STlR6RUR2OUhINGlVTEY4dEpD?= =?utf-8?B?eEEwTUNnckFTMWZROFBzRW5Db1NKcW81aXpuUk5VdGRuNmFGamNJU050UWpl?= =?utf-8?B?bG5BM3JvZHBBYUIyZjh4OXY3T1c4djZhTDVBbGxaNkttRUYxdW9oR3NYaDlz?= =?utf-8?B?OFozYXpzVFdrR2toLzBUMVM1MDg3U2paenowakFvZWoxWjE4dTRsbkhIdEF2?= =?utf-8?B?R0JVMzlGcnUrZFFpZXgwNXdTNjJoNUkzZnBtTnRSZ05WYXppNXpyaFNyUWtV?= =?utf-8?B?cy92anZsaGRkRVZaMS9Na0hieWIycU5Cczg4SHkxZElTeDBXamhsZzZVRDEx?= =?utf-8?B?ZzVlOFdtSTZVRWN1anBhdz09?= 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)(1800799024)(366016)(376014)(7416014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?azdqa3RYN3AwckFNS2cxTHYzcjF6ZXdBekVlSTZHV0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3NGMENqL3FtNERCc2U0N0VsNllwYTFIODRsUjVXWmdJbHA2Q3pNYUd5RFNy?= =?utf-8?B?VkZYMWt0ekdLMkRsbTlkUytVelF1eVN0OFBTbkF6cTBMUkRKMTd4cmp5dElq?= =?utf-8?B?eE1vNk9YUkNqaG45NGRpdjFSL2RrSFMzZW9EZkdIdStZZisyYTNqaFhGQXR1?= =?utf-8?B?YmZlaXR0VXhNTDZ1R3BRRmpWMDhKbjFkUEpsWkpGSzgwbDF5MmpiekE2dG1i?= =?utf-8?B?YXUxZDl5ODlrMFYzWWpwd1c2UEorWTkyamRaTFRjNFhsS3Fxenp2OFhSRFR3?= =?utf-8?B?c1ZuVko3NTM2cVliMWlHVktMUERtci9TZjl6QUVXZm5Wbng1Umh3bHF0clhk?= =?utf-8?B?dVE9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 156581a7-a058-4e37-ca19-08dd408f9c26 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2025 18:06:10.2313 (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: NkvDaBECquVttxrUzBNXNu6CtT0pylPjbuBUTnVBhNr3O4yaRqLHGrRk5HCRg4aVHczIunIxfpxg73MLuJvwkCXHEI/SftJ7UuAaoDIHgEg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR11MB6512 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 Wed, Jan 29, 2025 at 09:17:38AM -0800, Stephen Hemminger wrote: > On Wed, 29 Jan 2025 10:54:16 +0200 > Shani Peretz wrote: > > > DPDK provides two formats for specifying PCI device numbers: > > a full version ("0000:08:00.0") and a short version ("08:00.0"). > > Issues can occur when an application uses one format (e.g., short) > > while running testpmd, then attempts to use the other format > > (e.g., full) in a later command, resulting in a failure. > > > > The issue is that find_device goes over the list of devices and > > compares the user-provided string to the rte_device structure's > > device->name (device->name is just the string received from devargs > > (i.e "08:00.0" or "0000:08:00.0")). > > Notice that there's another field that represents the device name, > > but this one is in the rte_pci_bus struct. This name is actually the result > > of the PCI parse function ("0000:08:00.0"). > > If we want to accurately compare these names, we'll need to bring both > > sides to the same representation by invoking the parse function on > > the user input. > > > > To make the cmp_dev_name function applicable to all buses—not just PCI— > > the proposed solution is to utilize the parse function implemented by > > each bus. When comparing names, we will call parse on the supplied > > string as well as on the device name itself and compare the results. > > This will allow consistent comparisons between different representations > > of same devices. > > > > Also, the pci_common_set function has been modified to improve naming > > consistency for PCI buses. > > Now, the name stored in rte_device for PCI buses will match the parsed > > name that is also stored in rte_pci_device name, > > rather than using the user-provided string from devargs. > > As a result, when a new PCI device is registered, the name displayed in > > the device list will be the parsed version. > > > > Added tests that compare and find devices in various forms of names > > under test_devargs. > > > > Fixes: a3ee360f4440 ("eal: add hotplug add/remove device") > > Maybe just fix for now by normalizing the PCI device string when before > storing and after parsing? That would allow for simple fix that can be backported. > The more complex generalization of bus address is too much to go to stable branch. One idea for backport, perhaps? https://patches.dpdk.org/project/dpdk/patch/20241119155723.2307189-1-bruce.richardson@intel.com/