From owner-svn-src-head@freebsd.org Thu May 24 10:55:27 2018 Return-Path: Delivered-To: svn-src-head@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 92A17EB125D; Thu, 24 May 2018 10:55:27 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47B4583A78; Thu, 24 May 2018 10:55:27 +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 0ADE1114F0; Thu, 24 May 2018 10:55:27 +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 w4OAtQ1a096927; Thu, 24 May 2018 10:55:26 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4OAtQQ9096926; Thu, 24 May 2018 10:55:26 GMT (envelope-from np@FreeBSD.org) Message-Id: <201805241055.w4OAtQQ9096926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 24 May 2018 10:55:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334148 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 334148 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.26 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, 24 May 2018 10:55:27 -0000 Author: np Date: Thu May 24 10:55:26 2018 New Revision: 334148 URL: https://svnweb.freebsd.org/changeset/base/334148 Log: cxgbe(4): Report IFCAP_TXRTLMT to kernels built with RATELIMIT if the firmware has provisioned resources for this feature. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu May 24 10:22:57 2018 (r334147) +++ head/sys/dev/cxgbe/t4_main.c Thu May 24 10:55:26 2018 (r334148) @@ -1508,6 +1508,10 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) if (vi->nnmrxq != 0) ifp->if_capabilities |= IFCAP_NETMAP; #endif +#ifdef RATELIMIT + if (is_ethoffload(vi->pi->adapter) && vi->nofldtxq != 0) + ifp->if_capabilities |= IFCAP_TXRTLMT; +#endif ifp->if_capenable = T4_CAP_ENABLE; ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO | CSUM_UDP_IPV6 | CSUM_TCP_IPV6; @@ -1526,10 +1530,22 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) #endif sb = sbuf_new_auto(); sbuf_printf(sb, "%d txq, %d rxq (NIC)", vi->ntxq, vi->nrxq); +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) + switch (ifp->if_capabilities & (IFCAP_TOE | IFCAP_TXRTLMT)) { + case IFCAP_TOE: + sbuf_printf(sb, "; %d txq (TOE)", vi->nofldtxq); + break; + case IFCAP_TOE | IFCAP_TXRTLMT: + sbuf_printf(sb, "; %d txq (TOE/ETHOFLD)", vi->nofldtxq); + break; + case IFCAP_TXRTLMT: + sbuf_printf(sb, "; %d txq (ETHOFLD)", vi->nofldtxq); + break; + } +#endif #ifdef TCP_OFFLOAD if (ifp->if_capabilities & IFCAP_TOE) - sbuf_printf(sb, "; %d txq, %d rxq (TOE)", - vi->nofldtxq, vi->nofldrxq); + sbuf_printf(sb, ", %d rxq (TOE)", vi->nofldrxq); #endif #ifdef DEV_NETMAP if (ifp->if_capabilities & IFCAP_NETMAP) @@ -1821,6 +1837,10 @@ redo_sifflags: ifp->if_capenable ^= IFCAP_VLAN_HWTSO; if (mask & IFCAP_VLAN_HWCSUM) ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; +#ifdef RATELIMIT + if (mask & IFCAP_TXRTLMT) + ifp->if_capenable ^= IFCAP_TXRTLMT; +#endif #ifdef VLAN_CAPABILITIES VLAN_CAPABILITIES(ifp);