| 613 | } |
| 614 | |
| 615 | static void |
| 616 | sw_dump(struct rte_eventdev *dev, FILE *f) |
| 617 | { |
| 618 | const struct sw_evdev *sw = sw_pmd_priv(dev); |
| 619 | |
| 620 | static const char * const q_type_strings[] = { |
| 621 | "Ordered", "Atomic", "Parallel", "Directed" |
| 622 | }; |
| 623 | uint32_t i; |
| 624 | fprintf(f, "EventDev %s: ports %d, qids %d\n", |
| 625 | dev->data->name, sw->port_count, sw->qid_count); |
| 626 | |
| 627 | fprintf(f, "\trx %"PRIu64"\n\tdrop %"PRIu64"\n\ttx %"PRIu64"\n", |
| 628 | sw->stats.rx_pkts, sw->stats.rx_dropped, sw->stats.tx_pkts); |
| 629 | fprintf(f, "\tsched calls: %"PRIu64"\n", sw->sched_called); |
| 630 | fprintf(f, "\tsched cq/qid call: %"PRIu64"\n", sw->sched_cq_qid_called); |
| 631 | fprintf(f, "\tsched no IQ enq: %"PRIu64"\n", sw->sched_no_iq_enqueues); |
| 632 | fprintf(f, "\tsched no CQ enq: %"PRIu64"\n", sw->sched_no_cq_enqueues); |
| 633 | uint32_t inflights = rte_atomic32_read(&sw->inflights); |
| 634 | uint32_t credits = sw->nb_events_limit - inflights; |
| 635 | fprintf(f, "\tinflight %d, credits: %d\n", inflights, credits); |
| 636 | |
| 637 | #define COL_RED "\x1b[31m" |
| 638 | #define COL_RESET "\x1b[0m" |
| 639 | |
| 640 | for (i = 0; i < sw->port_count; i++) { |
| 641 | int max, j; |
| 642 | const struct sw_port *p = &sw->ports[i]; |
| 643 | if (!p->initialized) { |
| 644 | fprintf(f, " %sPort %d not initialized.%s\n", |
| 645 | COL_RED, i, COL_RESET); |
| 646 | continue; |
| 647 | } |
| 648 | fprintf(f, " Port %d %s\n", i, |
| 649 | p->is_directed ? " (SingleCons)" : ""); |
| 650 | fprintf(f, "\trx %"PRIu64"\tdrop %"PRIu64"\ttx %"PRIu64 |
| 651 | "\t%sinflight %d%s\n", sw->ports[i].stats.rx_pkts, |
| 652 | sw->ports[i].stats.rx_dropped, |
| 653 | sw->ports[i].stats.tx_pkts, |
| 654 | (p->inflights == p->inflight_max) ? |
| 655 | COL_RED : COL_RESET, |
| 656 | sw->ports[i].inflights, COL_RESET); |
| 657 | |
| 658 | fprintf(f, "\tMax New: %u" |
| 659 | "\tAvg cycles PP: %"PRIu64"\tCredits: %u\n", |
| 660 | sw->ports[i].inflight_max, |
| 661 | sw->ports[i].avg_pkt_ticks, |
| 662 | sw->ports[i].inflight_credits); |
| 663 | fprintf(f, "\tReceive burst distribution:\n"); |
| 664 | float zp_percent = p->zero_polls * 100.0 / p->total_polls; |
| 665 | fprintf(f, zp_percent < 10 ? "\t\t0:%.02f%% " : "\t\t0:%.0f%% ", |
| 666 | zp_percent); |
| 667 | for (max = (int)RTE_DIM(p->poll_buckets); max-- > 0;) |
| 668 | if (p->poll_buckets[max] != 0) |
| 669 | break; |
| 670 | for (j = 0; j <= max; j++) { |
| 671 | if (p->poll_buckets[j] != 0) { |
| 672 | float poll_pc = p->poll_buckets[j] * 100.0 / |
nothing calls this directly
no test coverage detected