Add support for latency task with multiple ports
[samplevnf.git] / VNFs / DPPD-PROX / cmd_parser.c
index f88ee94..7df6b16 100644 (file)
@@ -76,24 +76,13 @@ static int cores_task_are_valid(unsigned int *lcores, int task_id, unsigned int
        unsigned int lcore_id;
        for (unsigned int i = 0; i < nb_cores; i++) {
                lcore_id = lcores[i];
-               if (lcore_id >= RTE_MAX_LCORE) {
-                       plog_err("Invalid core id %u (lcore ID above %d)\n", lcore_id, RTE_MAX_LCORE);
+               if (core_task_is_valid(lcore_id, task_id) == 0)
                        return 0;
-               }
-               else if (!prox_core_active(lcore_id, 0)) {
-                       plog_err("Invalid core id %u (lcore is not active)\n", lcore_id);
-                       return 0;
-               }
-               else if (task_id >= lcore_cfg[lcore_id].n_tasks_all) {
-                       plog_err("Invalid task id (valid task IDs for core %u are below %u)\n",
-                               lcore_id, lcore_cfg[lcore_id].n_tasks_all);
-                       return 0;
-               }
        }
        return 1;
 }
 
-static int parse_core_task(const char *str, uint32_t *lcore_id, uint32_t *task_id, unsigned int *nb_cores)
+static int parse_cores_task(const char *str, uint32_t *lcore_id, uint32_t *task_id, unsigned *nb_cores)
 {
        char str_lcore_id[128];
        int ret;
@@ -110,6 +99,29 @@ static int parse_core_task(const char *str, uint32_t *lcore_id, uint32_t *task_i
        return 0;
 }
 
+static int parse_cores_tasks(const char *str, uint32_t *lcore_id, uint32_t *task_id, unsigned *nb_cores, unsigned *nb_tasks)
+{
+       char str_lcore_id[128], str_task_id[128];
+       int ret;
+
+       if (2 != sscanf(str, "%s %s", str_lcore_id, str_task_id))
+               return -1;
+
+       if ((ret = parse_list_set(lcore_id, str_lcore_id, RTE_MAX_LCORE)) <= 0) {
+               plog_err("Invalid core while parsing command (%s)\n", get_parse_err());
+               return -1;
+       }
+       *nb_cores = ret;
+
+       if ((ret = parse_list_set(task_id, str_task_id, MAX_TASKS_PER_CORE)) <= 0) {
+               plog_err("Invalid task while parsing command (%s)\n", get_parse_err());
+               return -1;
+       }
+       *nb_tasks = ret;
+
+       return 0;
+}
+
 static const char *strchr_skip_twice(const char *str, int chr)
 {
        str = strchr(str, chr);
@@ -207,7 +219,7 @@ static int parse_cmd_trace(const char *str, struct input *input)
 {
        unsigned lcores[RTE_MAX_LCORE], task_id, nb_packets, nb_cores;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
        if (!(str = strchr_skip_twice(str, ' ')))
                return -1;
@@ -226,7 +238,7 @@ static int parse_cmd_dump_rx(const char *str, struct input *input)
 {
        unsigned lcores[RTE_MAX_LCORE], task_id, nb_packets, nb_cores;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
        if (!(str = strchr_skip_twice(str, ' ')))
                return -1;
@@ -273,7 +285,7 @@ static int parse_cmd_dump_tx(const char *str, struct input *input)
 {
        unsigned lcores[RTE_MAX_LCORE], task_id, nb_packets, nb_cores;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
        if (!(str = strchr_skip_twice(str, ' ')))
                return -1;
@@ -360,7 +372,7 @@ static int parse_cmd_count(const char *str, struct input *input)
 {
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, count, nb_cores;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
        if (!(str = strchr_skip_twice(str, ' ')))
                return -1;
@@ -389,7 +401,7 @@ static int parse_cmd_set_probability(const char *str, struct input *input)
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, nb_cores;
        float probability;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
        if (!(str = strchr_skip_twice(str, ' ')))
                return -1;
@@ -414,7 +426,7 @@ static int parse_cmd_delay_us(const char *str, struct input *input)
 {
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, delay_us, nb_cores;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
        if (!(str = strchr_skip_twice(str, ' ')))
                return -1;
@@ -439,7 +451,7 @@ static int parse_cmd_random_delay_us(const char *str, struct input *input)
 {
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, delay_us, nb_cores;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
        if (!(str = strchr_skip_twice(str, ' ')))
                return -1;
@@ -464,7 +476,7 @@ static int parse_cmd_bypass(const char *str, struct input *input)
 {
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, pkt_size, nb_cores;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
        if ((prox_cfg.flags & DSF_ENABLE_BYPASS) == 0) {
                plog_err("enable bypass not set => command not supported\n");
@@ -485,7 +497,7 @@ static int parse_cmd_reconnect(const char *str, struct input *input)
 {
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, pkt_size, nb_cores;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
        if (cores_task_are_valid(lcores, task_id, nb_cores)) {
                for (unsigned int i = 0; i < nb_cores; i++) {
@@ -501,7 +513,7 @@ static int parse_cmd_pkt_size(const char *str, struct input *input)
 {
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, pkt_size, nb_cores;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
        if (!(str = strchr_skip_twice(str, ' ')))
                return -1;
@@ -528,7 +540,7 @@ static int parse_cmd_speed(const char *str, struct input *input)
        float speed;
        unsigned i;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
        if (!(str = strchr_skip_twice(str, ' ')))
                return -1;
@@ -565,7 +577,7 @@ static int parse_cmd_speed_byte(const char *str, struct input *input)
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, nb_cores;
        uint64_t bps;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
        if (!(str = strchr_skip_twice(str, ' ')))
                return -1;
@@ -638,7 +650,7 @@ static int parse_cmd_reset_values(const char *str, struct input *input)
 {
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, nb_cores;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
 
        if (cores_task_are_valid(lcores, task_id, nb_cores)) {
@@ -664,7 +676,7 @@ static int parse_cmd_set_value(const char *str, struct input *input)
        unsigned short offset;
        uint8_t value_len;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
        if (!(str = strchr_skip_twice(str, ' ')))
                return -1;
@@ -705,7 +717,7 @@ static int parse_cmd_set_random(const char *str, struct input *input)
        char rand_str[64];
        int16_t rand_id = -1;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
        if (!(str = strchr_skip_twice(str, ' ')))
                return -1;
@@ -740,7 +752,7 @@ static int parse_cmd_thread_info(const char *str, struct input *input)
 {
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, nb_cores;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
        for (unsigned int i = 0; i < nb_cores; i++) {
                cmd_thread_info(lcores[i], task_id);
@@ -769,7 +781,7 @@ static int parse_cmd_arp_add(const char *str, struct input *input)
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, nb_cores;
        struct rte_ring *ring;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
        if (!(str = strchr_skip_twice(str, ' ')))
                return -1;
@@ -803,7 +815,7 @@ static int parse_cmd_rule_add(const char *str, struct input *input)
        struct rte_ring *ring;
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, nb_cores;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
        if (!(str = strchr_skip_twice(str, ' ')))
                return -1;
@@ -847,7 +859,7 @@ static int parse_cmd_gateway_ip(const char *str, struct input *input)
 {
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, ip[4], nb_cores, i;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
        if (!(str = strchr_skip_twice(str, ' ')))
                return -1;
@@ -876,7 +888,7 @@ static int parse_cmd_local_ip(const char *str, struct input *input)
 {
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, ip[4], nb_cores, i;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
        if (!(str = strchr_skip_twice(str, ' ')))
                return -1;
@@ -908,7 +920,7 @@ static int parse_cmd_route_add(const char *str, struct input *input)
 {
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, prefix, next_hop_idx, ip[4], nb_cores;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
        if (!(str = strchr_skip_twice(str, ' ')))
                return -1;
@@ -1541,7 +1553,7 @@ static int parse_cmd_ring_info(const char *str, struct input *input)
 {
        unsigned lcores[RTE_MAX_LCORE], task_id, nb_cores;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
 
        if (cores_task_are_valid(lcores, task_id, nb_cores)) {
@@ -1582,11 +1594,54 @@ static int parse_cmd_port_stats(const char *str, struct input *input)
        return 0;
 }
 
+static int parse_cmd_multi_port_stats(const char *str, struct input *input)
+{
+       uint32_t ports[PROX_MAX_PORTS];
+       int nb_ports = parse_list_set(ports, str, PROX_MAX_PORTS);
+       if (nb_ports <= 0) {
+               return -1;
+       }
+
+       char buf[PROX_MAX_PORTS * (11+5*21) + 1], *pbuf = buf;
+       int left = sizeof(buf);
+       for (int i = 0; i < nb_ports; ++i) {
+               struct get_port_stats s;
+               if (stats_port(ports[i], &s)) {
+                       plog_err("Invalid port %u\n", ports[i]);
+                       return 0;
+               }
+
+               int len = snprintf(pbuf, left,
+                               "%u,"
+                               "%"PRIu64",%"PRIu64","
+                               "%"PRIu64",%"PRIu64","
+                               "%"PRIu64";",
+                               //TODO: adjust buf size above when adding fields
+                               ports[i],
+                               s.rx_tot, s.tx_tot,
+                               s.no_mbufs_tot, s.ierrors_tot + s.imissed_tot,
+                               s.last_tsc);
+               if ((len < 0) || (len >= left)) {
+                       plog_err("Cannot print stats for port %u\n", ports[i]);
+                       return 0;
+               }
+               pbuf += len;
+               left -= len;
+       }
+       pbuf--;
+       *pbuf = '\n';
+
+       plog_info("%s", buf);
+       if (input->reply)
+               input->reply(input, buf, sizeof(buf) - left);
+       return 0;
+}
+
 static int parse_cmd_core_stats(const char *str, struct input *input)
 {
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, nb_cores;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
 
        if (cores_task_are_valid(lcores, task_id, nb_cores)) {
@@ -1613,22 +1668,115 @@ static int parse_cmd_core_stats(const char *str, struct input *input)
        return 0;
 }
 
+static int parse_cmd_dp_core_stats(const char *str, struct input *input)
+{
+       unsigned lcores[RTE_MAX_LCORE], tasks[MAX_TASKS_PER_CORE], lcore_id, task_id, nb_cores, nb_tasks;
+
+       // This function either outputs a single line, in case of syntax error on the lists of cores and/or tasks
+       if (parse_cores_tasks(str, lcores, tasks, &nb_cores, &nb_tasks)) {
+               if (input->reply) {
+                       char buf[128];
+                       snprintf(buf, sizeof(buf), "error: invalid syntax\n");
+                       input->reply(input, buf, strlen(buf));
+               }
+               return -1;
+       }
+
+       // or outputs (nb_cores * nb_tasks) lines, one line for each core/task pair:
+       // - if the core/task pair is invalid, the output line reports an error
+       // - otherwise, the output line provides the dataplane statistics for the core/task pair
+       for (unsigned int i = 0; i < nb_cores; i++) {
+               for (unsigned int j = 0; j < nb_tasks; j++) {
+                       lcore_id = lcores[i];
+                       task_id = tasks[j];
+                       if (core_task_is_valid(lcore_id, task_id) == 0) {
+                               if (input->reply) {
+                                       char buf[128];
+                                       snprintf(buf, sizeof(buf), "error: invalid core %u, task %u\n", lcore_id, task_id);
+                                       input->reply(input, buf, strlen(buf));
+                               } else {
+                                       plog_info("error: invalid core %u, task %u\n", lcore_id, task_id);
+                               }
+                               continue;
+                       }
+                       uint64_t tot_rx = stats_core_task_tot_rx(lcore_id, task_id);
+                       uint64_t tot_tx = stats_core_task_tot_tx(lcore_id, task_id);
+                       uint64_t tot_tx_fail = stats_core_task_tot_tx_fail(lcore_id, task_id);
+                       uint64_t tot_rx_non_dp = stats_core_task_tot_rx_non_dp(lcore_id, task_id);
+                       uint64_t tot_tx_non_dp = stats_core_task_tot_tx_non_dp(lcore_id, task_id);
+                       uint64_t tot_drop = stats_core_task_tot_drop(lcore_id, task_id);
+                       uint64_t last_tsc = stats_core_task_last_tsc(lcore_id, task_id);
+
+                       if (input->reply) {
+                               char buf[128];
+                               snprintf(buf, sizeof(buf),
+                                       "%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%u,%u\n",
+                                       tot_rx, tot_tx, tot_rx_non_dp, tot_tx_non_dp, tot_drop, tot_tx_fail, last_tsc, rte_get_tsc_hz(), lcore_id, task_id);
+                               input->reply(input, buf, strlen(buf));
+                       }
+                       else {
+                               plog_info("core: %u, task: %u, RX: %"PRIu64", TX: %"PRIu64", RX_NON_DP: %"PRIu64", TX_NON_DP: %"PRIu64", DROP: %"PRIu64", TX_FAIL: %"PRIu64"\n",
+                                       lcore_id, task_id, tot_rx, tot_tx, tot_rx_non_dp, tot_tx_non_dp, tot_drop, tot_tx_fail);
+                       }
+               }
+       }
+       return 0;
+}
+
 static int parse_cmd_lat_stats(const char *str, struct input *input)
 {
-       unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, nb_cores;
+       unsigned lcores[RTE_MAX_LCORE], tasks[MAX_TASKS_PER_CORE], lcore_id, task_id, nb_cores, nb_tasks;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       // This function either outputs a single line, in case of syntax error on the lists of cores and/or tasks
+       if (parse_cores_tasks(str, lcores, tasks, &nb_cores, &nb_tasks)) {
+               if (input->reply) {
+                       char buf[128];
+                       snprintf(buf, sizeof(buf), "error: invalid syntax\n");
+                       input->reply(input, buf, strlen(buf));
+               }
                return -1;
+       }
 
-       if (cores_task_are_valid(lcores, task_id, nb_cores)) {
-               for (unsigned int i = 0; i < nb_cores; i++) {
+       // or outputs (nb_cores * nb_tasks) lines, one line for each core/task pair:
+       // - if the core/task pair is invalid, the output line reports an error
+       // - otherwise, the output line provides the latency statistics for the core/task pair
+       for (unsigned int i = 0; i < nb_cores; i++) {
+               for (unsigned int j = 0; j < nb_tasks; j++) {
                        lcore_id = lcores[i];
-                       if (!task_is_mode(lcore_id, task_id, "lat")) {
-                               plog_err("Core %u task %u is not measuring latency\n", lcore_id, task_id);
+                       task_id = tasks[j];
+                       if (core_task_is_valid(lcore_id, task_id) == 0) {
+                               if (input->reply) {
+                                       char buf[128];
+                                       snprintf(buf, sizeof(buf), "error: invalid core %u, task %u\n", lcore_id, task_id);
+                                       input->reply(input, buf, strlen(buf));
+                               } else {
+                                       plog_info("error: invalid core %u, task %u\n", lcore_id, task_id);
+                               }
+                       } else if (!task_is_mode(lcore_id, task_id, "lat")) {
+                               if (input->reply) {
+                                       char buf[128];
+                                       snprintf(buf, sizeof(buf), "error: core %u task %u is not measuring latency\n", lcore_id, task_id);
+                                       input->reply(input, buf, strlen(buf));
+                               } else {
+                                       plog_info("error: core %u task %u is not measuring latency\n", lcore_id, task_id);
+                               }
                        }
                        else {
                                struct stats_latency *stats = stats_latency_find(lcore_id, task_id);
                                struct stats_latency *tot = stats_latency_tot_find(lcore_id, task_id);
+                               if (!stats || !tot) {
+                                       if (input->reply) {
+                                               char buf[128];
+                                               snprintf(buf, sizeof(buf),
+                                                        "error: core %u task %u stats = %p tot = %p\n",
+                                                        lcore_id, task_id, stats, tot);
+                                               input->reply(input, buf, strlen(buf));
+                                       } else {
+                                               plog_info("error: core %u task %u stats = %p tot = %p\n",
+                                                         lcore_id, task_id, stats, tot);
+                                       }
+                                       continue;
+                               }
 
                                uint64_t last_tsc = stats_core_task_last_tsc(lcore_id, task_id);
                                uint64_t lat_min_usec = time_unit_to_usec(&stats->min.time);
@@ -1640,18 +1788,22 @@ static int parse_cmd_lat_stats(const char *str, struct input *input)
                                if (input->reply) {
                                        char buf[128];
                                        snprintf(buf, sizeof(buf),
-                                               "%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64"\n",
+                                                "%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%u,%u\n",
                                                 lat_min_usec,
                                                 lat_max_usec,
                                                 lat_avg_usec,
                                                 tot_lat_min_usec,
                                                 tot_lat_max_usec,
                                                 last_tsc,
-                                                rte_get_tsc_hz());
+                                                rte_get_tsc_hz(),
+                                                lcore_id,
+                                                task_id);
                                        input->reply(input, buf, strlen(buf));
                                }
                                else {
-                                       plog_info("min: %"PRIu64", max: %"PRIu64", avg: %"PRIu64", min since reset: %"PRIu64", max since reset: %"PRIu64"\n",
+                                       plog_info("core: %u, task: %u, min: %"PRIu64", max: %"PRIu64", avg: %"PRIu64", min since reset: %"PRIu64", max since reset: %"PRIu64"\n",
+                                                 lcore_id,
+                                                 task_id,
                                                  lat_min_usec,
                                                  lat_max_usec,
                                                  lat_avg_usec,
@@ -1670,7 +1822,7 @@ static int parse_cmd_show_irq_buckets(const char *str, struct input *input)
        unsigned int i, c;
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, nb_cores;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
 
        if (cores_task_are_valid(lcores, task_id, nb_cores)) {
@@ -1691,7 +1843,7 @@ static int parse_cmd_irq(const char *str, struct input *input)
        unsigned int i, c;
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, nb_cores;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
 
        if (cores_task_are_valid(lcores, task_id, nb_cores)) {
@@ -1739,7 +1891,7 @@ static int parse_cmd_lat_packets(const char *str, struct input *input)
 {
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, nb_cores;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
 
        if (cores_task_are_valid(lcores, task_id, nb_cores)) {
@@ -1760,7 +1912,7 @@ static int parse_cmd_cgnat_public_hash(const char *str, struct input *input)
 {
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, nb_cores;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
 
        if (cores_task_are_valid(lcores, task_id, nb_cores)) {
@@ -1784,7 +1936,7 @@ static int parse_cmd_cgnat_private_hash(const char *str, struct input *input)
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, nb_cores;
        uint32_t val;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
 
        if (cores_task_are_valid(lcores, task_id, nb_cores)) {
@@ -1808,7 +1960,7 @@ static int parse_cmd_accuracy(const char *str, struct input *input)
        unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, nb_cores;
        uint32_t val;
 
-       if (parse_core_task(str, lcores, &task_id, &nb_cores))
+       if (parse_cores_task(str, lcores, &task_id, &nb_cores))
                return -1;
        if (!(str = strchr_skip_twice(str, ' ')))
                return -1;
@@ -1932,7 +2084,9 @@ static struct cmd_str cmd_strings[] = {
        {"lat packets", "<core id> <task id>", "Print the latency for each of the last set of packets", parse_cmd_lat_packets},
        {"accuracy limit", "<core id> <task id> <nsec>", "Only consider latency of packets that were measured with an error no more than <nsec>", parse_cmd_accuracy},
        {"core stats", "<core id> <task id>", "Print rx/tx/drop for task <task id> running on core <core id>", parse_cmd_core_stats},
+       {"dp core stats", "<core id> <task id>", "Print rx/tx/non_dp_rx/non_dp_tx/drop for task <task id> running on core <core id>", parse_cmd_dp_core_stats},
        {"port_stats", "<port id>", "Print rate for no_mbufs, ierrors + imissed, rx_bytes, tx_bytes, rx_pkts, tx_pkts; totals for RX, TX, no_mbufs, ierrors + imissed for port <port id>", parse_cmd_port_stats},
+       {"multi port stats", "<port list>", "Get stats for multiple ports, semi-colon separated: port id, total for rx_pkts, tx_pkts, no_mbufs, ierrors + imissed, last_tsc", parse_cmd_multi_port_stats},
        {"read reg", "", "Read register", parse_cmd_read_reg},
        {"write reg", "", "Read register", parse_cmd_write_reg},
        {"set vlan offload", "", "Set Vlan offload", parse_cmd_set_vlan_offload},