vhost: rename driver callbacks struct
[dpdk.git] / drivers / event / dsw / dsw_xstats.c
index d332a57..4f7d4e3 100644 (file)
@@ -48,7 +48,7 @@ struct dsw_xstats_port {
 static uint64_t
 dsw_xstats_dev_credits_on_loan(struct dsw_evdev *dsw)
 {
-       return rte_atomic32_read(&dsw->credits_on_loan);
+       return __atomic_load_n(&dsw->credits_on_loan, __ATOMIC_RELAXED);
 }
 
 static struct dsw_xstat_dev dsw_dev_xstats[] = {
@@ -109,6 +109,13 @@ dsw_xstats_port_get_event_proc_latency(struct dsw_evdev *dsw, uint8_t port_id,
        return dequeued > 0 ? total_busy_cycles / dequeued : 0;
 }
 
+static uint64_t
+dsw_xstats_port_get_busy_cycles(struct dsw_evdev *dsw, uint8_t port_id,
+                               uint8_t queue_id __rte_unused)
+{
+       return dsw->ports[port_id].total_busy_cycles;
+}
+
 DSW_GEN_PORT_ACCESS_FN(inflight_credits)
 
 DSW_GEN_PORT_ACCESS_FN(pending_releases)
@@ -119,7 +126,7 @@ dsw_xstats_port_get_load(struct dsw_evdev *dsw, uint8_t port_id,
 {
        int16_t load;
 
-       load = rte_atomic16_read(&dsw->ports[port_id].load);
+       load = __atomic_load_n(&dsw->ports[port_id].load, __ATOMIC_RELAXED);
 
        return DSW_LOAD_TO_PERCENT(load);
 }
@@ -147,6 +154,8 @@ static struct dsw_xstats_port dsw_port_xstats[] = {
          false },
        { "port_%u_event_proc_latency", dsw_xstats_port_get_event_proc_latency,
          false },
+       { "port_%u_busy_cycles", dsw_xstats_port_get_busy_cycles,
+         false },
        { "port_%u_inflight_credits", dsw_xstats_port_get_inflight_credits,
          false },
        { "port_%u_pending_releases", dsw_xstats_port_get_pending_releases,