Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Added the explain about locking order in iavf(4)



details:   https://anonhg.NetBSD.org/src/rev/f449dbf373af
branches:  trunk
changeset: 938488:f449dbf373af
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Wed Sep 09 00:56:17 2020 +0000

description:
Added the explain about locking order in iavf(4)

diffstat:

 sys/dev/pci/if_iavf.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 281df9ad45ed -r f449dbf373af sys/dev/pci/if_iavf.c
--- a/sys/dev/pci/if_iavf.c     Wed Sep 09 00:35:36 2020 +0000
+++ b/sys/dev/pci/if_iavf.c     Wed Sep 09 00:56:17 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_iavf.c,v 1.3 2020/09/09 00:35:36 jakllsch Exp $     */
+/*     $NetBSD: if_iavf.c,v 1.4 2020/09/09 00:56:17 yamaguchi Exp $    */
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iavf.c,v 1.3 2020/09/09 00:35:36 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iavf.c,v 1.4 2020/09/09 00:56:17 yamaguchi Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -319,6 +319,12 @@
  * + Other fields in iavf_softc is protected by sc_cfg_lock
  *   (an adaptive mutex).
  *   - The lock must be held before acquiring another lock.
+ *
+ * Locking order:
+ *   - IFNET_LOCK => sc_cfg_lock => sc_adminq_lock
+ *   - sc_cfg_lock => ETHER_LOCK => sc_adminq_lock
+ *   - sc_cfg_lock => txr_lock
+ *   - sc_cfg_lock => rxr_lock
  */
 
 struct iavf_softc {



Home | Main Index | Thread Index | Old Index