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

Function cmd_cryptodev

dpdk/examples/ip_pipeline/cli.c:737–802  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

735" max_sessions <n_sessions>";
736
737static void
738cmd_cryptodev(char **tokens,
739 uint32_t n_tokens,
740 char *out,
741 size_t out_size)
742{
743 struct cryptodev_params params;
744 char *name;
745
746 memset(&params, 0, sizeof(params));
747 if (n_tokens != 9) {
748 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
749 return;
750 }
751
752 name = tokens[1];
753
754 if (strcmp(tokens[2], "dev") == 0)
755 params.dev_name = tokens[3];
756 else if (strcmp(tokens[2], "dev_id") == 0) {
757 if (parser_read_uint32(&params.dev_id, tokens[3]) < 0) {
758 snprintf(out, out_size, MSG_ARG_INVALID,
759 "dev_id");
760 return;
761 }
762 } else {
763 snprintf(out, out_size, MSG_ARG_INVALID,
764 "cryptodev");
765 return;
766 }
767
768 if (strcmp(tokens[4], "queue")) {
769 snprintf(out, out_size, MSG_ARG_NOT_FOUND,
770 "queue");
771 return;
772 }
773
774 if (parser_read_uint32(&params.n_queues, tokens[5]) < 0) {
775 snprintf(out, out_size, MSG_ARG_INVALID,
776 "q");
777 return;
778 }
779
780 if (parser_read_uint32(&params.queue_size, tokens[6]) < 0) {
781 snprintf(out, out_size, MSG_ARG_INVALID,
782 "queue_size");
783 return;
784 }
785
786 if (strcmp(tokens[7], "max_sessions")) {
787 snprintf(out, out_size, MSG_ARG_NOT_FOUND,
788 "max_sessions");
789 return;
790 }
791
792 if (parser_read_uint32(&params.session_pool_size, tokens[8]) < 0) {
793 snprintf(out, out_size, MSG_ARG_INVALID,
794 "queue_size");

Callers 1

cli_processFunction · 0.70

Calls 5

memsetFunction · 0.85
snprintfFunction · 0.85
strcmpFunction · 0.85
cryptodev_createFunction · 0.85
parser_read_uint32Function · 0.70

Tested by

no test coverage detected