netdev-dpdk: Fix tx drops statistic for a down netdev.
Dropped packets were not counted as tx_dropped when a DPDK netdev is
down (like after calling netdev-dpdk/set-admin-state dpdk1 down).
Fixes: ("netdev-dpdk: Don't call rte_dev_stop() in update_flags().")
Acked-by: Sunil Pai G
@@ -2817,6 +2817,9 @@ netdev_dpdk_eth_send(struct netdev *netdev, int qid,
int cnt, dropped;
if (OVS_UNLIKELY(!(dev->flags & NETDEV_UP))) {
+ rte_spinlock_lock(&dev->stats_lock);
+ dev->stats.tx_dropped += dp_packet_batch_size(batch);
+ rte_spinlock_unlock(&dev->stats_lock);
dp_packet_delete_batch(batch, true);
return 0;
}
