Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/netmap/netmap.c
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
opt->nro_status = error; | opt->nro_status = error; | ||||
if (error) { | if (error) { | ||||
netmap_do_unregif(priv); | netmap_do_unregif(priv); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
nifp = priv->np_nifp; | nifp = priv->np_nifp; | ||||
priv->np_td = td; /* for debugging purposes */ | |||||
/* return the offset of the netmap_if object */ | /* return the offset of the netmap_if object */ | ||||
req->nr_rx_rings = na->num_rx_rings; | req->nr_rx_rings = na->num_rx_rings; | ||||
req->nr_tx_rings = na->num_tx_rings; | req->nr_tx_rings = na->num_tx_rings; | ||||
req->nr_rx_slots = na->num_rx_desc; | req->nr_rx_slots = na->num_rx_desc; | ||||
req->nr_tx_slots = na->num_tx_desc; | req->nr_tx_slots = na->num_tx_desc; | ||||
error = netmap_mem_get_info(na->nm_mem, &req->nr_memsize, &memflags, | error = netmap_mem_get_info(na->nm_mem, &req->nr_memsize, &memflags, | ||||
&req->nr_mem_id); | &req->nr_mem_id); | ||||
▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | |||||
return 0; | return 0; | ||||
} | } | ||||
/* | /* | ||||
* select(2) and poll(2) handlers for the "netmap" device. | * select(2) and poll(2) handlers for the "netmap" device. | ||||
* | * | ||||
* Can be called for one or more queues. | * Can be called for one or more queues. | ||||
* Return true the event mask corresponding to ready events. | * Return true the event mask corresponding to ready events. | ||||
* If there are no ready events, do a selrecord on either individual | * If there are no ready events (and 'sr' is not NULL), do a | ||||
* selinfo or on the global one. | * selrecord on either individual selinfo or on the global one. | ||||
* Device-dependent parts (locking and sync of tx/rx rings) | * Device-dependent parts (locking and sync of tx/rx rings) | ||||
* are done through callbacks. | * are done through callbacks. | ||||
* | * | ||||
* On linux, arguments are really pwait, the poll table, and 'td' is struct file * | * On linux, arguments are really pwait, the poll table, and 'td' is struct file * | ||||
* The first one is remapped to pwait as selrecord() uses the name as an | * The first one is remapped to pwait as selrecord() uses the name as an | ||||
* hidden argument. | * hidden argument. | ||||
*/ | */ | ||||
int | int | ||||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |