| 477 | "ring <ring_name> size <size> numa <numa_node>\n"; |
| 478 | |
| 479 | static void |
| 480 | cmd_ring(char **tokens, |
| 481 | uint32_t n_tokens, |
| 482 | char *out, |
| 483 | size_t out_size, |
| 484 | void *obj __rte_unused) |
| 485 | { |
| 486 | struct rte_ring *r; |
| 487 | char *name; |
| 488 | uint32_t size, numa_node; |
| 489 | |
| 490 | if (n_tokens != 6) { |
| 491 | snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); |
| 492 | return; |
| 493 | } |
| 494 | |
| 495 | name = tokens[1]; |
| 496 | |
| 497 | if (strcmp(tokens[2], "size")) { |
| 498 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "size"); |
| 499 | return; |
| 500 | } |
| 501 | |
| 502 | if (parser_read_uint32(&size, tokens[3])) { |
| 503 | snprintf(out, out_size, MSG_ARG_INVALID, "size"); |
| 504 | return; |
| 505 | } |
| 506 | |
| 507 | if (strcmp(tokens[4], "numa")) { |
| 508 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "numa"); |
| 509 | return; |
| 510 | } |
| 511 | |
| 512 | if (parser_read_uint32(&numa_node, tokens[5])) { |
| 513 | snprintf(out, out_size, MSG_ARG_INVALID, "numa_node"); |
| 514 | return; |
| 515 | } |
| 516 | |
| 517 | r = rte_ring_create( |
| 518 | name, |
| 519 | size, |
| 520 | (int)numa_node, |
| 521 | RING_F_SP_ENQ | RING_F_SC_DEQ); |
| 522 | if (!r) { |
| 523 | snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]); |
| 524 | return; |
| 525 | } |
| 526 | } |
| 527 | |
| 528 | static const char cmd_cryptodev_help[] = |
| 529 | "cryptodev <cryptodev_name> queues <n_queue_pairs> qsize <queue_size>\n"; |
no test coverage detected