PERFORCE change 32381 for review

Robert Watson rwatson at FreeBSD.org
Mon Jun 2 16:29:13 GMT 2003


http://perforce.freebsd.org/chv.cgi?CH=32381

Change 32381 by rwatson at rwatson_tislabs on 2003/06/02 09:28:57

	Integrate change to how mbuf defragmentation occurs in if_fxp;
	this may resolve a bug involving m_tag chain corruption in the
	fxp driver, so give it a spin.

Affected files ...

.. //depot/projects/trustedbsd/base/sys/dev/fxp/if_fxp.c#25 integrate

Differences ...

==== //depot/projects/trustedbsd/base/sys/dev/fxp/if_fxp.c#25 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.180 2003/05/25 05:04:26 truckman Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.181 2003/06/02 05:16:42 silby Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1396,24 +1396,13 @@
 			 * mbuf chain first. Bail out if we can't get the
 			 * new buffers.
 			 */
-			MGETHDR(mn, M_DONTWAIT, MT_DATA);
+			mn = m_defrag(mb_head, M_DONTWAIT);
 			if (mn == NULL) {
 				m_freem(mb_head);
 				break;
+			} else {
+				mb_head = mn;
 			}
-			if (mb_head->m_pkthdr.len > MHLEN) {
-				MCLGET(mn, M_DONTWAIT);
-				if ((mn->m_flags & M_EXT) == 0) {
-					m_freem(mn);
-					m_freem(mb_head);
-					break;
-				}
-			}
-			m_copydata(mb_head, 0, mb_head->m_pkthdr.len,
-			    mtod(mn, caddr_t));
-			mn->m_pkthdr.len = mn->m_len = mb_head->m_pkthdr.len;
-			m_freem(mb_head);
-			mb_head = mn;
 			error = bus_dmamap_load_mbuf(sc->fxp_mtag, txp->tx_map,
 			    mb_head, fxp_dma_map_txbuf, sc, 0);
 			if (error) {
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list