Source-Changes-HG archive

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

[src/trunk]: src/sys/net update locking notes.



details:   https://anonhg.NetBSD.org/src/rev/8d723402ee9e
branches:  trunk
changeset: 826665:8d723402ee9e
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Thu Sep 21 09:48:15 2017 +0000

description:
update locking notes.

diffstat:

 sys/net/if_gif.h |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 368c7ada9524 -r 8d723402ee9e sys/net/if_gif.h
--- a/sys/net/if_gif.h  Thu Sep 21 09:46:14 2017 +0000
+++ b/sys/net/if_gif.h  Thu Sep 21 09:48:15 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_gif.h,v 1.26 2017/09/21 09:42:03 knakahara Exp $    */
+/*     $NetBSD: if_gif.h,v 1.27 2017/09/21 09:48:15 knakahara Exp $    */
 /*     $KAME: if_gif.h,v 1.23 2001/07/27 09:21:42 itojun Exp $ */
 
 /*
@@ -81,6 +81,17 @@
 
 /*
  * Locking notes:
- * - All members of struct si_sync are protected by si_lock (an adaptive mutex)
+ * + gif_softc_list is protected by gif_softcs.lock (an adaptive mutex)
+ *       gif_softc_list is list of all gif_softcs. It is used by ioctl
+ *       context only.
+ * + Members of struct gif_softc except for gif_ro_percpu are protected by
+ *   - encap_lock for writer
+ *   - stopping processing when writer begin to run
+ *     for reader(Tx and Rx processing)
+ * + Each CPU's gif_ro.gr_ro of gif_ro_percpu are protected by
+ *   percpu'ed gif_ro.gr_lock.
+ *
+ * Locking order:
+ *     - encap_lock => gif_softcs.lock
  */
 #endif /* !_NET_IF_GIF_H_ */



Home | Main Index | Thread Index | Old Index