aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2024-01-09 19:00:19 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2024-01-09 19:00:19 +0000
commit76f405ed63540aa2d989c231f70277062e76ccfb (patch)
treeecb9fdbb0dad8429fd129f67a71ae23f943e3bb5
parent6977311633c73f594ff3dae150d6d1fe06105a8f (diff)
downloadsrc-76f405ed63540aa2d989c231f70277062e76ccfb.tar.gz
src-76f405ed63540aa2d989c231f70277062e76ccfb.zip
mbuf: Add mbufq_empty
Complement to the existing mbufq_full Reviewed by: bz Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43337
-rw-r--r--sys/sys/mbuf.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index bb15557b5b6c..b84898fc268e 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -1607,6 +1607,12 @@ mbufq_last(const struct mbufq *mq)
return (STAILQ_LAST(&mq->mq_head, mbuf, m_stailqpkt));
}
+static inline bool
+mbufq_empty(const struct mbufq *mq)
+{
+ return (mq->mq_len == 0);
+}
+
static inline int
mbufq_full(const struct mbufq *mq)
{