From owner-svn-src-head@freebsd.org Thu Aug 31 20:33:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97798E057CD; Thu, 31 Aug 2017 20:33:24 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 6DDD0667EB; Thu, 31 Aug 2017 20:33:24 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7VKXNdX010729; Thu, 31 Aug 2017 20:33:23 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7VKXNnW010725; Thu, 31 Aug 2017 20:33:23 GMT (envelope-from np@FreeBSD.org) Message-Id: <201708312033.v7VKXNnW010725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 31 Aug 2017 20:33:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323069 - in head/sys/dev/cxgbe: . tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . tom X-SVN-Commit-Revision: 323069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Aug 2017 20:33:24 -0000 Author: np Date: Thu Aug 31 20:33:22 2017 New Revision: 323069 URL: https://svnweb.freebsd.org/changeset/base/323069 Log: cxgbe/t4_tom: Add a knob to select the congestion control algorigthm used by the TOE hardware for fully offloaded connections. The knob affects new connections only. MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_listen.c Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Thu Aug 31 20:16:28 2017 (r323068) +++ head/sys/dev/cxgbe/offload.h Thu Aug 31 20:33:22 2017 (r323069) @@ -144,6 +144,7 @@ struct uld_info { }; struct tom_tunables { + int cong_algorithm; int sndbuf; int ddp; int rx_coalesce; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Aug 31 20:16:28 2017 (r323068) +++ head/sys/dev/cxgbe/t4_main.c Thu Aug 31 20:33:22 2017 (r323069) @@ -5416,6 +5416,12 @@ t4_sysctls(struct adapter *sc) NULL, "TOE parameters"); children = SYSCTL_CHILDREN(oid); + sc->tt.cong_algorithm = -1; + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "cong_algorithm", + CTLFLAG_RW, &sc->tt.cong_algorithm, 0, "congestion control " + "(-1 = default, 0 = reno, 1 = tahoe, 2 = newreno, " + "3 = highspeed)"); + sc->tt.sndbuf = 256 * 1024; SYSCTL_ADD_INT(ctx, children, OID_AUTO, "sndbuf", CTLFLAG_RW, &sc->tt.sndbuf, 0, "max hardware send buffer size"); Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Thu Aug 31 20:16:28 2017 (r323068) +++ head/sys/dev/cxgbe/tom/t4_connect.c Thu Aug 31 20:33:22 2017 (r323069) @@ -259,6 +259,9 @@ calc_opt2a(struct socket *so, struct toepcb *toep) if (sc->tt.rx_coalesce) opt2 |= V_RX_COALESCE(M_RX_COALESCE); + if (sc->tt.cong_algorithm != -1) + opt2 |= V_CONG_CNTRL(sc->tt.cong_algorithm & M_CONG_CNTRL); + #ifdef USE_DDP_RX_FLOW_CONTROL if (toep->ulp_mode == ULP_MODE_TCPDDP) opt2 |= F_RX_FC_VALID | F_RX_FC_DDP; Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Thu Aug 31 20:16:28 2017 (r323068) +++ head/sys/dev/cxgbe/tom/t4_listen.c Thu Aug 31 20:33:22 2017 (r323069) @@ -1047,6 +1047,9 @@ calc_opt2p(struct adapter *sc, struct port_info *pi, i if (sc->tt.rx_coalesce) opt2 |= V_RX_COALESCE(M_RX_COALESCE); + if (sc->tt.cong_algorithm != -1) + opt2 |= V_CONG_CNTRL(sc->tt.cong_algorithm & M_CONG_CNTRL); + #ifdef USE_DDP_RX_FLOW_CONTROL if (ulp_mode == ULP_MODE_TCPDDP) opt2 |= F_RX_FC_VALID | F_RX_FC_DDP;