diff options
author | np <np@FreeBSD.org> | 2010-06-07 08:23:16 +0000 |
---|---|---|
committer | np <np@FreeBSD.org> | 2010-06-07 08:23:16 +0000 |
commit | 39b40533818940f0d9a36492b6229edfc8b8d1b1 (patch) | |
tree | c177976398cd60dbdc0d2ae9d1121bacc9c8df46 /sys/dev | |
parent | 7233caf7de7e171dc41c5c2a4549aa4130b87621 (diff) | |
download | FreeBSD-src-39b40533818940f0d9a36492b6229edfc8b8d1b1.zip FreeBSD-src-39b40533818940f0d9a36492b6229edfc8b8d1b1.tar.gz |
cxgb(4): add an 'nfilters' tunable that lets the user place an upper
limit on the number of hardware filters (and thus the amount of TCAM
reserved for filtering).
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/cxgb/cxgb_main.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index 4dcc997..7764d33 100644 --- a/sys/dev/cxgb/cxgb_main.c +++ b/sys/dev/cxgb/cxgb_main.c @@ -238,6 +238,10 @@ TUNABLE_INT("hw.cxgb.snd_queue_len", &cxgb_snd_queue_len); SYSCTL_UINT(_hw_cxgb, OID_AUTO, snd_queue_len, CTLFLAG_RDTUN, &cxgb_snd_queue_len, 0, "send queue size "); +static int nfilters = -1; +TUNABLE_INT("hw.cxgb.nfilters", &nfilters); +SYSCTL_INT(_hw_cxgb, OID_AUTO, nfilters, CTLFLAG_RDTUN, + &nfilters, 0, "max number of entries in the filter table"); enum { MAX_TXQ_ENTRIES = 16384, @@ -1652,6 +1656,7 @@ static int cxgb_up(struct adapter *sc) { int err = 0; + unsigned int mxf = t3_mc5_size(&sc->mc5) - MC5_MIN_TIDS; KASSERT(sc->open_device_map == 0, ("%s: device(s) already open (%x)", __func__, sc->open_device_map)); @@ -1668,11 +1673,13 @@ cxgb_up(struct adapter *sc) if ((err = update_tpsram(sc))) goto out; - if (is_offload(sc)) { + if (is_offload(sc) && nfilters != 0) { sc->params.mc5.nservers = 0; - sc->params.mc5.nroutes = 0; - sc->params.mc5.nfilters = t3_mc5_size(&sc->mc5) - - MC5_MIN_TIDS; + + if (nfilters < 0) + sc->params.mc5.nfilters = mxf; + else + sc->params.mc5.nfilters = min(nfilters, mxf); } err = t3_init_hw(sc, 0); |