FreeBSD/sys/dev/cxgbe/t4_sge.c
/*
 * Given an arbitrary "index," come up with an iq that can be used by other
 * queues (of this VI) for interrupt forwarding, SGE egress updates, etc.
 * The iq returned is guaranteed to be something that takes direct interrupts.
 */
Given an arbitrary "index," come up with an iq that can be used by other
queues (of this VI) for interrupt forwarding, SGE egress updates, etc.
The iq returned is guaranteed to be something that takes direct interrupts.
Given an arbitrary " index " come up with an iq that can be used by other queues ( of this VI ) for interrupt forwarding SGE egress updates etc . The iq returned is guaranteed to be something that takes direct interrupts .
static struct sge_iq *
vi_intr_iq(struct vi_info *vi, int idx)
{
	struct adapter *sc = vi->pi->adapter;
	struct sge *s = &sc->sge;
	struct sge_iq *iq = NULL;
	int nintr, i;
	if (sc->intr_count == 1)
		return (&sc->sge.fwq);
	nintr = vi->nintr;
	KASSERT(nintr != 0,
	    ("%s: vi %p has no exclusive interrupts, total interrupts = %d",
	    __func__, vi, sc->intr_count));
	i = idx % nintr;
	if (vi->flags & INTR_RXQ) {
	       	if (i < vi->nrxq) {
			iq = &s->rxq[vi->first_rxq + i].iq;
			goto done;
		}
		i -= vi->nrxq;
	}
#ifdef TCP_OFFLOAD
	if (vi->flags & INTR_OFLD_RXQ) {
	       	if (i < vi->nofldrxq) {
			iq = &s->ofld_rxq[vi->first_ofld_rxq + i].iq;
			goto done;
		}
		i -= vi->nofldrxq;
	}
#endif
	panic("%s: vi %p, intr_flags 0x%lx, idx %d, total intr %d\n", __func__,
	    vi, vi->flags & INTR_ALL, idx, nintr);
done:
	MPASS(iq != NULL);
	KASSERT(iq->flags & IQ_INTR,
	    ("%s: iq %p (vi %p, intr_flags 0x%lx, idx %d)", __func__, iq, vi,
	    vi->flags & INTR_ALL, idx));
	return (iq);
}
static struct sge_iq * vi_intr_iq ( struct vi_info * vi , int idx ) { struct adapter * sc = vi -> pi -> adapter ; struct sge * s = & sc -> sge ; struct sge_iq * iq = NULL ; int nintr , i ; if ( sc -> intr_count == 1 ) return ( & sc -> sge . fwq ) ; nintr = vi -> nintr ; KASSERT ( nintr != 0 , ( " " , __func__ , vi , sc -> intr_count ) ) ; i = idx % nintr ; if ( vi -> flags & INTR_RXQ ) { if ( i < vi -> nrxq ) { iq = & s -> rxq [ vi -> first_rxq + i ] . iq ; goto done ; } i -= vi -> nrxq ; } #ifdef TCP_OFFLOAD if ( vi -> flags & INTR_OFLD_RXQ ) { if ( i < vi -> nofldrxq ) { iq = & s -> ofld_rxq [ vi -> first_ofld_rxq + i ] . iq ; goto done ; } i -= vi -> nofldrxq ; } #endif panic ( " \n " , __func__ , vi , vi -> flags & INTR_ALL , idx , nintr ) ; done : MPASS ( iq != NULL ) ; KASSERT ( iq -> flags & IQ_INTR , ( " " , __func__ , iq , vi , vi -> flags & INTR_ALL , idx ) ) ; return ( iq ) ; }
Given an arbitrary "index," come up with an iq that can be used by other
 queues (of this VI) for interrupt forwarding, SGE egress updates, etc.
Given an arbitrary " index " come up with an iq that can be used by other queues ( of this VI ) for interrupt forwarding SGE egress updates etc .