From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id B09393777 for ; Thu, 17 Nov 2016 17:47:39 +0100 (CET) Received: by mail-wm0-f65.google.com with SMTP id m203so22893611wma.3 for ; Thu, 17 Nov 2016 08:47:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Z0OIQv2EHddLHHPR/aG5iX2ASM1oY998+Edadbt39W0=; b=SbIBohDtaZ5hOuw7pDPEnI9lbNHTNZ2U7o76ewzLTol77v9efZR3K9RVXIS4ciWcU7 lWK83tWDQjOsHKRp8TdXv19U8wWYPfxnEtyHUAWV8PfnZBv7mcGqFM/h9DmFmlbzkhwi U7VnKCT5dBpEOGy9O5uwbqkdVOuy3Pe+ZXxrPKOX8Ox56d8lR91m/Hf9qV9RDx6Z8zoX AaK8HmAffUO5BlnTe50MehwR+a9MH7CekrFif/gQW0PGgFIXG2A06W1HzaRMK8nR3QFt CgE8djkMcawWDjB+FcvJKNK3FbbbXW0GGSwx24EqsUJZHW/CiuYZjRN/2QwvcKRAiYR6 +1Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Z0OIQv2EHddLHHPR/aG5iX2ASM1oY998+Edadbt39W0=; b=GZUahZ+0wClsda7T6CShMjdlUzj8OPAn+TnkWkEgKIVE2Z+kZoLMopD7jWDnbL8jHa T74OTilFGbe1s6I00sKt33L9icPVXS0lfNd/13VfNsOE30E/qpwgsGg7AOjk1gRbHZ53 Nn+QkPNVYy2WMc8oiPyjZbTyAGgW/iWAgaSMndbvHBFgPJESelBgkapMMCf27QlFdF7o guUXqbK70TzZcO0WZh8Avpe/2vgjxR3LwXcekz3aY4NJTaQ5EIhfZpqBkxQuvyTio/NQ R66cr6SS6xstsuYbX6CP9M7nIl6p/b8Pc0Xlh00/+I2gNcjspQwhwMfWSnvl5EzP6g2I 1gzw== X-Gm-Message-State: ABUngveicTF69Nxki0NZm13cCppV54hMlZZZEsxfk75swtSUi098jK+u0FBIPZ265/RAz0KpMPn4xlCEILAtbw== X-Received: by 10.28.8.202 with SMTP id 193mr5024255wmi.101.1479401259363; Thu, 17 Nov 2016 08:47:39 -0800 (PST) MIME-Version: 1.0 Sender: jblunck@gmail.com Received: by 10.28.191.8 with HTTP; Thu, 17 Nov 2016 08:47:38 -0800 (PST) In-Reply-To: <5260eda3-89ed-ba1f-284e-5861bac2c724@intel.com> References: <1479392685-19608-1-git-send-email-jblunck@infradead.org> <1479392685-19608-2-git-send-email-jblunck@infradead.org> <5260eda3-89ed-ba1f-284e-5861bac2c724@intel.com> From: Jan Blunck Date: Thu, 17 Nov 2016 17:47:38 +0100 X-Google-Sender-Auth: kxpx3WtWlgB1VLsUAd9jSPdzqnM Message-ID: To: Ferruh Yigit Cc: dev@dpdk.org Content-Type: text/plain; charset=UTF-8 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 16:47:39 -0000 On Thu, Nov 17, 2016 at 4:46 PM, Ferruh Yigit 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 >> --- >> 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) >> >