256 ports in dpdk. All ethdev APIs which have port_id as parameter are changed
in the meantime.
+* **Modified the return type of rte_eth_stats_reset.**
+
+ Changed return type of ``rte_eth_stats_reset`` from ``void`` to ``int``
+ so the caller may know whether a device supports the operation or not
+ and if the operation was carried out.
+
* **Added a new driver for Marvell Armada 7k/8k devices.**
Added the new mrvl net driver for Marvell Armada 7k/8k devices. See the
return 0;
}
-void
+int
rte_eth_stats_reset(uint16_t port_id)
{
struct rte_eth_dev *dev;
- RTE_ETH_VALID_PORTID_OR_RET(port_id);
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
dev = &rte_eth_devices[port_id];
- RTE_FUNC_PTR_OR_RET(*dev->dev_ops->stats_reset);
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_reset, -ENOTSUP);
(*dev->dev_ops->stats_reset)(dev);
dev->data->rx_mbuf_alloc_failed = 0;
+
+ return 0;
}
static int
*
* @param port_id
* The port identifier of the Ethernet device.
+ * @return
+ * - (0) if device notified to reset stats.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port_id* invalid.
*/
-void rte_eth_stats_reset(uint16_t port_id);
+int rte_eth_stats_reset(uint16_t port_id);
/**
* Retrieve names of extended statistics of an Ethernet device.