git: 76f405ed6354 - main - mbuf: Add mbufq_empty

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Tue, 09 Jan 2024 19:02:52 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=76f405ed63540aa2d989c231f70277062e76ccfb

commit 76f405ed63540aa2d989c231f70277062e76ccfb
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-01-09 19:00:19 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-01-09 19:00:19 +0000

    mbuf: Add mbufq_empty
    
    Complement to the existing mbufq_full
    
    Reviewed by:    bz
    Sponsored by:   Chelsio Communications
    Differential Revision:  https://reviews.freebsd.org/D43337
---
 sys/sys/mbuf.h | 6 ++++++
 1 file changed, 6 insertions(+)

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)
 {