From owner-freebsd-current Fri May 5 0:14:10 2000 Delivered-To: freebsd-current@freebsd.org Received: from peedub.muc.de (peedub.muc.de [193.149.49.109]) by hub.freebsd.org (Postfix) with ESMTP id 0EDB737BAB7 for ; Fri, 5 May 2000 00:14:05 -0700 (PDT) (envelope-from garyj@peedub.muc.de) Received: from peedub.muc.de (localhost [127.0.0.1]) by peedub.muc.de (8.9.3/8.6.9) with ESMTP id JAA37756; Fri, 5 May 2000 09:08:25 +0200 (CEST) Message-Id: <200005050708.JAA37756@peedub.muc.de> X-Mailer: exmh version 2.1.1 10/15/1999 To: Bill Paul Cc: dillon@apollo.backplane.com, freebsd-current@FreeBSD.ORG Subject: Re: NFS, rl0 and Alpha Reply-To: Gary Jennejohn In-reply-to: Your message of "Fri, 05 May 2000 00:40:39 +0200." <200005042244.SAA07824@skynet.ctr.columbia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 05 May 2000 09:08:25 +0200 From: Gary Jennejohn Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Bill Paul writes: >Of all the gin joints in all the towns in all the world, Gary Jennejohn >had to walk into mine and say: > >> OK. Unfortunately, gdb core dumps when I try to analyze a crash dump >> with a debugging kernel :( Even worse, gdb core dumps when I try to >> run a debugging gdb in gdb to find out why gdb is core dumping when >> I try to debug a kernel with symbols :(( Wonderful. > >I suspect this may have something to do with the way packets sometimes >wrap from the end of the RX buffer pool to the beginning. This might >result in fragmentation across multiple mbufs in some cases (I think). >If I squint hard enough, I can see a way for the data to end up misaligned >in one of the additional mbufs. > >Try this patch. It's an untested hack (I don't have a RealTek card >in a test box right this second) but should fix the problem if it's >what I think it is. > > >*** if_rl.c.orig Sat Apr 29 14:15:10 2000 >--- if_rl.c Thu May 4 22:16:31 2000 >*************** >*** 913,919 **** > goto fail; > } > >! sc->rl_cdata.rl_rx_buf = contigmalloc(RL_RXBUFLEN + 32, M_DEVBUF, > M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0); > > if (sc->rl_cdata.rl_rx_buf == NULL) { >--- 911,917 ---- > goto fail; > } > >! sc->rl_cdata.rl_rx_buf = contigmalloc(RL_RXBUFLEN + 1518, M_DEVBUF, > M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0); > > if (sc->rl_cdata.rl_rx_buf == NULL) { >*************** >*** 1122,1129 **** > wrap = (sc->rl_cdata.rl_rx_buf + RL_RXBUFLEN) - rxbufpos; > > if (total_len > wrap) { > m = m_devget(rxbufpos - RL_ETHER_ALIGN, >! wrap + RL_ETHER_ALIGN, 0, ifp, NULL); > if (m == NULL) { > ifp->if_ierrors++; > printf("rl%d: out of mbufs, tried to " >--- 1120,1132 ---- > wrap = (sc->rl_cdata.rl_rx_buf + RL_RXBUFLEN) - rxbufpos; > > if (total_len > wrap) { >+ /* >+ * Fool m_devget() into thinking we want to copy >+ * the whole buffer so we don't end up fragmenting >+ * the data. >+ */ > m = m_devget(rxbufpos - RL_ETHER_ALIGN, >! total_len + RL_ETHER_ALIGN, 0, ifp, NULL); > if (m == NULL) { > ifp->if_ierrors++; > printf("rl%d: out of mbufs, tried to " >*************** >*** 1132,1145 **** > m_adj(m, RL_ETHER_ALIGN); > m_copyback(m, wrap, total_len - wrap, > sc->rl_cdata.rl_rx_buf); >- if (m->m_len < sizeof(struct ether_header)) >- m = m_pullup(m, >- sizeof(struct ether_header)); >- if (m == NULL) { >- printf("rl%d: m_pullup failed", >- sc->rl_unit); >- ifp->if_ierrors++; >- } > } > cur_rx = (total_len - wrap + ETHER_CRC_LEN); > } else { >--- 1135,1140 ---- Yes, this patch fixes the problem. Thank you, Bill Paul ! --- Gary Jennejohn / garyj@muc.de gj@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message