diff options
author | andre <andre@FreeBSD.org> | 2006-09-17 13:44:32 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2006-09-17 13:44:32 +0000 |
commit | 710a642f7a2c6d9d8683559d0a28398ef6c469ba (patch) | |
tree | 4599e27bf9b4be6bbe1416b996acd9b40ff07a22 /sys/kern/kern_mbuf.c | |
parent | 34f4a99b52554d9bb4b09a9220ae8ff71a27c828 (diff) | |
download | FreeBSD-src-710a642f7a2c6d9d8683559d0a28398ef6c469ba.zip FreeBSD-src-710a642f7a2c6d9d8683559d0a28398ef6c469ba.tar.gz |
Remove VLAN mtag UMA zones and initialize ether_vtag and tso_segsz packet
header fields to zero on mbuf allocation.
Sponsored by: TCP/IP Optimization Fundraise 2005
Diffstat (limited to 'sys/kern/kern_mbuf.c')
-rw-r--r-- | sys/kern/kern_mbuf.c | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index 0f03779..e43d323 100644 --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -150,7 +150,6 @@ uma_zone_t zone_jumbop; uma_zone_t zone_jumbo9; uma_zone_t zone_jumbo16; uma_zone_t zone_ext_refcnt; -uma_zone_t zone_mtag_vlan; /* * Local prototypes. @@ -163,7 +162,6 @@ static void mb_dtor_clust(void *, int, void *); static void mb_dtor_pack(void *, int, void *); static int mb_zinit_pack(void *, int, int); static void mb_zfini_pack(void *, int); -static int mt_zinit_vlan(void *, int, int); static void mb_reclaim(void *); static void mbuf_init(void *); @@ -244,12 +242,6 @@ mbuf_init(void *dummy) NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); - zone_mtag_vlan = uma_zcreate("mtag_vlan", - sizeof(struct m_tag) + sizeof(u_int), - NULL, NULL, - mt_zinit_vlan, NULL, - UMA_ALIGN_INT, 0); - /* uma_prealloc() goes here... */ /* @@ -325,6 +317,8 @@ mb_ctor_mbuf(void *mem, int size, void *arg, int how) m->m_pkthdr.header = NULL; m->m_pkthdr.csum_flags = 0; m->m_pkthdr.csum_data = 0; + m->m_pkthdr.tso_segsz = 0; + m->m_pkthdr.ether_vtag = 0; SLIST_INIT(&m->m_pkthdr.tags); #ifdef MAC /* If the label init fails, fail the alloc */ @@ -523,6 +517,8 @@ mb_ctor_pack(void *mem, int size, void *arg, int how) m->m_pkthdr.header = NULL; m->m_pkthdr.csum_flags = 0; m->m_pkthdr.csum_data = 0; + m->m_pkthdr.tso_segsz = 0; + m->m_pkthdr.ether_vtag = 0; SLIST_INIT(&m->m_pkthdr.tags); #ifdef MAC /* If the label init fails, fail the alloc */ @@ -536,23 +532,6 @@ mb_ctor_pack(void *mem, int size, void *arg, int how) return (0); } -static void -mt_vlan_free(struct m_tag *mtag) -{ - uma_zfree(zone_mtag_vlan, mtag); -} - -static int -mt_zinit_vlan(void *mem, int size, int how) -{ - struct m_tag *mtag = (struct m_tag *)mem; - - m_tag_setup(mtag, MTAG_VLAN, MTAG_VLAN_TAG, sizeof(u_int)); - mtag->m_tag_free = mt_vlan_free; - - return (0); -} - /* * This is the protocol drain routine. * |