datapath-windows: Allow NdisSwitchPortTypeSynthetic to be updated
[cascardo/ovs.git] / lib / netdev-dpdk.h
1 #ifndef NETDEV_DPDK_H
2 #define NETDEV_DPDK_H
3
4 #include <config.h>
5
6 struct dp_packet;
7
8 /* Reserves cpu core 0 for all non-pmd threads.  Changing the value of this
9  * macro will allow pmd thread to be pinned on cpu core 0.  This may not be
10  * ideal since the core may be non-isolated. */
11 #define NON_PMD_CORE_ID 0
12
13 #ifdef DPDK_NETDEV
14
15 #include <rte_config.h>
16 #include <rte_eal.h>
17 #include <rte_debug.h>
18 #include <rte_ethdev.h>
19 #include <rte_eth_ring.h>
20 #include <rte_errno.h>
21 #include <rte_memzone.h>
22 #include <rte_memcpy.h>
23 #include <rte_cycles.h>
24 #include <rte_spinlock.h>
25 #include <rte_launch.h>
26 #include <rte_malloc.h>
27
28 int dpdk_init(int argc, char **argv);
29 void netdev_dpdk_register(void);
30 void free_dpdk_buf(struct dp_packet *);
31 int pmd_thread_setaffinity_cpu(int cpu);
32 void thread_set_nonpmd(void);
33
34 #else
35
36 #include "util.h"
37
38 static inline int
39 dpdk_init(int argc, char **argv)
40 {
41     if (argc >= 2 && !strcmp(argv[1], "--dpdk")) {
42         ovs_fatal(0, "DPDK support not built into this copy of Open vSwitch.");
43     }
44     return 0;
45 }
46
47 static inline void
48 netdev_dpdk_register(void)
49 {
50     /* Nothing */
51 }
52
53 static inline void
54 free_dpdk_buf(struct dp_packet *buf OVS_UNUSED)
55 {
56     /* Nothing */
57 }
58
59 static inline int
60 pmd_thread_setaffinity_cpu(int cpu OVS_UNUSED)
61 {
62     return 0;
63 }
64
65 static inline void
66 thread_set_nonpmd(void)
67 {
68     /* Nothing */
69 }
70
71 #endif /* DPDK_NETDEV */
72 #endif