X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_mbuf%2Frte_mbuf_core.h;h=8f631b84cf3134165ab38dcb1965df6fc355b46a;hb=4a91344b5e06081f8e2254266bb469489f6633d8;hp=b9a59c879c37d8b7ea1ab6138e8d4818c4261cb1;hpb=3e6181b0703816e1ae4c4c1100a782a9a0d79f91;p=dpdk.git diff --git a/lib/librte_mbuf/rte_mbuf_core.h b/lib/librte_mbuf/rte_mbuf_core.h index b9a59c879c..8f631b84cf 100644 --- a/lib/librte_mbuf/rte_mbuf_core.h +++ b/lib/librte_mbuf/rte_mbuf_core.h @@ -12,6 +12,8 @@ * packet offload flags and some related macros. * For majority of DPDK entities, it is not recommended to include * this file directly, use include instead. + * + * New fields and flags should fit in the "dynamic space". */ #include @@ -124,12 +126,19 @@ extern "C" { #define PKT_RX_FDIR_FLX (1ULL << 14) /** - * The 2 vlans have been stripped by the hardware and their tci are - * saved in mbuf->vlan_tci (inner) and mbuf->vlan_tci_outer (outer). - * This can only happen if vlan stripping is enabled in the RX + * The outer VLAN has been stripped by the hardware and its TCI is + * saved in mbuf->vlan_tci_outer. + * This can only happen if VLAN stripping is enabled in the Rx * configuration of the PMD. - * When PKT_RX_QINQ_STRIPPED is set, the flags (PKT_RX_VLAN | - * PKT_RX_VLAN_STRIPPED | PKT_RX_QINQ) must also be set. + * When PKT_RX_QINQ_STRIPPED is set, the flags PKT_RX_VLAN and PKT_RX_QINQ + * must also be set. + * + * - If both PKT_RX_QINQ_STRIPPED and PKT_RX_VLAN_STRIPPED are set, the 2 VLANs + * have been stripped by the hardware and their TCIs are saved in + * mbuf->vlan_tci (inner) and mbuf->vlan_tci_outer (outer). + * - If PKT_RX_QINQ_STRIPPED is set and PKT_RX_VLAN_STRIPPED is unset, only the + * outer VLAN is removed from packet data, but both tci are saved in + * mbuf->vlan_tci (inner) and mbuf->vlan_tci_outer (outer). */ #define PKT_RX_QINQ_STRIPPED (1ULL << 15) @@ -157,8 +166,8 @@ extern "C" { /** * The RX packet is a double VLAN, and the outer tci has been - * saved in in mbuf->vlan_tci_outer. If PKT_RX_QINQ set, PKT_RX_VLAN - * also should be set and inner tci should be saved to mbuf->vlan_tci. + * saved in mbuf->vlan_tci_outer. If this flag is set, PKT_RX_VLAN + * must also be set and the inner tci is saved in mbuf->vlan_tci. * If the flag PKT_RX_QINQ_STRIPPED is also present, both VLANs * headers have been stripped from mbuf data, else they are still * present. @@ -474,11 +483,7 @@ struct rte_mbuf { * same mbuf cacheline0 layout for 32-bit and 64-bit. This makes * working on vector drivers easier. */ - RTE_STD_C11 - union { - rte_iova_t buf_iova; - rte_iova_t buf_physaddr; /**< deprecated */ - } __rte_aligned(sizeof(rte_iova_t)); + rte_iova_t buf_iova __rte_aligned(sizeof(rte_iova_t)); /* next 8 bytes are initialised on RX descriptor rearm */ RTE_MARKER64 rearm_data; @@ -493,12 +498,7 @@ struct rte_mbuf { * or non-atomic) is controlled by the CONFIG_RTE_MBUF_REFCNT_ATOMIC * config option. */ - RTE_STD_C11 - union { - rte_atomic16_t refcnt_atomic; /**< Atomically accessed refcnt */ - /** Non-atomically accessed refcnt */ - uint16_t refcnt; - }; + uint16_t refcnt; uint16_t nb_segs; /**< Number of segments. */ /** Input port (16 bits to support more than 256 virtual ports). @@ -521,11 +521,12 @@ struct rte_mbuf { RTE_STD_C11 union { uint32_t packet_type; /**< L2/L3/L4 and tunnel information. */ + __extension__ struct { - uint32_t l2_type:4; /**< (Outer) L2 type. */ - uint32_t l3_type:4; /**< (Outer) L3 type. */ - uint32_t l4_type:4; /**< (Outer) L4 type. */ - uint32_t tun_type:4; /**< Tunnel type. */ + uint8_t l2_type:4; /**< (Outer) L2 type. */ + uint8_t l3_type:4; /**< (Outer) L3 type. */ + uint8_t l4_type:4; /**< (Outer) L4 type. */ + uint8_t tun_type:4; /**< Tunnel type. */ RTE_STD_C11 union { uint8_t inner_esp_next_proto; @@ -541,7 +542,7 @@ struct rte_mbuf { /**< Inner L3 type. */ }; }; - uint32_t inner_l4_type:4; /**< Inner L4 type. */ + uint8_t inner_l4_type:4; /**< Inner L4 type. */ }; }; @@ -676,7 +677,7 @@ typedef void (*rte_mbuf_extbuf_free_callback_t)(void *addr, void *opaque); struct rte_mbuf_ext_shared_info { rte_mbuf_extbuf_free_callback_t free_cb; /**< Free callback function */ void *fcb_opaque; /**< Free callback argument */ - rte_atomic16_t refcnt_atomic; /**< Atomically accessed refcnt */ + uint16_t refcnt; }; /**< Maximum number of nb_segs allowed. */