Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Dec 2008 05:41:25 +0000 (UTC)
From:      Kip Macy <kmacy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r185663 - in user/kmacy/HEAD_fast_multi_xmit/sys: kern sys
Message-ID:  <200812060541.mB65fPk8083972@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kmacy
Date: Sat Dec  6 05:41:25 2008
New Revision: 185663
URL: http://svn.freebsd.org/changeset/base/185663

Log:
  revert local changes

Modified:
  user/kmacy/HEAD_fast_multi_xmit/sys/kern/kern_mbuf.c
  user/kmacy/HEAD_fast_multi_xmit/sys/sys/mbuf.h

Modified: user/kmacy/HEAD_fast_multi_xmit/sys/kern/kern_mbuf.c
==============================================================================
--- user/kmacy/HEAD_fast_multi_xmit/sys/kern/kern_mbuf.c	Sat Dec  6 02:10:53 2008	(r185662)
+++ user/kmacy/HEAD_fast_multi_xmit/sys/kern/kern_mbuf.c	Sat Dec  6 05:41:25 2008	(r185663)
@@ -208,7 +208,6 @@ SYSCTL_STRUCT(_kern_ipc, OID_AUTO, mbsta
  */
 uma_zone_t	zone_mbuf;
 uma_zone_t	zone_clust;
-uma_zone_t	zone_iclust;
 uma_zone_t	zone_pack;
 uma_zone_t	zone_jumbop;
 uma_zone_t	zone_jumbo9;
@@ -229,10 +228,9 @@ static void	mb_zfini_pack(void *, int);
 
 static void	mb_reclaim(void *);
 static void	mbuf_init(void *);
-
 static void    *mbuf_jumbo_alloc(uma_zone_t, int, u_int8_t *, int);
 static void	mbuf_jumbo_free(void *, int, u_int8_t);
-static void	*mb_alloc_iclust(uma_zone_t, int, u_int8_t *, int);
+
 static MALLOC_DEFINE(M_JUMBOFRAME, "jumboframes", "mbuf jumbo frame buffers");
 
 /* Ensure that MSIZE doesn't break dtom() - it must be a power of 2 */
@@ -258,14 +256,6 @@ mbuf_init(void *dummy)
 #endif
 	    MSIZE - 1, UMA_ZONE_MAXBUCKET);
 
