From fca9b6f206c673dd5989e5407e31e957b74479ac Mon Sep 17 00:00:00 2001 From: Patrick Wildt Date: Tue, 9 Feb 2021 14:06:20 +0000 Subject: Activate use of PF_LOCK() by removing the WITH_PF_LOCK ifdefs. Silence from the network group ok sashan@ --- sys/net/if_pfsync.c | 15 +-------------- sys/net/pf_ioctl.c | 4 +--- sys/net/pf_norm.c | 8 +------- sys/net/pfvar_priv.h | 17 +---------------- 4 files changed, 4 insertions(+), 40 deletions(-) (limited to 'sys/net') diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c index b5fe9fb3607..7dcbc56025a 100644 --- a/sys/net/if_pfsync.c +++ b/sys/net/if_pfsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pfsync.c,v 1.283 2021/02/04 00:55:41 sashan Exp $ */ +/* $OpenBSD: if_pfsync.c,v 1.284 2021/02/09 14:06:19 patrick Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff @@ -294,14 +294,12 @@ void pfsync_bulk_fail(void *); void pfsync_grab_snapshot(struct pfsync_snapshot *, struct pfsync_softc *); void pfsync_drop_snapshot(struct pfsync_snapshot *); -#ifdef WITH_PF_LOCK void pfsync_send_dispatch(void *); void pfsync_send_pkt(struct mbuf *); static struct mbuf_queue pfsync_mq; static struct task pfsync_task = TASK_INITIALIZER(pfsync_send_dispatch, &pfsync_mq); -#endif /* WITH_PF_LOCK */ #define PFSYNC_MAX_BULKTRIES 12 int pfsync_sync_ok; @@ -314,9 +312,7 @@ pfsyncattach(int npfsync) { if_clone_attach(&pfsync_cloner); pfsynccounters = counters_alloc(pfsyncs_ncounters); -#ifdef WITH_PF_LOCK mq_init(&pfsync_mq, 4096, IPL_SOFTNET); -#endif /* WITH_PF_LOCK */ } int @@ -1676,7 +1672,6 @@ pfsync_drop(struct pfsync_softc *sc) pfsync_drop_snapshot(&sn); } -#ifdef WITH_PF_LOCK void pfsync_send_dispatch(void *xmq) { @@ -1721,7 +1716,6 @@ pfsync_send_pkt(struct mbuf *m) } else task_add(net_tq(0), &pfsync_task); } -#endif /* WITH_PF_LOCK */ void pfsync_sendout(void) @@ -1900,14 +1894,7 @@ pfsync_sendout(void) m->m_pkthdr.ph_rtableid = sc->sc_if.if_rdomain; -#ifdef WITH_PF_LOCK pfsync_send_pkt(m); -#else /* !WITH_PF_LOCK */ - if (ip_output(m, NULL, NULL, IP_RAWOUTPUT, &sc->sc_imo, NULL, 0) == 0) - pfsyncstat_inc(pfsyncs_opackets); - else - pfsyncstat_inc(pfsyncs_oerrors); -#endif /* WITH_PF_LOCK */ } void diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c index afa40bb677b..10ada909601 100644 --- a/sys/net/pf_ioctl.c +++ b/sys/net/pf_ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_ioctl.c,v 1.361 2020/12/16 18:00:44 kn Exp $ */ +/* $OpenBSD: pf_ioctl.c,v 1.362 2021/02/09 14:06:19 patrick Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -133,7 +133,6 @@ struct { TAILQ_HEAD(pf_tags, pf_tagname) pf_tags = TAILQ_HEAD_INITIALIZER(pf_tags), pf_qids = TAILQ_HEAD_INITIALIZER(pf_qids); -#ifdef WITH_PF_LOCK /* * pf_lock protects consistency of PF data structures, which don't have * their dedicated lock yet. The pf_lock currently protects: @@ -149,7 +148,6 @@ TAILQ_HEAD(pf_tags, pf_tagname) pf_tags = TAILQ_HEAD_INITIALIZER(pf_tags), */ struct rwlock pf_lock = RWLOCK_INITIALIZER("pf_lock"); struct rwlock pf_state_lock = RWLOCK_INITIALIZER("pf_state_lock"); -#endif /* WITH_PF_LOCK */ #if (PF_QNAME_SIZE != PF_TAG_NAME_SIZE) #error PF_QNAME_SIZE must be equal to PF_TAG_NAME_SIZE diff --git a/sys/net/pf_norm.c b/sys/net/pf_norm.c index 0a438543e10..2b6789a7949 100644 --- a/sys/net/pf_norm.c +++ b/sys/net/pf_norm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_norm.c,v 1.219 2020/06/24 22:03:43 cheloha Exp $ */ +/* $OpenBSD: pf_norm.c,v 1.220 2021/02/09 14:06:19 patrick Exp $ */ /* * Copyright 2001 Niels Provos @@ -152,17 +152,11 @@ struct pool pf_frent_pl, pf_frag_pl, pf_frnode_pl; struct pool pf_state_scrub_pl; int pf_nfrents; -#ifdef WITH_PF_LOCK struct mutex pf_frag_mtx; #define PF_FRAG_LOCK_INIT() mtx_init(&pf_frag_mtx, IPL_SOFTNET) #define PF_FRAG_LOCK() mtx_enter(&pf_frag_mtx) #define PF_FRAG_UNLOCK() mtx_leave(&pf_frag_mtx) -#else /* !WITH_PF_LOCK */ -#define PF_FRAG_LOCK_INIT() (void)(0) -#define PF_FRAG_LOCK() (void)(0) -#define PF_FRAG_UNLOCK() (void)(0) -#endif /* WITH_PF_LOCK */ void pf_normalize_init(void) diff --git a/sys/net/pfvar_priv.h b/sys/net/pfvar_priv.h index 2b62cfe455b..b1a122af409 100644 --- a/sys/net/pfvar_priv.h +++ b/sys/net/pfvar_priv.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pfvar_priv.h,v 1.5 2018/09/11 07:53:38 sashan Exp $ */ +/* $OpenBSD: pfvar_priv.h,v 1.6 2021/02/09 14:06:19 patrick Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -104,7 +104,6 @@ extern struct timeout pf_purge_to; struct pf_state *pf_state_ref(struct pf_state *); void pf_state_unref(struct pf_state *); -#ifdef WITH_PF_LOCK extern struct rwlock pf_lock; extern struct rwlock pf_state_lock; @@ -152,20 +151,6 @@ extern struct rwlock pf_state_lock; rw_status(&pf_state_lock), __func__);\ } while (0) -#else /* !WITH_PF_LOCK */ -#define PF_LOCK() (void)(0) -#define PF_UNLOCK() (void)(0) -#define PF_ASSERT_LOCKED() (void)(0) -#define PF_ASSERT_UNLOCKED() (void)(0) - -#define PF_STATE_ENTER_READ() (void)(0) -#define PF_STATE_EXIT_READ() (void)(0) -#define PF_STATE_ENTER_WRITE() (void)(0) -#define PF_STATE_EXIT_WRITE() (void)(0) -#define PF_ASSERT_STATE_LOCKED() (void)(0) - -#endif /* WITH_PF_LOCK */ - extern void pf_purge_timeout(void *); extern void pf_purge(void *); #endif /* _KERNEL */ -- cgit v1.2.3