Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Mar 2013 10:05:36 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r248189 - head/sys/arm/at91
Message-ID:  <201303121005.r2CA5aL8028531@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Tue Mar 12 10:05:36 2013
New Revision: 248189
URL: http://svnweb.freebsd.org/changeset/base/248189

Log:
  Use m_get2() to get an mbuf of appropriate size.
  
  Reviewed by:	marius
  Sponsored by:	Nginx, Inc.

Modified:
  head/sys/arm/at91/if_ate.c

Modified: head/sys/arm/at91/if_ate.c
==============================================================================
--- head/sys/arm/at91/if_ate.c	Tue Mar 12 08:59:51 2013	(r248188)
+++ head/sys/arm/at91/if_ate.c	Tue Mar 12 10:05:36 2013	(r248189)
@@ -899,12 +899,9 @@ ate_intr(void *xsc)
 			/* FCS is not coppied into mbuf. */
 			remain = (sc->rx_descs[idx].status & ETH_LEN_MASK) - 4;
 
-			/* Get an appropriately sized mbuf  */
-			if (remain + ETHER_ALIGN >= MINCLSIZE)
-				mb = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
-			else
-				MGETHDR(mb, M_NOWAIT, MT_DATA);
-
+			/* Get an appropriately sized mbuf. */
+			mb = m_get2(M_NOWAIT, MT_DATA, M_PKTHDR,
+			    remain + ETHER_ALIGN);
 			if (mb == NULL) {
 				sc->ifp->if_iqdrops++;
 				rxdhead->status = 0;



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