summaryrefslogtreecommitdiffstats
path: root/sys/netipx/ipx_if.h
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-06-21 21:04:12 +0000
committerrwatson <rwatson@FreeBSD.org>2009-06-21 21:04:12 +0000
commit9e88f817eec82327026cdbd1ec18229191f6482d (patch)
treeab15f66e2608189ce25106a3bf1b8202ed4a4dac /sys/netipx/ipx_if.h
parentd092e8e13d0d2c4c93ccc14801eb033e16b09bb1 (diff)
downloadFreeBSD-src-9e88f817eec82327026cdbd1ec18229191f6482d.zip
FreeBSD-src-9e88f817eec82327026cdbd1ec18229191f6482d.tar.gz
Introduce basic locking of global IPX address list 'ipx_ifaddr' using
a new rwlock, ipx_ifaddr_rw, wrapped with macros. This locking is necessary but not sufficient, in isolation, to satisfy the stability requirements of a fully parallel IPX input path during interface reconfiguration. MFC after: 3 weeks
Diffstat (limited to 'sys/netipx/ipx_if.h')
-rw-r--r--sys/netipx/ipx_if.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/netipx/ipx_if.h b/sys/netipx/ipx_if.h
index 8b5d16c..fbf5547 100644
--- a/sys/netipx/ipx_if.h
+++ b/sys/netipx/ipx_if.h
@@ -105,7 +105,16 @@ struct ipx_aliasreq {
#define ETHERTYPE_IPX 0x8137 /* Only Ethernet_II Available */
#ifdef _KERNEL
-extern struct ipx_ifaddr *ipx_ifaddr;
+extern struct rwlock ipx_ifaddr_rw;
+extern struct ipx_ifaddr *ipx_ifaddr;
+
+#define IPX_IFADDR_LOCK_INIT() rw_init(&ipx_ifaddr_rw, "ipx_ifaddr_rw")
+#define IPX_IFADDR_LOCK_ASSERT() rw_assert(&ipx_ifaddr_rw, RA_LOCKED)
+#define IPX_IFADDR_RLOCK() rw_rlock(&ipx_ifaddr_rw)
+#define IPX_IFADDR_RUNLOCK() rw_runlock(&ipx_ifaddr_rw)
+#define IPX_IFADDR_WLOCK() rw_wlock(&ipx_ifaddr_rw)
+#define IPX_IFADDR_WUNLOCK() rw_wunlock(&ipx_ifaddr_rw)
+#define IPX_IFADDR_RLOCK_ASSERT() rw_assert(&ipx_ifaddr_rw, RA_WLOCKED)
struct ipx_ifaddr *ipx_iaonnetof(struct ipx_addr *dst);
#endif
OpenPOWER on IntegriCloud