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
This commit is contained in:
Andre Oppermann 2006-09-17 13:44:32 +00:00
parent 7ff0b850a6
commit a855e2b4c0

View File

@ -150,7 +150,6 @@ uma_zone_t zone_jumbop;
uma_zone_t zone_jumbo9; uma_zone_t zone_jumbo9;
uma_zone_t zone_jumbo16; uma_zone_t zone_jumbo16;
uma_zone_t zone_ext_refcnt; uma_zone_t zone_ext_refcnt;
uma_zone_t zone_mtag_vlan;
/* /*
* Local prototypes. * Local prototypes.
@ -163,7 +162,6 @@ static void mb_dtor_clust(void *, int, void *);
static void mb_dtor_pack(void *, int, void *); static void mb_dtor_pack(void *, int, void *);
static int mb_zinit_pack(void *, int, int); static int mb_zinit_pack(void *, int, int);
static void mb_zfini_pack(void *, int); static void mb_zfini_pack(void *, int);
static int mt_zinit_vlan(void *, int, int);
static void mb_reclaim(void *); static void mb_reclaim(void *);
static void mbuf_init(void *); static void mbuf_init(void *);
@ -244,12 +242,6 @@ mbuf_init(void *dummy)
NULL, NULL, NULL, NULL,
UMA_ALIGN_PTR, UMA_ZONE_ZINIT); 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... */ /* 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.header = NULL;
m->m_pkthdr.csum_flags = 0; m->m_pkthdr.csum_flags = 0;
m->m_pkthdr.csum_data = 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); SLIST_INIT(&m->m_pkthdr.tags);
#ifdef MAC #ifdef MAC
/* If the label init fails, fail the alloc */ /* 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.header = NULL;
m->m_pkthdr.csum_flags = 0; m->m_pkthdr.csum_flags = 0;
m->m_pkthdr.csum_data = 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); SLIST_INIT(&m->m_pkthdr.tags);
#ifdef MAC #ifdef MAC
/* If the label init fails, fail the alloc */ /* 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); 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. * This is the protocol drain routine.
* *