FreeBSD/sys/dev/ntb/ntb_hw/ntb_hw.c
/*
 * Remap the desired number of MSI-X messages to available ithreads in a simple
 * round-robin fashion.
 */
Remap the desired number of MSI-X messages to available ithreads in a simple
round-robin fashion.
Remap the desired number of MSI - X messages to available ithreads in a simple round - robin fashion .
static int
ntb_remap_msix(device_t dev, uint32_t desired, uint32_t avail)
{
	u_int *vectors;
	uint32_t i;
	int rc;
	if (ntb_prefer_intx != 0)
		return (ENXIO);
	vectors = malloc(desired * sizeof(*vectors), M_NTB, M_ZERO | M_WAITOK);
	for (i = 0; i < desired; i++)
		vectors[i] = (i % avail) + 1;
	rc = pci_remap_msix(dev, desired, vectors);
	free(vectors, M_NTB);
	return (rc);
}
static int ntb_remap_msix ( device_t dev , uint32_t desired , uint32_t avail ) { u_int * vectors ; uint32_t i ; int rc ; if ( ntb_prefer_intx != 0 ) return ( ENXIO ) ; vectors = malloc ( desired * sizeof ( * vectors ) , M_NTB , M_ZERO | M_WAITOK ) ; for ( i = 0 ; i < desired ; i ++ ) vectors [ i ] = ( i % avail ) + 1 ; rc = pci_remap_msix ( dev , desired , vectors ) ; free ( vectors , M_NTB ) ; return ( rc ) ; }
Remap the desired number of MSI-X messages to available ithreads in a simple
 round-robin fashion.
Remap the desired number of MSI - X messages to available ithreads in a simple round - robin fashion .