Lines Matching refs:tokens

121 parse_tokenize_string(char *string, char *tokens[], uint32_t *n_tokens)  in parse_tokenize_string()  argument
126 (tokens == NULL) || in parse_tokenize_string()
131 tokens[i] = strtok_r(string, PARSE_DELIMITER, &string); in parse_tokenize_string()
132 if (tokens[i] == NULL) in parse_tokenize_string()
162 cmd_mempool(char **tokens, in cmd_mempool() argument
173 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); in cmd_mempool()
177 name = tokens[1]; in cmd_mempool()
179 if (strcmp(tokens[2], "buffer") != 0) { in cmd_mempool()
184 if (parser_read_uint32(&p.buffer_size, tokens[3]) != 0) { in cmd_mempool()
189 if (strcmp(tokens[4], "pool") != 0) { in cmd_mempool()
194 if (parser_read_uint32(&p.pool_size, tokens[5]) != 0) { in cmd_mempool()
199 if (strcmp(tokens[6], "cache") != 0) { in cmd_mempool()
204 if (parser_read_uint32(&p.cache_size, tokens[7]) != 0) { in cmd_mempool()
209 if (strcmp(tokens[8], "cpu") != 0) { in cmd_mempool()
214 if (parser_read_uint32(&p.cpu_id, tokens[9]) != 0) { in cmd_mempool()
221 snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]); in cmd_mempool()
235 cmd_link(char **tokens, in cmd_link() argument
249 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); in cmd_link()
252 name = tokens[1]; in cmd_link()
254 if (strcmp(tokens[2], "dev") == 0) in cmd_link()
255 p.dev_name = tokens[3]; in cmd_link()
256 else if (strcmp(tokens[2], "port") == 0) { in cmd_link()
259 if (parser_read_uint16(&p.port_id, tokens[3]) != 0) { in cmd_link()
268 if (strcmp(tokens[4], "rxq") != 0) { in cmd_link()
273 if (parser_read_uint32(&p.rx.n_queues, tokens[5]) != 0) { in cmd_link()
277 if (parser_read_uint32(&p.rx.queue_size, tokens[6]) != 0) { in cmd_link()
282 p.rx.mempool_name = tokens[7]; in cmd_link()
284 if (strcmp(tokens[8], "txq") != 0) { in cmd_link()
289 if (parser_read_uint32(&p.tx.n_queues, tokens[9]) != 0) { in cmd_link()
294 if (parser_read_uint32(&p.tx.queue_size, tokens[10]) != 0) { in cmd_link()
299 if (strcmp(tokens[11], "promiscuous") != 0) { in cmd_link()
304 if (strcmp(tokens[12], "on") == 0) in cmd_link()
306 else if (strcmp(tokens[12], "off") == 0) in cmd_link()
318 if (strcmp(tokens[13], "rss") != 0) { in cmd_link()
327 if (parser_read_uint32(&queue_id, tokens[i]) != 0) { in cmd_link()
340 snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]); in cmd_link()
407 cmd_link_show(char **tokens, in cmd_link_show() argument
417 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); in cmd_link_show()
435 link_name = tokens[2]; in cmd_link_show()
451 cmd_pipeline_create(char **tokens, in cmd_pipeline_create() argument
462 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); in cmd_pipeline_create()
466 name = tokens[1]; in cmd_pipeline_create()
468 if (parser_read_uint32(&numa_node, tokens[3]) != 0) { in cmd_pipeline_create()
486 cmd_pipeline_port_in(char **tokens, in cmd_pipeline_port_in() argument
497 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); in cmd_pipeline_port_in()
501 p = pipeline_find(obj, tokens[1]); in cmd_pipeline_port_in()
503 snprintf(out, out_size, MSG_ARG_INVALID, tokens[0]); in cmd_pipeline_port_in()
507 if (strcmp(tokens[2], "port") != 0) { in cmd_pipeline_port_in()
512 if (strcmp(tokens[3], "in") != 0) { in cmd_pipeline_port_in()
517 if (parser_read_uint32(&port_id, tokens[4]) != 0) { in cmd_pipeline_port_in()
524 if (strcmp(tokens[t0], "link") == 0) { in cmd_pipeline_port_in()
534 link = link_find(obj, tokens[t0 + 1]); in cmd_pipeline_port_in()
542 if (strcmp(tokens[t0 + 2], "rxq") != 0) { in cmd_pipeline_port_in()
547 if (parser_read_uint16(&params.queue_id, tokens[t0 + 3]) != 0) { in cmd_pipeline_port_in()
553 if (strcmp(tokens[t0 + 4], "bsz") != 0) { in cmd_pipeline_port_in()
558 if (parser_read_uint32(&params.burst_size, tokens[t0 + 5])) { in cmd_pipeline_port_in()
570 } else if (strcmp(tokens[t0], "source") == 0) { in cmd_pipeline_port_in()
580 mp = mempool_find(obj, tokens[t0 + 1]); in cmd_pipeline_port_in()
588 params.file_name = tokens[t0 + 2]; in cmd_pipeline_port_in()
597 snprintf(out, out_size, MSG_ARG_INVALID, tokens[0]); in cmd_pipeline_port_in()
607 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); in cmd_pipeline_port_in()
618 cmd_pipeline_port_out(char **tokens, in cmd_pipeline_port_out() argument
629 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); in cmd_pipeline_port_out()
633 p = pipeline_find(obj, tokens[1]); in cmd_pipeline_port_out()
635 snprintf(out, out_size, MSG_ARG_INVALID, tokens[0]); in cmd_pipeline_port_out()
639 if (strcmp(tokens[2], "port") != 0) { in cmd_pipeline_port_out()
644 if (strcmp(tokens[3], "out") != 0) { in cmd_pipeline_port_out()
649 if (parser_read_uint32(&port_id, tokens[4]) != 0) { in cmd_pipeline_port_out()
656 if (strcmp(tokens[t0], "link") == 0) { in cmd_pipeline_port_out()
666 link = link_find(obj, tokens[t0 + 1]); in cmd_pipeline_port_out()
674 if (strcmp(tokens[t0 + 2], "txq") != 0) { in cmd_pipeline_port_out()
679 if (parser_read_uint16(&params.queue_id, tokens[t0 + 3]) != 0) { in cmd_pipeline_port_out()
685 if (strcmp(tokens[t0 + 4], "bsz") != 0) { in cmd_pipeline_port_out()
690 if (parser_read_uint32(&params.burst_size, tokens[t0 + 5])) { in cmd_pipeline_port_out()
702 } else if (strcmp(tokens[t0], "sink") == 0) { in cmd_pipeline_port_out()
705 params.file_name = strcmp(tokens[t0 + 1], "none") ? in cmd_pipeline_port_out()
706 tokens[t0 + 1] : NULL; in cmd_pipeline_port_out()
715 snprintf(out, out_size, MSG_ARG_INVALID, tokens[0]); in cmd_pipeline_port_out()
725 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); in cmd_pipeline_port_out()
734 cmd_pipeline_build(char **tokens, in cmd_pipeline_build() argument
747 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); in cmd_pipeline_build()
751 p = pipeline_find(obj, tokens[1]); in cmd_pipeline_build()
753 snprintf(out, out_size, MSG_ARG_INVALID, tokens[0]); in cmd_pipeline_build()
757 spec = fopen(tokens[3], "r"); in cmd_pipeline_build()
759 snprintf(out, out_size, "Cannot open file %s.\n", tokens[3]); in cmd_pipeline_build()
799 cmd_pipeline_table_update(char **tokens, in cmd_pipeline_table_update() argument
813 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); in cmd_pipeline_table_update()
817 pipeline_name = tokens[1]; in cmd_pipeline_table_update()
824 if (strcmp(tokens[2], "table") != 0) { in cmd_pipeline_table_update()
829 table_name = tokens[3]; in cmd_pipeline_table_update()
831 if (strcmp(tokens[4], "update") != 0) { in cmd_pipeline_table_update()
836 file_name_add = tokens[5]; in cmd_pipeline_table_update()
837 file_name_delete = tokens[6]; in cmd_pipeline_table_update()
838 file_name_default = tokens[7]; in cmd_pipeline_table_update()
1001 cmd_pipeline_stats(char **tokens, in cmd_pipeline_stats() argument
1013 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); in cmd_pipeline_stats()
1017 p = pipeline_find(obj, tokens[1]); in cmd_pipeline_stats()
1023 if (strcmp(tokens[2], "stats")) { in cmd_pipeline_stats()
1074 cmd_thread_pipeline_enable(char **tokens, in cmd_thread_pipeline_enable() argument
1086 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); in cmd_thread_pipeline_enable()
1090 if (parser_read_uint32(&thread_id, tokens[1]) != 0) { in cmd_thread_pipeline_enable()
1095 if (strcmp(tokens[2], "pipeline") != 0) { in cmd_thread_pipeline_enable()
1100 pipeline_name = tokens[3]; in cmd_thread_pipeline_enable()
1107 if (strcmp(tokens[4], "enable") != 0) { in cmd_thread_pipeline_enable()
1123 cmd_thread_pipeline_disable(char **tokens, in cmd_thread_pipeline_disable() argument
1135 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); in cmd_thread_pipeline_disable()
1139 if (parser_read_uint32(&thread_id, tokens[1]) != 0) { in cmd_thread_pipeline_disable()
1144 if (strcmp(tokens[2], "pipeline") != 0) { in cmd_thread_pipeline_disable()
1149 pipeline_name = tokens[3]; in cmd_thread_pipeline_disable()
1156 if (strcmp(tokens[4], "disable") != 0) { in cmd_thread_pipeline_disable()
1170 cmd_help(char **tokens, in cmd_help() argument
1176 tokens++; in cmd_help()
1196 if (strcmp(tokens[0], "mempool") == 0) { in cmd_help()
1201 if (strcmp(tokens[0], "link") == 0) { in cmd_help()
1206 if ((strcmp(tokens[0], "pipeline") == 0) && in cmd_help()
1207 (n_tokens == 2) && (strcmp(tokens[1], "create") == 0)) { in cmd_help()
1212 if ((strcmp(tokens[0], "pipeline") == 0) && in cmd_help()
1213 (n_tokens == 3) && (strcmp(tokens[1], "port") == 0)) { in cmd_help()
1214 if (strcmp(tokens[2], "in") == 0) { in cmd_help()
1220 if (strcmp(tokens[2], "out") == 0) { in cmd_help()
1227 if ((strcmp(tokens[0], "pipeline") == 0) && in cmd_help()
1228 (n_tokens == 2) && (strcmp(tokens[1], "build") == 0)) { in cmd_help()
1233 if ((strcmp(tokens[0], "pipeline") == 0) && in cmd_help()
1235 (strcmp(tokens[1], "table") == 0) && in cmd_help()
1236 (strcmp(tokens[2], "update") == 0)) { in cmd_help()
1242 if ((strcmp(tokens[0], "pipeline") == 0) && in cmd_help()
1243 (n_tokens == 2) && (strcmp(tokens[1], "stats") == 0)) { in cmd_help()
1249 (strcmp(tokens[0], "thread") == 0) && in cmd_help()
1250 (strcmp(tokens[1], "pipeline") == 0)) { in cmd_help()
1251 if (strcmp(tokens[2], "enable") == 0) { in cmd_help()
1257 if (strcmp(tokens[2], "disable") == 0) { in cmd_help()
1270 char *tokens[CMD_MAX_TOKENS]; in cli_process() local
1271 uint32_t n_tokens = RTE_DIM(tokens); in cli_process()
1277 status = parse_tokenize_string(in, tokens, &n_tokens); in cli_process()
1286 if (strcmp(tokens[0], "help") == 0) { in cli_process()
1287 cmd_help(tokens, n_tokens, out, out_size, obj); in cli_process()
1291 if (strcmp(tokens[0], "mempool") == 0) { in cli_process()
1292 cmd_mempool(tokens, n_tokens, out, out_size, obj); in cli_process()
1296 if (strcmp(tokens[0], "link") == 0) { in cli_process()
1297 if (strcmp(tokens[1], "show") == 0) { in cli_process()
1298 cmd_link_show(tokens, n_tokens, out, out_size, obj); in cli_process()
1302 cmd_link(tokens, n_tokens, out, out_size, obj); in cli_process()
1306 if (strcmp(tokens[0], "pipeline") == 0) { in cli_process()
1308 (strcmp(tokens[2], "create") == 0)) { in cli_process()
1309 cmd_pipeline_create(tokens, n_tokens, out, out_size, in cli_process()
1315 (strcmp(tokens[2], "port") == 0) && in cli_process()
1316 (strcmp(tokens[3], "in") == 0)) { in cli_process()
1317 cmd_pipeline_port_in(tokens, n_tokens, out, out_size, in cli_process()
1323 (strcmp(tokens[2], "port") == 0) && in cli_process()
1324 (strcmp(tokens[3], "out") == 0)) { in cli_process()
1325 cmd_pipeline_port_out(tokens, n_tokens, out, out_size, in cli_process()
1331 (strcmp(tokens[2], "build") == 0)) { in cli_process()
1332 cmd_pipeline_build(tokens, n_tokens, out, out_size, in cli_process()
1338 (strcmp(tokens[2], "table") == 0)) { in cli_process()
1339 cmd_pipeline_table_update(tokens, n_tokens, out, in cli_process()
1345 (strcmp(tokens[2], "stats") == 0)) { in cli_process()
1346 cmd_pipeline_stats(tokens, n_tokens, out, out_size, in cli_process()
1352 if (strcmp(tokens[0], "thread") == 0) { in cli_process()
1354 (strcmp(tokens[4], "enable") == 0)) { in cli_process()
1355 cmd_thread_pipeline_enable(tokens, n_tokens, in cli_process()
1361 (strcmp(tokens[4], "disable") == 0)) { in cli_process()
1362 cmd_thread_pipeline_disable(tokens, n_tokens, in cli_process()
1368 snprintf(out, out_size, MSG_CMD_UNKNOWN, tokens[0]); in cli_process()