Date: Thu, 24 May 2018 10:55:26 +0000 (UTC) From: Navdeep Parhar <np@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334148 - head/sys/dev/cxgbe Message-ID: <201805241055.w4OAtQQ9096926@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805241055.w4OAtQQ9096926>