repeating crashes with 8.1

Bjoern A. Zeeb bzeeb-lists at
Tue Nov 23 18:50:08 UTC 2010

On Sat, 23 Oct 2010, Bjoern A. Zeeb wrote:


just to get this out.  Jack you might want to review and if ok, include
in HEAD before we get feedback maybe.  To my understanding worst it
would be overhead but not really harm.

>>> >>>>> Oct 22 02:06:02 i4 kernel: em1: discard frame w/o packet header
>>> >>>>> Oct 22 02:06:10 i4 kernel: em2: discard frame w/o packet header

The following is a random-guess by code reading that hasn't been tested
yet but believed to be correct; also ran it by gnn.

--- sys/dev/e1000/if_em.c.orig	2010-11-01 20:57:53.000000000 -0400
+++ sys/dev/e1000/if_em.c	2010-11-16 01:28:00.000000000 -0500
@@ -3754,8 +3769,13 @@ em_refresh_mbufs(struct rx_ring *rxr, in
  		** they can only be due to an error
  		** and are to be reused.
-		if (rxbuf->m_head != NULL)
+		if (rxbuf->m_head != NULL) {
+			rxbuf->m_head->m_len = rxbuf->m_head->m_pkthdr.len = adapter->rx_mbuf_sz;
+			rxbuf->m_head->m_flags |= M_PKTHDR;
+			rxbuf->m_head->m_data = rxbuf->m_head->m_ext.ext_buf;
+			rxbuf->m_head->m_next = NULL;
  			goto reuse;
+		}
  		m = m_getjcl(M_DONTWAIT, MT_DATA,
  		    M_PKTHDR, adapter->rx_mbuf_sz);

I am not sure if igb and the others need a similar fix.  Haven't
looked in detail. gnn mentioned similarities though good ones imho
in there.

If you were able to reproduce the pkthdr issue it would be great to
test it.  If you always paniced it with IPv6 you may also want to test
the applicable patch (use the direct URLs mentioned) from the very end of
to make sure you are not running into that race.


Bjoern A. Zeeb                              Welcome a new stage of life.
         <ks> Going to jail sucks -- <bz> All my daemons like it!

More information about the freebsd-stable mailing list