FreeBSD/sys/dev/netmap/netmap_monitor.c
/* This is called when the monitored adapter leaves netmap mode
 * (see netmap_do_unregif).
 * We need to notify the monitors that the monitored rings are gone.
 * We do this by setting their mna->priv.np_na to NULL.
 * Note that the rings are already stopped when this happens, so
 * no monitor ring callback can be active.
 */
This is called when the monitored adapter leaves netmap mode
.
We need to notify the monitors that the monitored rings are gone.
We do this by setting their mna->priv.np_na to NULL.
Note that the rings are already stopped when this happens, so
no monitor ring callback can be active.
This is called when the monitored adapter leaves netmap mode . We need to notify the monitors that the monitored rings are gone . We do this by setting their mna - > priv . np_na to NULL . Note that the rings are already stopped when this happens so no monitor ring callback can be active .
void
netmap_monitor_stop(struct netmap_adapter *na)
{
	enum txrx t;
	for_rx_tx(t) {
		u_int i;
		for (i = 0; i < nma_get_nrings(na, t); i++) {
			struct netmap_kring *kring = &NMR(na, t)[i];
			u_int j;
			for (j = 0; j < kring->n_monitors; j++) {
				struct netmap_kring *mkring =
					kring->monitors[j];
				struct netmap_monitor_adapter *mna =
					(struct netmap_monitor_adapter *)mkring->na;
				netmap_adapter_put(mna->priv.np_na);
				mna->priv.np_na = NULL;
			}
		}
	}
}
void netmap_monitor_stop ( struct netmap_adapter * na ) { enum txrx t ; for_rx_tx ( t ) { u_int i ; for ( i = 0 ; i < nma_get_nrings ( na , t ) ; i ++ ) { struct netmap_kring * kring = & NMR ( na , t ) [ i ] ; u_int j ; for ( j = 0 ; j < kring -> n_monitors ; j ++ ) { struct netmap_kring * mkring = kring -> monitors [ j ] ; struct netmap_monitor_adapter * mna = ( struct netmap_monitor_adapter * ) mkring -> na ; netmap_adapter_put ( mna -> priv . np_na ) ; mna -> priv . np_na = NULL ; } } } }
This is called when the monitored adapter leaves netmap mode
 (see netmap_do_unregif).
This is called when the monitored adapter leaves netmap mode ( see netmap_do_unregif ) .
/* forget about this adapter */