From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 08:23:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5C2D1065673; Mon, 7 Jun 2010 08:23:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B51578FC13; Mon, 7 Jun 2010 08:23:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o578NGIT008943; Mon, 7 Jun 2010 08:23:16 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o578NGvJ008941; Mon, 7 Jun 2010 08:23:16 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201006070823.o578NGvJ008941@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 7 Jun 2010 08:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208887 - head/sys/dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 08:23:16 -0000 Author: np Date: Mon Jun 7 08:23:16 2010 New Revision: 208887 URL: http://svn.freebsd.org/changeset/base/208887 Log: 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). Modified: head/sys/dev/cxgb/cxgb_main.c Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Mon Jun 7 07:41:41 2010 (r208886) +++ head/sys/dev/cxgb/cxgb_main.c Mon Jun 7 08:23:16 2010 (r208887) @@ -238,6 +238,10 @@ TUNABLE_INT("hw.cxgb.snd_queue_len", &cx 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);