Date: Fri, 5 Feb 2016 05:06:39 +0000 From: Phabricator <phabric-noreply@FreeBSD.org> To: freebsd-net@freebsd.org Subject: [Differential] [Closed] D5102: hyperv/hn: Enable UDP RXCSUM Message-ID: <cba97515a92adb9f0f2369428003e91b@localhost.localdomain> In-Reply-To: <differential-rev-PHID-DREV-3f3iwvv4iwl4hir2av2u-req@FreeBSD.org> References: <differential-rev-PHID-DREV-3f3iwvv4iwl4hir2av2u-req@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--b1_cba97515a92adb9f0f2369428003e91b Content-Type: text/plain; charset = "utf-8" Content-Transfer-Encoding: 8bit This revision was automatically updated to reflect the committed changes. Closed by commit rS295299: hyperv/hn: Enable UDP RXCSUM (authored by sephe). CHANGED PRIOR TO COMMIT https://reviews.freebsd.org/D5102?vs=12780&id=13033#toc REPOSITORY rS FreeBSD src repository CHANGES SINCE LAST UPDATE https://reviews.freebsd.org/D5102?vs=12780&id=13033 REVISION DETAIL https://reviews.freebsd.org/D5102 AFFECTED FILES head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c CHANGE DETAILS diff --git a/head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c b/head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c --- a/head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c +++ b/head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c @@ -456,6 +456,8 @@ CTLFLAG_RW, &sc->hn_csum_ip, "RXCSUM IP"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "csum_tcp", CTLFLAG_RW, &sc->hn_csum_tcp, "RXCSUM TCP"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "csum_udp", + CTLFLAG_RW, &sc->hn_csum_udp, "RXCSUM UDP"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "csum_trusted", CTLFLAG_RW, &sc->hn_csum_trusted, "# of TCP segements that we trust host's csum verification"); @@ -1156,20 +1158,24 @@ m_new->m_pkthdr.rcvif = ifp; /* receive side checksum offload */ - if (NULL != csum_info) { + if (csum_info != NULL) { /* IP csum offload */ if (csum_info->receive.ip_csum_succeeded) { m_new->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID); sc->hn_csum_ip++; } - /* TCP csum offload */ - if (csum_info->receive.tcp_csum_succeeded) { + /* TCP/UDP csum offload */ + if (csum_info->receive.tcp_csum_succeeded || + csum_info->receive.udp_csum_succeeded) { m_new->m_pkthdr.csum_flags |= (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); m_new->m_pkthdr.csum_data = 0xffff; - sc->hn_csum_tcp++; + if (csum_info->receive.tcp_csum_succeeded) + sc->hn_csum_tcp++; + else + sc->hn_csum_udp++; } if (csum_info->receive.ip_csum_succeeded && diff --git a/head/sys/dev/hyperv/netvsc/hv_net_vsc.h b/head/sys/dev/hyperv/netvsc/hv_net_vsc.h --- a/head/sys/dev/hyperv/netvsc/hv_net_vsc.h +++ b/head/sys/dev/hyperv/netvsc/hv_net_vsc.h @@ -1036,6 +1036,7 @@ u_long hn_csum_ip; u_long hn_csum_tcp; + u_long hn_csum_udp; u_long hn_csum_trusted; u_long hn_lro_tried; u_long hn_small_pkts; EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, delphij, royger, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com, adrian, network Cc: freebsd-net-list --b1_cba97515a92adb9f0f2369428003e91b Content-Type: text/x-patch; charset=utf-8; name="D5102.13033.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="D5102.13033.patch" ZGlmZiAtLWdpdCBhL2hlYWQvc3lzL2Rldi9oeXBlcnYvbmV0dnNjL2h2X25ldHZzY19kcnZfZnJl ZWJzZC5jIGIvaGVhZC9zeXMvZGV2L2h5cGVydi9uZXR2c2MvaHZfbmV0dnNjX2Rydl9mcmVl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zEwMzYsNyBAQAog CiAJdV9sb25nCQlobl9jc3VtX2lwOwogCXVfbG9uZwkJaG5fY3N1bV90Y3A7CisJdV9sb25nCQlo bl9jc3VtX3VkcDsKIAl1X2xvbmcJCWhuX2NzdW1fdHJ1c3RlZDsKIAl1X2xvbmcJCWhuX2xyb190 cmllZDsKIAl1X2xvbmcJCWhuX3NtYWxsX3BrdHM7Cgo= --b1_cba97515a92adb9f0f2369428003e91b--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?cba97515a92adb9f0f2369428003e91b>