#include "dlb2_priv.h"
#include "dlb2_inline_fns.h"
+#include "pf/base/dlb2_regs.h"
enum dlb2_xstats_type {
/* common to device and port */
zero_polls, /**< Call dequeue burst and return 0 */
tx_nospc_ldb_hw_credits, /**< Insufficient LDB h/w credits */
tx_nospc_dir_hw_credits, /**< Insufficient DIR h/w credits */
+ tx_nospc_hw_credits, /**< Insufficient h/w credits */
tx_nospc_inflight_max, /**< Reach the new_event_threshold */
tx_nospc_new_event_limit, /**< Insufficient s/w credits */
tx_nospc_inflight_credits, /**< Port has too few s/w credits */
inflight_events,
ldb_pool_size,
dir_pool_size,
+ pool_size,
/* port specific */
tx_new, /**< Send an OP_NEW event */
tx_fwd, /**< Send an OP_FORWARD event */
int i;
uint64_t val = 0;
- for (i = 0; i < DLB2_MAX_NUM_PORTS; i++) {
+ for (i = 0; i < DLB2_MAX_NUM_PORTS(dlb2->version); i++) {
struct dlb2_eventdev_port *port = &dlb2->ev_ports[i];
if (!port->setup_done)
case tx_nospc_dir_hw_credits:
val += port->stats.traffic.tx_nospc_dir_hw_credits;
break;
+ case tx_nospc_hw_credits:
+ val += port->stats.traffic.tx_nospc_hw_credits;
+ break;
case tx_nospc_inflight_max:
val += port->stats.traffic.tx_nospc_inflight_max;
break;
case zero_polls:
case tx_nospc_ldb_hw_credits:
case tx_nospc_dir_hw_credits:
+ case tx_nospc_hw_credits:
case tx_nospc_inflight_max:
case tx_nospc_new_event_limit:
case tx_nospc_inflight_credits:
return dlb2->num_ldb_credits;
case dir_pool_size:
return dlb2->num_dir_credits;
+ case pool_size:
+ return dlb2->num_credits;
default: return -1;
}
}
case tx_nospc_dir_hw_credits:
return ev_port->stats.traffic.tx_nospc_dir_hw_credits;
+ case tx_nospc_hw_credits:
+ return ev_port->stats.traffic.tx_nospc_hw_credits;
+
case tx_nospc_inflight_max:
return ev_port->stats.traffic.tx_nospc_inflight_max;
int port = 0;
uint64_t tally = 0;
- for (port = 0; port < DLB2_MAX_NUM_PORTS; port++)
+ for (port = 0; port < DLB2_MAX_NUM_PORTS(dlb2->version); port++)
tally += dlb2->ev_ports[port].stats.queue[qid].qid_depth[stat];
return tally;
int port = 0;
uint64_t enq_ok_tally = 0;
- for (port = 0; port < DLB2_MAX_NUM_PORTS; port++)
+ for (port = 0; port < DLB2_MAX_NUM_PORTS(dlb2->version); port++)
enq_ok_tally += dlb2->ev_ports[port].stats.queue[qid].enq_ok;
return enq_ok_tally;
"zero_polls",
"tx_nospc_ldb_hw_credits",
"tx_nospc_dir_hw_credits",
+ "tx_nospc_hw_credits",
"tx_nospc_inflight_max",
"tx_nospc_new_event_limit",
"tx_nospc_inflight_credits",
"inflight_events",
"ldb_pool_size",
"dir_pool_size",
+ "pool_size",
};
static const enum dlb2_xstats_type dev_types[] = {
rx_ok,
zero_polls,
tx_nospc_ldb_hw_credits,
tx_nospc_dir_hw_credits,
+ tx_nospc_hw_credits,
tx_nospc_inflight_max,
tx_nospc_new_event_limit,
tx_nospc_inflight_credits,
inflight_events,
ldb_pool_size,
dir_pool_size,
+ pool_size,
};
/* Note: generated device stats are not allowed to be reset. */
static const uint8_t dev_reset_allowed[] = {
0, /* zero_polls */
0, /* tx_nospc_ldb_hw_credits */
0, /* tx_nospc_dir_hw_credits */
+ 0, /* tx_nospc_hw_credits */
0, /* tx_nospc_inflight_max */
0, /* tx_nospc_new_event_limit */
0, /* tx_nospc_inflight_credits */
0, /* inflight_events */
0, /* ldb_pool_size */
0, /* dir_pool_size */
+ 0, /* pool_size */
};
static const char * const port_stats[] = {
"is_configured",
"zero_polls",
"tx_nospc_ldb_hw_credits",
"tx_nospc_dir_hw_credits",
+ "tx_nospc_hw_credits",
"tx_nospc_inflight_max",
"tx_nospc_new_event_limit",
"tx_nospc_inflight_credits",
zero_polls,
tx_nospc_ldb_hw_credits,
tx_nospc_dir_hw_credits,
+ tx_nospc_hw_credits,
tx_nospc_inflight_max,
tx_nospc_new_event_limit,
tx_nospc_inflight_credits,
1, /* zero_polls */
1, /* tx_nospc_ldb_hw_credits */
1, /* tx_nospc_dir_hw_credits */
+ 1, /* tx_nospc_hw_credits */
1, /* tx_nospc_inflight_max */
1, /* tx_nospc_new_event_limit */
1, /* tx_nospc_inflight_credits */
/* other vars */
const unsigned int count = RTE_DIM(dev_stats) +
- DLB2_MAX_NUM_PORTS * RTE_DIM(port_stats) +
- DLB2_MAX_NUM_QUEUES * RTE_DIM(qid_stats);
+ DLB2_MAX_NUM_PORTS(dlb2->version) * RTE_DIM(port_stats) +
+ DLB2_MAX_NUM_QUEUES(dlb2->version) * RTE_DIM(qid_stats);
unsigned int i, port, qid, stat_id = 0;
dlb2->xstats = rte_zmalloc_socket(NULL,
}
dlb2->xstats_count_mode_dev = stat_id;
- for (port = 0; port < DLB2_MAX_NUM_PORTS; port++) {
+ for (port = 0; port < DLB2_MAX_NUM_PORTS(dlb2->version); port++) {
dlb2->xstats_offset_for_port[port] = stat_id;
uint32_t count_offset = stat_id;
dlb2->xstats_count_mode_port = stat_id - dlb2->xstats_count_mode_dev;
- for (qid = 0; qid < DLB2_MAX_NUM_QUEUES; qid++) {
+ for (qid = 0; qid < DLB2_MAX_NUM_QUEUES(dlb2->version); qid++) {
uint32_t count_offset = stat_id;
dlb2->xstats_offset_for_qid[qid] = stat_id;
xstats_mode_count = dlb2->xstats_count_mode_dev;
break;
case RTE_EVENT_DEV_XSTATS_PORT:
- if (queue_port_id >= DLB2_MAX_NUM_PORTS)
+ if (queue_port_id >= DLB2_MAX_NUM_PORTS(dlb2->version))
break;
xstats_mode_count = dlb2->xstats_count_per_port[queue_port_id];
start_offset = dlb2->xstats_offset_for_port[queue_port_id];
break;
case RTE_EVENT_DEV_XSTATS_QUEUE:
-#if (DLB2_MAX_NUM_QUEUES <= 255) /* max 8 bit value */
- if (queue_port_id >= DLB2_MAX_NUM_QUEUES)
+ if (queue_port_id >= DLB2_MAX_NUM_QUEUES(dlb2->version) &&
+ (DLB2_MAX_NUM_QUEUES(dlb2->version) <= 255))
break;
-#endif
xstats_mode_count = dlb2->xstats_count_per_qid[queue_port_id];
start_offset = dlb2->xstats_offset_for_qid[queue_port_id];
break;
xstats_mode_count = dlb2->xstats_count_mode_dev;
break;
case RTE_EVENT_DEV_XSTATS_PORT:
- if (queue_port_id >= DLB2_MAX_NUM_PORTS)
+ if (queue_port_id >= DLB2_MAX_NUM_PORTS(dlb2->version))
goto invalid_value;
xstats_mode_count = dlb2->xstats_count_per_port[queue_port_id];
break;
case RTE_EVENT_DEV_XSTATS_QUEUE:
-#if (DLB2_MAX_NUM_QUEUES <= 255) /* max 8 bit value */
- if (queue_port_id >= DLB2_MAX_NUM_QUEUES)
+#if (DLB2_MAX_NUM_QUEUES(DLB2_HW_V2_5) <= 255) /* max 8 bit value */
+ if (queue_port_id >= DLB2_MAX_NUM_QUEUES(dlb2->version))
goto invalid_value;
#endif
xstats_mode_count = dlb2->xstats_count_per_qid[queue_port_id];
break;
case RTE_EVENT_DEV_XSTATS_PORT:
if (queue_port_id == -1) {
- for (i = 0; i < DLB2_MAX_NUM_PORTS; i++) {
+ for (i = 0;
+ i < DLB2_MAX_NUM_PORTS(dlb2->version); i++) {
if (dlb2_xstats_reset_port(dlb2, i,
ids, nb_ids))
return -EINVAL;
}
- } else if (queue_port_id < DLB2_MAX_NUM_PORTS) {
+ } else if (queue_port_id < DLB2_MAX_NUM_PORTS(dlb2->version)) {
if (dlb2_xstats_reset_port(dlb2, queue_port_id,
ids, nb_ids))
return -EINVAL;
break;
case RTE_EVENT_DEV_XSTATS_QUEUE:
if (queue_port_id == -1) {
- for (i = 0; i < DLB2_MAX_NUM_QUEUES; i++) {
+ for (i = 0;
+ i < DLB2_MAX_NUM_QUEUES(dlb2->version); i++) {
if (dlb2_xstats_reset_queue(dlb2, i,
ids, nb_ids))
return -EINVAL;
}
- } else if (queue_port_id < DLB2_MAX_NUM_QUEUES) {
+ } else if (queue_port_id < DLB2_MAX_NUM_QUEUES(dlb2->version)) {
if (dlb2_xstats_reset_queue(dlb2, queue_port_id,
ids, nb_ids))
return -EINVAL;
fprintf(f, "\tnum_dir_credits = %u\n",
dlb2->hw_rsrc_query_results.num_dir_credits);
+ fprintf(f, "\tnum_credits = %u\n",
+ dlb2->hw_rsrc_query_results.num_credits);
+
/* Port level information */
for (i = 0; i < dlb2->num_ports; i++) {
fprintf(f, "\tdir_credits = %u\n",
p->qm_port.dir_credits);
+ fprintf(f, "\tcached_credits = %u\n",
+ p->qm_port.cached_credits);
+
+ fprintf(f, "\tdir_credits = %u\n",
+ p->qm_port.credits);
+
fprintf(f, "\tgenbit=%d, cq_idx=%d, cq_depth=%d\n",
p->qm_port.gen_bit,
p->qm_port.cq_idx,
fprintf(f, "\t\ttx_nospc_dir_hw_credits %" PRIu64 "\n",
p->stats.traffic.tx_nospc_dir_hw_credits);
+ fprintf(f, "\t\ttx_nospc_hw_credits %" PRIu64 "\n",
+ p->stats.traffic.tx_nospc_hw_credits);
+
fprintf(f, "\t\ttx_nospc_inflight_max %" PRIu64 "\n",
p->stats.traffic.tx_nospc_inflight_max);