cvs commit: src/sys/kern uipc_mbuf.c src/sys/sys mbuf.h

Robert Watson rwatson at FreeBSD.org
Thu Feb 24 10:46:02 GMT 2005


On Fri, 28 Mar 2003, Mike Silbersack wrote:

>   Add the m_defrag routine, as discussed on committers at .  This
>   incarnation should address the concerns of all in the discussion,
>   and keeps statistics which show how much it is used.

I just started tracking a bug report from Peter Holm in which if_rl free's
an already free'd mbuf, and tracked it back to the following problem: when
you went through and adapted various drivers to use m_defrag(), two bugs
were introduced:

(1) Callers of m_defrag() did not properly handle the case where
    m_defrag() would return a new mbuf cluster as the head.  Specifically,
    on encapsulation failure, they might requeue the old head in the ifnet
    queue.

(2) Callers of m_defrag() did not properly handle the case where
    m_defrag() would return NULL due to mbuf exhaustion.  Specifically, on
    encapsulation failure in the case where m_defrag() fails, they might
    attempt to enqueue a NULL mbuf pointer or a free'd mbuf pointer into
    the ifnet queue.

This may explain a number of problems seen with several device drivers
when under very high load. It looks like if_vge, if_bfe, if_dc, if_re,
if_rl, if_sis, if_vr, and if_xl may all be partially affected by these
bugs.  I may have missed other cases of breakage.  It looks like you and
jmg fixed a few at least partially, though.  It would be really good if we
could get this fixed for 5.4, and probably merged to the 5.3 patch branch!

Robert N M Watson




More information about the cvs-src mailing list