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 fix gref offset when setting up copy of mul...



details:   https://anonhg.NetBSD.org/src/rev/42596ac89b6e
branches:  trunk
changeset: 932213:42596ac89b6e
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sat May 02 11:28:02 2020 +0000

description:
fix gref offset when setting up copy of multi-fragment packet so data
for second and further fragments gets copied into correct place

diffstat:

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

diffs (42 lines):

diff -r 26c8f37631b6 -r 42596ac89b6e sys/arch/xen/xen/xennetback_xenbus.c
--- a/sys/arch/xen/xen/xennetback_xenbus.c      Sat May 02 11:12:49 2020 +0000
+++ b/sys/arch/xen/xen/xennetback_xenbus.c      Sat May 02 11:28:02 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: xennetback_xenbus.c,v 1.101 2020/05/01 19:59:47 jdolecek Exp $      */
+/*      $NetBSD: xennetback_xenbus.c,v 1.102 2020/05/02 11:28:02 jdolecek Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.101 2020/05/01 19:59:47 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.102 2020/05/02 11:28:02 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -749,6 +749,7 @@
                }
 
                gsize = xst->xs_tx_size;
+               goff = 0;
                for (; seg < dm->dm_nsegs && gsize > 0; seg++) {
                        bus_dma_segment_t *ds = &dm->dm_segs[seg];
                        ma = ds->ds_addr;
@@ -787,6 +788,7 @@
                        segoff = 0;
                }
                KASSERT(gsize == 0);
+               KASSERT(goff == xst->xs_tx_size);
        }
        if (copycnt > 0) {
                if (xennetback_copy(ifp, xneti->xni_gop_copy, copycnt) != 0)
@@ -931,6 +933,7 @@
                                 * Flush queue if too full to fit this
                                 * new packet whole.
                                 */
+                               KASSERT(m0 == NULL);
                                xennetback_tx_copy_process(ifp, xneti, queued);
                                queued = 0;
                        }



Home | Main Index | Thread Index | Old Index