dpif_packet: Rename to dp_packet
[cascardo/ovs.git] / lib / netdev-dpdk.h
index f443a21..d3840f9 100644 (file)
@@ -2,9 +2,13 @@
 #define NETDEV_DPDK_H
 
 #include <config.h>
-#include "ofpbuf.h"
 
-struct dpif_packet;
+struct dp_packet;
+
+/* Reserves cpu core 0 for all non-pmd threads.  Changing the value of this
+ * macro will allow pmd thread to be pinned on cpu core 0.  This may not be
+ * ideal since the core may be non-isolated. */
+#define NON_PMD_CORE_ID 0
 
 #ifdef DPDK_NETDEV
 
@@ -12,6 +16,7 @@ struct dpif_packet;
 #include <rte_eal.h>
 #include <rte_debug.h>
 #include <rte_ethdev.h>
+#include <rte_eth_ring.h>
 #include <rte_errno.h>
 #include <rte_memzone.h>
 #include <rte_memcpy.h>
@@ -22,14 +27,20 @@ struct dpif_packet;
 
 int dpdk_init(int argc, char **argv);
 void netdev_dpdk_register(void);
-void free_dpdk_buf(struct dpif_packet *);
+void free_dpdk_buf(struct dp_packet *);
 int pmd_thread_setaffinity_cpu(int cpu);
+void thread_set_nonpmd(void);
 
 #else
 
+#include "util.h"
+
 static inline int
-dpdk_init(int arg1 OVS_UNUSED, char **arg2 OVS_UNUSED)
+dpdk_init(int argc, char **argv)
 {
+    if (argc >= 2 && !strcmp(argv[1], "--dpdk")) {
+        ovs_fatal(0, "DPDK support not built into this copy of Open vSwitch.");
+    }
     return 0;
 }
 
@@ -40,7 +51,7 @@ netdev_dpdk_register(void)
 }
 
 static inline void
-free_dpdk_buf(struct dpif_packet *buf OVS_UNUSED)
+free_dpdk_buf(struct dp_packet *buf OVS_UNUSED)
 {
     /* Nothing */
 }
@@ -51,5 +62,11 @@ pmd_thread_setaffinity_cpu(int cpu OVS_UNUSED)
     return 0;
 }
 
+static inline void
+thread_set_nonpmd(void)
+{
+    /* Nothing */
+}
+
 #endif /* DPDK_NETDEV */
 #endif