xref: /f-stack/dpdk/examples/ip_pipeline/kni.h (revision 2d9fd380)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2018 Intel Corporation
3  */
4 
5 #ifndef _INCLUDE_KNI_H_
6 #define _INCLUDE_KNI_H_
7 
8 #include <stdint.h>
9 #include <sys/queue.h>
10 
11 #ifdef RTE_LIB_KNI
12 #include <rte_kni.h>
13 #endif
14 
15 #include "common.h"
16 
17 struct kni {
18 	TAILQ_ENTRY(kni) node;
19 	char name[NAME_SIZE];
20 #ifdef RTE_LIB_KNI
21 	struct rte_kni *k;
22 #endif
23 };
24 
25 TAILQ_HEAD(kni_list, kni);
26 
27 int
28 kni_init(void);
29 
30 struct kni *
31 kni_find(const char *name);
32 
33 struct kni_params {
34 	const char *link_name;
35 	const char *mempool_name;
36 	int force_bind;
37 	uint32_t thread_id;
38 };
39 
40 struct kni *
41 kni_create(const char *name, struct kni_params *params);
42 
43 void
44 kni_handle_request(void);
45 
46 #endif /* _INCLUDE_KNI_H_ */
47