aboutsummaryrefslogtreecommitdiff
path: root/lib/netdev-odp.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/netdev-odp.c')
-rw-r--r--lib/netdev-odp.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c
index 637128b..f1c8af5 100644
--- a/lib/netdev-odp.c
+++ b/lib/netdev-odp.c
@@ -471,9 +471,38 @@ static int
netdev_odp_get_stats(const struct netdev *netdev, struct netdev_stats *stats)
{
struct netdev_odp *dev = netdev_odp_cast(netdev);
+ struct odp_pktio_stats_t odp_stats;
ovs_mutex_lock(&dev->mutex);
- *stats = dev->stats;
+ odp_pktio_stats(dev->pktio, &odp_stats);
+
+ memset(stats, 0, sizeof(*stats));
+
+ stats->rx_packets = odp_stats.in_ucast_pkts;
+ stats->tx_packets = odp_stats.out_ucast_pkts;
+ stats->rx_bytes = odp_stats.in_octets;
+ stats->tx_bytes = odp_stats.out_octets;
+ stats->rx_errors = odp_stats.in_errors;
+ stats->tx_errors = odp_stats.out_errors;
+ stats->multicast = UINT64_MAX;
+
+ stats->tx_dropped = dev->stats.tx_dropped;
+
+ stats->rx_dropped = UINT64_MAX;
+ stats->collisions = UINT64_MAX;
+
+ stats->rx_length_errors = UINT64_MAX;
+ stats->rx_over_errors = UINT64_MAX;
+ stats->rx_crc_errors = UINT64_MAX;
+ stats->rx_frame_errors = odp_stats.in_unknown_protos;
+ stats->rx_fifo_errors = UINT64_MAX;
+ stats->rx_missed_errors = odp_stats.in_discards;
+
+ stats->tx_aborted_errors = odp_stats.out_discards;
+ stats->tx_carrier_errors = UINT64_MAX;
+ stats->tx_fifo_errors = UINT64_MAX;
+ stats->tx_heartbeat_errors = UINT64_MAX;
+ stats->tx_window_errors = UINT64_MAX;
ovs_mutex_unlock(&dev->mutex);
return 0;