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

Function cmd_pipeline_build

dpdk/examples/pipeline/cli.c:767–847  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

765"pipeline <pipeline_name> build lib <lib_file> io <iospec_file> numa <numa_node>\n";
766
767static void
768cmd_pipeline_build(char **tokens,
769 uint32_t n_tokens,
770 char *out,
771 size_t out_size,
772 void *obj __rte_unused)
773{
774 struct rte_swx_pipeline *p = NULL;
775 struct rte_swx_ctl_pipeline *ctl = NULL;
776 char *pipeline_name, *lib_file_name, *iospec_file_name;
777 FILE *iospec_file = NULL;
778 uint32_t numa_node = 0;
779 int status = 0;
780
781 /* Parsing. */
782 if (n_tokens != 9) {
783 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
784 return;
785 }
786
787 pipeline_name = tokens[1];
788
789 if (strcmp(tokens[2], "build")) {
790 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "build");
791 return;
792 }
793
794 if (strcmp(tokens[3], "lib")) {
795 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "lib");
796 return;
797 }
798
799 lib_file_name = tokens[4];
800
801 if (strcmp(tokens[5], "io")) {
802 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "io");
803 return;
804 }
805
806 iospec_file_name = tokens[6];
807
808 if (strcmp(tokens[7], "numa")) {
809 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "numa");
810 return;
811 }
812
813 if (parser_read_uint32(&numa_node, tokens[8])) {
814 snprintf(out, out_size, MSG_ARG_INVALID, "numa_node");
815 return;
816 }
817
818 /* I/O spec file open. */
819 iospec_file = fopen(iospec_file_name, "r");
820 if (!iospec_file) {
821 snprintf(out, out_size, "Cannot open file \"%s\".\n", iospec_file_name);
822 return;
823 }
824

Callers 1

cli_processFunction · 0.85

Calls 6

snprintfFunction · 0.85
strcmpFunction · 0.85
rte_swx_pipeline_freeFunction · 0.85
parser_read_uint32Function · 0.70

Tested by

no test coverage detected