[dpdk-dev] [PATCH 7/8] ethdev: break ethernet driver and pci_driver connection

Ferruh Yigit ferruh.yigit at intel.com
Tue Jan 10 18:58:38 CET 2017


On 1/10/2017 1:59 PM, Ferruh Yigit wrote:
> On 1/7/2017 6:17 PM, Stephen Hemminger wrote:
>> There are multiple buses and device types now. Therefore it no longer
>> makes sense that PCI driver information is part of the Ethernet driver
>> structure.
>>
>> This patch removes pci_driver from eth_driver and introduces a
>> new combined structure for use in all existing PMD's. The rationale
>> is that although all existing PCI drivers are Ethernet drivers,
>> it make sense that future projects may want to support PCI devices
>> that are not Ethernet.
>>
>> It also removes the requirement that driver is first element in
>> PCI driver structure.
>>
>> Signed-off-by: Stephen Hemminger <sthemmin at microsoft.com>
>> ---
> 
> <...>
> 
>>  /**
>> + * @internal
>> + * The structure associated with a PMD PCI Ethernet driver.
>> + */
>> +struct rte_pci_eth_driver {
>> +	struct rte_pci_driver	pci_drv;	/**< Underlying PCI driver. */
>> +	struct eth_driver	eth_drv;	/**< Ethernet driver. */
>> +};
> 
> So do we need to add rte_vdev_eth_driver struct for virtual drivers, or
> need to add rte_pci_cryptodev_driver struct for pci crypto devices?
> 
> Can this be done in a more generic way? After Shreyansh's patches, there
> will be rte_device, rte_driver abstractions, can they be useful?

What do you think separating bus (pci) and functionality (eth/crypto)
driver structs, to make them less coupled. This makes combining bus /
function pairs easily.

I will send a patch as reply to this mail, it is not the complete patch,
but just to give the idea. It is based on Shreyansh's patchet.

> 
> <...>
> 



More information about the dev mailing list