X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fip_pipeline%2Fcli.c;h=a92467e63d4ae9221ec57dded504cb65bce9c0c1;hb=261bbff75e34dbbefcbf13d672b902eb0a917c5e;hp=9fd7f32760a1a8043aff6d214084747695c7f8c5;hpb=f634e4c5698a90f647e80fa3c11e3b1dc04b4ff8;p=dpdk.git diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c index 9fd7f32760..a92467e63d 100644 --- a/examples/ip_pipeline/cli.c +++ b/examples/ip_pipeline/cli.c @@ -9,8 +9,11 @@ #include #include +#include #include "cli.h" + +#include "cryptodev.h" #include "kni.h" #include "link.h" #include "mempool.h" @@ -25,16 +28,17 @@ #define CMD_MAX_TOKENS 256 #endif -#define MSG_OUT_OF_MEMORY "Not enough memory.\n" -#define MSG_CMD_UNKNOWN "Unknown command \"%s\".\n" -#define MSG_CMD_UNIMPLEM "Command \"%s\" not implemented.\n" -#define MSG_ARG_NOT_ENOUGH "Not enough arguments for command \"%s\".\n" -#define MSG_ARG_TOO_MANY "Too many arguments for command \"%s\".\n" -#define MSG_ARG_MISMATCH "Wrong number of arguments for command \"%s\".\n" -#define MSG_ARG_NOT_FOUND "Argument \"%s\" not found.\n" -#define MSG_ARG_INVALID "Invalid value for argument \"%s\".\n" -#define MSG_FILE_ERR "Error in file \"%s\" at line %u.\n" -#define MSG_CMD_FAIL "Command \"%s\" failed.\n" +#define MSG_OUT_OF_MEMORY "Not enough memory.\n" +#define MSG_CMD_UNKNOWN "Unknown command \"%s\".\n" +#define MSG_CMD_UNIMPLEM "Command \"%s\" not implemented.\n" +#define MSG_ARG_NOT_ENOUGH "Not enough arguments for command \"%s\".\n" +#define MSG_ARG_TOO_MANY "Too many arguments for command \"%s\".\n" +#define MSG_ARG_MISMATCH "Wrong number of arguments for command \"%s\".\n" +#define MSG_ARG_NOT_FOUND "Argument \"%s\" not found.\n" +#define MSG_ARG_INVALID "Invalid value for argument \"%s\".\n" +#define MSG_FILE_ERR "Error in file \"%s\" at line %u.\n" +#define MSG_FILE_NOT_ENOUGH "Not enough rules in file \"%s\".\n" +#define MSG_CMD_FAIL "Command \"%s\" failed.\n" static int is_comment(char *in) @@ -47,13 +51,13 @@ is_comment(char *in) return 0; } -/** - * mempool - * buffer - * pool - * cache - * cpu - */ +static const char cmd_mempool_help[] = +"mempool \n" +" buffer \n" +" pool \n" +" cache \n" +" cpu \n"; + static void cmd_mempool(char **tokens, uint32_t n_tokens, @@ -118,14 +122,14 @@ cmd_mempool(char **tokens, } } -/** - * link - * dev | port - * rxq - * txq - * promiscuous on | off - * [rss ... ] - */ +static const char cmd_link_help[] = +"link \n" +" dev | port \n" +" rxq \n" +" txq \n" +" promiscuous on | off\n" +" [rss ... ]\n"; + static void cmd_link(char **tokens, uint32_t n_tokens, @@ -137,6 +141,8 @@ cmd_link(char **tokens, struct link *link; char *name; + memset(&p, 0, sizeof(p)); + if ((n_tokens < 13) || (n_tokens > 14 + LINK_RXQ_RSS_MAX)) { snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); return; @@ -234,11 +240,96 @@ cmd_link(char **tokens, } } -/** - * swq - * size - * cpu +/* Print the link stats and info */ +static void +print_link_info(struct link *link, char *out, size_t out_size) +{ + struct rte_eth_stats stats; + struct ether_addr mac_addr; + struct rte_eth_link eth_link; + uint16_t mtu; + + memset(&stats, 0, sizeof(stats)); + rte_eth_stats_get(link->port_id, &stats); + + rte_eth_macaddr_get(link->port_id, &mac_addr); + rte_eth_link_get(link->port_id, ð_link); + rte_eth_dev_get_mtu(link->port_id, &mtu); + + snprintf(out, 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" + "\tRX packets %" PRIu64" bytes %" PRIu64"\n" + "\tRX errors %" PRIu64" missed %" PRIu64" no-mbuf %" PRIu64"\n" + "\tTX packets %" PRIu64" bytes %" PRIu64"\n" + "\tTX errors %" PRIu64"\n", + link->name, + eth_link.link_status == 0 ? "DOWN" : "UP", + mtu, + mac_addr.addr_bytes[0], mac_addr.addr_bytes[1], + mac_addr.addr_bytes[2], mac_addr.addr_bytes[3], + mac_addr.addr_bytes[4], mac_addr.addr_bytes[5], + link->n_rxq, + link->n_txq, + link->port_id, + eth_link.link_speed, + stats.ipackets, + stats.ibytes, + stats.ierrors, + stats.imissed, + stats.rx_nombuf, + stats.opackets, + stats.obytes, + stats.oerrors); +} + +/* + * link show [] */ +static void +cmd_link_show(char **tokens, uint32_t n_tokens, char *out, size_t out_size) +{ + struct link *link; + char *link_name; + + if (n_tokens != 2 && n_tokens != 3) { + snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); + return; + } + + if (n_tokens == 2) { + link = link_next(NULL); + + while (link != NULL) { + out_size = out_size - strlen(out); + out = &out[strlen(out)]; + + print_link_info(link, out, out_size); + link = link_next(link); + } + } else { + out_size = out_size - strlen(out); + out = &out[strlen(out)]; + + link_name = tokens[2]; + link = link_find(link_name); + + if (link == NULL) { + snprintf(out, out_size, MSG_ARG_INVALID, + "Link does not exist"); + return; + } + print_link_info(link, out, out_size); + } +} + +static const char cmd_swq_help[] = +"swq \n" +" size \n" +" cpu \n"; + static void cmd_swq(char **tokens, uint32_t n_tokens, @@ -283,12 +374,12 @@ cmd_swq(char **tokens, } } -/** - * tmgr subport profile - * - * - * - */ +static const char cmd_tmgr_subport_profile_help[] = +"tmgr subport profile\n" +" \n" +" \n" +" \n"; + static void cmd_tmgr_subport_profile(char **tokens, uint32_t n_tokens, @@ -331,14 +422,14 @@ cmd_tmgr_subport_profile(char **tokens, } } -/** - * tmgr pipe profile - * - * - * - * - * - */ +static const char cmd_tmgr_pipe_profile_help[] = +"tmgr pipe profile\n" +" \n" +" \n" +" \n" +" \n" +" \n"; + static void cmd_tmgr_pipe_profile(char **tokens, uint32_t n_tokens, @@ -394,16 +485,16 @@ cmd_tmgr_pipe_profile(char **tokens, } } -/** - * tmgr - * rate - * spp - * pps - * qsize - * fo - * mtu - * cpu - */ +static const char cmd_tmgr_help[] = +"tmgr \n" +" rate \n" +" spp \n" +" pps \n" +" qsize \n" +" fo \n" +" mtu \n" +" cpu \n"; + static void cmd_tmgr(char **tokens, uint32_t n_tokens, @@ -500,10 +591,10 @@ cmd_tmgr(char **tokens, } } -/** - * tmgr subport - * profile - */ +static const char cmd_tmgr_subport_help[] = +"tmgr subport \n" +" profile \n"; + static void cmd_tmgr_subport(char **tokens, uint32_t n_tokens, @@ -538,11 +629,12 @@ cmd_tmgr_subport(char **tokens, } } -/** - * tmgr subport pipe - * from to - * profile - */ + +static const char cmd_tmgr_subport_pipe_help[] = +"tmgr subport pipe\n" +" from to \n" +" profile \n"; + static void cmd_tmgr_subport_pipe(char **tokens, uint32_t n_tokens, @@ -608,9 +700,10 @@ cmd_tmgr_subport_pipe(char **tokens, } } -/** - * tap - */ + +static const char cmd_tap_help[] = +"tap \n"; + static void cmd_tap(char **tokens, uint32_t n_tokens, @@ -634,12 +727,12 @@ cmd_tap(char **tokens, } } -/** - * kni - * link - * mempool - * [thread ] - */ +static const char cmd_kni_help[] = +"kni \n" +" link \n" +" mempool \n" +" [thread ]\n"; + static void cmd_kni(char **tokens, uint32_t n_tokens, @@ -650,6 +743,7 @@ cmd_kni(char **tokens, char *name; struct kni *kni; + memset(&p, 0, sizeof(p)); if ((n_tokens != 6) && (n_tokens != 8)) { snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); return; @@ -693,11 +787,84 @@ cmd_kni(char **tokens, } } -/** - * port in action profile - * [filter match | mismatch offset mask key port ] - * [balance offset mask port ... ] - */ +static const char cmd_cryptodev_help[] = +"cryptodev \n" +" dev | dev_id \n" +" queue \n" +" max_sessions "; + +static void +cmd_cryptodev(char **tokens, + uint32_t n_tokens, + char *out, + size_t out_size) +{ + struct cryptodev_params params; + char *name; + + memset(¶ms, 0, sizeof(params)); + if (n_tokens != 9) { + snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); + return; + } + + name = tokens[1]; + + if (strcmp(tokens[2], "dev") == 0) + params.dev_name = tokens[3]; + else if (strcmp(tokens[2], "dev_id") == 0) { + if (parser_read_uint32(¶ms.dev_id, tokens[3]) < 0) { + snprintf(out, out_size, MSG_ARG_INVALID, + "dev_id"); + return; + } + } else { + snprintf(out, out_size, MSG_ARG_INVALID, + "cryptodev"); + return; + } + + if (strcmp(tokens[4], "queue")) { + snprintf(out, out_size, MSG_ARG_NOT_FOUND, + "queue"); + return; + } + + if (parser_read_uint32(¶ms.n_queues, tokens[5]) < 0) { + snprintf(out, out_size, MSG_ARG_INVALID, + "q"); + return; + } + + if (parser_read_uint32(¶ms.queue_size, tokens[6]) < 0) { + snprintf(out, out_size, MSG_ARG_INVALID, + "queue_size"); + return; + } + + if (strcmp(tokens[7], "max_sessions")) { + snprintf(out, out_size, MSG_ARG_NOT_FOUND, + "max_sessions"); + return; + } + + if (parser_read_uint32(¶ms.session_pool_size, tokens[8]) < 0) { + snprintf(out, out_size, MSG_ARG_INVALID, + "queue_size"); + return; + } + + if (cryptodev_create(name, ¶ms) == NULL) { + snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]); + return; + } +} + +static const char cmd_port_in_action_profile_help[] = +"port in action profile \n" +" [filter match | mismatch offset mask key port ]\n" +" [balance offset mask port ... ]\n"; + static void cmd_port_in_action_profile(char **tokens, uint32_t n_tokens, @@ -804,7 +971,8 @@ cmd_port_in_action_profile(char **tokens, uint32_t i; if (n_tokens < t0 + 22) { - snprintf(out, out_size, MSG_ARG_MISMATCH, "port in action profile balance"); + snprintf(out, out_size, MSG_ARG_MISMATCH, + "port in action profile balance"); return; } @@ -856,23 +1024,29 @@ cmd_port_in_action_profile(char **tokens, } } -/** - * table action profile - * ipv4 | ipv6 - * offset - * fwd - * [meter srtcm | trtcm - * tc - * stats none | pkts | bytes | both] - * [tm spp pps ] - * [encap ether | vlan | qinq | mpls | pppoe] - * [nat src | dst - * proto udp | tcp] - * [ttl drop | fwd - * stats none | pkts] - * [stats pkts | bytes | both] - * [time] - */ + +static const char cmd_table_action_profile_help[] = +"table action profile \n" +" ipv4 | ipv6\n" +" offset \n" +" fwd\n" +" [balance offset mask outoffset ]\n" +" [meter srtcm | trtcm\n" +" tc \n" +" stats none | pkts | bytes | both]\n" +" [tm spp pps ]\n" +" [encap ether | vlan | qinq | mpls | pppoe |\n" +" vxlan offset ipv4 | ipv6 vlan on | off]\n" +" [nat src | dst\n" +" proto udp | tcp]\n" +" [ttl drop | fwd\n" +" stats none | pkts]\n" +" [stats pkts | bytes | both]\n" +" [time]\n" +" [sym_crypto dev offset ]\n" +" [tag]\n" +" [decap]\n"; + static void cmd_table_action_profile(char **tokens, uint32_t n_tokens, @@ -930,6 +1104,47 @@ cmd_table_action_profile(char **tokens, p.action_mask |= 1LLU << RTE_TABLE_ACTION_FWD; t0 = 8; + if ((t0 < n_tokens) && (strcmp(tokens[t0], "balance") == 0)) { + if (n_tokens < t0 + 7) { + snprintf(out, out_size, MSG_ARG_MISMATCH, "table action profile balance"); + return; + } + + if (strcmp(tokens[t0 + 1], "offset") != 0) { + snprintf(out, out_size, MSG_ARG_NOT_FOUND, "offset"); + return; + } + + if (parser_read_uint32(&p.lb.key_offset, tokens[t0 + 2]) != 0) { + snprintf(out, out_size, MSG_ARG_INVALID, "key_offset"); + return; + } + + if (strcmp(tokens[t0 + 3], "mask") != 0) { + snprintf(out, out_size, MSG_ARG_NOT_FOUND, "mask"); + return; + } + + p.lb.key_size = RTE_PORT_IN_ACTION_LB_KEY_SIZE_MAX; + if (parse_hex_string(tokens[t0 + 4], p.lb.key_mask, &p.lb.key_size) != 0) { + snprintf(out, out_size, MSG_ARG_INVALID, "key_mask"); + return; + } + + if (strcmp(tokens[t0 + 5], "outoffset") != 0) { + snprintf(out, out_size, MSG_ARG_NOT_FOUND, "outoffset"); + return; + } + + if (parser_read_uint32(&p.lb.out_offset, tokens[t0 + 6]) != 0) { + snprintf(out, out_size, MSG_ARG_INVALID, "out_offset"); + return; + } + + p.action_mask |= 1LLU << RTE_TABLE_ACTION_LB; + t0 += 7; + } /* balance */ + if ((t0 < n_tokens) && (strcmp(tokens[t0], "meter") == 0)) { if (n_tokens < t0 + 6) { snprintf(out, out_size, MSG_ARG_MISMATCH, @@ -1020,6 +1235,8 @@ cmd_table_action_profile(char **tokens, } /* tm */ if ((t0 < n_tokens) && (strcmp(tokens[t0], "encap") == 0)) { + uint32_t n_extra_tokens = 0; + if (n_tokens < t0 + 2) { snprintf(out, out_size, MSG_ARG_MISMATCH, "action profile encap"); @@ -1036,13 +1253,61 @@ cmd_table_action_profile(char **tokens, p.encap.encap_mask = 1LLU << RTE_TABLE_ACTION_ENCAP_MPLS; else if (strcmp(tokens[t0 + 1], "pppoe") == 0) p.encap.encap_mask = 1LLU << RTE_TABLE_ACTION_ENCAP_PPPOE; - else { + else if (strcmp(tokens[t0 + 1], "vxlan") == 0) { + if (n_tokens < t0 + 2 + 5) { + snprintf(out, out_size, MSG_ARG_MISMATCH, + "action profile encap vxlan"); + return; + } + + if (strcmp(tokens[t0 + 2], "offset") != 0) { + snprintf(out, out_size, MSG_ARG_NOT_FOUND, + "vxlan: offset"); + return; + } + + if (parser_read_uint32(&p.encap.vxlan.data_offset, + tokens[t0 + 2 + 1]) != 0) { + snprintf(out, out_size, MSG_ARG_INVALID, + "vxlan: ether_offset"); + return; + } + + if (strcmp(tokens[t0 + 2 + 2], "ipv4") == 0) + p.encap.vxlan.ip_version = 1; + else if (strcmp(tokens[t0 + 2 + 2], "ipv6") == 0) + p.encap.vxlan.ip_version = 0; + else { + snprintf(out, out_size, MSG_ARG_INVALID, + "vxlan: ipv4 or ipv6"); + return; + } + + if (strcmp(tokens[t0 + 2 + 3], "vlan") != 0) { + snprintf(out, out_size, MSG_ARG_NOT_FOUND, + "vxlan: vlan"); + return; + } + + if (strcmp(tokens[t0 + 2 + 4], "on") == 0) + p.encap.vxlan.vlan = 1; + else if (strcmp(tokens[t0 + 2 + 4], "off") == 0) + p.encap.vxlan.vlan = 0; + else { + snprintf(out, out_size, MSG_ARG_INVALID, + "vxlan: on or off"); + return; + } + + p.encap.encap_mask = 1LLU << RTE_TABLE_ACTION_ENCAP_VXLAN; + n_extra_tokens = 5; + } else { snprintf(out, out_size, MSG_ARG_MISMATCH, "encap"); return; } p.action_mask |= 1LLU << RTE_TABLE_ACTION_ENCAP; - t0 += 2; + t0 += 2 + n_extra_tokens; } /* encap */ if ((t0 < n_tokens) && (strcmp(tokens[t0], "nat") == 0)) { @@ -1148,6 +1413,51 @@ cmd_table_action_profile(char **tokens, t0 += 1; } /* time */ + if ((t0 < n_tokens) && (strcmp(tokens[t0], "sym_crypto") == 0)) { + struct cryptodev *cryptodev; + + if (n_tokens < t0 + 5 || + strcmp(tokens[t0 + 1], "dev") || + strcmp(tokens[t0 + 3], "offset")) { + snprintf(out, out_size, MSG_ARG_MISMATCH, + "table action profile sym_crypto"); + return; + } + + cryptodev = cryptodev_find(tokens[t0 + 2]); + if (cryptodev == NULL) { + snprintf(out, out_size, MSG_ARG_INVALID, + "table action profile sym_crypto"); + return; + } + + p.sym_crypto.cryptodev_id = cryptodev->dev_id; + + if (parser_read_uint32(&p.sym_crypto.op_offset, + tokens[t0 + 4]) != 0) { + snprintf(out, out_size, MSG_ARG_INVALID, + "table action profile sym_crypto"); + return; + } + + p.sym_crypto.mp_create = cryptodev->mp_create; + p.sym_crypto.mp_init = cryptodev->mp_init; + + p.action_mask |= 1LLU << RTE_TABLE_ACTION_SYM_CRYPTO; + + t0 += 5; + } /* sym_crypto */ + + if ((t0 < n_tokens) && (strcmp(tokens[t0], "tag") == 0)) { + p.action_mask |= 1LLU << RTE_TABLE_ACTION_TAG; + t0 += 1; + } /* tag */ + + if ((t0 < n_tokens) && (strcmp(tokens[t0], "decap") == 0)) { + p.action_mask |= 1LLU << RTE_TABLE_ACTION_DECAP; + t0 += 1; + } /* decap */ + if (t0 < n_tokens) { snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); return; @@ -1160,12 +1470,12 @@ cmd_table_action_profile(char **tokens, } } -/** - * pipeline - * period - * offset_port_id - * cpu - */ +static const char cmd_pipeline_help[] = +"pipeline \n" +" period \n" +" offset_port_id \n" +" cpu \n"; + static void cmd_pipeline(char **tokens, uint32_t n_tokens, @@ -1220,18 +1530,19 @@ cmd_pipeline(char **tokens, } } -/** - * pipeline port in - * bsz - * link rxq - * | swq - * | tmgr - * | tap mempool mtu - * | kni - * | source mempool file bpp - * [action ] - * [disabled] - */ +static const char cmd_pipeline_port_in_help[] = +"pipeline port in\n" +" bsz \n" +" link rxq \n" +" | swq \n" +" | tmgr \n" +" | tap mempool mtu \n" +" | kni \n" +" | source mempool file bpp \n" +" | cryptodev rxq \n" +" [action ]\n" +" [disabled]\n"; + static void cmd_pipeline_port_in(char **tokens, uint32_t n_tokens, @@ -1401,6 +1712,26 @@ cmd_pipeline_port_in(char **tokens, } t0 += 7; + } else if (strcmp(tokens[t0], "cryptodev") == 0) { + if (n_tokens < t0 + 3) { + snprintf(out, out_size, MSG_ARG_MISMATCH, + "pipeline port in cryptodev"); + return; + } + + p.type = PORT_IN_CRYPTODEV; + + p.dev_name = tokens[t0 + 1]; + if (parser_read_uint16(&p.rxq.queue_id, tokens[t0 + 3]) != 0) { + snprintf(out, out_size, MSG_ARG_INVALID, + "rxq"); + return; + } + + p.cryptodev.arg_callback = NULL; + p.cryptodev.f_callback = NULL; + + t0 += 4; } else { snprintf(out, out_size, MSG_ARG_INVALID, tokens[0]); return; @@ -1439,16 +1770,17 @@ cmd_pipeline_port_in(char **tokens, } } -/** - * pipeline port out - * bsz - * link txq - * | swq - * | tmgr - * | tap - * | kni - * | sink [file pkts ] - */ +static const char cmd_pipeline_port_out_help[] = +"pipeline port out\n" +" bsz \n" +" link txq \n" +" | swq \n" +" | tmgr \n" +" | tap \n" +" | kni \n" +" | sink [file pkts ]\n" +" | cryptodev txq offset \n"; + static void cmd_pipeline_port_out(char **tokens, uint32_t n_tokens, @@ -1581,6 +1913,41 @@ cmd_pipeline_port_out(char **tokens, return; } } + + } else if (strcmp(tokens[6], "cryptodev") == 0) { + if (n_tokens != 12) { + snprintf(out, out_size, MSG_ARG_MISMATCH, + "pipeline port out cryptodev"); + return; + } + + p.type = PORT_OUT_CRYPTODEV; + + p.dev_name = tokens[7]; + + if (strcmp(tokens[8], "txq")) { + snprintf(out, out_size, MSG_ARG_MISMATCH, + "pipeline port out cryptodev"); + return; + } + + if (parser_read_uint16(&p.cryptodev.queue_id, tokens[9]) + != 0) { + snprintf(out, out_size, MSG_ARG_INVALID, "queue_id"); + return; + } + + if (strcmp(tokens[10], "offset")) { + snprintf(out, out_size, MSG_ARG_MISMATCH, + "pipeline port out cryptodev"); + return; + } + + if (parser_read_uint32(&p.cryptodev.op_offset, tokens[11]) + != 0) { + snprintf(out, out_size, MSG_ARG_INVALID, "queue_id"); + return; + } } else { snprintf(out, out_size, MSG_ARG_INVALID, tokens[0]); return; @@ -1593,30 +1960,30 @@ cmd_pipeline_port_out(char **tokens, } } -/** - * pipeline table - * match - * acl - * ipv4 | ipv6 - * offset - * size - * | array - * offset - * size - * | hash - * ext | lru - * key - * mask - * offset - * buckets - * size - * | lpm - * ipv4 | ipv6 - * offset - * size - * | stub - * [action ] - */ +static const char cmd_pipeline_table_help[] = +"pipeline table\n" +" match\n" +" acl\n" +" ipv4 | ipv6\n" +" offset \n" +" size \n" +" | array\n" +" offset \n" +" size \n" +" | hash\n" +" ext | lru\n" +" key \n" +" mask \n" +" offset \n" +" buckets \n" +" size \n" +" | lpm\n" +" ipv4 | ipv6\n" +" offset \n" +" size \n" +" | stub\n" +" [action ]\n"; + static void cmd_pipeline_table(char **tokens, uint32_t n_tokens, @@ -1846,12 +2213,6 @@ cmd_pipeline_table(char **tokens, t0 += 6; } else if (strcmp(tokens[t0], "stub") == 0) { - if (n_tokens < t0 + 1) { - snprintf(out, out_size, MSG_ARG_MISMATCH, - "pipeline table stub"); - return; - } - p.match_type = TABLE_STUB; t0 += 1; @@ -1884,9 +2245,9 @@ cmd_pipeline_table(char **tokens, } } -/** - * pipeline port in table - */ +static const char cmd_pipeline_port_in_table_help[] = +"pipeline port in table \n"; + static void cmd_pipeline_port_in_table(char **tokens, uint32_t n_tokens, @@ -1938,9 +2299,9 @@ cmd_pipeline_port_in_table(char **tokens, } } -/** - * pipeline port in stats read [clear] - */ + +static const char cmd_pipeline_port_in_stats_help[] = +"pipeline port in stats read [clear]\n"; #define MSG_PIPELINE_PORT_IN_STATS \ "Pkts in: %" PRIu64 "\n" \ @@ -2015,9 +2376,10 @@ cmd_pipeline_port_in_stats(char **tokens, stats.stats.n_pkts_drop); } -/** - * pipeline port in enable - */ + +static const char cmd_pipeline_port_in_enable_help[] = +"pipeline port in enable\n"; + static void cmd_pipeline_port_in_enable(char **tokens, uint32_t n_tokens, @@ -2062,9 +2424,10 @@ cmd_pipeline_port_in_enable(char **tokens, } } -/** - * pipeline port in disable - */ + +static const char cmd_pipeline_port_in_disable_help[] = +"pipeline port in disable\n"; + static void cmd_pipeline_port_in_disable(char **tokens, uint32_t n_tokens, @@ -2109,9 +2472,10 @@ cmd_pipeline_port_in_disable(char **tokens, } } -/** - * pipeline port out stats read [clear] - */ + +static const char cmd_pipeline_port_out_stats_help[] = +"pipeline port out stats read [clear]\n"; + #define MSG_PIPELINE_PORT_OUT_STATS \ "Pkts in: %" PRIu64 "\n" \ "Pkts dropped by AH: %" PRIu64 "\n" \ @@ -2185,9 +2549,10 @@ cmd_pipeline_port_out_stats(char **tokens, stats.stats.n_pkts_drop); } -/** - * pipeline table stats read [clear] - */ + +static const char cmd_pipeline_table_stats_help[] = +"pipeline table stats read [clear]\n"; + #define MSG_PIPELINE_TABLE_STATS \ "Pkts in: %" PRIu64 "\n" \ "Pkts in with lookup miss: %" PRIu64 "\n" \ @@ -2270,8 +2635,7 @@ cmd_pipeline_table_stats(char **tokens, * priority * ipv4 | ipv6 * - * | array - * pos + * | array * | hash * raw * | ipv4_5tuple @@ -2727,11 +3091,31 @@ parse_match(char **tokens, * [label1