diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2018-12-11 01:36:43 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2018-12-11 01:36:43 +0000 |
commit | 19970a552782c0a8eb22432785d34620c7b53c01 (patch) | |
tree | 88645cbd4bb7925a600780b499e174805e5774b7 | |
parent | 9fb2f8d8d5736a6c53e25cdc82fe4f512fddbcea (diff) |
provide ifq_is_priq, mostly so things can tell if hfsc is in effect or not.
-rw-r--r-- | sys/net/ifq.c | 2 | ||||
-rw-r--r-- | sys/net/ifq.h | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/sys/net/ifq.c b/sys/net/ifq.c index f0674ce9315..373707131f7 100644 --- a/sys/net/ifq.c +++ b/sys/net/ifq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifq.c,v 1.23 2018/12/11 01:33:05 dlg Exp $ */ +/* $OpenBSD: ifq.c,v 1.24 2018/12/11 01:36:42 dlg Exp $ */ /* * Copyright (c) 2015 David Gwynne <dlg@openbsd.org> diff --git a/sys/net/ifq.h b/sys/net/ifq.h index 304ee5a2bc6..6beb428b176 100644 --- a/sys/net/ifq.h +++ b/sys/net/ifq.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ifq.h,v 1.21 2018/12/11 01:33:05 dlg Exp $ */ +/* $OpenBSD: ifq.h,v 1.22 2018/12/11 01:36:42 dlg Exp $ */ /* * Copyright (c) 2015 David Gwynne <dlg@openbsd.org> @@ -396,6 +396,8 @@ struct ifq_ops { void (*ifqop_free)(unsigned int, void *); }; +extern const struct ifq_ops * const ifq_priq_ops; + /* * Interface send queues. */ @@ -423,6 +425,12 @@ void ifq_barrier(struct ifqueue *); #define ifq_empty(_ifq) (ifq_len(_ifq) == 0) #define ifq_set_maxlen(_ifq, _l) ((_ifq)->ifq_maxlen = (_l)) +static inline int +ifq_is_priq(struct ifqueue *ifq) +{ + return (ifq->ifq_ops == ifq_priq_ops); +} + static inline void ifq_set_oactive(struct ifqueue *ifq) { @@ -461,8 +469,6 @@ ifq_idx(struct ifqueue *ifq, unsigned int nifqs, const struct mbuf *m) #define IFQ_ASSERT_SERIALIZED(_ifq) KASSERT(ifq_is_serialized(_ifq)) -extern const struct ifq_ops * const ifq_priq_ops; - /* ifiq */ void ifiq_init(struct ifiqueue *, struct ifnet *, unsigned int); |