* Padding is necessary to assure the offsets of these fields
*/
struct rte_kni_mbuf {
- void *pool;
void *buf_addr;
- char pad0[16];
- void *next;
+ char pad0[10];
uint16_t data_off; /**< Start address of data in segment buffer. */
+ char pad1[4];
+ uint16_t ol_flags; /**< Offload features. */
+ char pad2[8];
uint16_t data_len; /**< Amount of data in segment buffer. */
uint32_t pkt_len; /**< Total pkt len: sum of all segment data_len. */
- char pad2[4];
- uint16_t ol_flags; /**< Offload features. */
+ char pad3[8];
+ void *pool;
+ void *next;
} __attribute__((__aligned__(64)));
/*
* The generic rte_mbuf, containing a packet mbuf.
*/
struct rte_mbuf {
- struct rte_mempool *pool; /**< Pool from which mbuf was allocated. */
void *buf_addr; /**< Virtual address of segment buffer. */
phys_addr_t buf_physaddr; /**< Physical address of segment buffer. */
- uint16_t buf_len; /**< Length of segment buffer. */
- /* valid for any segment */
- struct rte_mbuf *next; /**< Next segment of scattered packet. */
+ /* next 8 bytes are initialised on RX descriptor rearm */
+ uint16_t buf_len; /**< Length of segment buffer. */
uint16_t data_off;
- uint16_t data_len; /**< Amount of data in segment buffer. */
- uint32_t pkt_len; /**< Total pkt len: sum of all segments. */
#ifdef RTE_MBUF_REFCNT
/**
#else
uint16_t refcnt_reserved; /**< Do not use this field */
#endif
- uint16_t reserved; /**< Unused field. Required for padding */
- uint16_t ol_flags; /**< Offload features. */
-
- /* these fields are valid for first segment only */
uint8_t nb_segs; /**< Number of segments. */
uint8_t port; /**< Input port. */
- /* offload features, valid for first segment only */
+ uint16_t ol_flags; /**< Offload features. */
+ uint16_t reserved0; /**< Unused field. Required for padding */
+ uint32_t reserved1; /**< Unused field. Required for padding */
+
+ /* remaining bytes are set on RX when pulling packet from descriptor */
+ uint16_t reserved2; /**< Unused field. Required for padding */
+ uint16_t data_len; /**< Amount of data in segment buffer. */
+ uint32_t pkt_len; /**< Total pkt len: sum of all segments. */
union {
uint16_t l2_l3_len; /**< combined l2/l3 lengths as single var */
struct {
uint32_t sched; /**< Hierarchical scheduler */
} hash; /**< hash information */
+ /* fields only used in slow path or on TX */
+ struct rte_mempool *pool; /**< Pool from which mbuf was allocated. */
+ struct rte_mbuf *next; /**< Next segment of scattered packet. */
+
union {
uint8_t metadata[0];
uint16_t metadata16[0];