diff options
author | kmacy <kmacy@FreeBSD.org> | 2008-03-20 20:52:37 +0000 |
---|---|---|
committer | kmacy <kmacy@FreeBSD.org> | 2008-03-20 20:52:37 +0000 |
commit | db590514fa414bc526a9da675714256973cd3f41 (patch) | |
tree | 529347846113d599d3f9f77e76d2cee84c7d3d02 /sys/dev/cxgb | |
parent | ae058e4be51a6ef3182441d44e7242df5b52d3a7 (diff) | |
download | FreeBSD-src-db590514fa414bc526a9da675714256973cd3f41.zip FreeBSD-src-db590514fa414bc526a9da675714256973cd3f41.tar.gz |
pay attention to default cluster limits when sizing receive queues
Diffstat (limited to 'sys/dev/cxgb')
-rw-r--r-- | sys/dev/cxgb/cxgb_main.c | 9 | ||||
-rw-r--r-- | sys/dev/cxgb/cxgb_sge.c | 31 |
2 files changed, 32 insertions, 8 deletions
diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index 07ad574..5bea6b1 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 38f8dae..bde6585 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; |