Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/xen/xen need to retain csum_flags in xennetback_cop...



details:   https://anonhg.NetBSD.org/src/rev/fda82a2c5188
branches:  trunk
changeset: 746097:fda82a2c5188
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sat Mar 21 23:25:53 2020 +0000

description:
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

diffstat:

 sys/arch/xen/xen/xennetback_xenbus.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r d10b40980372 -r fda82a2c5188 sys/arch/xen/xen/xennetback_xenbus.c
--- a/sys/arch/xen/xen/xennetback_xenbus.c      Sat Mar 21 22:52:48 2020 +0000
+++ b/sys/arch/xen/xen/xennetback_xenbus.c      Sat Mar 21 23:25:53 2020 +0000
@@ -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 @@
            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;
 }
 



Home | Main Index | Thread Index | Old Index