]> git.droids-corp.org - dpdk.git/commitdiff
mbuf: move l2_len and l3_len to second cache line
authorBruce Richardson <bruce.richardson@intel.com>
Thu, 11 Sep 2014 13:15:45 +0000 (14:15 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 17 Sep 2014 16:57:29 +0000 (18:57 +0200)
The l2_len and l3_len fields are used for TX offloads and so should be
put on the second cache line, along with the other fields only used on
TX.

The l2 and l3 lengths can be accessed as a single uint16_t for
performance, as well as individually.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
lib/librte_mbuf/rte_mbuf.h

index 508021bd908bdef57db01d160bc59be5505b85fd..1c6e11507aad1e4dedf81221aa52a14647ee9382 100644 (file)
@@ -159,13 +159,7 @@ struct rte_mbuf {
        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 {
-                       uint16_t l3_len:9;      /**< L3 (IP) Header Length. */
-                       uint16_t l2_len:7;      /**< L2 (MAC) Header Length. */
-               };
-       };
+       uint16_t reserved;
        uint16_t vlan_tci;        /**< VLAN Tag Control Identifier (CPU order) */
        union {
                uint32_t rss;     /**< RSS hash result if RSS enabled */
@@ -181,6 +175,14 @@ struct rte_mbuf {
        struct rte_mempool *pool; /**< Pool from which mbuf was allocated. */
        struct rte_mbuf *next;    /**< Next segment of scattered packet. */
 
+       /* fields to support TX offloads */
+       union {
+               uint16_t l2_l3_len; /**< combined l2/l3 lengths as single var */
+               struct {
+                       uint16_t l3_len:9;      /**< L3 (IP) Header Length. */
+                       uint16_t l2_len:7;      /**< L2 (MAC) Header Length. */
+               };
+       };
 } __rte_cache_aligned;
 
 /**