- struct rte_sched_queue_stats stats;
- struct rte_sched_port *port;
- uint16_t qlen;
- uint8_t i, j;
- uint32_t queue_id;
-
- for (i = 0; i < nb_pfc; i++) {
- if (qos_conf[i].tx_port == port_id)
- break;
- }
- if (i == nb_pfc || subport_id >= port_params.n_subports_per_port || pipe_id >= port_params.n_pipes_per_subport)
- return -1;
-
- port = qos_conf[i].sched_port;
-
- queue_id = RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS * (subport_id * port_params.n_pipes_per_subport + pipe_id);
-
- printf("\n");
- printf("+----+-------+-------------+-------------+-------------+-------------+-------------+\n");
- printf("| TC | Queue | Pkts OK |Pkts Dropped | Bytes OK |Bytes Dropped| Length |\n");
- printf("+----+-------+-------------+-------------+-------------+-------------+-------------+\n");
-
- for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++) {
- for (j = 0; j < RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS; j++) {
-
- rte_sched_queue_read_stats(port, queue_id + (i * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS + j), &stats, &qlen);
-
- printf("| %d | %d | %11" PRIu32 " | %11" PRIu32 " | %11" PRIu32 " | %11" PRIu32 " | %11i |\n", i, j,
- stats.n_pkts, stats.n_pkts_dropped, stats.n_bytes, stats.n_bytes_dropped, qlen);
- printf("+----+-------+-------------+-------------+-------------+-------------+-------------+\n");
- }
- if (i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE - 1)
- printf("+----+-------+-------------+-------------+-------------+-------------+-------------+\n");
- }
- printf("\n");
-
- return 0;
+ struct rte_sched_queue_stats stats;
+ struct rte_sched_port *port;
+ uint16_t qlen;
+ uint8_t i, j;
+ uint32_t queue_id = 0;
+
+ for (i = 0; i < nb_pfc; i++) {
+ if (qos_conf[i].tx_port == port_id)
+ break;
+ }
+
+ if (i == nb_pfc ||
+ subport_id >= port_params.n_subports_per_port ||
+ pipe_id >= subport_params[subport_id].n_pipes_per_subport_enabled)
+ return -1;
+
+ port = qos_conf[i].sched_port;
+ for (i = 0; i < subport_id; i++)
+ queue_id += subport_params[i].n_pipes_per_subport_enabled *
+ RTE_SCHED_QUEUES_PER_PIPE;
+
+ queue_id += pipe_id * RTE_SCHED_QUEUES_PER_PIPE;
+
+ printf("\n");
+ printf("+----+-------+-------------+-------------+-------------+-------------+-------------+\n");
+ printf("| TC | Queue | Pkts OK |Pkts Dropped | Bytes OK |Bytes Dropped| Length |\n");
+ printf("+----+-------+-------------+-------------+-------------+-------------+-------------+\n");
+
+ for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++) {
+ if (i < RTE_SCHED_TRAFFIC_CLASS_BE) {
+ rte_sched_queue_read_stats(port, queue_id + i, &stats, &qlen);
+ printf("| %d | %d | %11" PRIu64 " | %11" PRIu64 " | %11" PRIu64 " | %11" PRIu64 " | %11i |\n",
+ i, 0, stats.n_pkts, stats.n_pkts_dropped, stats.n_bytes,
+ stats.n_bytes_dropped, qlen);
+ printf("+----+-------+-------------+-------------+-------------+-------------+-------------+\n");
+ } else {
+ for (j = 0; j < RTE_SCHED_BE_QUEUES_PER_PIPE; j++) {
+ rte_sched_queue_read_stats(port, queue_id + i + j,
+ &stats, &qlen);
+ printf("| %d | %d | %11" PRIu64 " | %11" PRIu64 " | %11" PRIu64 " | %11" PRIu64 " | %11i |\n",
+ i, j, stats.n_pkts, stats.n_pkts_dropped, stats.n_bytes,
+ stats.n_bytes_dropped, qlen);
+ printf("+----+-------+-------------+-------------+-------------+-------------+-------------+\n");
+ }
+ }
+ }
+ printf("\n");
+
+ return 0;