From: Shreyansh Jain <shreyansh.jain@nxp.com>
To: Jianbo Liu <jianbo.liu@linaro.org>
Cc: David Marchand <david.marchand@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] Clarification for eth_driver changes
Date: Thu, 10 Nov 2016 14:08:38 +0530 [thread overview]
Message-ID: <d6bad754-4ea5-d00b-099f-184836844e11@nxp.com> (raw)
In-Reply-To: <CAP4Qi3_abM_c72itz7v-YXLW-F3E1Tk2Tuy8uZ5_=7Zk_kdFeQ@mail.gmail.com>
On Thursday 10 November 2016 01:21 PM, Jianbo Liu wrote:
> On 10 November 2016 at 15:26, Shreyansh Jain <shreyansh.jain@nxp.com> wrote:
>> Hello David, list,
>>
>> I need some help and clarification regarding some changes I am doing to
>> cleanup the EAL code.
>>
>> There are some changes which should be done for eth_driver/rte_eth_device
>> structures:
>>
>> 1. most obvious, eth_driver should be renamed to rte_eth_driver.
>> 2. eth_driver currently has rte_pci_driver embedded in it
>> - there can be ethernet devices which are _not_ PCI
>> - in which case, this structure should be removed.
>> 3. Similarly, rte_eth_dev has rte_pci_device which should be replaced with
>> rte_device.
>>
>> This is what the current outline of eth_driver is:
>>
>> +------------------------+
>> | eth_driver |
>> | +---------------------+|
>> | | rte_pci_driver ||
>> | | +------------------+||
>> | | | rte_driver |||
>> | | | name[] |||
>> | | | ... |||
>> | | +------------------+||
>> | | .probe ||
>> | | .remove ||
>> | | ... ||
>> | +---------------------+|
>> | .eth_dev_init |
>> | .eth_dev_uninit |
>> +------------------------+
>>
>> This is what I was thinking:
>>
>> +---------------------+ +----------------------+
>> | rte_pci_driver | |eth_driver |
>> | +------------------+| _|_struct rte_driver *p |
>> | | rte_driver <-------/ | .eth_dev_init |
>> | | ... || | .eth_dev_uninit |
>> | | name || +----------------------+
>> | | <more> ||
>> | +------------------+|
>> | <PCI specific info>|
>> +---------------------+
>>
>> ::Impact::
>> Various drivers use the rte_pci_driver embedded in the eth_driver object for
>> device initialization.
>> == They assume that rte_pci_driver is directly embedded and hence simply
>> dereference.
>> == e.g. eth_igb_dev_init() in drivers/net/e1000/igb_ethdev.c file
>>
>> With the above change, such drivers would have to access rte_driver and then
>> perform container_of to obtain their respective rte_xxx_driver.
>> == this would be useful in case there is a non-PCI driver
>>
>> ::Problem::
>> I am not sure of reason as to why eth_driver embedded rte_pci_driver in
>> first place - other than a convenient way to define it before PCI driver
>> registration.
>>
>> As all the existing PMDs are impacted - am I missing something here in
>> making the above change?
>>
>
> How do you know eth_driver->p is pointing to a rte_pci_driver or rte_soc_driver?
> Maybe you need to add a type/flag in rte_driver.
My take: PMD implementation would specify this - similar to how it is
done now. A PCI PMD would perform a container_of(rte_pci_driver,...).
I don't think we need a differentiation here - primarily because
generic doesn't handle the eth_driver.
>
>> Probably, similar is the case for rte_eth_dev.
>>
>> -
>> Shreyansh
>
--
-
Shreyansh
next prev parent reply other threads:[~2016-11-10 8:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-10 7:26 Shreyansh Jain
2016-11-10 7:51 ` Jianbo Liu
2016-11-10 8:03 ` Thomas Monjalon
2016-11-10 8:42 ` Shreyansh Jain
2016-11-10 8:58 ` Thomas Monjalon
2016-11-10 9:20 ` Jianbo Liu
2016-11-10 10:51 ` Stephen Hemminger
2016-11-10 11:07 ` Thomas Monjalon
2016-11-10 11:09 ` Shreyansh Jain
2016-11-10 8:38 ` Shreyansh Jain [this message]
2016-11-10 8:16 ` David Marchand
2016-11-10 11:05 ` Shreyansh Jain
2016-11-11 19:16 ` Ferruh Yigit
2016-11-12 17:44 ` Shreyansh Jain
2016-11-14 17:38 ` Ferruh Yigit
2016-11-16 5:09 ` Shreyansh Jain
2016-11-14 9:07 ` David Marchand
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=d6bad754-4ea5-d00b-099f-184836844e11@nxp.com \
--to=shreyansh.jain@nxp.com \
--cc=david.marchand@6wind.com \
--cc=dev@dpdk.org \
--cc=jianbo.liu@linaro.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).