From b47fcd485fd614121d2698205a3640cbdb5a5d14 Mon Sep 17 00:00:00 2001 From: mikeb Date: Sat, 20 Jan 2018 20:03:45 +0000 Subject: [PATCH] Disable TCP and UDP transmit checksum offloading In certain configurations, transmit checksum offloading doesn't appear to work correctly, preventing correct TCP and UDP operation. Some of these issues involving VLAN tagging are documented by the Xen project. Problem reported and fix tested by Imre Oolberg, thanks! --- sys/dev/pv/if_xnf.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/dev/pv/if_xnf.c b/sys/dev/pv/if_xnf.c index 1f5c3916062..75d29eb584e 100644 --- a/sys/dev/pv/if_xnf.c +++ b/sys/dev/pv/if_xnf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_xnf.c,v 1.62 2017/12/09 14:00:21 mikeb Exp $ */ +/* $OpenBSD: if_xnf.c,v 1.63 2018/01/20 20:03:45 mikeb Exp $ */ /* * Copyright (c) 2015, 2016 Mike Belopuhov @@ -1112,6 +1112,7 @@ xnf_capabilities(struct xnf_softc *sc) if (error == 0 && res == 1) sc->sc_caps |= XNF_CAP_SG; +#if 0 /* Query IPv4 checksum offloading capability, enabled by default */ sc->sc_caps |= XNF_CAP_CSUM4; prop = "feature-no-csum-offload"; @@ -1128,6 +1129,7 @@ xnf_capabilities(struct xnf_softc *sc) goto errout; if (error == 0 && res == 1) sc->sc_caps |= XNF_CAP_CSUM6; +#endif /* Query multicast traffic contol capability */ prop = "feature-multicast-control"; @@ -1192,6 +1194,13 @@ xnf_init_backend(struct xnf_softc *sc) goto errout; } + /* Disable IPv4 checksum offloading */ + if (!(sc->sc_caps & XNF_CAP_CSUM4)) { + prop = "feature-no-csum-offload"; + if (xs_setnum(sc->sc_parent, sc->sc_node, prop, 1)) + goto errout; + } + /* Enable IPv6 checksum offloading */ if (sc->sc_caps & XNF_CAP_CSUM6) { prop = "feature-ipv6-csum-offload"; -- 2.20.1