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 in xennet_tx_complete() replace the grant s...



details:   https://anonhg.NetBSD.org/src/rev/c0f891f2d363
branches:  trunk
changeset: 970520:c0f891f2d363
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Thu Mar 26 18:50:16 2020 +0000

description:
in xennet_tx_complete() replace the grant status condition with just KASSERT()

it's really a possible programming error rather than something actually
happening in wild - since rev. 1.57 in 2012 this condition leaked
locked mutex, and nobody noticed

diffstat:

 sys/arch/xen/xen/if_xennet_xenbus.c |  11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diffs (32 lines):

diff -r 0aa5f13f8f8d -r c0f891f2d363 sys/arch/xen/xen/if_xennet_xenbus.c
--- a/sys/arch/xen/xen/if_xennet_xenbus.c       Thu Mar 26 18:32:21 2020 +0000
+++ b/sys/arch/xen/xen/if_xennet_xenbus.c       Thu Mar 26 18:50:16 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: if_xennet_xenbus.c,v 1.95 2020/03/26 18:32:21 jdolecek Exp $      */
+/*      $NetBSD: if_xennet_xenbus.c,v 1.96 2020/03/26 18:50:16 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.95 2020/03/26 18:32:21 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.96 2020/03/26 18:50:16 jdolecek Exp $");
 
 #include "opt_xen.h"
 #include "opt_nfs_boot.h"
@@ -951,12 +951,7 @@
                req = &sc->sc_txreqs[RING_GET_RESPONSE(&sc->sc_tx_ring, i)->id];
                KASSERT(req->txreq_id ==
                    RING_GET_RESPONSE(&sc->sc_tx_ring, i)->id);
-               if (__predict_false(xengnt_status(req->txreq_gntref))) {
-                       aprint_verbose_dev(sc->sc_dev,
-                           "grant still used by backend\n");
-                       sc->sc_tx_ring.rsp_cons = i;
-                       return;
-               }
+               KASSERT(xengnt_status(req->txreq_gntref) == 0);
                if (__predict_false(
                    RING_GET_RESPONSE(&sc->sc_tx_ring, i)->status !=
                    NETIF_RSP_OKAY))



Home | Main Index | Thread Index | Old Index