From owner-svn-src-user@FreeBSD.ORG Thu Oct 17 19:56:51 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E393633B; Thu, 17 Oct 2013 19:56:50 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C22E42DFD; Thu, 17 Oct 2013 19:56:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9HJuovn006026; Thu, 17 Oct 2013 19:56:50 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9HJuopc006020; Thu, 17 Oct 2013 19:56:50 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201310171956.r9HJuopc006020@svn.freebsd.org> From: Andre Oppermann Date: Thu, 17 Oct 2013 19:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r256697 - in user/andre/mbuf_staging: kern sys X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Oct 2013 19:56:51 -0000 Author: andre Date: Thu Oct 17 19:56:50 2013 New Revision: 256697 URL: http://svnweb.freebsd.org/changeset/base/256697 Log: Internalize struct mb_args from sys/mbuf.h into kern/kern_mbuf.c which is the only place where it used now. Be consequent and move m_last() to a real function as well. Move the MCHTYPE() macro and m_chtype() inline function together and decide later what to do with them. The warning in the comment doesn't seem to be true. Modified: user/andre/mbuf_staging/kern/kern_mbuf.c user/andre/mbuf_staging/sys/mbuf.h Modified: user/andre/mbuf_staging/kern/kern_mbuf.c ============================================================================== --- user/andre/mbuf_staging/kern/kern_mbuf.c Thu Oct 17 19:24:10 2013 (r256696) +++ user/andre/mbuf_staging/kern/kern_mbuf.c Thu Oct 17 19:56:50 2013 (r256697) @@ -300,6 +300,15 @@ static void mb_reclaim(void *); static void *mbuf_jumbo_alloc(uma_zone_t, int, uint8_t *, int); /* + * Argument structure passed to UMA routines during mbuf and packet + * allocations. + */ +struct mb_args { + int flags; /* Flags for mbuf being allocated */ + short type; /* Type of mbuf being allocated */ +}; + +/* * Initialize FreeBSD Network buffer allocation. */ static void Modified: user/andre/mbuf_staging/sys/mbuf.h ============================================================================== --- user/andre/mbuf_staging/sys/mbuf.h Thu Oct 17 19:24:10 2013 (r256696) +++ user/andre/mbuf_staging/sys/mbuf.h Thu Oct 17 19:56:50 2013 (r256697) @@ -75,15 +75,6 @@ */ #define mtod(m, t) ((t)((m)->m_data)) #define mtodo(m, o) ((void *)(((m)->m_data) + (o))) - -/* - * Argument structure passed to UMA routines during mbuf and packet - * allocations. - */ -struct mb_args { - int flags; /* Flags for mbuf being allocated */ - short type; /* Type of mbuf being allocated */ -}; #endif /* _KERNEL */ /* @@ -523,6 +514,14 @@ struct mbuf *m_get2(int, int, short, int struct mbuf *m_getjcl(int, short, int, int); struct mbuf *m_getm2(struct mbuf *, int, int, short, int); + + +/* + * Change mbuf to new type. This is a relatively expensive operation and + * should be avoided. + */ +#define MCHTYPE(m, t) m_chtype((m), (t)) + static __inline void m_chtype(struct mbuf *m, short new_type) { @@ -537,15 +536,6 @@ m_clrprotoflags(struct mbuf *m) m->m_flags &= ~M_PROTOFLAGS; } -static __inline struct mbuf * -m_last(struct mbuf *m) -{ - - while (m->m_next) - m = m->m_next; - return (m); -} - /* * mbuf, cluster, and external object allocation macros (for compatibility * purposes). @@ -613,12 +603,6 @@ int _m_trailingspace(const struct mbuf * */ #define M_PREPEND(m, plen, how) (m = m_prepend(m, plen, how)) -/* - * Change mbuf to new type. This is a relatively expensive operation and - * should be avoided. - */ -#define MCHTYPE(m, t) m_chtype((m), (t)) - /* Length to m_copy to copy all. */ #define M_COPYALL 1000000000 @@ -660,6 +644,7 @@ int m_dup_pkthdr(struct mbuf *, struct u_int m_fixhdr(struct mbuf *); struct mbuf *m_fragment(struct mbuf *, int, int); struct mbuf *m_getptr(struct mbuf *, int, int *); +struct mbuf *m_last(struct mbuf *); u_int m_length(struct mbuf *, struct mbuf **); int m_mbuftouio(struct uio *, struct mbuf *, int); void m_move_pkthdr(struct mbuf *, struct mbuf *);