From dddbf4cd54036c88ab90de54668f542d70b771b0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Imre=20Vad=C3=A1sz?= Date: Tue, 17 Oct 2017 22:11:08 +0200 Subject: [PATCH] if_vtnet - Disable rx csum offload due to unsupported ipv6 rx csum offload. * Ignoring the checksum offloading in the receive path of the driver isn't sufficient, since we might receive only partially checksummed packets from the host. * Unfortunately there is only a single feature flag for both ipv4 and ipv6 receive checksum offloading, so we need to disable both for now. * At the moment we don't support a way to explicitly enable the rx csum feature at runtime, but this will be easily possible by adding support for the VIRTIO_NET_F_CTRL_GUEST_OFFLOADS feature. * Mention this as a caveat in the manpage. * Update correct default value of hw.vtnet.lro_disable tunable in the manpage, to match the code again. --- share/man/man4/vtnet.4 | 9 +++++++-- sys/dev/virtual/virtio/net/if_vtnet.c | 8 ++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/share/man/man4/vtnet.4 b/share/man/man4/vtnet.4 index 8740af9351..0e230a0ce2 100644 --- a/share/man/man4/vtnet.4 +++ b/share/man/man4/vtnet.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD: head/share/man/man4/vtnet.4 255112 2013-09-01 04:33:47Z bryanv $ .\" -.Dd April 21, 2014 +.Dd October 17, 2017 .Dt VTNET 4 .Os .Sh NAME @@ -79,7 +79,7 @@ The default value is 1. .It Va hw.vtnet.lro_disable .\".It Va hw.vtnet. Ns Ar X Ns Va .lro_disable This tunable disables LRO. -The default value is 1. +The default value is 0. .\".It Va hw.vtnet.mq_disable .\".It Va hw.vtnet. Ns Ar X Ns Va .mq_disable .\"This tunable disables multiqueue. @@ -114,3 +114,8 @@ The .Nm driver only supports LRO when the hypervisor advertises the mergeable buffer feature. +The receive checksum offload feature of the +.Nm +driver is masked for now, because of missing support for receive checksum +offload in IPv6 packet handling in +.Dx . diff --git a/sys/dev/virtual/virtio/net/if_vtnet.c b/sys/dev/virtual/virtio/net/if_vtnet.c index 8abd92db7c..467e1907c0 100644 --- a/sys/dev/virtual/virtio/net/if_vtnet.c +++ b/sys/dev/virtual/virtio/net/if_vtnet.c @@ -478,6 +478,14 @@ vtnet_negotiate_features(struct vtnet_softc *sc) mask |= VIRTIO_NET_F_CSUM | VIRTIO_NET_F_GUEST_CSUM; /* + * XXX DragonFly doesn't support receive checksum offload for ipv6 yet, + * hence always disable the virtio feature for now. + * XXX We need to support the DynOffload feature, in order to + * dynamically enable/disable this feature. + */ + mask |= VIRTIO_NET_F_GUEST_CSUM; + + /* * TSO and LRO are only available when their corresponding checksum * offload feature is also negotiated. */ -- 2.11.4.GIT