path: root/drivers/net/af_packet
diff options
authorMatan Azrad <>2017-10-10 20:20:18 +0000
committerFerruh Yigit <>2017-10-12 01:52:49 +0100
commitd5b0924ba6baae2cb6ac7c880db0977d4befedc6 (patch)
tree97b37855886bb8c3d11a2ef516fbadfaced4eb4a /drivers/net/af_packet
parent75cd6fb1d901e3f62fa9b5d9e1eba75777f99efa (diff)
ethdev: add return value to stats get dev op
The stats_get dev op API doesn't include return value, so PMD cannot return an error in case of failure at stats getting process time. Since PCI devices can be removed and there is a time between the physical removal to the RMV interrupt, the user may get invalid stats without any indication. This patch changes the stats_get API return value to be int instead of void. All the net PMDs stats_get dev ops are adjusted by this patch. Signed-off-by: Matan Azrad <> Reviewed-by: Ferruh Yigit <>
Diffstat (limited to 'drivers/net/af_packet')
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 295b7a7..46b8250 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -331,7 +331,7 @@ eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
dev_info->min_rx_bufsize = 0;
-static void
+static int
eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *igb_stats)
unsigned i, imax;
@@ -364,6 +364,7 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *igb_stats)
igb_stats->opackets = tx_total;
igb_stats->oerrors = tx_err_total;
igb_stats->obytes = tx_bytes_total;
+ return 0;
static void