diff options
author | 2018-12-11 01:36:42 +0000 | |
---|---|---|
committer | 2018-12-11 01:36:42 +0000 | |
commit | a4ca8437e1203c70a99d3cd84c29338ea6f37fee (patch) | |
tree | 55bd0de48b3ccd2b7d656ed9b8dd7f0687c756c9 | |
parent | use ifq_hdatalen for handling the FIONREAD ioctl (diff) | |
download | wireguard-openbsd-a4ca8437e1203c70a99d3cd84c29338ea6f37fee.tar.xz wireguard-openbsd-a4ca8437e1203c70a99d3cd84c29338ea6f37fee.zip |
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); |