Date: Wed, 8 Aug 2007 06:19:41 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 124877 for review Message-ID: <200708080619.l786JfY0000150@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=124877 Change 124877 by kmacy@kmacy_home:ethng on 2007/08/08 06:19:37 bind interrupts to the qsets corresponding CPU when using MSI-x and there is more than one qset in use remove sched_bind calls from IFNET_MULTIQUEUE case as intr_bind will now do that for us Affected files ... .. //depot/projects/ethng/src/sys/dev/cxgb/cxgb_main.c#5 edit .. //depot/projects/ethng/src/sys/dev/cxgb/cxgb_sge.c#4 edit Differences ... ==== //depot/projects/ethng/src/sys/dev/cxgb/cxgb_main.c#5 (text+ko) ==== @@ -82,6 +82,8 @@ #include <sys/priv.h> #endif +#include <machine/intr_machdep.h> + static int cxgb_setup_msix(adapter_t *, int); static void cxgb_teardown_msix(adapter_t *); static void cxgb_init(void *); @@ -874,7 +876,7 @@ static int cxgb_setup_msix(adapter_t *sc, int msix_count) { - int i, j, k, nqsets, rid; + int i, j, k, nqsets, rid, vector; /* The first message indicates link changes and error conditions */ sc->irq_rid = 1; @@ -896,7 +898,7 @@ nqsets = sc->port[i].nqsets; for (j = 0; j < nqsets; j++, k++) { struct sge_qset *qs = &sc->sge.qs[k]; - + rid = k + 2; if (cxgb_debug) printf("rid=%d ", rid); @@ -909,19 +911,24 @@ } sc->msix_irq_rid[k] = rid; if (bus_setup_intr(sc->dev, sc->msix_irq_res[k], - INTR_MPSAFE|INTR_TYPE_NET, + INTR_MPSAFE|INTR_TYPE_NET, #ifdef INTR_FILTERS - NULL, + NULL, #endif t3_intr_msix, qs, &sc->msix_intr_tag[k])) { device_printf(sc->dev, "Cannot set up " "interrupt for message %d\n", rid); return (EINVAL); } + if (singleq) { + vector = rman_get_start(sc->msix_irq_res[k]); + if (bootverbose) + device_printf(sc->dev, "binding vector=%d to cpu=%d\n", vector, k % mp_ncpus); + intr_bind(vector, k % mp_ncpus); + } } } - return (0); } ==== //depot/projects/ethng/src/sys/dev/cxgb/cxgb_sge.c#4 (text+ko) ==== @@ -2607,19 +2607,6 @@ taskqueue_enqueue(adap->tq, &adap->slow_intr_task); } -#ifdef IFNET_MULTIQUEUE -static void -bind_qs_thread(struct sge_qset *qs) -{ - struct thread *td = curthread; - thread_lock(td); - sched_bind(td, qs->cpuid); - thread_unlock(td); - critical_enter(); - qs->flags |= QS_BOUND; - critical_exit(); -} - void t3_intr_msix(void *data) { @@ -2628,28 +2615,11 @@ struct sge_rspq *rspq = &qs->rspq; mtx_lock(&rspq->lock); - if ((qs->flags & QS_BOUND) == 0) - bind_qs_thread(qs); - if (process_responses_gts(adap, rspq) == 0) rspq->unhandled_irqs++; mtx_unlock(&rspq->lock); } -#else -void -t3_intr_msix(void *data) -{ - struct sge_qset *qs = data; - adapter_t *adap = qs->port->adapter; - struct sge_rspq *rspq = &qs->rspq; - - mtx_lock(&rspq->lock); - if (process_responses_gts(adap, rspq) == 0) - rspq->unhandled_irqs++; - mtx_unlock(&rspq->lock); -} -#endif /* * broken by recent mbuf changes */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708080619.l786JfY0000150>