From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: [PATCH 11/13] mbuf: move l2_len and l3_len to second cache line Date: Wed, 3 Sep 2014 16:49:36 +0100 Message-ID: <1409759378-10113-12-git-send-email-bruce.richardson@intel.com> References: <1409759378-10113-1-git-send-email-bruce.richardson@intel.com> To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1409759378-10113-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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. Signed-off-by: Bruce Richardson --- lib/librte_mbuf/rte_mbuf.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index db079ac..d3c1745 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -159,8 +159,7 @@ struct rte_mbuf { uint16_t packet_type; /**< Type of packet, e.g. protocols used */ uint16_t data_len; /**< Amount of data in segment buffer. */ uint32_t pkt_len; /**< Total pkt len: sum of all segments. */ - 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 */ @@ -176,6 +175,9 @@ 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 */ + uint16_t l3_len:9; /**< L3 (IP) Header Length. */ + uint16_t l2_len:7; /**< L2 (MAC) Header Length. */ } __rte_cache_aligned; #define RTE_MBUF_METADATA_UINT8(mbuf, offset) \ -- 1.9.3