aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorKip Macy <kmacy@FreeBSD.org>2008-03-20 20:52:37 +0000
committerKip Macy <kmacy@FreeBSD.org>2008-03-20 20:52:37 +0000
commitf705d735fb4fb532401b2c5adf1d1ec7cebcac3e (patch)
tree529347846113d599d3f9f77e76d2cee84c7d3d02 /sys/dev
parent42ef13a247221203f7eb77cfa5fe970291a2702c (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cxgb/cxgb_main.c9
-rw-r--r--sys/dev/cxgb/cxgb_sge.c31
2 files changed, 32 insertions, 8 deletions
diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c
index 07ad574d8e32..5bea6b1b9df7 100644
--- a/sys/dev/cxgb/cxgb_main.c
+++ b/sys/dev/cxgb/cxgb_main.c
@@ -500,7 +500,7 @@ cxgb_controller_attach(device_t dev)
error = ENODEV;
goto out;
}
- /* Allocate the BAR for doing MSI-X. If it succeeds, try to allocate
+ /* Allocate the BAR for doing MSI-X. If it succeeds, try to allocate
* enough messages for the queue sets. If that fails, try falling
* back to MSI. If that fails, then try falling back to the legacy
* interrupt pin model.
@@ -549,7 +549,9 @@ cxgb_controller_attach(device_t dev)
sc->cxgb_intr = t3b_intr;
}
-
+ if ((sc->flags & USING_MSIX) && !singleq)
+ port_qsets = min((SGE_QSETS/(sc)->params.nports), mp_ncpus);
+
/* Create a private taskqueue thread for handling driver events */
#ifdef TASKQUEUE_CURRENT
sc->tq = taskqueue_create("cxgb_taskq", M_NOWAIT,
@@ -594,9 +596,6 @@ cxgb_controller_attach(device_t dev)
sc->flags |= TPS_UPTODATE;
}
- if ((sc->flags & USING_MSIX) && !singleq)
- port_qsets = min((SGE_QSETS/(sc)->params.nports), mp_ncpus);
-
/*
* Create a child device for each MAC. The ethernet attachment
* will be done in these children.
diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c
index 38f8daee5968..bde6585f700c 100644
--- a/sys/dev/cxgb/cxgb_sge.c
+++ b/sys/dev/cxgb/cxgb_sge.c
@@ -83,8 +83,16 @@ int cxgb_cached_allocations;
int cxgb_cached;
int cxgb_ext_freed = 0;
int cxgb_ext_inited = 0;
+int fl_q_size = 0;
+int jumbo_q_size = 0;
+
extern int cxgb_use_16k_clusters;
extern int cxgb_pcpu_cache_enable;
+extern int nmbjumbo4;
+extern int nmbjumbo9;
+extern int nmbjumbo16;
+
+
#define USE_GTS 0
@@ -360,8 +368,25 @@ t3_sge_err_intr_handler(adapter_t *adapter)
void
t3_sge_prep(adapter_t *adap, struct sge_params *p)
{
- int i;
+ int i, nqsets;
+
+ nqsets = min(SGE_QSETS, mp_ncpus*4);
+ fl_q_size = min(nmbclusters/(3*nqsets), FL_Q_SIZE);
+
+ while (!powerof2(fl_q_size))
+ fl_q_size--;
+#if __FreeBSD_version > 800000
+ if (cxgb_use_16k_clusters)
+ jumbo_q_size = min(nmbjumbo16/(3*nqsets), JUMBO_Q_SIZE);
+ else
+ jumbo_q_size = min(nmbjumbo9/(3*nqsets), JUMBO_Q_SIZE);
+#else
+ jumbo_q_size = min(nmbjumbo4/(3*nqsets), JUMBO_Q_SIZE);
+#endif
+ while (!powerof2(jumbo_q_size))
+ jumbo_q_size--;
+
/* XXX Does ETHER_ALIGN need to be accounted for here? */
p->max_pkt_size = adap->sge.qs[0].fl[1].buf_size - sizeof(struct cpl_rx_data);
@@ -379,8 +404,8 @@ t3_sge_prep(adapter_t *adap, struct sge_params *p)
}
q->polling = adap->params.rev > 0;
q->rspq_size = RSPQ_Q_SIZE;
- q->fl_size = FL_Q_SIZE;
- q->jumbo_size = JUMBO_Q_SIZE;
+ q->fl_size = fl_q_size;
+ q->jumbo_size = jumbo_q_size;
q->txq_size[TXQ_ETH] = TX_ETH_Q_SIZE;
q->txq_size[TXQ_OFLD] = 1024;
q->txq_size[TXQ_CTRL] = 256;