summaryrefslogtreecommitdiff
path: root/drivers/net/af_packet
diff options
context:
space:
mode:
authorMatan Azrad <matan@mellanox.com>2017-10-10 20:20:18 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2017-10-12 01:52:49 +0100
commitd5b0924ba6baae2cb6ac7c880db0977d4befedc6 (patch)
tree97b37855886bb8c3d11a2ef516fbadfaced4eb4a /drivers/net/af_packet
parent75cd6fb1d901e3f62fa9b5d9e1eba75777f99efa (diff)
downloaddpdk-next-eventdev-d5b0924ba6baae2cb6ac7c880db0977d4befedc6.zip
dpdk-next-eventdev-d5b0924ba6baae2cb6ac7c880db0977d4befedc6.tar.gz
dpdk-next-eventdev-d5b0924ba6baae2cb6ac7c880db0977d4befedc6.tar.xz
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 <matan@mellanox.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'drivers/net/af_packet')
-rw-r--r--drivers/net/af_packet/rte_eth_af_packet.c3
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