X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Flibrte_mbuf%2Frte_mbuf.h;h=98225ec80bf1ca33f90e5fe9d0d18f0c8a0d9a4a;hb=201960437d30008876c0539e6e2abbf73b171929;hp=e4c2da6ee655444ce358ceebe147be2ec6331bce;hpb=8bd5f07c7a1ac0c5b8d16758efc3ada3e16b0adc;p=dpdk.git diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index e4c2da6ee6..98225ec80b 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -668,6 +668,8 @@ struct rte_mbuf { /** Valid if PKT_RX_TIMESTAMP is set. The unit and time reference * are not normalized but are always the same for a given port. + * Some devices allow to query rte_eth_read_clock that will return the + * current device timestamp. */ uint64_t timestamp; @@ -700,7 +702,18 @@ struct rte_mbuf { uint64_t tso_segsz:RTE_MBUF_TSO_SEGSZ_BITS; /**< TCP TSO segment size */ - /* fields for TX offloading of tunnels */ + /* + * Fields for Tx offloading of tunnels. + * These are undefined for packets which don't request + * any tunnel offloads (outer IP or UDP checksum, + * tunnel TSO). + * + * PMDs should not use these fields unconditionally + * when calculating offsets. + * + * Applications are expected to set appropriate tunnel + * offload flags when they fill in these fields. + */ uint64_t outer_l3_len:RTE_MBUF_OUTL3_LEN_BITS; /**< Outer L3 (IP) Hdr Length. */ uint64_t outer_l2_len:RTE_MBUF_OUTL2_LEN_BITS; @@ -864,7 +877,8 @@ rte_mbuf_from_indirect(struct rte_mbuf *mi) * @return * The pointer of the mbuf buffer. */ -static inline char * __rte_experimental +__rte_experimental +static inline char * rte_mbuf_buf_addr(struct rte_mbuf *mb, struct rte_mempool *mp) { return (char *)mb + sizeof(*mb) + rte_pktmbuf_priv_size(mp); @@ -881,10 +895,18 @@ rte_mbuf_buf_addr(struct rte_mbuf *mb, struct rte_mempool *mp) * @return * The pointer of the beginning of the mbuf data. */ -static inline char * __rte_experimental -rte_mbuf_data_addr_default(struct rte_mbuf *mb) +__rte_experimental +static inline char * +rte_mbuf_data_addr_default(__rte_unused struct rte_mbuf *mb) { + /* gcc complains about calling this experimental function even + * when not using it. Hide it with ALLOW_EXPERIMENTAL_API. + */ +#ifdef ALLOW_EXPERIMENTAL_API return rte_mbuf_buf_addr(mb, mb->pool) + RTE_PKTMBUF_HEADROOM; +#else + return NULL; +#endif } /** @@ -924,7 +946,8 @@ rte_mbuf_to_baddr(struct rte_mbuf *md) * @return * The starting address of the private data area of the given mbuf. */ -static inline void * __rte_experimental +__rte_experimental +static inline void * rte_mbuf_to_priv(struct rte_mbuf *m) { return RTE_PTR_ADD(m, sizeof(struct rte_mbuf));