From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pablo de Lara Subject: [PATCH v3 1/3] ether: Reset whole dev info structure Date: Wed, 1 Oct 2014 10:49:03 +0100 Message-ID: <1412156945-6549-2-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> To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1412156945-6549-1-git-send-email-pablo.de.lara.guarch-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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