[dpdk-dev] [PATCH 1/2] ethdev: Allow to overload pci_drv.devinit and pci_drv.devuninit

David Marchand david.marchand at 6wind.com
Wed Feb 3 09:47:32 CET 2016


Hello,

On Tue, Feb 2, 2016 at 3:27 PM,  <krytarowski at caviumnetworks.com> wrote:
> From: Kamil Rytarowski <Kamil.Rytarowski at caviumnetworks.com>
>
> This change enables drivers needing custom pci (de)initialization functions
> through the standard callback overloading.
>
> For example:
>
>  /*
>   * virtual function driver struct
>   */
>  static struct eth_driver rte_DRIVER_pmd = {
>         {
>                 .name = "rte_DRIVER_pmd",
>                 .id_table = pci_id_DRIVER_map,
>                 .drv_flags = RTE_PCI_DRV_NEED_MAPPING,
>                 .devinit = DRIVER_pci_devinit,
>         },
>         .eth_dev_init = eth_DRIVER_dev_init,
>         .dev_private_size = sizeof(struct DRIVER),
>  };
>
> Use-case is as follows: NIC offers several pci virtual functions, while
> one of them is to be treated as port, we need to configure the rest in a
> specific way for particular device for full interface (port) functionality.

Mmm, why don't you register a custom pci driver rather than a eth_driver ?
And do your custom things in its devinit function ?


-- 
David Marchand


More information about the dev mailing list