kern/86306: [patch] if_em.c locks up while trying to send a
highly fragmented packet
Ruslan Ermilov
ru at freebsd.org
Sun Sep 18 23:30:23 PDT 2005
The following reply was made to PR kern/86306; it has been noted by GNATS.
From: Ruslan Ermilov <ru at freebsd.org>
To: Dmitrij Tejblum <tejblum at yandex-team.ru>
Cc: FreeBSD-gnats-submit at freebsd.org
Subject: Re: kern/86306: [patch] if_em.c locks up while trying to send a highly fragmented packet
Date: Mon, 19 Sep 2005 09:29:26 +0300
Hi Dmitrij,
On Sun, Sep 18, 2005 at 11:25:35PM +0400, Dmitrij Tejblum wrote:
> When em_encap() tries to send a very long mbuf chain (i.e. more than
> EM_MAX_SCATTER == 64 mbufs), bus_dmamap_load_mbuf_sg() may fail with EFBIG.
> Then em_encap() fail, the packet is not sent and left in the output queue,
> and thus no futher transmission is possible.
>
> Some other driver handle similar condition with m_defrag(9) function
> (which is intended for this purpose).
>
Can you please modify your patch as follows:
1) Count how much fragments are in the packet in em_encap() first, and
do m_defrag() if it exceeeds EM_MAX_SCATTER, like in if_dc.c. If it
is still EFBIG after that and bus_dmamap_load_mbuf_sg(), then free it
as you do to prevent re-enqueue.
2) Put BPF processing back to em_start_locked().
3) Pull up to the HEAD version of the driver.
Cheers,
--
Ruslan Ermilov
ru at FreeBSD.org
FreeBSD committer
More information about the freebsd-bugs
mailing list