aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/netmap/netmap_mem2.h
diff options
context:
space:
mode:
authorLuigi Rizzo <luigi@FreeBSD.org>2015-07-10 05:51:36 +0000
committerLuigi Rizzo <luigi@FreeBSD.org>2015-07-10 05:51:36 +0000
commit847bf38369b6ea5abf8b6409006468cfe4f66d5e (patch)
tree2a938ad28f8fa79c60e58c3430a4c2c93631db94 /sys/dev/netmap/netmap_mem2.h
parent9d73ee0f82b756db5e53a32e55766db958d41dba (diff)
Notes
Diffstat (limited to 'sys/dev/netmap/netmap_mem2.h')
-rw-r--r--sys/dev/netmap/netmap_mem2.h30
1 files changed, 25 insertions, 5 deletions
diff --git a/sys/dev/netmap/netmap_mem2.h b/sys/dev/netmap/netmap_mem2.h
index 4c620bd4a780..ef0ff96d8e7f 100644
--- a/sys/dev/netmap/netmap_mem2.h
+++ b/sys/dev/netmap/netmap_mem2.h
@@ -117,9 +117,7 @@
extern struct netmap_mem_d nm_mem;
-struct lut_entry* netmap_mem_get_lut(struct netmap_mem_d *);
-u_int netmap_mem_get_buftotal(struct netmap_mem_d *);
-size_t netmap_mem_get_bufsize(struct netmap_mem_d *);
+void netmap_mem_get_lut(struct netmap_mem_d *, struct netmap_lut *);
vm_paddr_t netmap_mem_ofstophys(struct netmap_mem_d *, vm_ooffset_t);
int netmap_mem_finalize(struct netmap_mem_d *, struct netmap_adapter *);
int netmap_mem_init(void);
@@ -134,12 +132,34 @@ ssize_t netmap_mem_if_offset(struct netmap_mem_d *, const void *vaddr);
struct netmap_mem_d* netmap_mem_private_new(const char *name,
u_int txr, u_int txd, u_int rxr, u_int rxd, u_int extra_bufs, u_int npipes,
int* error);
-void netmap_mem_private_delete(struct netmap_mem_d *);
+void netmap_mem_delete(struct netmap_mem_d *);
+
+//#define NM_DEBUG_MEM_PUTGET 1
+
+#ifdef NM_DEBUG_MEM_PUTGET
+
+#define netmap_mem_get(nmd) \
+ do { \
+ __netmap_mem_get(nmd, __FUNCTION__, __LINE__); \
+ } while (0)
+
+#define netmap_mem_put(nmd) \
+ do { \
+ __netmap_mem_put(nmd, __FUNCTION__, __LINE__); \
+ } while (0)
+
+void __netmap_mem_get(struct netmap_mem_d *, const char *, int);
+void __netmap_mem_put(struct netmap_mem_d *, const char *, int);
+#else /* !NM_DEBUG_MEM_PUTGET */
+
+void netmap_mem_get(struct netmap_mem_d *);
+void netmap_mem_put(struct netmap_mem_d *);
+
+#endif /* !NM_DEBUG_PUTGET */
#define NETMAP_MEM_PRIVATE 0x2 /* allocator uses private address space */
#define NETMAP_MEM_IO 0x4 /* the underlying memory is mmapped I/O */
uint32_t netmap_extra_alloc(struct netmap_adapter *, uint32_t *, uint32_t n);
-
#endif