MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cmd_cryptodev

Function cmd_cryptodev

dpdk/examples/pipeline/cli.c:531–578  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

529"cryptodev <cryptodev_name> queues <n_queue_pairs> qsize <queue_size>\n";
530
531static void
532cmd_cryptodev(char **tokens,
533 uint32_t n_tokens,
534 char *out,
535 size_t out_size,
536 void *obj __rte_unused)
537{
538 struct cryptodev_params params;
539 char *cryptodev_name;
540 int status;
541
542 if (n_tokens != 6) {
543 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
544 return;
545 }
546
547 if (strcmp(tokens[0], "cryptodev")) {
548 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "cryptodev");
549 return;
550 }
551
552 cryptodev_name = tokens[1];
553
554 if (strcmp(tokens[2], "queues")) {
555 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "queues");
556 return;
557 }
558
559 if (parser_read_uint32(&params.n_queue_pairs, tokens[3])) {
560 snprintf(out, out_size, MSG_ARG_INVALID, "n_queue_pairs");
561 return;
562 }
563
564 if (strcmp(tokens[4], "qsize")) {
565 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "qsize");
566 return;
567 }
568
569
570 if (parser_read_uint32(&params.queue_size, tokens[5])) {
571 snprintf(out, out_size, MSG_ARG_INVALID, "queue_size");
572 return;
573 }
574
575 status = cryptodev_config(cryptodev_name, &params);
576 if (status)
577 snprintf(out, out_size, "Crypto device configuration failed (%d).\n", status);
578}
579
580static const char cmd_pipeline_codegen_help[] =
581"pipeline codegen <spec_file> <code_file>\n";

Callers 1

cli_processFunction · 0.70

Calls 4

snprintfFunction · 0.85
strcmpFunction · 0.85
cryptodev_configFunction · 0.85
parser_read_uint32Function · 0.70

Tested by

no test coverage detected