From owner-svn-src-user@FreeBSD.ORG Thu Oct 10 18:18:05 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6F5A4D9E; Thu, 10 Oct 2013 18:18:05 +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 5D330217D; Thu, 10 Oct 2013 18:18:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AII5OJ083722; Thu, 10 Oct 2013 18:18:05 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AII5p7083720; Thu, 10 Oct 2013 18:18:05 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201310101818.r9AII5p7083720@svn.freebsd.org> From: Andre Oppermann Date: Thu, 10 Oct 2013 18:18:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r256285 - 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, 10 Oct 2013 18:18:05 -0000 Author: andre Date: Thu Oct 10 18:18:04 2013 New Revision: 256285 URL: http://svnweb.freebsd.org/changeset/base/256285 Log: Rename the constituent parts of struct mbuf to more sensible and less namespace polluting names. For example struct m_ext used to be impossible to access because of the 'm_ext' macro to paint over the big union in struct mbuf. struct m_hdr -> mh_hdr struct pkthdr -> mh_pkthdr struct m_ext -> mh_ext There is no functional change and nobody should have directly used any of these structures anyways. In fact not a single place in the tree does with the exception of the mbuf constructors themself. Update some comments. Modified: user/andre/mbuf_staging/kern/uipc_mbuf.c user/andre/mbuf_staging/sys/mbuf.h Modified: user/andre/mbuf_staging/kern/uipc_mbuf.c ============================================================================== --- user/andre/mbuf_staging/kern/uipc_mbuf.c Thu Oct 10 18:05:13 2013 (r256284) +++ user/andre/mbuf_staging/kern/uipc_mbuf.c Thu Oct 10 18:18:04 2013 (r256285) @@ -397,7 +397,7 @@ m_demote(struct mbuf *m0, int all) if (m->m_flags & M_PKTHDR) { m_tag_delete_chain(m, NULL); m->m_flags &= ~M_PKTHDR; - bzero(&m->m_pkthdr, sizeof(struct pkthdr)); + bzero(&m->m_pkthdr, sizeof(struct mh_pkthdr)); } if (m != m0 && m->m_nextpkt != NULL) { KASSERT(m->m_nextpkt == NULL, Modified: user/andre/mbuf_staging/sys/mbuf.h ============================================================================== --- user/andre/mbuf_staging/sys/mbuf.h Thu Oct 10 18:05:13 2013 (r256284) +++ user/andre/mbuf_staging/sys/mbuf.h Thu Oct 10 18:18:04 2013 (r256285) @@ -61,8 +61,8 @@ * MHLEN is data length in an mbuf with pktheader. * MINCLSIZE is a smallest amount of data that should be put into cluster. */ -#define MLEN ((int)(MSIZE - sizeof(struct m_hdr))) -#define MHLEN ((int)(MLEN - sizeof(struct pkthdr))) +#define MLEN ((int)(MSIZE - sizeof(struct mh_hdr))) +#define MHLEN ((int)(MLEN - sizeof(struct mh_pkthdr))) #define MINCLSIZE (MHLEN + 1) #ifdef _KERNEL @@ -71,7 +71,7 @@ * type: * * mtod(m, t) -- Convert mbuf pointer to data pointer of correct type. - * mtodo(m, o) -- Same as above but with offset 'o' into data. + * mtodo(m, o) -- Same as above but with offset 'o' into data. */ #define mtod(m, t) ((t)((m)->m_data)) #define mtodo(m, o) ((void *)(((m)->m_data) + (o))) @@ -91,7 +91,7 @@ struct mb_args { * Size ILP32: 24 * LP64: 32 */ -struct m_hdr { +struct mh_hdr { struct mbuf *mh_next; /* next buffer in chain */ struct mbuf *mh_nextpkt; /* next chain in queue/record */ caddr_t mh_data; /* location of data */ @@ -105,6 +105,8 @@ struct m_hdr { /* * Packet tag structure (see below for details). + * Size ILP32: 16 + * LP64: 24 */ struct m_tag { SLIST_ENTRY(m_tag) m_tag_link; /* List of packet tags */ @@ -119,7 +121,7 @@ struct m_tag { * Size ILP32: 48 * LP64: 56 */ -struct pkthdr { +struct mh_pkthdr { struct ifnet *rcvif; /* rcv interface */ SLIST_HEAD(packet_tags, m_tag) tags; /* list of packet tags */ int32_t len; /* total packet length */ @@ -166,7 +168,7 @@ struct pkthdr { * Size ILP32: 28 * LP64: 48 */ -struct m_ext { +struct mh_ext { volatile u_int *ref_cnt; /* pointer to ref count info */ caddr_t ext_buf; /* start of buffer */ uint32_t ext_size; /* size of buffer, for ext_free */ @@ -183,12 +185,12 @@ struct m_ext { * purposes. */ struct mbuf { - struct m_hdr m_hdr; + struct mh_hdr m_hdr; union { struct { - struct pkthdr MH_pkthdr; /* M_PKTHDR set */ + struct mh_pkthdr MH_pkthdr; /* M_PKTHDR set */ union { - struct m_ext MH_ext; /* M_EXT set */ + struct mh_ext MH_ext; /* M_EXT set */ char MH_databuf[MHLEN]; } MH_dat; } MH;