sw->sched_no_iq_enqueues += (in_pkts_total == 0);
sw->sched_no_cq_enqueues += (out_pkts_total == 0);
+ uint64_t work_done = (in_pkts_total + out_pkts_total) != 0;
+ sw->sched_progress_last_iter = work_done;
+
+ uint64_t cqs_scheds_last_iter = 0;
+
/* push all the internal buffered QEs in port->cq_ring to the
* worker cores: aka, do the ring transfers batched.
*/
&sw->cq_ring_space[i]);
port->cq_buf_count = 0;
no_enq = 0;
+ cqs_scheds_last_iter |= (1ULL << i);
} else {
sw->cq_ring_space[i] =
rte_event_ring_free_count(worker) -
sw->sched_min_burst = sw->sched_min_burst_size;
}
+ /* Provide stats on what eventdev ports were scheduled to this
+ * iteration. If more than 64 ports are active, always report that
+ * all Eventdev ports have been scheduled events.
+ */
+ sw->sched_last_iter_bitmask = cqs_scheds_last_iter;
+ if (unlikely(sw->port_count >= 64))
+ sw->sched_last_iter_bitmask = UINT64_MAX;
}
int ret = rte_event_dev_xstats_names_get(evdev,
RTE_EVENT_DEV_XSTATS_DEVICE,
0, xstats_names, ids, XSTATS_MAX);
- if (ret != 6) {
- printf("%d: expected 6 stats, got return %d\n", __LINE__, ret);
+ if (ret != 8) {
+ printf("%d: expected 8 stats, got return %d\n", __LINE__, ret);
return -1;
}
ret = rte_event_dev_xstats_get(evdev,
RTE_EVENT_DEV_XSTATS_DEVICE,
0, ids, values, ret);
- if (ret != 6) {
- printf("%d: expected 6 stats, got return %d\n", __LINE__, ret);
+ if (ret != 8) {
+ printf("%d: expected 8 stats, got return %d\n", __LINE__, ret);
return -1;
}
ret = rte_event_dev_xstats_get(evdev,
RTE_EVENT_DEV_XSTATS_DEVICE,
0, ids, values, num_stats);
- static const uint64_t expected[] = {3, 3, 0, 1, 0, 0};
+ static const uint64_t expected[] = {3, 3, 0, 1, 0, 0, 4, 1};
for (i = 0; (signed int)i < ret; i++) {
if (expected[i] != values[i]) {
printf(
0, NULL, 0);
/* ensure reset statistics are zero-ed */
- static const uint64_t expected_zero[] = {0, 0, 0, 0, 0, 0};
+ static const uint64_t expected_zero[] = {0, 0, 0, 0, 0, 0, 0, 0};
ret = rte_event_dev_xstats_get(evdev,
RTE_EVENT_DEV_XSTATS_DEVICE,
0, ids, values, num_stats);
for (i = 0; i < XSTATS_MAX; i++)
ids[i] = i;
-#define NUM_DEV_STATS 6
+#define NUM_DEV_STATS 8
/* Device names / values */
int num_stats = rte_event_dev_xstats_names_get(evdev,
RTE_EVENT_DEV_XSTATS_DEVICE,
static const char * const dev_names[] = {
"dev_rx", "dev_tx", "dev_drop", "dev_sched_calls",
"dev_sched_no_iq_enq", "dev_sched_no_cq_enq",
+ "dev_sched_last_iter_bitmask",
+ "dev_sched_progress_last_iter"
};
- uint64_t dev_expected[] = {NPKTS, NPKTS, 0, 1, 0, 0};
+ uint64_t dev_expected[] = {NPKTS, NPKTS, 0, 1, 0, 0, 4, 1};
for (i = 0; (int)i < ret; i++) {
unsigned int id;
uint64_t val = rte_event_dev_xstats_by_name_get(evdev,
}
if (val != dev_expected[i]) {
printf("%d: %s value incorrect, expected %"
- PRIu64" got %d\n", __LINE__, dev_names[i],
- dev_expected[i], id);
+ PRIu64" got %"PRIu64"\n", __LINE__,
+ dev_names[i], dev_expected[i], val);
goto fail;
}
/* reset to zero */
}
};
-/* 48 is stat offset from start of the devices whole xstats.
+/* 49 is stat offset from start of the devices whole xstats.
* This WILL break every time we add a statistic to a port
* or the device, but there is no other way to test
*/
-#define PORT_OFF 48
+#define PORT_OFF 50
/* num stats for the tested port. CQ size adds more stats to a port */
#define NUM_PORT_STATS 21
/* the port to test. */
/* queue offset from start of the devices whole xstats.
* This will break every time we add a statistic to a device/port/queue
*/
-#define QUEUE_OFF 90
+#define QUEUE_OFF 92
const uint32_t queue = 0;
num_stats = rte_event_dev_xstats_names_get(evdev,
RTE_EVENT_DEV_XSTATS_QUEUE, queue,
/* device instance specific */
no_iq_enq,
no_cq_enq,
+ sched_last_iter_bitmask,
+ sched_progress_last_iter,
/* port_specific */
rx_used,
rx_free,
case calls: return sw->sched_called;
case no_iq_enq: return sw->sched_no_iq_enqueues;
case no_cq_enq: return sw->sched_no_cq_enqueues;
+ case sched_last_iter_bitmask: return sw->sched_last_iter_bitmask;
+ case sched_progress_last_iter: return sw->sched_progress_last_iter;
+
default: return -1;
}
}
*/
static const char * const dev_stats[] = { "rx", "tx", "drop",
"sched_calls", "sched_no_iq_enq", "sched_no_cq_enq",
+ "sched_last_iter_bitmask", "sched_progress_last_iter",
};
static const enum xstats_type dev_types[] = { rx, tx, dropped,
- calls, no_iq_enq, no_cq_enq,
+ calls, no_iq_enq, no_cq_enq, sched_last_iter_bitmask,
+ sched_progress_last_iter,
};
/* all device stats are allowed to be reset */