From owner-svn-src-stable-11@freebsd.org Mon Apr 29 21:34:25 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 954AA159E9DB; Mon, 29 Apr 2019 21:34:25 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31A80767B8; Mon, 29 Apr 2019 21:34:25 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03BAA27E8F; Mon, 29 Apr 2019 21:34:25 +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 x3TLYOJ5043083; Mon, 29 Apr 2019 21:34:24 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TLYOcG043081; Mon, 29 Apr 2019 21:34:24 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904292134.x3TLYOcG043081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 21:34:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346928 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 31A80767B8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 21:34:25 -0000 Author: np Date: Mon Apr 29 21:34:24 2019 New Revision: 346928 URL: https://svnweb.freebsd.org/changeset/base/346928 Log: MFC r339628, r339965 r339628: cxgbe(4): improve the accuracy of various TSO limits reported to the kernel. Sponsored by: Chelsio Communications r339965: cxgbe(4): Report a reasonable non-zero if_hw_tsomaxsegsize to the kernel. This reverts an accidental change that snuck in with r339628. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 20:53:20 2019 (r346927) +++ stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 21:34:24 2019 (r346928) @@ -114,6 +114,7 @@ enum { SGE_MAX_WR_NDESC = SGE_MAX_WR_LEN / EQ_ESIZE, /* max WR size in desc */ TX_SGL_SEGS = 39, TX_SGL_SEGS_TSO = 38, + TX_SGL_SEGS_EO_TSO = 30, /* XXX: lower for IPv6. */ TX_WR_FLITS = SGE_MAX_WR_LEN / 8 }; Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 20:53:20 2019 (r346927) +++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 21:34:24 2019 (r346928) @@ -60,6 +60,8 @@ __FBSDID("$FreeBSD$"); #ifdef RSS #include #endif +#include +#include #if defined(__i386__) || defined(__amd64__) #include #include @@ -1607,8 +1609,12 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO | CSUM_UDP_IPV6 | CSUM_TCP_IPV6; - ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); - ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS; + ifp->if_hw_tsomax = IP_MAXPACKET; + ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS_TSO; +#ifdef RATELIMIT + if (is_ethoffload(vi->pi->adapter) && vi->nofldtxq != 0) + ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS_EO_TSO; +#endif ifp->if_hw_tsomaxsegsize = 65536; ether_ifattach(ifp, vi->hw_addr);