Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 May 2005 15:23:38 -0700 (PDT)
From:      John Polstra <jdp@polstra.com>
To:        Ernest Smallis <esmallis@stbernard.com>
Cc:        freebsd-net@freebsd.org
Subject:   RE: PR kern/78968 MBuf cluster exhaustion.  RFC (solutions)
Message-ID:  <XFMail.20050517152338.jdp@polstra.com>
In-Reply-To: <E7E213858379814A9AE48CA6754F5ECB04D8BD80@mail01.stbernard.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 17-May-2005 Ernest Smallis wrote:

> Hi All, I am seeing this problem as well:
> a. The kernel is in a tight loop via the fxp driver since there are
> frames that need to be DMA'd but cannot be because 'b.'
> b. The fxp driver calls m_getcl( ) which returns ENOBUFS since there
> are no clusters to satisfy the request. This goes on constantly so
> it appears the system is hung.

I'll describe the usual solution for this kind of bug.

  - A packet comes in, the device generates an interrupt, and you
    take the mbuf containing the received packet from the
    descriptor.

  - Now you call m_getcl() to replenish the descriptor, but it
    returns ENOBUFS.

  - Take the mbuf containing the received packet (from the first
    step) and reuse it to replenish the descriptor, discarding the
    mbuf contents and thus dropping the freshly received packet.

In this way you ensure that the receive descriptors always have mbufs,
no matter what happens.  Yes, you have to drop a perfectly good
received packet in order to accomplish this.  But you are going to end
up dropping a packet regardless, if you can't replenish the descriptor.

John



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20050517152338.jdp>