X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fip_pipeline%2Fcli.c;h=ec4acf0acadfee64ebed122c0166c5a528474122;hb=54a298e5f7f41c5883233dcd0f66fc57d7b351a2;hp=c72030682225db43a461a65a52a65a434561e49e;hpb=29169a4184416d56d2ed67d43ee059893fa5cbde;p=dpdk.git diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c index c720306822..ec4acf0aca 100644 --- a/examples/ip_pipeline/cli.c +++ b/examples/ip_pipeline/cli.c @@ -273,7 +273,7 @@ print_link_info(struct link *link, char *out, size_t out_size) "\n" "%s: flags=<%s> mtu %u\n" "\tether %02X:%02X:%02X:%02X:%02X:%02X rxqueues %u txqueues %u\n" - "\tport# %u speed %u Mbps\n" + "\tport# %u speed %s\n" "\tRX packets %" PRIu64" bytes %" PRIu64"\n" "\tRX errors %" PRIu64" missed %" PRIu64" no-mbuf %" PRIu64"\n" "\tTX packets %" PRIu64" bytes %" PRIu64"\n" @@ -287,7 +287,7 @@ print_link_info(struct link *link, char *out, size_t out_size) link->n_rxq, link->n_txq, link->port_id, - eth_link.link_speed, + rte_eth_link_speed_to_str(eth_link.link_speed), stats.ipackets, stats.ibytes, stats.ierrors, @@ -393,12 +393,7 @@ static const char cmd_tmgr_subport_profile_help[] = " " " " " \n" -" \n" -" pps \n" -" qsize " -" " -" " -" "; +" \n"; static void cmd_tmgr_subport_profile(char **tokens, @@ -406,57 +401,37 @@ cmd_tmgr_subport_profile(char **tokens, char *out, size_t out_size) { - struct rte_sched_subport_params p; + struct rte_sched_subport_profile_params subport_profile; int status, i; - if (n_tokens != 35) { + if (n_tokens != 19) { snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); return; } - if (parser_read_uint32(&p.tb_rate, tokens[3]) != 0) { + if (parser_read_uint64(&subport_profile.tb_rate, tokens[3]) != 0) { snprintf(out, out_size, MSG_ARG_INVALID, "tb_rate"); return; } - if (parser_read_uint32(&p.tb_size, tokens[4]) != 0) { + if (parser_read_uint64(&subport_profile.tb_size, tokens[4]) != 0) { snprintf(out, out_size, MSG_ARG_INVALID, "tb_size"); return; } for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++) - if (parser_read_uint32(&p.tc_rate[i], tokens[5 + i]) != 0) { + if (parser_read_uint64(&subport_profile.tc_rate[i], + tokens[5 + i]) != 0) { snprintf(out, out_size, MSG_ARG_INVALID, "tc_rate"); return; } - if (parser_read_uint32(&p.tc_period, tokens[18]) != 0) { + if (parser_read_uint64(&subport_profile.tc_period, tokens[18]) != 0) { snprintf(out, out_size, MSG_ARG_INVALID, "tc_period"); return; } - if (strcmp(tokens[19], "pps") != 0) { - snprintf(out, out_size, MSG_ARG_NOT_FOUND, "pps"); - return; - } - - if (parser_read_uint32(&p.n_pipes_per_subport_enabled, tokens[20]) != 0) { - snprintf(out, out_size, MSG_ARG_INVALID, "n_pipes_per_subport"); - return; - } - - if (strcmp(tokens[21], "qsize") != 0) { - snprintf(out, out_size, MSG_ARG_NOT_FOUND, "qsize"); - return; - } - - for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++) - if (parser_read_uint16(&p.qsize[i], tokens[22 + i]) != 0) { - snprintf(out, out_size, MSG_ARG_INVALID, "qsize"); - return; - } - - status = tmgr_subport_profile_add(&p); + status = tmgr_subport_profile_add(&subport_profile); if (status != 0) { snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]); return; @@ -487,23 +462,23 @@ cmd_tmgr_pipe_profile(char **tokens, return; } - if (parser_read_uint32(&p.tb_rate, tokens[3]) != 0) { + if (parser_read_uint64(&p.tb_rate, tokens[3]) != 0) { snprintf(out, out_size, MSG_ARG_INVALID, "tb_rate"); return; } - if (parser_read_uint32(&p.tb_size, tokens[4]) != 0) { + if (parser_read_uint64(&p.tb_size, tokens[4]) != 0) { snprintf(out, out_size, MSG_ARG_INVALID, "tb_size"); return; } for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++) - if (parser_read_uint32(&p.tc_rate[i], tokens[5 + i]) != 0) { + if (parser_read_uint64(&p.tc_rate[i], tokens[5 + i]) != 0) { snprintf(out, out_size, MSG_ARG_INVALID, "tc_rate"); return; } - if (parser_read_uint32(&p.tc_period, tokens[18]) != 0) { + if (parser_read_uint64(&p.tc_period, tokens[18]) != 0) { snprintf(out, out_size, MSG_ARG_INVALID, "tc_period"); return; } @@ -530,6 +505,7 @@ static const char cmd_tmgr_help[] = "tmgr \n" " rate \n" " spp \n" +" pps \n" " fo \n" " mtu \n" " cpu \n"; @@ -544,7 +520,7 @@ cmd_tmgr(char **tokens, char *name; struct tmgr_port *tmgr_port; - if (n_tokens != 12) { + if (n_tokens != 14) { snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); return; } @@ -556,7 +532,7 @@ cmd_tmgr(char **tokens, return; } - if (parser_read_uint32(&p.rate, tokens[3]) != 0) { + if (parser_read_uint64(&p.rate, tokens[3]) != 0) { snprintf(out, out_size, MSG_ARG_INVALID, "rate"); return; } @@ -571,32 +547,42 @@ cmd_tmgr(char **tokens, return; } - if (strcmp(tokens[6], "fo") != 0) { + if (strcmp(tokens[6], "pps") != 0) { + snprintf(out, out_size, MSG_ARG_NOT_FOUND, "spp"); + return; + } + + if (parser_read_uint32(&p.n_pipes_per_subport, tokens[7]) != 0) { + snprintf(out, out_size, MSG_ARG_INVALID, "n_pipes_per_subport"); + return; + } + + if (strcmp(tokens[8], "fo") != 0) { snprintf(out, out_size, MSG_ARG_NOT_FOUND, "fo"); return; } - if (parser_read_uint32(&p.frame_overhead, tokens[7]) != 0) { + if (parser_read_uint32(&p.frame_overhead, tokens[9]) != 0) { snprintf(out, out_size, MSG_ARG_INVALID, "frame_overhead"); return; } - if (strcmp(tokens[8], "mtu") != 0) { + if (strcmp(tokens[10], "mtu") != 0) { snprintf(out, out_size, MSG_ARG_NOT_FOUND, "mtu"); return; } - if (parser_read_uint32(&p.mtu, tokens[9]) != 0) { + if (parser_read_uint32(&p.mtu, tokens[11]) != 0) { snprintf(out, out_size, MSG_ARG_INVALID, "mtu"); return; } - if (strcmp(tokens[10], "cpu") != 0) { + if (strcmp(tokens[12], "cpu") != 0) { snprintf(out, out_size, MSG_ARG_NOT_FOUND, "cpu"); return; } - if (parser_read_uint32(&p.cpu_id, tokens[11]) != 0) { + if (parser_read_uint32(&p.cpu_id, tokens[13]) != 0) { snprintf(out, out_size, MSG_ARG_INVALID, "cpu_id"); return; } @@ -2671,7 +2657,7 @@ struct pkt_key_qinq { uint16_t svlan; uint16_t ethertype_cvlan; uint16_t cvlan; -} __attribute__((__packed__)); +} __rte_packed; struct pkt_key_ipv4_5tuple { uint8_t time_to_live; @@ -2681,7 +2667,7 @@ struct pkt_key_ipv4_5tuple { uint32_t da; uint16_t sp; uint16_t dp; -} __attribute__((__packed__)); +} __rte_packed; struct pkt_key_ipv6_5tuple { uint16_t payload_length; @@ -2691,15 +2677,15 @@ struct pkt_key_ipv6_5tuple { uint8_t da[16]; uint16_t sp; uint16_t dp; -} __attribute__((__packed__)); +} __rte_packed; struct pkt_key_ipv4_addr { uint32_t addr; -} __attribute__((__packed__)); +} __rte_packed; struct pkt_key_ipv6_addr { uint8_t addr[16]; -} __attribute__((__packed__)); +} __rte_packed; static uint32_t parse_match(char **tokens,