summaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2016-05-11 04:49:46 -0700
committerDamjan Marion <damarion@cisco.com>2016-05-18 17:14:46 +0000
commit82e29c455833b5b12e04c89d2dec1106b499e6b0 (patch)
tree4e7fc87fd853113d5ab47dd92aec04968f7551cc /vnet
parent5a206eafdbf9370fead2dd26fcab09e7ff5544c4 (diff)
Add netmap API
JIRA: VPP-66 Change-Id: I421529fa8eafe5268745a34a4fcd40156defcdf8 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/devices/netmap/cli.c4
-rw-r--r--vnet/vnet/devices/netmap/device.c5
-rw-r--r--vnet/vnet/devices/netmap/netmap.h9
-rw-r--r--vnet/vnet/devices/netmap/node.c5
4 files changed, 17 insertions, 6 deletions
diff --git a/vnet/vnet/devices/netmap/cli.c b/vnet/vnet/devices/netmap/cli.c
index e3d61460b6c..584d68002d3 100644
--- a/vnet/vnet/devices/netmap/cli.c
+++ b/vnet/vnet/devices/netmap/cli.c
@@ -14,11 +14,15 @@
* limitations under the License.
*------------------------------------------------------------------
*/
+#include <stdint.h>
+#include <net/if.h>
+#include <sys/ioctl.h>
#include <vlib/vlib.h>
#include <vlib/unix/unix.h>
#include <vnet/ethernet/ethernet.h>
+#include <vnet/devices/netmap/net_netmap.h>
#include <vnet/devices/netmap/netmap.h>
static clib_error_t *
diff --git a/vnet/vnet/devices/netmap/device.c b/vnet/vnet/devices/netmap/device.c
index dcd04733613..f04e0672c90 100644
--- a/vnet/vnet/devices/netmap/device.c
+++ b/vnet/vnet/devices/netmap/device.c
@@ -15,10 +15,15 @@
*------------------------------------------------------------------
*/
+#include <stdint.h>
+#include <net/if.h>
+#include <sys/ioctl.h>
+
#include <vlib/vlib.h>
#include <vlib/unix/unix.h>
#include <vnet/ethernet/ethernet.h>
+#include <vnet/devices/netmap/net_netmap.h>
#include <vnet/devices/netmap/netmap.h>
#define foreach_netmap_tx_func_error \
diff --git a/vnet/vnet/devices/netmap/netmap.h b/vnet/vnet/devices/netmap/netmap.h
index 026f0001f96..c5b3dfbc71a 100644
--- a/vnet/vnet/devices/netmap/netmap.h
+++ b/vnet/vnet/devices/netmap/netmap.h
@@ -40,11 +40,6 @@
* SUCH DAMAGE.
*/
-#include <stdint.h>
-#include <net/if.h>
-#include <sys/ioctl.h>
-#include <vnet/devices/netmap/net_netmap.h>
-
typedef struct {
CLIB_CACHE_LINE_ALIGN_MARK(cacheline0);
u8 * host_if_name;
@@ -101,6 +96,8 @@ int netmap_delete_if(vlib_main_t * vm, u8 * host_if_name);
/* Macros and helper functions from sys/net/netmap_user.h */
+#ifdef _NET_NETMAP_H_
+
#define _NETMAP_OFFSET(type, ptr, offset) \
((type)(void *)((char *)(ptr) + (offset)))
@@ -144,5 +141,5 @@ nm_ring_space(struct netmap_ring *ring)
ret += ring->num_slots;
return ret;
}
-
+#endif
diff --git a/vnet/vnet/devices/netmap/node.c b/vnet/vnet/devices/netmap/node.c
index d4c01411904..3986c7e4762 100644
--- a/vnet/vnet/devices/netmap/node.c
+++ b/vnet/vnet/devices/netmap/node.c
@@ -15,10 +15,15 @@
*------------------------------------------------------------------
*/
+#include <stdint.h>
+#include <net/if.h>
+#include <sys/ioctl.h>
+
#include <vlib/vlib.h>
#include <vlib/unix/unix.h>
#include <vnet/ethernet/ethernet.h>
+#include <vnet/devices/netmap/net_netmap.h>
#include <vnet/devices/netmap/netmap.h>
#define foreach_netmap_input_error