Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157924546
D49817.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D49817.diff
View Options
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -1109,7 +1109,7 @@
m_extrefcnt(struct mbuf *m)
{
- KASSERT(m->m_flags & M_EXT, ("%s: M_EXT missing", __func__));
+ KASSERT(m->m_flags & M_EXT, ("%s: M_EXT missing for %p", __func__, m));
return ((m->m_ext.ext_flags & EXT_FLAG_EMBREF) ? m->m_ext.ext_count :
*m->m_ext.ext_cnt);
@@ -1141,13 +1141,13 @@
/* Check if the supplied mbuf has a packet header, or else panic. */
#define M_ASSERTPKTHDR(m) \
KASSERT((m) != NULL && (m)->m_flags & M_PKTHDR, \
- ("%s: no mbuf packet header!", __func__))
+ ("%s: no mbuf %p packet header!", __func__, (m)))
/* Check if the supplied mbuf has no send tag, or else panic. */
#define M_ASSERT_NO_SND_TAG(m) \
KASSERT((m) != NULL && (m)->m_flags & M_PKTHDR && \
((m)->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0, \
- ("%s: receive mbuf has send tag!", __func__))
+ ("%s: receive mbuf %p has send tag!", __func__, (m)))
/* Check if mbuf is multipage. */
#define M_ASSERTEXTPG(m) \
@@ -1161,7 +1161,7 @@
*/
#define M_ASSERTVALID(m) \
KASSERT((((struct mbuf *)m)->m_flags & 0) == 0, \
- ("%s: attempted use of a free mbuf!", __func__))
+ ("%s: attempted use of a free mbuf %p!", __func__, (m)))
/* Check whether any mbuf in the chain is unmapped. */
#ifdef INVARIANTS
@@ -1206,12 +1206,9 @@
static __inline void
m_align(struct mbuf *m, int len)
{
-#ifdef INVARIANTS
- const char *msg = "%s: not a virgin mbuf";
-#endif
int adjust;
-
- KASSERT(m->m_data == M_START(m), (msg, __func__));
+ KASSERT(m->m_data == M_START(m),
+ ("%s: not a virgin mbuf %p", __func__, m));
adjust = M_SIZE(m) - len;
m->m_data += adjust &~ (sizeof(long)-1);
@@ -1531,14 +1528,16 @@
static __inline int
rt_m_getfib(struct mbuf *m)
{
- KASSERT(m->m_flags & M_PKTHDR , ("Attempt to get FIB from non header mbuf."));
+ KASSERT(m->m_flags & M_PKTHDR,
+ ("%s: Attempt to get FIB from non header mbuf %p", __func__, m));
return (m->m_pkthdr.fibnum);
}
#define M_GETFIB(_m) rt_m_getfib(_m)
#define M_SETFIB(_m, _fib) do { \
- KASSERT((_m)->m_flags & M_PKTHDR, ("Attempt to set FIB on non header mbuf.")); \
+ KASSERT((_m)->m_flags & M_PKTHDR, \
+ ("%s: Attempt to set FIB on non header mbuf %p", __func__, (_m))); \
((_m)->m_pkthdr.fibnum) = (_fib); \
} while (0)
@@ -1809,9 +1808,9 @@
mbuf_tstmp2timespec(struct mbuf *m, struct timespec *ts)
{
- KASSERT((m->m_flags & M_PKTHDR) != 0, ("mbuf %p no M_PKTHDR", m));
+ M_ASSERTPKTHDR(m);
KASSERT((m->m_flags & (M_TSTMP|M_TSTMP_LRO)) != 0,
- ("mbuf %p no M_TSTMP or M_TSTMP_LRO", m));
+ ("%s: mbuf %p no M_TSTMP or M_TSTMP_LRO", __func__, m));
ts->tv_sec = m->m_pkthdr.rcv_tstmp / 1000000000;
ts->tv_nsec = m->m_pkthdr.rcv_tstmp % 1000000000;
}
@@ -1821,9 +1820,9 @@
mbuf_tstmp2timeval(struct mbuf *m, struct timeval *tv)
{
- KASSERT((m->m_flags & M_PKTHDR) != 0, ("mbuf %p no M_PKTHDR", m));
+ M_ASSERTPKTHDR(m);
KASSERT((m->m_flags & (M_TSTMP|M_TSTMP_LRO)) != 0,
- ("mbuf %p no M_TSTMP or M_TSTMP_LRO", m));
+ ("%s: mbuf %p no M_TSTMP or M_TSTMP_LRO", __func__, m));
tv->tv_sec = m->m_pkthdr.rcv_tstmp / 1000000000;
tv->tv_usec = (m->m_pkthdr.rcv_tstmp % 1000000000) / 1000;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, May 27, 1:16 PM (10 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33557696
Default Alt Text
D49817.diff (3 KB)
Attached To
Mode
D49817: mbuf: add mbuf information to KASSERTs
Attached
Detach File
Event Timeline
Log In to Comment