diff options
author | David Marchand <david.marchand@redhat.com> | 2022-04-22 14:24:59 +0200 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2022-05-04 21:09:45 +0200 |
commit | 27df8dc13f6e6a3b3ee48810c93a5193eb44a708 (patch) | |
tree | cb43ca890f96bd30949c856f61b932b6c99645f9 | |
parent | f771ef6803f4dc4fa63202f2fbf2ebbb0974509a (diff) | |
download | openvswitch-27df8dc13f6e6a3b3ee48810c93a5193eb44a708.tar.gz |
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: 3b1fb0779b87 ("netdev-dpdk: Don't call rte_dev_stop() in update_flags().")
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Sunil Pai G <sunil.pai.g@intel.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
-rw-r--r-- | lib/netdev-dpdk.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index f080dec61..4da7f0352 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -2899,6 +2899,9 @@ netdev_dpdk_send__(struct netdev_dpdk *dev, int qid, bool concurrent_txq) { 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; } |