From: Pablo de Lara Date: Wed, 1 Oct 2014 09:49:03 +0000 (+0100) Subject: ethdev: reset whole dev info structure before filling X-Git-Tag: spdx-start~10314 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a30268e9a2d0;p=dpdk.git ethdev: reset whole dev info structure before filling 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 Acked-by: David Marchand --- diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index b71b679e2f..6c657cf116 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -1386,10 +1386,8 @@ 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; + 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;