From owner-svn-src-head@freebsd.org Mon Nov 21 05:41:09 2016 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 A42CCC4C336; Mon, 21 Nov 2016 05:41:09 +0000 (UTC) (envelope-from sephe@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 5298A1F54; Mon, 21 Nov 2016 05:41:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAL5f8Hi081469; Mon, 21 Nov 2016 05:41:08 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAL5f8MK081467; Mon, 21 Nov 2016 05:41:08 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611210541.uAL5f8MK081467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 21 Nov 2016 05:41:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308908 - head/sys/dev/hyperv/netvsc X-SVN-Group: head 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: Mon, 21 Nov 2016 05:41:09 -0000 Author: sephe Date: Mon Nov 21 05:41:08 2016 New Revision: 308908 URL: https://svnweb.freebsd.org/changeset/base/308908 Log: hyperv/hn: Allow enabling IPv6 TX checksum offloading and IPv6 TSO. They are still disabled by default. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8490 Modified: head/sys/dev/hyperv/netvsc/hn_rndis.c head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hn_rndis.c Mon Nov 21 05:21:15 2016 (r308907) +++ head/sys/dev/hyperv/netvsc/hn_rndis.c Mon Nov 21 05:41:08 2016 (r308908) @@ -602,7 +602,6 @@ hn_rndis_conf_offload(struct hn_softc *s if ((hwcaps.ndis_lsov2.ndis_ip6_encap & NDIS_OFFLOAD_ENCAP_8023) && (hwcaps.ndis_lsov2.ndis_ip6_opts & HN_NDIS_LSOV2_CAP_IP6) == HN_NDIS_LSOV2_CAP_IP6) { -#ifdef notyet caps |= HN_CAP_TSO6; params.ndis_lsov2_ip6 = NDIS_OFFLOAD_LSOV2_ON; @@ -610,7 +609,6 @@ hn_rndis_conf_offload(struct hn_softc *s tso_maxsz = hwcaps.ndis_lsov2.ndis_ip6_maxsz; if (hwcaps.ndis_lsov2.ndis_ip6_minsg > tso_minsg) tso_minsg = hwcaps.ndis_lsov2.ndis_ip6_minsg; -#endif } sc->hn_ndis_tso_szmax = 0; sc->hn_ndis_tso_sgmin = 0; Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 21 05:21:15 2016 (r308907) +++ head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 21 05:41:08 2016 (r308908) @@ -1127,6 +1127,13 @@ hn_attach(device_t dev) /* Enable all available capabilities by default. */ ifp->if_capenable = ifp->if_capabilities; + /* + * Disable IPv6 TSO and TXCSUM by default, they still can + * be enabled through SIOCSIFCAP. + */ + ifp->if_capenable &= ~(IFCAP_TXCSUM_IPV6 | IFCAP_TSO6); + ifp->if_hwassist &= ~(HN_CSUM_IP6_MASK | CSUM_IP6_TSO); + if (ifp->if_capabilities & (IFCAP_TSO6 | IFCAP_TSO4)) { hn_set_tso_maxsize(sc, hn_tso_maxlen, ETHERMTU); ifp->if_hw_tsomaxsegcount = HN_TX_DATA_SEGCNT_MAX; @@ -3646,12 +3653,10 @@ hn_fixup_tx_data(struct hn_softc *sc) csum_assist |= CSUM_IP_TCP; if (sc->hn_caps & HN_CAP_UDP4CS) csum_assist |= CSUM_IP_UDP; -#ifdef notyet if (sc->hn_caps & HN_CAP_TCP6CS) csum_assist |= CSUM_IP6_TCP; if (sc->hn_caps & HN_CAP_UDP6CS) csum_assist |= CSUM_IP6_UDP; -#endif for (i = 0; i < sc->hn_tx_ring_cnt; ++i) sc->hn_tx_ring[i].hn_csum_assist = csum_assist;