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 NETTXF_csum_blank and NETTXF_data_validated...



details:   https://anonhg.NetBSD.org/src/rev/65dd58477a40
branches:  trunk
changeset: 931763:65dd58477a40
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Thu Apr 30 11:19:39 2020 +0000

description:
NETTXF_csum_blank and NETTXF_data_validated should be set only for first
fragment of the packet

diffstat:

 sys/arch/xen/xen/if_xennet_xenbus.c |  16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diffs (39 lines):

diff -r 00ce9e424887 -r 65dd58477a40 sys/arch/xen/xen/if_xennet_xenbus.c
--- a/sys/arch/xen/xen/if_xennet_xenbus.c       Thu Apr 30 11:03:29 2020 +0000
+++ b/sys/arch/xen/xen/if_xennet_xenbus.c       Thu Apr 30 11:19:39 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: if_xennet_xenbus.c,v 1.119 2020/04/26 12:58:28 jdolecek Exp $      */
+/*      $NetBSD: if_xennet_xenbus.c,v 1.120 2020/04/30 11:19:39 jdolecek Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -81,7 +81,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.119 2020/04/26 12:58:28 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.120 2020/04/30 11:19:39 jdolecek Exp $");
 
 #include "opt_xen.h"
 #include "opt_nfs_boot.h"
@@ -1105,13 +1105,15 @@
                txreq->id = req->txreq_id;
                txreq->gref = req->txreq_gntref;
                txreq->offset = ds->ds_addr & PAGE_MASK;
-               /* For Tx, first fragment has size always set to total size */
+               /* For Tx, first fragment size is always set to total size */
                txreq->size = (i == 0) ? m->m_pkthdr.len : ds->ds_len;
                txreq->flags = 0;
-               if ((m->m_pkthdr.csum_flags & XN_M_CSUM_SUPPORTED) != 0) {
-                       txreq->flags |= NETTXF_csum_blank;
-               } else {
-                       txreq->flags |= NETTXF_data_validated;
+               if (i == 0) {
+                       if (m->m_pkthdr.csum_flags & XN_M_CSUM_SUPPORTED) {
+                               txreq->flags |= NETTXF_csum_blank;
+                       } else {
+                               txreq->flags |= NETTXF_data_validated;
+                       }
                }
                if (multiseg && i < lastseg)
                        txreq->flags |= NETTXF_more_data;



Home | Main Index | Thread Index | Old Index