X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=examples%2Fip_pipeline%2Fcli.c;h=74215857ba2ef808c69fda6bfa0854846368ece4;hb=33e7afe6318d5eb3c0f852091af1c984cfbf5101;hp=3ff7caaca50e5c4292dd67889e0646c34d58786e;hpb=1edccebcccdbe600dc0a3a418fae68336648a87e;p=dpdk.git diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c index 3ff7caaca5..74215857ba 100644 --- a/examples/ip_pipeline/cli.c +++ b/examples/ip_pipeline/cli.c @@ -790,7 +790,8 @@ cmd_kni(char **tokens, static const char cmd_cryptodev_help[] = "cryptodev \n" " dev | dev_id \n" -" queue \n"; +" queue \n" +" max_sessions "; static void cmd_cryptodev(char **tokens, @@ -802,7 +803,7 @@ cmd_cryptodev(char **tokens, char *name; memset(¶ms, 0, sizeof(params)); - if (n_tokens != 7) { + if (n_tokens != 9) { snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); return; } @@ -825,7 +826,7 @@ cmd_cryptodev(char **tokens, if (strcmp(tokens[4], "queue")) { snprintf(out, out_size, MSG_ARG_NOT_FOUND, - "4"); + "queue"); return; } @@ -841,6 +842,18 @@ cmd_cryptodev(char **tokens, 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; @@ -1022,7 +1035,7 @@ static const char cmd_table_action_profile_help[] = " tc \n" " stats none | pkts | bytes | both]\n" " [tm spp pps ]\n" -" [encap ether | vlan | qinq | mpls | pppoe |\n" +" [encap ether | vlan | qinq | mpls | pppoe | qinq_pppoe \n" " vxlan offset ipv4 | ipv6 vlan on | off]\n" " [nat src | dst\n" " proto udp | tcp]\n" @@ -1030,9 +1043,9 @@ static const char cmd_table_action_profile_help[] = " stats none | pkts]\n" " [stats pkts | bytes | both]\n" " [time]\n" -" [sym_crypto dev offset " -" mempool_create \n" -" mempool_init ]\n"; +" [sym_crypto dev offset ]\n" +" [tag]\n" +" [decap]\n"; static void cmd_table_action_profile(char **tokens, @@ -1288,7 +1301,10 @@ cmd_table_action_profile(char **tokens, p.encap.encap_mask = 1LLU << RTE_TABLE_ACTION_ENCAP_VXLAN; n_extra_tokens = 5; - } else { + } else if (strcmp(tokens[t0 + 1], "qinq_pppoe") == 0) + p.encap.encap_mask = + 1LLU << RTE_TABLE_ACTION_ENCAP_QINQ_PPPOE; + else { snprintf(out, out_size, MSG_ARG_MISMATCH, "encap"); return; } @@ -1402,13 +1418,10 @@ cmd_table_action_profile(char **tokens, if ((t0 < n_tokens) && (strcmp(tokens[t0], "sym_crypto") == 0)) { struct cryptodev *cryptodev; - struct mempool *mempool; - if (n_tokens < t0 + 9 || + if (n_tokens < t0 + 5 || strcmp(tokens[t0 + 1], "dev") || - strcmp(tokens[t0 + 3], "offset") || - strcmp(tokens[t0 + 5], "mempool_create") || - strcmp(tokens[t0 + 7], "mempool_init")) { + strcmp(tokens[t0 + 3], "offset")) { snprintf(out, out_size, MSG_ARG_MISMATCH, "table action profile sym_crypto"); return; @@ -1430,27 +1443,24 @@ cmd_table_action_profile(char **tokens, return; } - mempool = mempool_find(tokens[t0 + 6]); - if (mempool == NULL) { - snprintf(out, out_size, MSG_ARG_INVALID, - "table action profile sym_crypto"); - return; - } - p.sym_crypto.mp_create = mempool->m; - - mempool = mempool_find(tokens[t0 + 8]); - if (mempool == NULL) { - snprintf(out, out_size, MSG_ARG_INVALID, - "table action profile sym_crypto"); - return; - } - p.sym_crypto.mp_init = mempool->m; + 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 += 9; + 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; @@ -3078,6 +3088,7 @@ parse_match(char **tokens, * ether * | vlan * | qinq + * | qinq_pppoe * | mpls unicast | multicast * * label0