]>
Commit | Line | Data |
---|---|---|
8a9562d2 PS |
1 | #ifndef NETDEV_DPDK_H |
2 | #define NETDEV_DPDK_H | |
3 | ||
8a9562d2 | 4 | #include <config.h> |
b8da6cce | 5 | |
e14deea0 | 6 | struct dp_packet; |
91088554 | 7 | |
b8da6cce | 8 | #ifdef DPDK_NETDEV |
8a9562d2 PS |
9 | |
10 | #include <rte_config.h> | |
11 | #include <rte_eal.h> | |
12 | #include <rte_debug.h> | |
13 | #include <rte_ethdev.h> | |
95fb793a | 14 | #include <rte_eth_ring.h> |
8a9562d2 PS |
15 | #include <rte_errno.h> |
16 | #include <rte_memzone.h> | |
17 | #include <rte_memcpy.h> | |
18 | #include <rte_cycles.h> | |
19 | #include <rte_spinlock.h> | |
20 | #include <rte_launch.h> | |
21 | #include <rte_malloc.h> | |
22 | ||
d5c199ea DDP |
23 | #define NON_PMD_CORE_ID LCORE_ID_ANY |
24 | ||
8a9562d2 PS |
25 | int dpdk_init(int argc, char **argv); |
26 | void netdev_dpdk_register(void); | |
e14deea0 | 27 | void free_dpdk_buf(struct dp_packet *); |
bd5131ba | 28 | int pmd_thread_setaffinity_cpu(unsigned cpu); |
8a9562d2 PS |
29 | |
30 | #else | |
31 | ||
d5c199ea DDP |
32 | #define NON_PMD_CORE_ID UINT32_MAX |
33 | ||
e03f0d03 BP |
34 | #include "util.h" |
35 | ||
b8da6cce | 36 | static inline int |
e03f0d03 | 37 | dpdk_init(int argc, char **argv) |
b8da6cce | 38 | { |
e03f0d03 BP |
39 | if (argc >= 2 && !strcmp(argv[1], "--dpdk")) { |
40 | ovs_fatal(0, "DPDK support not built into this copy of Open vSwitch."); | |
41 | } | |
b8da6cce AZ |
42 | return 0; |
43 | } | |
44 | ||
45 | static inline void | |
46 | netdev_dpdk_register(void) | |
47 | { | |
48 | /* Nothing */ | |
49 | } | |
50 | ||
51 | static inline void | |
e14deea0 | 52 | free_dpdk_buf(struct dp_packet *buf OVS_UNUSED) |
b8da6cce AZ |
53 | { |
54 | /* Nothing */ | |
55 | } | |
56 | ||
57 | static inline int | |
bd5131ba | 58 | pmd_thread_setaffinity_cpu(unsigned cpu OVS_UNUSED) |
b8da6cce AZ |
59 | { |
60 | return 0; | |
61 | } | |
8a9562d2 PS |
62 | |
63 | #endif /* DPDK_NETDEV */ | |
64 | #endif |