diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2019-03-29 04:21:56 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2019-03-29 04:21:56 +0000 |
commit | 9b05c536704ad4c9417761902321f3271fb6a576 (patch) | |
tree | e8cc4174289aa0a1b11e6ff6aa91762484dfbdeb /sys | |
parent | 773a4555f559222f3571db60878fa5c3a27c4b0a (diff) |
while here, drop ifq_is_serialized and IFQ_ASSERT_SERIALIZED
nothing uses them, and they can generate false positives if the
serialiser is running at a lower IPL on the same cpu as a call to
ifq_is_serialiazed.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/ifq.c | 7 | ||||
-rw-r--r-- | sys/net/ifq.h | 18 |
2 files changed, 5 insertions, 20 deletions
diff --git a/sys/net/ifq.c b/sys/net/ifq.c index 9e17c229eb1..7ba629dab04 100644 --- a/sys/net/ifq.c +++ b/sys/net/ifq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifq.c,v 1.29 2019/03/29 04:12:55 dlg Exp $ */ +/* $OpenBSD: ifq.c,v 1.30 2019/03/29 04:21:55 dlg Exp $ */ /* * Copyright (c) 2015 David Gwynne <dlg@openbsd.org> @@ -457,10 +457,9 @@ ifiq_init(struct ifiqueue *ifiq, struct ifnet *ifp, unsigned int idx) void ifiq_destroy(struct ifiqueue *ifiq) { - if (!task_del(ifiq->ifiq_softnet, &ifiq->ifiq_task)) { - NET_ASSERT_UNLOCKED(); + NET_ASSERT_UNLOCKED(); + if (!task_del(ifiq->ifiq_softnet, &ifiq->ifiq_task)) taskq_barrier(ifiq->ifiq_softnet); - } /* don't need to lock because this is the last use of the ifiq */ ml_purge(&ifiq->ifiq_ml); diff --git a/sys/net/ifq.h b/sys/net/ifq.h index 664a483950e..974617e7f07 100644 --- a/sys/net/ifq.h +++ b/sys/net/ifq.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ifq.h,v 1.24 2019/03/29 04:12:55 dlg Exp $ */ +/* $OpenBSD: ifq.h,v 1.25 2019/03/29 04:21:55 dlg Exp $ */ /* * Copyright (c) 2015 David Gwynne <dlg@openbsd.org> @@ -212,8 +212,7 @@ struct ifiqueue { * == Network Driver API * * The API used by network drivers is mostly documented in the - * ifq_dequeue(9) manpage except for ifq_serialize(), - * ifq_is_serialized(), and IFQ_ASSERT_SERIALIZED(). + * ifq_dequeue(9) manpage except for ifq_serialize(). * * === ifq_serialize() * @@ -228,16 +227,6 @@ struct ifiqueue { * task and the work it represents can extend beyond the end of the * call to ifq_serialize() that dispatched it. * - * === ifq_is_serialized() - * - * This function returns whether the caller is currently within the - * ifqueue serializer context. - * - * === IFQ_ASSERT_SERIALIZED() - * - * This macro will assert that the caller is currently within the - * specified ifqueue serialiser context. - * * * = ifqueue work serialisation * @@ -419,7 +408,6 @@ unsigned int ifq_purge(struct ifqueue *); void *ifq_q_enter(struct ifqueue *, const struct ifq_ops *); void ifq_q_leave(struct ifqueue *, void *); void ifq_serialize(struct ifqueue *, struct task *); -int ifq_is_serialized(struct ifqueue *); void ifq_barrier(struct ifqueue *); #define ifq_len(_ifq) ((_ifq)->ifq_len) @@ -468,8 +456,6 @@ ifq_idx(struct ifqueue *ifq, unsigned int nifqs, const struct mbuf *m) return ((*ifq->ifq_ops->ifqop_idx)(nifqs, m)); } -#define IFQ_ASSERT_SERIALIZED(_ifq) KASSERT(ifq_is_serialized(_ifq)) - /* ifiq */ void ifiq_init(struct ifiqueue *, struct ifnet *, unsigned int); |