FreeBSD/sys/dev/netmap/netmap_monitor.c
/* callback used to replace the nm_sync callback in the monitored rx rings */
callback used to replace the nm_sync callback in the monitored rx rings
callback used to replace the nm_sync callback in the monitored rx rings
static int
netmap_monitor_parent_rxsync(struct netmap_kring *kring, int flags)
{
	u_int first_new;
	int new_slots, error;
	error =  kring->mon_sync(kring, flags);
	if (error)
		return error;
	first_new = kring->mon_tail;
        new_slots = kring->nr_hwtail - first_new;
        if (new_slots < 0)
                new_slots += kring->nkr_num_slots;
	if (new_slots)
		netmap_monitor_parent_sync(kring, first_new, new_slots);
	kring->mon_tail = kring->nr_hwtail;
	return 0;
}
static int netmap_monitor_parent_rxsync ( struct netmap_kring * kring , int flags ) { u_int first_new ; int new_slots , error ; error = kring -> mon_sync ( kring , flags ) ; if ( error ) return error ; first_new = kring -> mon_tail ; new_slots = kring -> nr_hwtail - first_new ; if ( new_slots < 0 ) new_slots += kring -> nkr_num_slots ; if ( new_slots ) netmap_monitor_parent_sync ( kring , first_new , new_slots ) ; kring -> mon_tail = kring -> nr_hwtail ; return 0 ; }
callback used to replace the nm_sync callback in the monitored rx rings
callback used to replace the nm_sync callback in the monitored rx rings
/* get the new slots */