From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id CAE48B3B7 for ; Thu, 11 Sep 2014 15:11:34 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 11 Sep 2014 06:16:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,505,1406617200"; d="scan'208";a="598051486" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 11 Sep 2014 06:15:51 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s8BDFnUS002158; Thu, 11 Sep 2014 14:15:50 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id s8BDFn9o023682; Thu, 11 Sep 2014 14:15:49 +0100 Received: (from bricha3@localhost) by sivswdev02.ir.intel.com with id s8BDFnIo023678; Thu, 11 Sep 2014 14:15:49 +0100 From: Bruce Richardson To: dev@dpdk.org Date: Thu, 11 Sep 2014 14:15:45 +0100 Message-Id: <1410441347-22840-12-git-send-email-bruce.richardson@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1410441347-22840-1-git-send-email-bruce.richardson@intel.com> References: <1409759378-10113-1-git-send-email-bruce.richardson@intel.com> <1410441347-22840-1-git-send-email-bruce.richardson@intel.com> Subject: [dpdk-dev] [PATCH v2 11/13] mbuf: move l2_len and l3_len to second cache line X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Sep 2014 13:11:35 -0000 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. Updates in V2: * The l2 and l3 lengths can be accessed as a single uint16_t for performance, as well as individually. Signed-off-by: Bruce Richardson --- lib/librte_mbuf/rte_mbuf.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 508021b..1c6e115 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -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; /** -- 1.9.3