Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Mar 2003 23:20:16 +0100
From:      Maxime Henrion <mux@freebsd.org>
To:        Mike Silbersack <silby@silby.com>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/conf options src/sys/netinet ip_output.c
Message-ID:  <20030325222016.GF57674@elvis.mu.org>
In-Reply-To: <20030324234234.T6129@odysseus.silby.com>
References:  <200303250545.h2P5j5PM008552@repoman.freebsd.org> <20030324234234.T6129@odysseus.silby.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Mike Silbersack wrote:
> FWIW, the two drivers I tested this with (if_xl and if_sis) both flunk.
> if_xl tries to fix the situation, but fails, and if_sis goes totally
> weird, eating mbufs and rendering the interface unuseable.
> 
> I'll test more interfaces once I have these two fixed.

Looks like there is a bug in this code.  I tried to understand what's
wrong in the if_xl code that tries to deal with mbuf chains containing
more than XL_MAXFRAGS mbufs, and noticed that m_head->m_pkthdr.len isn't
set properly.  The length of an mbuf chain shouldn't change when we're
just splitting it into more mbufs, so this is kinda weird.  Using
m_fixhdr() just after the splitting code solves it, but that's probably
just a workaround, and either m_split() or the MBUF_FRAG_TEST code needs
to be fixed.

That would be a very sufficient reason for this code to not work, but
unfortunately, it seems there are more bugs to fix.  However, I couldn't
even see the packet in tcpdump before, and I now can.  That means the
card has successfully queued the packet, otherwise it would not get
passed to BPF_MTAP() and it wouldn't show up in tcpdump.  Moreover, it
looks like the packet is valid, yet it seems it's not sent by the card
for some reason.  I couldn't figure out why yet.

I think we should have some code like this before handing a packet to a
network driver :

KASSERT(m0->m_pkthdr.len == m_length(m0, NULL), ("Bad packet header"));

Cheers,
Maxime




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