Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/netmap/netmap_kloop.c
Show First 20 Lines • Show All 1,152 Lines • ▼ Show 20 Lines | ptnet_nm_dtor(struct netmap_adapter *na) | ||||
netmap_mem_pt_guest_ifp_del(na->nm_mem, na->ifp); | netmap_mem_pt_guest_ifp_del(na->nm_mem, na->ifp); | ||||
} | } | ||||
int | int | ||||
netmap_pt_guest_attach(struct netmap_adapter *arg, | netmap_pt_guest_attach(struct netmap_adapter *arg, | ||||
unsigned int nifp_offset, unsigned int memid) | unsigned int nifp_offset, unsigned int memid) | ||||
{ | { | ||||
struct netmap_pt_guest_adapter *ptna; | struct netmap_pt_guest_adapter *ptna; | ||||
struct ifnet *ifp = arg ? arg->ifp : NULL; | if_t ifp = arg ? arg->ifp : NULL; | ||||
int error; | int error; | ||||
/* get allocator */ | /* get allocator */ | ||||
arg->nm_mem = netmap_mem_pt_guest_new(ifp, nifp_offset, memid); | arg->nm_mem = netmap_mem_pt_guest_new(ifp, nifp_offset, memid); | ||||
if (arg->nm_mem == NULL) | if (arg->nm_mem == NULL) | ||||
return ENOMEM; | return ENOMEM; | ||||
arg->na_flags |= NAF_MEM_OWNER; | arg->na_flags |= NAF_MEM_OWNER; | ||||
error = netmap_attach_ext(arg, sizeof(struct netmap_pt_guest_adapter), 1); | error = netmap_attach_ext(arg, sizeof(struct netmap_pt_guest_adapter), 1); | ||||
Show All 20 Lines |