xref: /dpdk/examples/pipeline/main.c (revision b77f660028127061b05a8a14cc6c93becb9e73bb)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2020 Intel Corporation
3  */
4 
5 #include <stdio.h>
6 #include <string.h>
7 #include <fcntl.h>
8 #include <unistd.h>
9 #include <getopt.h>
10 
11 #include <rte_launch.h>
12 #include <rte_eal.h>
13 
14 #include "obj.h"
15 #include "thread.h"
16 
17 int
18 main(int argc, char **argv)
19 {
20 	struct obj *obj;
21 	int status;
22 
23 	/* EAL */
24 	status = rte_eal_init(argc, argv);
25 	if (status < 0) {
26 		printf("Error: EAL initialization failed (%d)\n", status);
27 		return status;
28 	};
29 
30 	/* Obj */
31 	obj = obj_init();
32 	if (!obj) {
33 		printf("Error: Obj initialization failed (%d)\n", status);
34 		return status;
35 	}
36 
37 	/* Thread */
38 	status = thread_init();
39 	if (status) {
40 		printf("Error: Thread initialization failed (%d)\n", status);
41 		return status;
42 	}
43 
44 	rte_eal_mp_remote_launch(
45 		thread_main,
46 		NULL,
47 		SKIP_MASTER);
48 
49 	return 0;
50 }
51