All of lore.kernel.org
 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: [PATCH 1/2] ethdev: Allow to overload pci_drv.devinit and pci_drv.devuninit
Date: Wed, 3 Feb 2016 16:49:16 +0100	[thread overview]
Message-ID: <56B2217C.9030407@caviumnetworks.com> (raw)
In-Reply-To: <CALwxeUtJYxK=rvwwNkPJCs8-BLwuhBpx0HckGUJipwzv33XYuQ@mail.gmail.com>



W dniu 03.02.2016 o 15:08, David Marchand pisze:
> On Wed, Feb 3, 2016 at 12:39 PM, Kamil Rytarowski
> <krytarowski@caviumnetworks.com> wrote:
>> W dniu 03.02.2016 o 09:47, David Marchand pisze:
>>> And do your custom things in its devinit function ?
>> 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).
> Well, again, if you don't want to associate a port to this pci
> resource, why are you registering a eth_driver ?
> A eth_driver driver supposes you have a 1 - 1 relation between ethdev
> and pci resource.
In my use-case one DPDK port optionally manages more than single PCI 
resource, and these PCI resources compose single interface.

Another example of overloaded .devinit is in app/test/test_pci.c:

/*
  * PCI test
  * ========
  *
  * - Register a driver with a ``devinit()`` function.
  *
  * - Dump all PCI devices.
  *
  * - Check that the ``devinit()`` function is called at least once.
  */

With the current implementation it won't work, as .devinit callback will 
be overwritten by the internal function.

> For your case, register a pci driver, then in your pci probing
> function (.devinit), depending on what you want to do, you can either
> do nothing (?) or create one or more ethdevs (see mlx* and cxgbe
> drivers).
>
>
>

This is what I'm doing right now.

I need to initialize PCI bars and interrupts (resources) - all having 
the same PCI ID and their functionality depending upon PF configuration. 
Depending on this state, I'm making further decisions in 
DRIVER_devinit() and whether to make from it a port or a resource to 
reuse by a master port.

  reply	other threads:[~2016-02-03 15:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-02 14:27 [PATCH 1/2] ethdev: Allow to overload pci_drv.devinit and pci_drv.devuninit krytarowski
2016-02-02 14:27 ` [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 ` [PATCH 1/2] ethdev: Allow to overload pci_drv.devinit and pci_drv.devuninit David Marchand
2016-02-03 11:39   ` Kamil Rytarowski
2016-02-03 14:08     ` David Marchand
2016-02-03 15:49       ` Kamil Rytarowski [this message]
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=56B2217C.9030407@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.