[dpdk-dev] [PATCH v2 12/12] drivers: update PMDs to use rte_driver probe and remove

Shreyansh Jain shreyansh.jain at nxp.com
Mon Dec 26 10:14:07 CET 2016


On Friday 16 December 2016 03:06 AM, Jan Blunck wrote:
> On Wed, Dec 14, 2016 at 10:49 AM, Shreyansh Jain <shreyansh.jain at nxp.com> wrote:
>> On Tuesday 13 December 2016 07:07 PM, Shreyansh Jain wrote:
>>>
>>> These callbacks now act as first layer of PCI interfaces from the Bus.
>>> Bus probe would enter the PMDs through the rte_driver->probe/remove
>>> callbacks, falling to rte_xxx_driver->probe/remove (Currently, all the
>>> drivers are rte_pci_driver).
>>>
>>> Signed-off-by: Shreyansh Jain <shreyansh.jain at nxp.com>
>>> ---
>>>  drivers/net/bnx2x/bnx2x_ethdev.c        | 8 ++++++++
>>>  drivers/net/bnxt/bnxt_ethdev.c          | 4 ++++
>>>  drivers/net/cxgbe/cxgbe_ethdev.c        | 4 ++++
>>>  drivers/net/e1000/em_ethdev.c           | 4 ++++
>>>  drivers/net/e1000/igb_ethdev.c          | 8 ++++++++
>>>  drivers/net/ena/ena_ethdev.c            | 4 ++++
>>>  drivers/net/enic/enic_ethdev.c          | 4 ++++
>>>  drivers/net/fm10k/fm10k_ethdev.c        | 4 ++++
>>>  drivers/net/i40e/i40e_ethdev.c          | 4 ++++
>>>  drivers/net/i40e/i40e_ethdev_vf.c       | 4 ++++
>>>  drivers/net/ixgbe/ixgbe_ethdev.c        | 8 ++++++++
>>>  drivers/net/mlx4/mlx4.c                 | 4 +++-
>>>  drivers/net/mlx5/mlx5.c                 | 1 +
>>>  drivers/net/nfp/nfp_net.c               | 4 ++++
>>>  drivers/net/qede/qede_ethdev.c          | 8 ++++++++
>>>  drivers/net/szedata2/rte_eth_szedata2.c | 4 ++++
>>>  drivers/net/thunderx/nicvf_ethdev.c     | 4 ++++
>>>  drivers/net/virtio/virtio_ethdev.c      | 2 ++
>>>  drivers/net/vmxnet3/vmxnet3_ethdev.c    | 4 ++++
>>>  19 files changed, 86 insertions(+), 1 deletion(-)
>>>
>> <snip>
>>
>> drivers/crypto/qat/rte_qat_cryptodev.c should also be changed for this. It
>> seems to be only PCI registered PMD. All others are VDEV.
>>
>> I will send a v3 soon to fix this.
>>
>> @Jan, would you be looking in the VDEV part or should I start with that? [1]
>>
>
> Yes, I am doing that. Will send out early next week.

Do you think following model will help you for VDEV devices?

--->8--
Each bus has following methods:
  .probe(...)
  .remove(...)
  .attach(const char *name)
  .detach(const char *name)
--->8---

Each bus, in this case VDEV bus, would implement these (attach/detach
being optional).
  - For rte_eal_dev_attach, 'attach()' of each bus would be called and
    name of the devices passed to it.
  - Bus->attach() would search for the device name (in case of PCI, BDF)
    and call appropriate initialization routine.
  - Search over bus stops as soon as any bus confirms a successful attach

This is what I was thinking for VDEV:
1. Expose the attach/detach functions in eal_common_bus
2. Define VDEV bus
3. Rather than probe/remove, VDEV implements attach/detach.
    Rationale for this is that VDEV don't really have a bus and neither
    is a probe/remove natural for them. They are 'attached'/'detached'.

Let me know if this helps.
I can provide you base patches over bus series to enable this (I have it 
ready without much testing).

>
> Thx,
> Jan
>
>> [1] http://dpdk.org/ml/archives/dev/2016-November/050443.html
>>
>

-
Shreyansh


More information about the dev mailing list