doc: add Meson coding style to contributors guide
[dpdk.git] / lib / librte_mbuf / rte_mbuf_core.h
index 8f631b8..c17dc95 100644 (file)
@@ -17,8 +17,9 @@
  */
 
 #include <stdint.h>
+
 #include <rte_compat.h>
-#include <generic/rte_atomic.h>
+#include <rte_byteorder.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -72,8 +73,17 @@ extern "C" {
  */
 #define PKT_RX_IP_CKSUM_BAD  (1ULL << 4)
 
- /** External IP header checksum error. */
-#define PKT_RX_EIP_CKSUM_BAD (1ULL << 5)
+/**
+ * This flag is set when the outermost IP header checksum is detected as
+ * wrong by the hardware.
+ */
+#define PKT_RX_OUTER_IP_CKSUM_BAD (1ULL << 5)
+
+/**
+ * Deprecated.
+ * This flag has been renamed, use PKT_RX_OUTER_IP_CKSUM_BAD instead.
+ */
+#define PKT_RX_EIP_CKSUM_BAD PKT_RX_OUTER_IP_CKSUM_BAD
 
 /**
  * A vlan has been stripped by the hardware and its tci is saved in
@@ -149,10 +159,7 @@ extern "C" {
  */
 #define PKT_RX_LRO           (1ULL << 16)
 
-/**
- * Indicate that the timestamp field in the mbuf is valid.
- */
-#define PKT_RX_TIMESTAMP     (1ULL << 17)
+/* There is no flag defined at offset 17. It is free for any future use. */
 
 /**
  * Indicate that security offload processing was applied on the RX packet.
@@ -279,7 +286,7 @@ extern "C" {
  * mbuf 'vlan_tci' & 'vlan_tci_outer' must be valid when this flag is set.
  */
 #define PKT_TX_QINQ        (1ULL << 49)
-/* this old name is deprecated */
+/** This old name is deprecated. */
 #define PKT_TX_QINQ_PKT    PKT_TX_QINQ
 
 /**
@@ -495,8 +502,7 @@ struct rte_mbuf {
         * It should only be accessed using the following functions:
         * rte_mbuf_refcnt_update(), rte_mbuf_refcnt_read(), and
         * rte_mbuf_refcnt_set(). The functionality of these functions (atomic,
-        * or non-atomic) is controlled by the CONFIG_RTE_MBUF_REFCNT_ATOMIC
-        * config option.
+        * or non-atomic) is controlled by the RTE_MBUF_REFCNT_ATOMIC flag.
         */
        uint16_t refcnt;
        uint16_t nb_segs;         /**< Number of segments. */
@@ -590,23 +596,11 @@ struct rte_mbuf {
 
        uint16_t buf_len;         /**< Length of segment buffer. */
 
-       /** 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;
+       struct rte_mempool *pool; /**< Pool from which mbuf was allocated. */
 
        /* second cache line - fields only used in slow path or on TX */
        RTE_MARKER cacheline1 __rte_cache_min_aligned;
 
-       RTE_STD_C11
-       union {
-               void *userdata;   /**< Can be used for external metadata */
-               uint64_t udata64; /**< Allow 8-byte userdata on 32-bit */
-       };
-
-       struct rte_mempool *pool; /**< Pool from which mbuf was allocated. */
        struct rte_mbuf *next;    /**< Next segment of scattered packet. */
 
        /* fields to support TX offloads */
@@ -647,6 +641,11 @@ struct rte_mbuf {
                };
        };
 
+       /** Shared data for external buffer attached to mbuf. See
+        * rte_pktmbuf_attach_extbuf().
+        */
+       struct rte_mbuf_ext_shared_info *shinfo;
+
        /** Size of the application private data. In case of an indirect
         * mbuf, it stores the direct mbuf private data size.
         */
@@ -655,15 +654,7 @@ struct rte_mbuf {
        /** Timesync flags for use with IEEE1588. */
        uint16_t timesync;
 
-       /** Sequence number. See also rte_reorder_insert(). */
-       uint32_t seqn;
-
-       /** Shared data for external buffer attached to mbuf. See
-        * rte_pktmbuf_attach_extbuf().
-        */
-       struct rte_mbuf_ext_shared_info *shinfo;
-
-       uint64_t dynfield1[2]; /**< Reserved for dynamic fields. */
+       uint32_t dynfield1[9]; /**< Reserved for dynamic fields. */
 } __rte_cache_aligned;
 
 /**
@@ -680,7 +671,7 @@ struct rte_mbuf_ext_shared_info {
        uint16_t refcnt;
 };
 
-/**< Maximum number of nb_segs allowed. */
+/** Maximum number of nb_segs allowed. */
 #define RTE_MBUF_MAX_NB_SEGS   UINT16_MAX
 
 /**
@@ -708,7 +699,10 @@ struct rte_mbuf_ext_shared_info {
 #define RTE_MBUF_DIRECT(mb) \
        (!((mb)->ol_flags & (IND_ATTACHED_MBUF | EXT_ATTACHED_MBUF)))
 
-#define MBUF_INVALID_PORT UINT16_MAX
+/** Uninitialized or unspecified port. */
+#define RTE_MBUF_PORT_INVALID UINT16_MAX
+/** For backwards compatibility. */
+#define MBUF_INVALID_PORT RTE_MBUF_PORT_INVALID
 
 /**
  * A macro that points to an offset into the data in the mbuf.