From owner-svn-src-all@FreeBSD.ORG Tue Apr 15 08:08:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A01FDD6; Tue, 15 Apr 2014 08:08:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 454AB1989; Tue, 15 Apr 2014 08:08:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3F88jBd011751; Tue, 15 Apr 2014 08:08:45 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3F88ikA011749; Tue, 15 Apr 2014 08:08:44 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201404150808.s3F88ikA011749@svn.freebsd.org> From: Scott Long Date: Tue, 15 Apr 2014 08:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264493 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 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: Tue, 15 Apr 2014 08:08:45 -0000 Author: scottl Date: Tue Apr 15 08:08:44 2014 New Revision: 264493 URL: http://svnweb.freebsd.org/changeset/base/264493 Log: MFC r261558 Add a new sysctl, dev.cxgbe.N.rsrv_noflow, and a companion tunable, hw.cxgbe.rsrv_noflow. When set, queue 0 of the port is reserved for TX packets without a flowid. The hash value of packets with a flowid is bumped up by 1. The intent is to provide a private queue for link-level packets like LACP that is unlikely to overflow or suffer deep queue latency. Modified: stable/10/sys/dev/cxgbe/adapter.h stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/10/sys/dev/cxgbe/adapter.h Tue Apr 15 08:02:57 2014 (r264492) +++ stable/10/sys/dev/cxgbe/adapter.h Tue Apr 15 08:08:44 2014 (r264493) @@ -208,6 +208,7 @@ struct port_info { /* These need to be int as they are used in sysctl */ int ntxq; /* # of tx queues */ int first_txq; /* index of first tx queue */ + int rsrv_noflowq; /* Reserve queue 0 for non-flowid packets */ int nrxq; /* # of rx queues */ int first_rxq; /* index of first rx queue */ #ifdef TCP_OFFLOAD Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Tue Apr 15 08:02:57 2014 (r264492) +++ stable/10/sys/dev/cxgbe/t4_main.c Tue Apr 15 08:08:44 2014 (r264493) @@ -197,6 +197,9 @@ TUNABLE_INT("hw.cxgbe.ntxq1g", &t4_ntxq1 static int t4_nrxq1g = -1; TUNABLE_INT("hw.cxgbe.nrxq1g", &t4_nrxq1g); +static int t4_rsrv_noflowq = 0; +TUNABLE_INT("hw.cxgbe.rsrv_noflowq", &t4_rsrv_noflowq); + #ifdef TCP_OFFLOAD #define NOFLDTXQ_10G 8 static int t4_nofldtxq10g = -1; @@ -299,6 +302,7 @@ struct intrs_and_queues { int nrxq10g; /* # of NIC rxq's for each 10G port */ int ntxq1g; /* # of NIC txq's for each 1G port */ int nrxq1g; /* # of NIC rxq's for each 1G port */ + int rsrv_noflowq; /* Flag whether to reserve queue 0 */ #ifdef TCP_OFFLOAD int nofldtxq10g; /* # of TOE txq's for each 10G port */ int nofldrxq10g; /* # of TOE rxq's for each 10G port */ @@ -375,6 +379,7 @@ static int cxgbe_sysctls(struct port_inf static int sysctl_int_array(SYSCTL_HANDLER_ARGS); static int sysctl_bitfield(SYSCTL_HANDLER_ARGS); static int sysctl_btphy(SYSCTL_HANDLER_ARGS); +static int sysctl_noflowq(SYSCTL_HANDLER_ARGS); static int sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS); static int sysctl_holdoff_pktc_idx(SYSCTL_HANDLER_ARGS); static int sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS); @@ -782,6 +787,11 @@ t4_attach(device_t dev) pi->ntxq = iaq.ntxq1g; } + if (pi->ntxq > 1) + pi->rsrv_noflowq = iaq.rsrv_noflowq ? 1 : 0; + else + pi->rsrv_noflowq = 0; + rqidx += pi->nrxq; tqidx += pi->ntxq; @@ -1267,7 +1277,8 @@ cxgbe_transmit(struct ifnet *ifp, struct } if (m->m_flags & M_FLOWID) - txq += (m->m_pkthdr.flowid % pi->ntxq); + txq += ((m->m_pkthdr.flowid % (pi->ntxq - pi->rsrv_noflowq)) + + pi->rsrv_noflowq); br = txq->br; if (TXQ_TRYLOCK(txq) == 0) { @@ -1719,6 +1730,7 @@ cfg_itype_and_nqueues(struct adapter *sc iaq->ntxq1g = t4_ntxq1g; iaq->nrxq10g = nrxq10g = t4_nrxq10g; iaq->nrxq1g = nrxq1g = t4_nrxq1g; + iaq->rsrv_noflowq = t4_rsrv_noflowq; #ifdef TCP_OFFLOAD if (is_offload(sc)) { iaq->nofldtxq10g = t4_nofldtxq10g; @@ -4498,6 +4510,9 @@ cxgbe_sysctls(struct port_info *pi) &pi->first_rxq, 0, "index of first rx queue"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_txq", CTLFLAG_RD, &pi->first_txq, 0, "index of first tx queue"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rsrv_noflowq", CTLTYPE_INT | + CTLFLAG_RW, pi, 0, sysctl_noflowq, "IU", + "Reserve queue 0 for non-flowid packets"); #ifdef TCP_OFFLOAD if (is_offload(pi->adapter)) { @@ -4752,6 +4767,25 @@ sysctl_btphy(SYSCTL_HANDLER_ARGS) } static int +sysctl_noflowq(SYSCTL_HANDLER_ARGS) +{ + struct port_info *pi = arg1; + int rc, val; + + val = pi->rsrv_noflowq; + rc = sysctl_handle_int(oidp, &val, 0, req); + if (rc != 0 || req->newptr == NULL) + return (rc); + + if ((val >= 1) && (pi->ntxq > 1)) + pi->rsrv_noflowq = 1; + else + pi->rsrv_noflowq = 0; + + return (rc); +} + +static int sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS) { struct port_info *pi = arg1;