On 12/8/2019 7:25 PM, Alfredo Cardigliano wrote:
> 
>> On 2 Dec 2019, at 17:09, Ferruh Yigit <[email protected]
>> <mailto:[email protected]>> wrote:
>>
>>> + * There is no room in struct rte_pci_driver to keep a reference
>>> + * to the adapter, using a static list for the time being.
>>> + */
>>> +static LIST_HEAD(ionic_pci_adapters_list, ionic_adapter) 
>>> ionic_pci_adapters =
>>> +LIST_HEAD_INITIALIZER(ionic_pci_adapters);
>>
>> Why this list is used? Will holding the reference in the private data help?
> 
> A pci_dev is tied to an adapter, that can be tied to multiple LIFs (logical
> interfaces), 
> an eth_dev is created with rte_eth_dev_create for each LIF.The reason we have 
> the
> adapters list is for example to handle eth_ionic_pci_remove which is called 
> on a 
> pci_dev, thus we need to keep the adapter with the list of LIFs (eth_devs) to
> destroy
> them.

Got it, we are keeping device private data in eth_dev level, not pci_dev level,
that is why, what about to store the 'adapter' in eth_dev device private data
and in 'eth_ionic_pci_remove()' reconstruct eth_dev name ("net_%s_lif_%lu",
pci_dev->device.name, i) and get eth_dev from it. This way you can access
'adapter' without keeping specific list for it.

> 
> Btw, all other comments have been fixed, a new patch-set is coming.

Good to know, thanks.

Reply via email to