DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Jan Blunck <jblunck@infradead.org>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 1/2] Clear eth_dev->data in rte_eth_dev_allocate()
Date: Thu, 17 Nov 2016 16:05:05 +0000	[thread overview]
Message-ID: <2fb871d1-979e-92e8-8af9-d96f48de18eb@intel.com> (raw)
In-Reply-To: <1479392685-19608-1-git-send-email-jblunck@infradead.org>

On 11/17/2016 2:24 PM, Jan Blunck wrote:
> Lets clear the eth_dev->data when allocating a new rte_eth_dev so that
> drivers only need to set non-zero values.
> 
> Signed-off-by: Jan Blunck <jblunck@infradead.org>
> ---
>  drivers/net/mlx4/mlx4.c       | 1 -
>  drivers/net/mlx5/mlx5.c       | 1 -
>  lib/librte_ether/rte_ethdev.c | 2 +-

+ drivers/net/bonding/rte_eth_bond_api.c ?

-       eth_dev->data->dev_link.link_status = ETH_LINK_DOWN;
-
...
-       eth_dev->data->dev_started = 0;
-       eth_dev->data->promiscuous = 0;
-       eth_dev->data->scattered_rx = 0;
-       eth_dev->data->all_multicast = 0;
-

+ drivers/net/mpipe/mpipe_tilegx.c ?

-       eth_dev->data->dev_flags = 0;


<...>

> @@ -212,6 +212,7 @@ rte_eth_dev_allocate(const char *name)
>  
>  	eth_dev = &rte_eth_devices[port_id];
>  	eth_dev->data = &rte_eth_dev_data[port_id];
> +	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->attached = DEV_ATTACHED;
> @@ -259,7 +260,6 @@ rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv,
>  	}
>  	eth_dev->pci_dev = pci_dev;
>  	eth_dev->driver = eth_drv;
> -	eth_dev->data->rx_mbuf_alloc_failed = 0;
>  
>  	/* init user callbacks */
>  	TAILQ_INIT(&(eth_dev->link_intr_cbs));
> 

      parent reply	other threads:[~2016-11-17 16:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-17 14:24 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
2016-11-17 16:05 ` Ferruh Yigit [this message]

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=2fb871d1-979e-92e8-8af9-d96f48de18eb@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=jblunck@infradead.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).