Hi, > -----Original Message----- > From: Shani Peretz <shper...@nvidia.com> > Sent: Thursday, February 6, 2025 8:09 AM > To: dev@dpdk.org > Cc: step...@networkplumber.org; Shani Peretz <shper...@nvidia.com>; > Parav Pandit <pa...@nvidia.com>; Xueming Li <xuemi...@nvidia.com>; > Nipun Gupta <nipun.gu...@amd.com>; Nikhil Agarwal > <nikhil.agar...@amd.com>; Hemant Agrawal <hemant.agra...@nxp.com>; > Sachin Saxena <sachin.sax...@nxp.com>; Xu, Rosen <rosen...@intel.com>; > Chenbo Xia <chen...@nvidia.com>; Tomasz Duszynski > <tduszyn...@marvell.com>; Chengwen Feng > <fengcheng...@huawei.com>; Long Li <lon...@microsoft.com>; Wei Hu > <w...@microsoft.com>; Richardson, Bruce <bruce.richard...@intel.com>; > Laatz, Kevin <kevin.la...@intel.com>; Tyler Retzlaff > <roret...@linux.microsoft.com>; Jan Blunck <jblu...@infradead.org> > Subject: [PATCH v5 2/4] lib: fix comparison between devices > > DPDK supports multiple formats for specifying buses, (such as "0000:08:00.0" > and "08:00.0" for PCI). > This flexibility can lead to inconsistencies when using one format while > running testpmd, then attempts to use the other format in a later command, > resulting in a failure. > > The issue arises from the find_device function, which compares the user- > provided string directly with the device->name in the rte_device structure. > 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. > > 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. > As part of the change the parse function will now return the size of the > parsed address. > > This will allow consistent comparisons between different representations of > same devices. > > In addition, fixed vdev test to use the rte_cmp_dev_name function instead > of the custom one. > > Fixes: a3ee360f4440 ("eal: add hotplug add/remove device") > > Signed-off-by: Shani Peretz <shper...@nvidia.com>
Reviewed-by: Rosen Xu <rosen...@intel.com>