Module Name: src
Committed By: knakahara
Date: Thu Sep 21 09:48:15 UTC 2017
Modified Files:
src/sys/net: if_gif.h
Log Message:
update locking notes.
To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/net/if_gif.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/if_gif.h
diff -u src/sys/net/if_gif.h:1.26 src/sys/net/if_gif.h:1.27
--- src/sys/net/if_gif.h:1.26 Thu Sep 21 09:42:03 2017
+++ src/sys/net/if_gif.h Thu Sep 21 09:48:15 2017
@@ -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 @@ int gif_encapcheck(struct mbuf *, int, i
/*
* 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_ */