svn commit: r295299 - head/sys/dev/hyperv/netvsc
Sepherosa Ziehau
sephe at FreeBSD.org
Fri Feb 5 05:06:15 UTC 2016
Author: sephe
Date: Fri Feb 5 05:06:14 2016
New Revision: 295299
URL: https://svnweb.freebsd.org/changeset/base/295299
Log:
hyperv/hn: Enable UDP RXCSUM
Reviewed by: adrian
Approved by: adrian (mentor)
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5102
Modified:
head/sys/dev/hyperv/netvsc/hv_net_vsc.h
head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Feb 5 05:01:02 2016 (r295298)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Feb 5 05:06:14 2016 (r295299)
@@ -1036,6 +1036,7 @@ typedef struct hn_softc {
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;
Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Feb 5 05:01:02 2016 (r295298)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Feb 5 05:06:14 2016 (r295299)
@@ -456,6 +456,8 @@ netvsc_attach(device_t dev)
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,7 +1158,7 @@ netvsc_recv(struct hv_device *device_ctx
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 |=
@@ -1164,12 +1166,16 @@ netvsc_recv(struct hv_device *device_ctx
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 &&
More information about the svn-src-all
mailing list