Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/netmap/netmap_mem2.c
Show First 20 Lines • Show All 195 Lines • ▼ Show 20 Lines | |||||
NMD_DEFNACB(struct netmap_if *, if_new); | NMD_DEFNACB(struct netmap_if *, if_new); | ||||
NMD_DEFNACB1(void, if_delete, struct netmap_if *); | NMD_DEFNACB1(void, if_delete, struct netmap_if *); | ||||
NMD_DEFNACB(int, rings_create); | NMD_DEFNACB(int, rings_create); | ||||
NMD_DEFNACB(void, rings_delete); | NMD_DEFNACB(void, rings_delete); | ||||
static int netmap_mem_map(struct netmap_obj_pool *, struct netmap_adapter *); | static int netmap_mem_map(struct netmap_obj_pool *, struct netmap_adapter *); | ||||
static int netmap_mem_unmap(struct netmap_obj_pool *, struct netmap_adapter *); | static int netmap_mem_unmap(struct netmap_obj_pool *, struct netmap_adapter *); | ||||
static int nm_mem_assign_group(struct netmap_mem_d *, struct device *); | static int nm_mem_assign_group(struct netmap_mem_d *, device_t); | ||||
#define NMA_LOCK_INIT(n) NM_MTX_INIT((n)->nm_mtx) | #define NMA_LOCK_INIT(n) NM_MTX_INIT((n)->nm_mtx) | ||||
#define NMA_LOCK_DESTROY(n) NM_MTX_DESTROY((n)->nm_mtx) | #define NMA_LOCK_DESTROY(n) NM_MTX_DESTROY((n)->nm_mtx) | ||||
#define NMA_LOCK(n) NM_MTX_LOCK((n)->nm_mtx) | #define NMA_LOCK(n) NM_MTX_LOCK((n)->nm_mtx) | ||||
#define NMA_UNLOCK(n) NM_MTX_UNLOCK((n)->nm_mtx) | #define NMA_UNLOCK(n) NM_MTX_UNLOCK((n)->nm_mtx) | ||||
#ifdef NM_DEBUG_MEM_PUTGET | #ifdef NM_DEBUG_MEM_PUTGET | ||||
#define NM_DBG_REFC(nmd, func, line) \ | #define NM_DBG_REFC(nmd, func, line) \ | ||||
▲ Show 20 Lines • Show All 238 Lines • ▼ Show 20 Lines | if (netmap_last_mem_d == nmd) | ||||
netmap_last_mem_d = nmd->prev; | netmap_last_mem_d = nmd->prev; | ||||
nmd->prev = nmd->next = NULL; | nmd->prev = nmd->next = NULL; | ||||
NMA_UNLOCK(&nm_mem); | NMA_UNLOCK(&nm_mem); | ||||
} | } | ||||
static int | static int | ||||
nm_mem_assign_group(struct netmap_mem_d *nmd, struct device *dev) | nm_mem_assign_group(struct netmap_mem_d *nmd, device_t dev) | ||||
{ | { | ||||
int err = 0, id; | int err = 0, id; | ||||
id = nm_iommu_group_id(dev); | id = nm_iommu_group_id(dev); | ||||
if (netmap_verbose) | if (netmap_verbose) | ||||
D("iommu_group %d", id); | D("iommu_group %d", id); | ||||
NMA_LOCK(nmd); | NMA_LOCK(nmd); | ||||
▲ Show 20 Lines • Show All 1,171 Lines • Show Last 20 Lines |