]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
IB/qib: Set cfgctxts to number of CPUs by default
authorRalph Campbell <ralph.campbell@qlogic.com>
Wed, 21 Jul 2010 22:46:11 +0000 (22:46 +0000)
committerRoland Dreier <rolandd@cisco.com>
Tue, 3 Aug 2010 20:59:05 +0000 (13:59 -0700)
Up to now, we have set the number of available user contexts based on
the number of hardware contexts which is set according to the number
of available CPUs.  This was fine since most CPUs had a power of two
number of cores and the chip supported 4, 8, or 16 user contexts.  Now
that some systems have 12 cores, the default isn't optimal and should
be set to 12 even though 16 hardware contexts need to be enabled.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/qib/qib_iba7322.c
drivers/infiniband/hw/qib/qib_init.c

index fc14ef8e55972015b8273862edfbaf2cb6cc4f96..584d443b5335978df67b66ca2d15e12d73c8d733 100644 (file)
@@ -5864,7 +5864,7 @@ static void write_7322_initregs(struct qib_devdata *dd)
         * Doesn't clear any of the error bits that might be set.
         */
        val = TIDFLOW_ERRBITS; /* these are W1C */
-       for (i = 0; i < dd->ctxtcnt; i++) {
+       for (i = 0; i < dd->cfgctxts; i++) {
                int flow;
                for (flow = 0; flow < NUM_TIDFLOWS_CTXT; flow++)
                        qib_write_ureg(dd, ur_rcvflowtable+flow, val, i);
index a873dd596e8172a1b75ba276579936fdee997352..f1d16d3a01f66c72ab004b62dbb6575dde11ba02 100644 (file)
@@ -93,7 +93,7 @@ unsigned long *qib_cpulist;
 void qib_set_ctxtcnt(struct qib_devdata *dd)
 {
        if (!qib_cfgctxts)
-               dd->cfgctxts = dd->ctxtcnt;
+               dd->cfgctxts = dd->first_user_ctxt + num_online_cpus();
        else if (qib_cfgctxts < dd->num_pports)
                dd->cfgctxts = dd->ctxtcnt;
        else if (qib_cfgctxts <= dd->ctxtcnt)