From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 412D37E6A for ; Wed, 1 Oct 2014 11:42:42 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 01 Oct 2014 02:49:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,631,1406617200"; d="scan'208";a="599218334" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 01 Oct 2014 02:49:17 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s919nG1P021802; Wed, 1 Oct 2014 10:49:16 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id s919nGE4006685; Wed, 1 Oct 2014 10:49:16 +0100 Received: (from pdelarax@localhost) by sivswdev02.ir.intel.com with id s919nG7Y006681; Wed, 1 Oct 2014 10:49:16 +0100 From: Pablo de Lara To: dev@dpdk.org Date: Wed, 1 Oct 2014 10:49:03 +0100 Message-Id: <1412156945-6549-2-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1412156945-6549-1-git-send-email-pablo.de.lara.guarch@intel.com> References: <1412150458-26213-1-git-send-email-pablo.de.lara.guarch@intel.com> <1412156945-6549-1-git-send-email-pablo.de.lara.guarch@intel.com> Subject: [dpdk-dev] [PATCH v3 1/3] ether: Reset whole dev info structure 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: Wed, 01 Oct 2014 09:42:43 -0000 To guarantee that RX/TX configuration structures are reseted before modifying them, plus the other dev info fields, dev info structure is zeroed beforehand. Signed-off-by: Pablo de Lara --- lib/librte_ether/rte_ethdev.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index fd1010a..3c09a23 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -1249,10 +1249,9 @@ rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info) } dev = &rte_eth_devices[port_id]; - /* Default device offload capabilities to zero */ - dev_info->rx_offload_capa = 0; - dev_info->tx_offload_capa = 0; - dev_info->if_index = 0; + /* Reset dev info structure */ + memset(dev_info, 0, sizeof(struct rte_eth_dev_info)); + FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get); (*dev->dev_ops->dev_infos_get)(dev, dev_info); dev_info->pci_dev = dev->pci_dev; -- 1.7.4.1