X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_mbuf%2Frte_mbuf.h;h=27988c3bf4e3c78c0c074ad550db456b8e95c9b7;hb=d7937e2e3d12e326b86248a42f95825db53c8b4f;hp=5acb6a8d4868824f1a04486405ffc367c93eab3f;hpb=af75078fece3615088e561357c1e97603e43a5fe;p=dpdk.git diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 5acb6a8d48..27988c3bf4 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright(c) 2010-2012 Intel Corporation. All rights reserved. + * Copyright(c) 2010-2013 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -30,7 +30,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * version: DPDK.L.1.2.3-3 */ #ifndef _RTE_MBUF_H_ @@ -60,7 +59,6 @@ */ #include - #include #include #include @@ -117,12 +115,26 @@ struct rte_ctrlmbuf { */ #define PKT_TX_OFFLOAD_MASK (PKT_TX_VLAN_PKT | PKT_TX_IP_CKSUM | PKT_TX_L4_MASK) -/* Compare mask for vlan_macip_lens, used for context build up */ +/** Offload features */ +union rte_vlan_macip { + uint32_t data; + struct { + uint16_t l3_len:9; /**< L3 (IP) Header Length. */ + uint16_t l2_len:7; /**< L2 (MAC) Header Length. */ + uint16_t vlan_tci; + /**< VLAN Tag Control Identifier (CPU order). */ + } f; +}; + +/* + * Compare mask for vlan_macip_len.data, + * should be in sync with rte_vlan_macip.f layout. + * */ #define TX_VLAN_CMP_MASK 0xFFFF0000 /**< VLAN length - 16-bits. */ #define TX_MAC_LEN_CMP_MASK 0x0000FE00 /**< MAC length - 7-bits. */ #define TX_IP_LEN_CMP_MASK 0x000001FF /**< IP length - 9-bits. */ -/** MAC+IP length. */ -#define TX_MACIP_LEN_CMP_MASK (TX_MAC_LEN_CMP_MASK | TX_IP_LEN_CMP_MASK) +/**< MAC+IP length. */ +#define TX_MACIP_LEN_CMP_MASK (TX_MAC_LEN_CMP_MASK | TX_IP_LEN_CMP_MASK) /** * A packet message buffer. @@ -139,9 +151,7 @@ struct rte_pktmbuf { uint32_t pkt_len; /**< Total pkt len: sum of all segment data_len. */ /* offload features */ - uint16_t vlan_tci; /**< VLAN Tag Control Identifier (CPU order). */ - uint16_t l2_len:7; /**< L2 (MAC) Header Length. */ - uint16_t l3_len:9; /**< L3 (IP) Header Length. */ + union rte_vlan_macip vlan_macip; union { uint32_t rss; /**< RSS hash result if RSS enabled */ struct { @@ -342,6 +352,8 @@ rte_mbuf_refcnt_set(struct rte_mbuf *m, uint16_t new_value) /** Mbuf prefetch */ #define RTE_MBUF_PREFETCH_TO_FREE(m) do { } while(0) +#define rte_mbuf_refcnt_set(m,v) do { } while(0) + #endif /* RTE_MBUF_SCATTER_GATHER */ @@ -543,9 +555,7 @@ static inline void rte_pktmbuf_reset(struct rte_mbuf *m) m->pkt.next = NULL; m->pkt.pkt_len = 0; - m->pkt.l2_len = 0; - m->pkt.l3_len = 0; - m->pkt.vlan_tci = 0; + m->pkt.vlan_macip.data = 0; m->pkt.nb_segs = 1; m->pkt.in_port = 0xff;