From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 128665582 for ; Thu, 17 Nov 2016 17:05:15 +0100 (CET) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP; 17 Nov 2016 08:05:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,506,1473145200"; d="scan'208";a="32546015" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.57]) ([10.237.220.57]) by fmsmga006.fm.intel.com with ESMTP; 17 Nov 2016 08:05:07 -0800 To: Jan Blunck , dev@dpdk.org References: <1479392685-19608-1-git-send-email-jblunck@infradead.org> From: Ferruh Yigit Message-ID: <2fb871d1-979e-92e8-8af9-d96f48de18eb@intel.com> Date: Thu, 17 Nov 2016 16:05:05 +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-1-git-send-email-jblunck@infradead.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 1/2] Clear eth_dev->data in 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:05:16 -0000 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 > --- > 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)); >