netmap_mem2.h (257537) | netmap_mem2.h (259412) |
---|---|
1/* 2 * Copyright (C) 2012-2013 Matteo Landi, Luigi Rizzo, Giuseppe Lettieri. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 */ 25 26/* | 1/* 2 * Copyright (C) 2012-2013 Matteo Landi, Luigi Rizzo, Giuseppe Lettieri. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 */ 25 26/* |
27 * $FreeBSD: head/sys/dev/netmap/netmap_mem2.h 257537 2013-11-02 00:54:47Z luigi $ | 27 * $FreeBSD: head/sys/dev/netmap/netmap_mem2.h 259412 2013-12-15 08:37:24Z luigi $ |
28 * 29 * (New) memory allocator for netmap 30 */ 31 32/* 33 * This allocator creates three memory pools: 34 * nm_if_pool for the struct netmap_if 35 * nm_ring_pool for the struct netmap_ring --- 148 unchanged lines hidden (view full) --- 184 u_int flags; 185#define NETMAP_MEM_FINALIZED 0x1 /* preallocation done */ 186#define NETMAP_MEM_PRIVATE 0x2 /* uses private address space */ 187 int lasterr; /* last error for curr config */ 188 int refcount; /* existing priv structures */ 189 /* the three allocators */ 190 struct netmap_obj_pool pools[NETMAP_POOLS_NR]; 191 | 28 * 29 * (New) memory allocator for netmap 30 */ 31 32/* 33 * This allocator creates three memory pools: 34 * nm_if_pool for the struct netmap_if 35 * nm_ring_pool for the struct netmap_ring --- 148 unchanged lines hidden (view full) --- 184 u_int flags; 185#define NETMAP_MEM_FINALIZED 0x1 /* preallocation done */ 186#define NETMAP_MEM_PRIVATE 0x2 /* uses private address space */ 187 int lasterr; /* last error for curr config */ 188 int refcount; /* existing priv structures */ 189 /* the three allocators */ 190 struct netmap_obj_pool pools[NETMAP_POOLS_NR]; 191 |
192 netmap_mem_config_t config; | 192 netmap_mem_config_t config; |
193 netmap_mem_finalize_t finalize; 194 netmap_mem_deref_t deref; 195}; 196 197extern struct netmap_mem_d nm_mem; 198 199vm_paddr_t netmap_mem_ofstophys(struct netmap_mem_d *, vm_ooffset_t); 200int netmap_mem_finalize(struct netmap_mem_d *); 201int netmap_mem_init(void); 202void netmap_mem_fini(void); | 193 netmap_mem_finalize_t finalize; 194 netmap_mem_deref_t deref; 195}; 196 197extern struct netmap_mem_d nm_mem; 198 199vm_paddr_t netmap_mem_ofstophys(struct netmap_mem_d *, vm_ooffset_t); 200int netmap_mem_finalize(struct netmap_mem_d *); 201int netmap_mem_init(void); 202void netmap_mem_fini(void); |
203struct netmap_if * netmap_mem_if_new(const char *, struct netmap_adapter *); 204void netmap_mem_if_delete(struct netmap_adapter *na, struct netmap_if *nifp); | 203struct netmap_if * 204 netmap_mem_if_new(const char *, struct netmap_adapter *); 205void netmap_mem_if_delete(struct netmap_adapter *, struct netmap_if *); 206int netmap_mem_rings_create(struct netmap_adapter *); 207void netmap_mem_rings_delete(struct netmap_adapter *); |
205void netmap_mem_deref(struct netmap_mem_d *); | 208void netmap_mem_deref(struct netmap_mem_d *); |
206int netmap_mem_get_info(struct netmap_mem_d *nm_mem, u_int *size, u_int *memflags); 207ssize_t netmap_mem_if_offset(struct netmap_mem_d *nm_mem, const void *vaddr); | 209int netmap_mem_get_info(struct netmap_mem_d *, u_int *size, u_int *memflags); 210ssize_t netmap_mem_if_offset(struct netmap_mem_d *, const void *vaddr); |
208struct netmap_mem_d* 209 netmap_mem_private_new(const char *name, u_int txr, u_int txd, u_int rxr, u_int rxd); | 211struct netmap_mem_d* 212 netmap_mem_private_new(const char *name, u_int txr, u_int txd, u_int rxr, u_int rxd); |
210void netmap_mem_private_delete(struct netmap_mem_d *nm_mem); | 213void netmap_mem_private_delete(struct netmap_mem_d *); |
211 212#define NETMAP_BDG_BUF_SIZE(n) ((n)->pools[NETMAP_BUF_POOL]._objsize) 213 214 215 216#endif | 214 215#define NETMAP_BDG_BUF_SIZE(n) ((n)->pools[NETMAP_BUF_POOL]._objsize) 216 217 218 219#endif |