Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 May 2000 09:08:25 +0200
From:      Gary Jennejohn <garyj@peedub.muc.de>
To:        Bill Paul <wpaul@skynet.ctr.columbia.edu>
Cc:        dillon@apollo.backplane.com, freebsd-current@FreeBSD.ORG
Subject:   Re: NFS, rl0 and Alpha 
Message-ID:  <200005050708.JAA37756@peedub.muc.de>
In-Reply-To: Your message of "Fri, 05 May 2000 00:40:39 %2B0200." <200005042244.SAA07824@skynet.ctr.columbia.edu> 

next in thread | previous in thread | raw e-mail | index | archive | help
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




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