Module Name:    src
Committed By:   jdolecek
Date:           Sat Mar 21 23:25:53 UTC 2020

Modified Files:
        src/sys/arch/xen/xen: xennetback_xenbus.c

Log Message:
need to retain csum_flags in xennetback_copymbuf() when creating
new mbuf for the COPY transmit path, so that later NETRXF_csum_blank
flag is set correctly when passing request over to DomU

fixes bad checksums in DomU when xvif(4) TX offload is enabled;
problem observed when testing new IPv6 offloading, but it should
affect also existing IPv4 offloading

Note: code in xennet(4) is unaffected, there code consults the original
mbuf, rather than the new_m one


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/arch/xen/xen/xennetback_xenbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/xen/xennetback_xenbus.c
diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.82 src/sys/arch/xen/xen/xennetback_xenbus.c:1.83
--- src/sys/arch/xen/xen/xennetback_xenbus.c:1.82	Thu Mar 19 11:19:25 2020
+++ src/sys/arch/xen/xen/xennetback_xenbus.c	Sat Mar 21 23:25:53 2020
@@ -1,4 +1,4 @@
-/*      $NetBSD: xennetback_xenbus.c,v 1.82 2020/03/19 11:19:25 jdolecek Exp $      */
+/*      $NetBSD: xennetback_xenbus.c,v 1.83 2020/03/21 23:25:53 jdolecek Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.82 2020/03/19 11:19:25 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.83 2020/03/21 23:25:53 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -1224,6 +1224,13 @@ xennetback_copymbuf(struct mbuf *m)
 	    mtod(new_m, void *));
 	new_m->m_len = new_m->m_pkthdr.len =
 	    m->m_pkthdr.len;
+
+	/*
+	 * Need to retain csum flags to know if csum was actually computed.
+	 * This is used to set NETRXF_csum_blank/NETRXF_data_validated.
+	 */
+	new_m->m_pkthdr.csum_flags = m->m_pkthdr.csum_flags;
+
 	return new_m;
 }
 

Reply via email to