DPDK patches and discussions
 help / color / mirror / Atom feed
From: Kamil Rytarowski <krytarowski@caviumnetworks.com>
To: David Marchand <david.marchand@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/2] ethdev: Allow to overload pci_drv.devinit and pci_drv.devuninit
Date: Wed, 3 Feb 2016 12:39:55 +0100	[thread overview]
Message-ID: <56B1E70B.4070607@caviumnetworks.com> (raw)
In-Reply-To: <CALwxeUuFRikTY_aqrR1M0SZ9JuzXxP3gmoYHb6tSPPx=YXUrqA@mail.gmail.com>



W dniu 03.02.2016 o 09:47, David Marchand pisze:
> Hello,
Hello,

> On Tue, Feb 2, 2016 at 3:27 PM,  <krytarowski@caviumnetworks.com> wrote:
>> From: Kamil Rytarowski <Kamil.Rytarowski@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 ?
Both Virtual Functions are of eth_driver type and they share the same 
PCI ID.

They are like 2 (or more) NIC devices working in tandem (it's not 
bonding), with a possibility to join into a single one and offer 
additional functionality. In that case one is master and the other is 
donor of functionality, like additional queue sets.

> And do your custom things in its devinit function ?
>
>
Yes, I'm doing custom things.

I'm requesting from PF the mode of the device to be initialized. This 
part is handled dynamically and depends of the current configuration in PF.

In my use-case there are two device types: primary (master) and 
secondary (slave). For the primary VF I'm creating a DPDK port normally, 
for secondary I retain configured PCI device for further reuse (and 
there is no port created).

I cannot overload functions called after .devinit() as the secondary 
devices will be wrongly treated like a DPDK port.


My use-case doesn't need modified API to be functional.

The missing handling of overloaded .devinit and .devuninit looks like a 
bug - there is API for it, but it will keep overwriting the pointers 
with local functions (rte_eth_dev_init(), rte_eth_dev_uninit()).

  reply	other threads:[~2016-02-03 11:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-02 14:27 krytarowski
2016-02-02 14:27 ` [dpdk-dev] [PATCH 2/2] ethdev: Export rte_eth_dev_create_unique_device_name() to public API krytarowski
2016-02-11 16:56   ` Panu Matilainen
2016-02-11 17:15     ` David Marchand
2016-02-03  8:47 ` [dpdk-dev] [PATCH 1/2] ethdev: Allow to overload pci_drv.devinit and pci_drv.devuninit David Marchand
2016-02-03 11:39   ` Kamil Rytarowski [this message]
2016-02-03 14:08     ` David Marchand
2016-02-03 15:49       ` Kamil Rytarowski
2016-02-03 15:59         ` Kamil Rytarowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56B1E70B.4070607@caviumnetworks.com \
    --to=krytarowski@caviumnetworks.com \
    --cc=david.marchand@6wind.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).