From owner-p4-projects@FreeBSD.ORG Fri Mar 10 00:07:56 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 943C916A423; Fri, 10 Mar 2006 00:07:55 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 44B5416A420 for ; Fri, 10 Mar 2006 00:07:55 +0000 (GMT) (envelope-from cognet@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0FB3143D45 for ; Fri, 10 Mar 2006 00:07:55 +0000 (GMT) (envelope-from cognet@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k2A07stO040520 for ; Fri, 10 Mar 2006 00:07:54 GMT (envelope-from cognet@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k2A07r3r040508 for perforce@freebsd.org; Fri, 10 Mar 2006 00:07:53 GMT (envelope-from cognet@freebsd.org) Date: Fri, 10 Mar 2006 00:07:53 GMT Message-Id: <200603100007.k2A07r3r040508@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to cognet@freebsd.org using -f From: Olivier Houchard To: Perforce Change Reviews Cc: Subject: PERFORCE change 93082 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Mar 2006 00:07:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=93082 Change 93082 by cognet@cognet on 2006/03/10 00:06:58 Split the received mbuf into two mbuf, for alignment constraints. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/if_ate.c#35 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/if_ate.c#35 (text+ko) ==== @@ -74,7 +74,7 @@ #include "miibus_if.h" #define ATE_MAX_TX_BUFFERS 2 /* We have ping-pong tx buffers */ -#define ATE_MAX_RX_BUFFERS 64 +#define ATE_MAX_RX_BUFFERS 8 struct ate_softc { @@ -579,7 +579,7 @@ struct ate_softc *sc = xsc; int status; int i; - struct mbuf *mb; + struct mbuf *mb, *tmp_mbuf; bus_dma_segment_t seg; int rx_stat; int nsegs; @@ -630,8 +630,6 @@ * the new buffer is loaded for dma. */ sc->rx_mbuf[i] = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - sc->rx_mbuf[i]->m_len = - sc->rx_mbuf[i]->m_pkthdr.len = MCLBYTES; if (!sc->rx_mbuf[i]) { printf("Failed to get another mbuf -- discarding packet\n"); sc->rx_mbuf[i] = mb; @@ -642,6 +640,8 @@ BUS_DMASYNC_PREWRITE); continue; } + sc->rx_mbuf[i]->m_len = + sc->rx_mbuf[i]->m_pkthdr.len = MCLBYTES; bus_dmamap_unload(sc->rxtag, sc->rx_map[i]); if (bus_dmamap_load_mbuf_sg(sc->rxtag, sc->rx_map[i], sc->rx_mbuf[i], &seg, &nsegs, 0) != 0) { @@ -657,6 +657,7 @@ mb->m_len = rx_stat & ETH_LEN_MASK; mb->m_pkthdr.len = mb->m_len; mb->m_pkthdr.rcvif = sc->ifp; + tmp_mbuf = m_copyup(mb, ETHER_HDR_LEN, 2); /* * For the last buffer, set the wrap bit so * the controller restarts from the first @@ -670,7 +671,7 @@ BUS_DMASYNC_PREREAD); bus_dmamap_sync(sc->rx_desc_tag, sc->rx_desc_map, BUS_DMASYNC_PREWRITE); - (*sc->ifp->if_input)(sc->ifp, mb); + (*sc->ifp->if_input)(sc->ifp, tmp_mbuf); } } if (status & ETH_ISR_TCOM) {