-	zone_iclust = uma_zcreate("mbuf_icluster", MICLBYTES,
-	    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR,
-	    UMA_ZONE_MAXBUCKET | UMA_ZONE_STRIPEBUCKET | UMA_ZONE_NOFREE);
-	uma_zone_set_ppera(zone_iclust,
-	    (MICLBYTES * (PAGE_SIZE / 64)) / PAGE_SIZE);
-	uma_zone_set_allocf(zone_iclust, mb_alloc_iclust);
-	uma_prealloc(zone_iclust, 8192);
-
 	zone_clust = uma_zcreate(MBUF_CLUSTER_MEM_NAME, MCLBYTES,
 	    mb_ctor_clust, mb_dtor_clust,
 #ifdef INVARIANTS
@@ -427,7 +417,6 @@ mb_ctor_mbuf(void *mem, int size, void *
 		m->m_pkthdr.tso_segsz = 0;
 		m->m_pkthdr.ether_vtag = 0;
 		SLIST_INIT(&m->m_pkthdr.tags);
-		m->m_pkthdr.flowid = 0;
 #ifdef MAC
 		/* If the label init fails, fail the alloc */
 		error = mac_mbuf_init(m, how);
@@ -557,66 +546,6 @@ mb_ctor_clust(void *mem, int size, void 
 	return (0);
 }
 
-static MALLOC_DEFINE(M_ICLUST, "iclust", "inline clusters");
-
-void *
-mb_alloc_iclust(uma_zone_t zone, int bytes, u_int8_t *flags, int wait)
-{
-
-	*flags = UMA_SLAB_PRIV;
-	return contigmalloc(bytes, M_ICLUST, 0, 0, ~0, 1, 0);
-}
-
-void
-mb_iclust_free(void *mem, void *arg)
-{
-
-	uma_zfree(zone_iclust, arg);
-}
-
-int
-mb_iclust_init(struct mbuf *m, short type, int flags)
-{
-	int *ref;
-
-	/*
-	 * The mbuf is initialized later.  The caller has the
-	 * responsibility to set up any MAC labels too.
-	 */
-	if (type == MT_NOINIT)
-		return (0);
-	/*
-	 * Initialize header contents.
-	 */
-	m->m_next = NULL;
-	m->m_nextpkt = NULL;
-	m->m_data = m_icldata(m);
-	m->m_len = 0;
-	m->m_flags = flags | M_EXT | M_NOFREE;
-	m->m_type = type;
-	if (flags & M_PKTHDR) {
-		memset(&m->m_pkthdr, 0, sizeof(m->m_pkthdr));
-#ifdef MAC
-		int error;
-		/* If the label init fails, fail the alloc */
-		error = mac_init_mbuf(m, how);
-		if (error)
-			return (error);
-#endif
-	}
-	m->m_ext.ext_buf = m_icldata(m);
-	m->m_ext.ext_free = mb_iclust_free;
-	m->m_ext.ext_arg1 = m;
-	m->m_ext.ext_size = MCLBYTES;
-	m->m_ext.ext_type = EXT_EXTREF;
-	ref = (int *)((uintptr_t)m + (MICLHLEN - sizeof(int)));
-	m->m_ext.ref_cnt = ref;
-	*ref = 1;
-
-	return (0);
-}
-
-
 /*
  * The Mbuf Cluster zone destructor.
  */

Modified: user/kmacy/HEAD_fast_multi_xmit/sys/sys/mbuf.h
==============================================================================
--- user/kmacy/HEAD_fast_multi_xmit/sys/sys/mbuf.h	Sat Dec  6 02:10:53 2008	(r185662)
+++ user/kmacy/HEAD_fast_multi_xmit/sys/sys/mbuf.h	Sat Dec  6 05:41:25 2008	(r185663)
@@ -44,8 +44,6 @@
 #endif
 #endif
 
-#define	M_DPAD_LEN	64
-
 /*
  * Mbufs are of a single size, MSIZE (sys/param.h), which includes overhead.
  * An mbuf may add a single "mbuf cluster" of size MCLBYTES (also in
@@ -59,9 +57,6 @@
 #define	MHLEN		(MLEN - sizeof(struct pkthdr))	/* data len w/pkthdr */
 #define	MINCLSIZE	(MHLEN + 1)	/* smallest amount to put in cluster */
 #define	M_MAXCOMPRESS	(MHLEN / 2)	/* max amount to copy for compression */
-#define	MICLHLEN	(sizeof(struct m_hdr) + sizeof(struct pkthdr) + M_DPAD_LEN + sizeof(((struct mbuf *)0)->m_ext) + sizeof(int))
-#define	MICLDOFF	(roundup2(MICLHLEN, 64))
-#define	MICLBYTES	(MCLBYTES + MICLDOFF)
 
 #ifdef _KERNEL
 /*-
@@ -141,8 +136,8 @@ struct m_ext {
 			    (void *, void *);
 	void		*ext_arg1;	/* optional argument pointer */
 	void		*ext_arg2;	/* optional argument pointer */
-	volatile u_int	*ref_cnt;	/* pointer to ref count info */
 	u_int		 ext_size;	/* size of buffer, for ext_free */
+	volatile u_int	*ref_cnt;	/* pointer to ref count info */
 	int		 ext_type;	/* type of external storage */
 };
 
@@ -357,12 +352,10 @@ extern uma_zone_t	zone_jumbop;
 extern uma_zone_t	zone_jumbo9;
 extern uma_zone_t	zone_jumbo16;
 extern uma_zone_t	zone_ext_refcnt;
-extern uma_zone_t	zone_iclust;
 
 static __inline struct mbuf	*m_getcl(int how, short type, int flags);
 static __inline struct mbuf	*m_get(int how, short type);
 static __inline struct mbuf	*m_gethdr(int how, short type);
-static __inline struct mbuf	*m_geticl(int how, short type, int flags);
 static __inline struct mbuf	*m_getjcl(int how, short type, int flags,
 				    int size);
 static __inline struct mbuf	*m_getclr(int how, short type);	/* XXX */
@@ -372,12 +365,6 @@ static __inline void		*m_cljget(struct m
 static __inline void		 m_chtype(struct mbuf *m, short new_type);
 void				 mb_free_ext(struct mbuf *);
 static __inline struct mbuf	*m_last(struct mbuf *m);
-void				 m_tag_delete_chain(struct mbuf *,
-                                    struct m_tag *);
-
-
-int mb_iclust_init(struct mbuf *m, short type, int flags);
-void mb_iclust_free(void *mem, void *arg);
 
 static __inline int
 m_gettype(int size)
@@ -480,18 +467,7 @@ static __inline struct mbuf *
 m_getcl(int how, short type, int flags)
 {
 	struct mb_args args;
-	struct mbuf *m;
-	
-	/* First try an iclust. */
-	m = uma_zalloc(zone_iclust, how);
-	if (m) {
-		if (type != MT_NOINIT)
-			mb_iclust_init(m, type, flags);
-		return (m);
-	}
-	/*
-	 * Then fallback to the packetzone.
-	 */
+
 	args.flags = flags;
 	args.type = type;
 	return ((struct mbuf *)(uma_zalloc_arg(zone_pack, &args, how)));
@@ -642,50 +618,6 @@ m_last(struct mbuf *m)
 		m = m->m_next;
 	return (m);
 }
-static __inline void *
-m_icldata(struct mbuf *m)
-{
-
-	return ((void *)((uintptr_t)m + MICLDOFF));
-}
-
-static __inline
-struct mbuf *
-m_geticl(int how, short type, int flags)
-{
-	struct mbuf *m;
-
-	m = uma_zalloc(zone_iclust, how);
-	if (m && type != MT_NOINIT)
-		mb_iclust_init(m, type, flags);
-
-	return (m);
-}
-
-/*
- * Determine whether an mbuf can be torn down prior to xmit or not.  This
- * allows the driver to avoid touching the mbuf header when cleaning
- * transmit interrupts.
- */
-static inline int
-m_fasttest(struct mbuf *m)
-{
-	if (m->m_next == NULL && (m->m_flags & M_EXT) != 0 &&
-	    m->m_ext.ext_free == mb_iclust_free && *m->m_ext.ref_cnt == 1) {
-		if (SLIST_FIRST(&m->m_pkthdr.tags) != NULL)
-			m_tag_delete_chain(m, NULL);
-		return (1);
-	}
-	return (0);
-}
-
-static inline void
-m_fastfree(struct mbuf *m)
-{
-
-	uma_zfree(zone_iclust, m);
-}
-
 
 /*
  * mbuf, cluster, and external object allocation macros (for compatibility
@@ -935,6 +867,7 @@ struct mbuf	*m_unshare(struct mbuf *, in
 /* Packet tag routines. */
 struct m_tag	*m_tag_alloc(u_int32_t, int, int, int);
 void		 m_tag_delete(struct mbuf *, struct m_tag *);
+void		 m_tag_delete_chain(struct mbuf *, struct m_tag *);
 void		 m_tag_free_default(struct m_tag *);
 struct m_tag	*m_tag_locate(struct mbuf *, u_int32_t, int, struct m_tag *);
 struct m_tag	*m_tag_copy(struct m_tag *, int);



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