[2/2] eventdev: add dropped count to Rx adapter stats
Checks
Commit Message
The application can install a callback invoked by
the Rx adapter. The callback can drop packets and populate
a callback argument with the number of dropped packets.
Add a Rx adapter stats field to keep track of the total
number of dropped packets.
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
---
lib/librte_eventdev/rte_event_eth_rx_adapter.h | 2 ++
lib/librte_eventdev/rte_event_eth_rx_adapter.c | 3 +++
2 files changed, 5 insertions(+)
@@ -197,6 +197,8 @@ struct rte_event_eth_rx_adapter_stats {
/**< Eventdev enqueue count */
uint64_t rx_enq_retry;
/**< Eventdev enqueue retry count */
+ uint64_t rx_dropped;
+ /**< Received packet dropped count */
uint64_t rx_enq_start_ts;
/**< Rx enqueue start timestamp */
uint64_t rx_enq_block_cycles;
@@ -807,6 +807,7 @@ static uint16_t rxa_gcd_u16(uint16_t a, uint16_t b)
if (dev_info->cb_fn) {
+ dropped = 0;
nb_cb = dev_info->cb_fn(eth_dev_id,
rx_queue_id,
ETH_EVENT_BUFFER_SIZE,
@@ -820,6 +821,8 @@ static uint16_t rxa_gcd_u16(uint16_t a, uint16_t b)
nb_cb, num);
else
num = nb_cb;
+ if (dropped)
+ rx_adapter->stats.rx_dropped += dropped;
}
buf->count += num;