From: mvs Date: Thu, 14 Jul 2022 13:52:10 +0000 (+0000) Subject: Use capital letters for global ipsec(4) locks description. Use 'D' X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=cb81ca9838752cb1ae835dbbec1302dbe890ceed;p=openbsd Use capital letters for global ipsec(4) locks description. Use 'D' instead of 's' for `tdb_sadb_mtx' mutex(9) because this is 'D'atabase. No functional changes. ok bluhm@ --- diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c index 3d7c9a0b25b..99e82c2e44c 100644 --- a/sys/netinet/ip_ipsp.c +++ b/sys/netinet/ip_ipsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipsp.c,v 1.271 2022/06/28 09:32:27 bluhm Exp $ */ +/* $OpenBSD: ip_ipsp.c,v 1.272 2022/07/14 13:52:10 mvs Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr), @@ -88,7 +88,8 @@ void tdb_hashstats(void); /* * Locks used to protect global data and struct members: - * F ipsec_flows_mtx + * D tdb_sadb_mtx + * F ipsec_flows_mtx SA database global mutex */ struct mutex ipsec_flows_mtx = MUTEX_INITIALIZER(IPL_SOFTNET); @@ -194,14 +195,13 @@ const struct xformsw *const xformswNXFORMSW = &xformsw[nitems(xformsw)]; #define TDB_HASHSIZE_INIT 32 -/* Protected by the tdb_sadb_mtx. */ struct mutex tdb_sadb_mtx = MUTEX_INITIALIZER(IPL_SOFTNET); -static SIPHASH_KEY tdbkey; -static struct tdb **tdbh; -static struct tdb **tdbdst; -static struct tdb **tdbsrc; -static u_int tdb_hashmask = TDB_HASHSIZE_INIT - 1; -static int tdb_count; +static SIPHASH_KEY tdbkey; /* [D] */ +static struct tdb **tdbh; /* [D] */ +static struct tdb **tdbdst; /* [D] */ +static struct tdb **tdbsrc; /* [D] */ +static u_int tdb_hashmask = TDB_HASHSIZE_INIT - 1; /* [D] */ +static int tdb_count; /* [D] */ void ipsp_init(void) diff --git a/sys/netinet/ip_ipsp.h b/sys/netinet/ip_ipsp.h index 9eb91628c1c..f7e621efa3a 100644 --- a/sys/netinet/ip_ipsp.h +++ b/sys/netinet/ip_ipsp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipsp.h,v 1.239 2022/04/30 13:28:53 mvs Exp $ */ +/* $OpenBSD: ip_ipsp.h,v 1.240 2022/07/14 13:52:10 mvs Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr), @@ -47,9 +47,9 @@ * N net lock * A ipsec_acquire_mtx * F ipsec_flows_mtx + * P ipo_tdb_mtx link policy to TDB global mutex + * D tdb_sadb_mtx SA database global mutex * m tdb_mtx fields of struct tdb - * p ipo_tdb_mtx link policy to TDB global mutex - * s tdb_sadb_mtx SA database global mutex */ /* IPSP global definitions. */ @@ -278,7 +278,7 @@ struct ipsec_policy { * mode was used. */ - u_int64_t ipo_last_searched; /* [p] Timestamp of lookup */ + u_int64_t ipo_last_searched; /* [P] Timestamp of lookup */ u_int8_t ipo_flags; /* See IPSP_POLICY_* definitions */ u_int8_t ipo_type; /* USE/ACQUIRE/... */ @@ -287,12 +287,12 @@ struct ipsec_policy { struct refcnt ipo_refcnt; - struct tdb *ipo_tdb; /* [p] Cached TDB entry */ + struct tdb *ipo_tdb; /* [P] Cached TDB entry */ struct ipsec_ids *ipo_ids; struct ipsec_acquire_head ipo_acquires; /* [A] List of acquires */ - TAILQ_ENTRY(ipsec_policy) ipo_tdb_next; /* [p] List TDB policies */ + TAILQ_ENTRY(ipsec_policy) ipo_tdb_next; /* [P] List TDB policies */ TAILQ_ENTRY(ipsec_policy) ipo_list; /* List of all policies */ }; @@ -322,9 +322,9 @@ struct tdb { /* tunnel descriptor block */ * policy matching. The following three fields maintain the hash * queues in those three tables. */ - struct tdb *tdb_hnext; /* [s] dst/spi/sproto table */ - struct tdb *tdb_dnext; /* [s] dst/sproto table */ - struct tdb *tdb_snext; /* [s] src/sproto table */ + struct tdb *tdb_hnext; /* [D] dst/spi/sproto table */ + struct tdb *tdb_dnext; /* [D] dst/sproto table */ + struct tdb *tdb_snext; /* [D] src/sproto table */ struct tdb *tdb_inext; struct tdb *tdb_onext; SIMPLEQ_ENTRY(tdb) tdb_walk; /* [N] temp list for tdb walker */ @@ -438,7 +438,7 @@ struct tdb { /* tunnel descriptor block */ struct sockaddr_encap tdb_filter; /* What traffic is acceptable */ struct sockaddr_encap tdb_filtermask; /* And the mask */ - TAILQ_HEAD(tdb_policy_head, ipsec_policy) tdb_policy_head; /* [p] */ + TAILQ_HEAD(tdb_policy_head, ipsec_policy) tdb_policy_head; /* [P] */ TAILQ_ENTRY(tdb) tdb_sync_entry; TAILQ_ENTRY(tdb) tdb_sync_snap; };