On Wed, 12 Feb 2025 18:38:33 +0200 Shani Peretz <shper...@nvidia.com> wrote:
> 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. Could you give an example where this happens please? Shouldn't find_device string always be changed into canonical form in find_device handler? > 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 recive the address > to write to and the size of the pointer, in addition it will return > the size of the parsed address. This leads to more complexity than needed, the layering here is a bit of a mess already. Way too complex as it is. There is complex nesting between generic bus code, pci bus code, kvargs processing and drivers. Why does the PCI code need to be calling generic code for parse. > This will allow consistent comparisons between different representations > of same devices. Not a fan of how wide this change ends up being. Would like to keep it just to PCI.