[dpdk-dev,v3,1/3] ether: Reset whole dev info structure
Commit Message
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 <pablo.de.lara.guarch@intel.com>
---
lib/librte_ether/rte_ethdev.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
Comments
2014-10-01 10:49, Pablo de Lara:
> + /* Reset dev info structure */
> + memset(dev_info, 0, sizeof(struct rte_eth_dev_info));
It's typically the kind of situation where a comment is not needed :)
@@ -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;