From 8492adc270fd9b1774683064764cdf56df995b99 Mon Sep 17 00:00:00 2001 From: Jan Scheurich Date: Thu, 19 Apr 2018 19:40:44 +0200 Subject: netdev: Add optional qfill output parameter to rxq_recv() If the caller provides a non-NULL qfill pointer and the netdev implemementation supports reading the rx queue fill level, the rxq_recv() function returns the remaining number of packets in the rx queue after reception of the packet burst to the caller. If the implementation does not support this, it returns -ENOTSUP instead. Reading the remaining queue fill level should not substantilly slow down the recv() operation. A first implementation is provided for ethernet and vhostuser DPDK ports in netdev-dpdk.c. This output parameter will be used in the upcoming commit for PMD performance metrics to supervise the rx queue fill level for DPDK vhostuser ports. Signed-off-by: Jan Scheurich Acked-by: Billy O'Mahony Signed-off-by: Ian Stokes --- lib/netdev.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/netdev.h') diff --git a/lib/netdev.h b/lib/netdev.h index 441e53dae..bd6f45abb 100644 --- a/lib/netdev.h +++ b/lib/netdev.h @@ -175,7 +175,8 @@ void netdev_rxq_close(struct netdev_rxq *); const char *netdev_rxq_get_name(const struct netdev_rxq *); int netdev_rxq_get_queue_id(const struct netdev_rxq *); -int netdev_rxq_recv(struct netdev_rxq *rx, struct dp_packet_batch *); +int netdev_rxq_recv(struct netdev_rxq *rx, struct dp_packet_batch *, + int *qfill); void netdev_rxq_wait(struct netdev_rxq *); int netdev_rxq_drain(struct netdev_rxq *); -- cgit v1.2.1