From: Jan Blunck <jblunck@infradead.org>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 2/2] Move non-PCI related eth_dev initialization to rte_eth_dev_allocate()
Date: Thu, 17 Nov 2016 17:47:38 +0100 [thread overview]
Message-ID: <CALe+Z012SxJQKY8s3+7cw2HvUDB6JE-bJNRk6iFuY+s6=V=xhw@mail.gmail.com> (raw)
In-Reply-To: <5260eda3-89ed-ba1f-284e-5861bac2c724@intel.com>
On Thu, Nov 17, 2016 at 4:46 PM, Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> On 11/17/2016 2:24 PM, Jan Blunck wrote:
>> This moves the non-PCI related initialization of the link state interrupt
>> callback list and the setting of the default MTU to rte_eth_dev_allocate()
>> so that drivers only need to set non-default values.
>>
>> Signed-off-by: Jan Blunck <jblunck@infradead.org>
>> ---
>> drivers/net/bonding/rte_eth_bond_api.c | 2 --
>> drivers/net/cxgbe/cxgbe_main.c | 2 --
>> drivers/net/mlx4/mlx4.c | 2 --
>> drivers/net/mlx5/mlx5.c | 3 ---
>> drivers/net/null/rte_eth_null.c | 2 --
>> drivers/net/ring/rte_eth_ring.c | 2 --
>> drivers/net/vhost/rte_eth_vhost.c | 2 --
>> lib/librte_ether/rte_ethdev.c | 12 ++++--------
>> 8 files changed, 4 insertions(+), 23 deletions(-)
>
> I think following also redundant and can be removed:
> app/test/virtual_pmd.c:
> 604: TAILQ_INIT(&(eth_dev->link_intr_cbs));
>
> <...>
>
>> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
>> index 12af4b1..f58a995 100644
>> --- a/lib/librte_ether/rte_ethdev.c
>> +++ b/lib/librte_ether/rte_ethdev.c
>
> What do you think doing same thing for rte_cryptodev.c J
>
Thanks for the review Ferruh. I'll fixup the patches and resend. I'm
currently looking in the rte_bus and rte_eth_dev stuff. If nobody
volunteers to do the changes for cryptodev I can take a look at some
later point.
Thanks,
Jan
>> @@ -215,6 +215,10 @@ rte_eth_dev_allocate(const char *name)
>> memset(eth_dev->data, 0, sizeof(*eth_dev->data));
>> snprintf(eth_dev->data->name, sizeof(eth_dev->data->name), "%s", name);
>> eth_dev->data->port_id = port_id;
>> + eth_dev->data->rx_mbuf_alloc_failed = 0;
>
> This is no more required, because of memset
>
>> + eth_dev->data->mtu = ETHER_MTU;
>> + TAILQ_INIT(&(eth_dev->link_intr_cbs));
>> +
>> eth_dev->attached = DEV_ATTACHED;
>> eth_dev_last_created_port = port_id;
>> nb_ports++;
>> @@ -261,14 +265,6 @@ rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv,
>> eth_dev->pci_dev = pci_dev;
>> eth_dev->driver = eth_drv;
>>
>> - /* init user callbacks */
>> - TAILQ_INIT(&(eth_dev->link_intr_cbs));
>> -
>> - /*
>> - * Set the default MTU.
>> - */
>> - eth_dev->data->mtu = ETHER_MTU;
>> -
>> /* Invoke PMD device initialization function */
>> diag = (*eth_drv->eth_dev_init)(eth_dev);
>> if (diag == 0)
>>
>
next prev parent reply other threads:[~2016-11-17 16:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-17 14:24 [dpdk-dev] [PATCH 1/2] Clear eth_dev->data in rte_eth_dev_allocate() Jan Blunck
2016-11-17 14:24 ` [dpdk-dev] [PATCH 2/2] Move non-PCI related eth_dev initialization to rte_eth_dev_allocate() Jan Blunck
2016-11-17 15:46 ` Ferruh Yigit
2016-11-17 16:47 ` Jan Blunck [this message]
2016-11-17 16:05 ` [dpdk-dev] [PATCH 1/2] Clear eth_dev->data in rte_eth_dev_allocate() Ferruh Yigit
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='CALe+Z012SxJQKY8s3+7cw2HvUDB6JE-bJNRk6iFuY+s6=V=xhw@mail.gmail.com' \
--to=jblunck@infradead.org \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
/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).