Index: mbuf.h =================================================================== RCS file: /usr/home/kmacy/devel/cxgb/ncvs/src/sys/sys/mbuf.h,v retrieving revision 1.207 diff -d -u -r1.207 mbuf.h --- mbuf.h 11 Apr 2007 23:13:12 -0000 1.207 +++ mbuf.h 14 Apr 2007 05:07:38 -0000 @@ -84,9 +84,18 @@ struct mbuf *mh_next; /* next buffer in chain */ struct mbuf *mh_nextpkt; /* next chain in queue/record */ caddr_t mh_data; /* location of data */ - int mh_len; /* amount of data in this mbuf */ int mh_flags; /* flags; see below */ - short mh_type; /* type of data in this mbuf */ + uint16_t mh_type; /* type of data in this mbuf */ +#if defined(SMALL_M_HDR) + uint16_t mh_len; /* amount of data in this mbuf */ +#else + uint32_t mh_len; /* amount of data in this mbuf */ +#if defined(__LP64__) + uint8_t mh_pad[6]; +#else + uint8_t mh_pad[2]; +#endif +#endif /* !SMALL_M_HDR */ }; /* @@ -105,16 +114,16 @@ */ struct pkthdr { struct ifnet *rcvif; /* rcv interface */ - int len; /* total packet length */ /* variables for ip and tcp reassembly */ void *header; /* pointer to packet header */ + int len; /* total packet length */ /* variables for hardware checksum */ int csum_flags; /* flags regarding checksum */ int csum_data; /* data field used by csum routines */ u_int16_t tso_segsz; /* TSO segment size */ u_int16_t ether_vtag; /* Ethernet 802.1p+q vlan tag */ SLIST_HEAD(packet_tags, m_tag) tags; /* list of packet tags */ -}; +}; /* 40 bytes on 64-bit */ /* * Description of external storage mapped into mbuf; valid only if M_EXT is @@ -194,7 +203,9 @@ #define EXT_JUMBOP 3 /* jumbo cluster 4096 bytes */ #define EXT_JUMBO9 4 /* jumbo cluster 9216 bytes */ #define EXT_JUMBO16 5 /* jumbo cluster 16184 bytes */ +#ifndef PACKET_ZONE_DISABLED #define EXT_PACKET 6 /* mbuf+cluster from packet zone */ +#endif #define EXT_MBUF 7 /* external mbuf reference (M_IOVEC) */ #define EXT_NET_DRV 100 /* custom ext_buf provided by net driver(s) */ #define EXT_MOD_TYPE 200 /* custom module's ext_buf type */ @@ -325,10 +336,11 @@ * * The rest of it is defined in kern/kern_mbuf.c */ - +#ifndef PACKET_ZONE_DISABLED +extern uma_zone_t zone_pack; +#endif extern uma_zone_t zone_mbuf; extern uma_zone_t zone_clust; -extern uma_zone_t zone_pack; extern uma_zone_t zone_jumbop; extern uma_zone_t zone_jumbo9; extern uma_zone_t zone_jumbo16; @@ -444,16 +456,6 @@ return ((struct mbuf *)(uma_zalloc_arg(zone_mbuf, &args, how))); } -static __inline struct mbuf * -m_getcl(int how, short type, int flags) -{ - struct mb_args args; - - args.flags = flags; - args.type = type; - return ((struct mbuf *)(uma_zalloc_arg(zone_pack, &args, how))); -} - /* * m_getjcl() returns an mbuf with a cluster of the specified size attached. * For size it takes MCLBYTES, MJUMPAGESIZE, MJUM9BYTES, MJUM16BYTES. @@ -484,6 +486,19 @@ } static __inline struct mbuf * +m_getcl(int how, short type, int flags) +{ +#ifndef PACKET_ZONE_DISABLED + struct mb_args args; + args.flags = flags; + args.type = type; + return ((struct mbuf *)(uma_zalloc_arg(zone_pack, &args, how))); +#else + return m_getjcl(how, type, flags, MCLBYTES); +#endif +} + +static __inline struct mbuf * m_free(struct mbuf *m) { struct mbuf *n = m->m_next; @@ -503,6 +518,7 @@ printf("%s: %p mbuf already has cluster\n", __func__, m); m->m_ext.ext_buf = (char *)NULL; uma_zalloc_arg(zone_clust, m, how); +#ifndef PACKET_ZONE_DISABLED /* * On a cluster allocation failure, drain the packet zone and retry, * we might be able to loosen a few clusters up on the drain. @@ -511,6 +527,7 @@ zone_drain(zone_pack); uma_zalloc_arg(zone_clust, m, how); } +#endif } /*