FreeBSD/sys/dev/netmap/netmap_freebsd.c
/*
 * Intercept the packet steering routine in the tx path,
 * so that we can decide which queue is used for an mbuf.
 * Second argument is non-zero to intercept, 0 to restore.
 * On freebsd we just intercept if_transmit.
 */
Intercept the packet steering routine in the tx path,
so that we can decide which queue is used for an mbuf.
Second argument is non-zero to intercept, 0 to restore.
On freebsd we just intercept if_transmit.
Intercept the packet steering routine in the tx path so that we can decide which queue is used for an mbuf . Second argument is non - zero to intercept 0 to restore . On freebsd we just intercept if_transmit .
void
netmap_catch_tx(struct netmap_generic_adapter *gna, int enable)
{
	struct netmap_adapter *na = &gna->up.up;
	struct ifnet *ifp = netmap_generic_getifp(gna);
	if (enable) {
		na->if_transmit = ifp->if_transmit;
		ifp->if_transmit = netmap_transmit;
	} else {
		ifp->if_transmit = na->if_transmit;
	}
}
void netmap_catch_tx ( struct netmap_generic_adapter * gna , int enable ) { struct netmap_adapter * na = & gna -> up . up ; struct ifnet * ifp = netmap_generic_getifp ( gna ) ; if ( enable ) { na -> if_transmit = ifp -> if_transmit ; ifp -> if_transmit = netmap_transmit ; } else { ifp -> if_transmit = na -> if_transmit ; } }
Intercept the packet steering routine in the tx path,
 so that we can decide which queue is used for an mbuf.
Intercept the packet steering routine in the tx path so that we can decide which queue is used for an mbuf .