FreeBSD/sys/dev/netmap/netmap_vale.c
/* nm_krings_create callback for VALE ports.
 * Calls the standard netmap_krings_create, then adds leases on rx
 * rings and bdgfwd on tx rings.
 */
nm_krings_create callback for VALE ports.
Calls the standard netmap_krings_create, then adds leases on rx
rings and bdgfwd on tx rings.
nm_krings_create callback for VALE ports . Calls the standard netmap_krings_create then adds leases on rx rings and bdgfwd on tx rings .
static int
netmap_vp_krings_create(struct netmap_adapter *na)
{
	u_int tailroom;
	int error, i;
	uint32_t *leases;
	u_int nrx = netmap_real_rings(na, NR_RX);
	tailroom = sizeof(uint32_t) * na->num_rx_desc * nrx;
	error = netmap_krings_create(na, tailroom);
	if (error)
		return error;
	leases = na->tailroom;
	for (i = 0; i < nrx; i++) { 
		na->rx_rings[i].nkr_leases = leases;
		leases += na->num_rx_desc;
	}
	error = nm_alloc_bdgfwd(na);
	if (error) {
		netmap_krings_delete(na);
		return error;
	}
	return 0;
}
static int netmap_vp_krings_create ( struct netmap_adapter * na ) { u_int tailroom ; int error , i ; uint32_t * leases ; u_int nrx = netmap_real_rings ( na , NR_RX ) ; tailroom = sizeof ( uint32_t ) * na -> num_rx_desc * nrx ; error = netmap_krings_create ( na , tailroom ) ; if ( error ) return error ; leases = na -> tailroom ; for ( i = 0 ; i < nrx ; i ++ ) { na -> rx_rings [ i ] . nkr_leases = leases ; leases += na -> num_rx_desc ; } error = nm_alloc_bdgfwd ( na ) ; if ( error ) { netmap_krings_delete ( na ) ; return error ; } return 0 ; }
nm_krings_create callback for VALE ports.
nm_krings_create callback for VALE ports .
/*
	 * Leases are attached to RX rings on vale ports
	 */ /* Receive rings */