mbuf: use 2 bytes for port and nb segments
[dpdk.git] / lib / librte_mbuf / rte_mbuf.h
index 1efebec..323a1ac 100644 (file)
@@ -400,14 +400,13 @@ struct rte_mbuf {
        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. */
-
-       /* next 6 bytes are initialised on RX descriptor rearm */
-       MARKER8 rearm_data;
+       /* next 8 bytes are initialised on RX descriptor rearm */
+       MARKER64 rearm_data;
        uint16_t data_off;
 
        /**
-        * 16-bit Reference counter.
+        * Reference counter. Its size should at least equal to the size
+        * of port field (16 bits), to support zero-copy broadcast.
         * 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,
@@ -419,8 +418,10 @@ struct rte_mbuf {
                rte_atomic16_t refcnt_atomic; /**< Atomically accessed refcnt */
                uint16_t refcnt;              /**< Non-atomically accessed refcnt */
        };
-       uint8_t nb_segs;          /**< Number of segments. */
-       uint8_t port;             /**< Input port. */
+       uint16_t nb_segs;         /**< Number of segments. */
+
+       /** Input port (16 bits to support more than 256 virtual ports). */
+       uint16_t port;
 
        uint64_t ol_flags;        /**< Offload features. */
 
@@ -481,6 +482,7 @@ struct rte_mbuf {
        /** Outer VLAN TCI (CPU order), valid if PKT_RX_QINQ_STRIPPED is set. */
        uint16_t vlan_tci_outer;
 
+       uint16_t buf_len;         /**< Length of segment buffer. */
        /* second cache line - fields only used in slow path or on TX */
        MARKER cacheline1 __rte_cache_min_aligned;