[dpdk-dev] [PATCH 2/2] drivers/net: use device name from device structure

Jan Blunck jblunck at infradead.org
Sat Jun 10 09:35:47 CEST 2017


On Fri, Jun 9, 2017 at 3:52 PM, Thomas Monjalon <thomas at monjalon.net> wrote:
> 26/05/2017 18:11, Ferruh Yigit:
>> Device name resides in two different locations, in rte_device->name and
>> in ethernet device private data.
>
> Yes would be nice to remove the name from rte_eth_dev_data.
>

I wonder if this is really the right thing to do. The name in the
eth_dev data is the eth_dev device name and it might be different from
the low-level device name. Some busses might use UUID as the device
identifier and I don't believe that this is a user friendly name.

>> For now, the copy in the ethernet device private data is required for
>> multi process support, the name is the how secondary process finds about
>> primary process device.
>
> Yes it is in rte_eth_dev_attach_secondary().
> This secondary process forces us to write ugly data structures.
>
>> But for drivers there is no reason to use the copy in the ethernet
>> device private data.
>
> Yes I agree.

Probably. But it also depends on at what stage the driver is using the
name and what information is printed. During probing I would expect
the low-level device name to be printed. After probing the eth_dev PMD
should use the user friendly device name.

> There are probably other places where we can avoid using this field.
> I see rte_eth_dev_get_name_by_port() and rte_eth_dev_get_port_by_name()
> using rte_eth_dev_data[port].name.
>
>> This patch updates PMDs to use only rte_device->name.
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
>


More information about the dev mailing list