diff options
| author | Vincenzo Maffione <vmaffione@FreeBSD.org> | 2018-04-09 09:24:26 +0000 |
|---|---|---|
| committer | Vincenzo Maffione <vmaffione@FreeBSD.org> | 2018-04-09 09:24:26 +0000 |
| commit | 4f80b14ce2b17100b12dc3a346fb9e6e76764e11 (patch) | |
| tree | e7c1347079629914a4d8c369d8d70121ee53904f /sys/dev/netmap/netmap_mem2.h | |
| parent | df4531ffd910985c8ec5a288a69adff34ceb6c03 (diff) | |
Notes
Diffstat (limited to 'sys/dev/netmap/netmap_mem2.h')
| -rw-r--r-- | sys/dev/netmap/netmap_mem2.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/dev/netmap/netmap_mem2.h b/sys/dev/netmap/netmap_mem2.h index 81f601c4ca9f..f0bee7a33fd5 100644 --- a/sys/dev/netmap/netmap_mem2.h +++ b/sys/dev/netmap/netmap_mem2.h @@ -136,9 +136,9 @@ struct netmap_if * netmap_mem_if_new(struct netmap_adapter *, struct netmap_priv void netmap_mem_if_delete(struct netmap_adapter *, struct netmap_if *); int netmap_mem_rings_create(struct netmap_adapter *); void netmap_mem_rings_delete(struct netmap_adapter *); -void netmap_mem_deref(struct netmap_mem_d *, struct netmap_adapter *); +int netmap_mem_deref(struct netmap_mem_d *, struct netmap_adapter *); int netmap_mem2_get_pool_info(struct netmap_mem_d *, u_int, u_int *, u_int *); -int netmap_mem_get_info(struct netmap_mem_d *, u_int *size, u_int *memflags, uint16_t *id); +int netmap_mem_get_info(struct netmap_mem_d *, uint64_t *size, u_int *memflags, uint16_t *id); ssize_t netmap_mem_if_offset(struct netmap_mem_d *, const void *vaddr); struct netmap_mem_d* netmap_mem_private_new( u_int txr, u_int txd, u_int rxr, u_int rxd, u_int extra_bufs, u_int npipes, int* error); @@ -149,6 +149,14 @@ void netmap_mem_delete(struct netmap_mem_d *); struct netmap_mem_d* __netmap_mem_get(struct netmap_mem_d *, const char *, int); void __netmap_mem_put(struct netmap_mem_d *, const char *, int); struct netmap_mem_d* netmap_mem_find(nm_memid_t); +unsigned netmap_mem_bufsize(struct netmap_mem_d *nmd); + +#ifdef WITH_EXTMEM +struct netmap_mem_d* netmap_mem_ext_create(struct nmreq *, int *); +#else /* !WITH_EXTMEM */ +#define netmap_mem_ext_create(nmr, _perr) \ + ({ int *perr = _perr; if (perr) *(perr) = EOPNOTSUPP; NULL; }) +#endif /* WITH_EXTMEM */ #ifdef WITH_PTNETMAP_GUEST struct netmap_mem_d* netmap_mem_pt_guest_new(struct ifnet *, @@ -163,6 +171,7 @@ int netmap_mem_pools_info_get(struct nmreq *, struct netmap_mem_d *); #define NETMAP_MEM_PRIVATE 0x2 /* allocator uses private address space */ #define NETMAP_MEM_IO 0x4 /* the underlying memory is mmapped I/O */ +#define NETMAP_MEM_EXT 0x10 /* external memory (not remappable) */ uint32_t netmap_extra_alloc(struct netmap_adapter *, uint32_t *, uint32_t n); |
