Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Hold per-queue locks when clearing config of que...



details:   https://anonhg.NetBSD.org/src/rev/744af69d7d19
branches:  trunk
changeset: 745207:744af69d7d19
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Tue Feb 25 07:31:19 2020 +0000

description:
Hold per-queue locks when clearing config of queues for safety

diffstat:

 sys/dev/pci/if_ixl.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r e618855c3508 -r 744af69d7d19 sys/dev/pci/if_ixl.c
--- a/sys/dev/pci/if_ixl.c      Tue Feb 25 07:22:18 2020 +0000
+++ b/sys/dev/pci/if_ixl.c      Tue Feb 25 07:31:19 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ixl.c,v 1.47 2020/02/25 07:22:18 yamaguchi Exp $    */
+/*     $NetBSD: if_ixl.c,v 1.48 2020/02/25 07:31:19 yamaguchi Exp $    */
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ixl.c,v 1.47 2020/02/25 07:22:18 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ixl.c,v 1.48 2020/02/25 07:31:19 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -2293,8 +2293,13 @@
                txr = sc->sc_qps[i].qp_txr;
                rxr = sc->sc_qps[i].qp_rxr;
 
+               mutex_enter(&txr->txr_lock);
                ixl_txr_unconfig(sc, txr);
+               mutex_exit(&txr->txr_lock);
+
+               mutex_enter(&rxr->rxr_lock);
                ixl_rxr_unconfig(sc, rxr);
+               mutex_exit(&rxr->rxr_lock);
 
                ixl_txr_clean(sc, txr);
                ixl_rxr_clean(sc, rxr);



Home | Main Index | Thread Index | Old Index