Merge r254736 from user/np/cxl_tuning.

Don't leak tags when M_NOFREE | M_PKTHDR mbufs are freed.

Reviewed by:	andre
This commit is contained in:
np 2013-08-29 08:07:35 +00:00
parent a52be00b7f
commit af4b945621

View File

@ -646,18 +646,6 @@ m_getcl(int how, short type, int flags)
return (uma_zalloc_arg(zone_pack, &args, how));
}
static __inline struct mbuf *
m_free(struct mbuf *m)
{
struct mbuf *n = m->m_next;
if (m->m_flags & M_EXT)
mb_free_ext(m);
else if ((m->m_flags & M_NOFREE) == 0)
uma_zfree(zone_mbuf, m);
return (n);
}
static __inline void
m_clget(struct mbuf *m, int how)
{
@ -1124,6 +1112,20 @@ m_tag_find(struct mbuf *m, int type, struct m_tag *start)
m_tag_locate(m, MTAG_ABI_COMPAT, type, start));
}
static __inline struct mbuf *
m_free(struct mbuf *m)
{
struct mbuf *n = m->m_next;
if ((m->m_flags & (M_PKTHDR|M_NOFREE)) == (M_PKTHDR|M_NOFREE))
m_tag_delete_chain(m, NULL);
if (m->m_flags & M_EXT)
mb_free_ext(m);
else if ((m->m_flags & M_NOFREE) == 0)
uma_zfree(zone_mbuf, m);
return (n);
}
static int inline
rt_m_getfib(struct mbuf *m)
{