From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id EF2F4558A for ; Thu, 17 Nov 2016 16:46:42 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 17 Nov 2016 07:46:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,506,1473145200"; d="scan'208";a="787626755" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.57]) ([10.237.220.57]) by FMSMGA003.fm.intel.com with ESMTP; 17 Nov 2016 07:46:29 -0800 To: Jan Blunck , dev@dpdk.org References: <1479392685-19608-1-git-send-email-jblunck@infradead.org> <1479392685-19608-2-git-send-email-jblunck@infradead.org> From: Ferruh Yigit Message-ID: <5260eda3-89ed-ba1f-284e-5861bac2c724@intel.com> Date: Thu, 17 Nov 2016 15:46:28 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1479392685-19608-2-git-send-email-jblunck@infradead.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 2/2] Move non-PCI related eth_dev initialization to rte_eth_dev_allocate() X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2016 15:46:43 -0000 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 > --- > 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 > @@ -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) >