From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 2080968A7 for ; Thu, 11 Sep 2014 15:10:38 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 11 Sep 2014 06:07:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="384718631" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by FMSMGA003.fm.intel.com with ESMTP; 11 Sep 2014 06:10:43 -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 s8BDFnjg002152; Thu, 11 Sep 2014 14:15:49 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id s8BDFnWA023652; Thu, 11 Sep 2014 14:15:49 +0100 Received: (from bricha3@localhost) by sivswdev02.ir.intel.com with id s8BDFnD6023647; Thu, 11 Sep 2014 14:15:49 +0100 From: Bruce Richardson To: dev@dpdk.org Date: Thu, 11 Sep 2014 14:15:41 +0100 Message-Id: <1410441347-22840-8-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 07/13] mbuf: move metadata macros to rte_port library 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:10:39 -0000 The metadata macros are only used by libs and apps using the rte_port packet framework library, so move them to a header file there. Signed-off-by: Bruce Richardson --- lib/librte_mbuf/rte_mbuf.h | 18 ------------------ lib/librte_port/rte_port.h | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index f855e64..2f1bd4a 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -173,24 +173,6 @@ struct rte_mbuf { } __rte_cache_aligned; -#define RTE_MBUF_METADATA_UINT8(mbuf, offset) \ - (((uint8_t *)&(mbuf)[1])[offset]) -#define RTE_MBUF_METADATA_UINT16(mbuf, offset) \ - (((uint16_t *)&(mbuf)[1])[offset/sizeof(uint16_t)]) -#define RTE_MBUF_METADATA_UINT32(mbuf, offset) \ - (((uint32_t *)&(mbuf)[1])[offset/sizeof(uint32_t)]) -#define RTE_MBUF_METADATA_UINT64(mbuf, offset) \ - (((uint64_t *)&(mbuf)[1])[offset/sizeof(uint64_t)]) - -#define RTE_MBUF_METADATA_UINT8_PTR(mbuf, offset) \ - (&RTE_MBUF_METADATA_UINT8(mbuf, offset)) -#define RTE_MBUF_METADATA_UINT16_PTR(mbuf, offset) \ - (&RTE_MBUF_METADATA_UINT16(mbuf, offset)) -#define RTE_MBUF_METADATA_UINT32_PTR(mbuf, offset) \ - (&RTE_MBUF_METADATA_UINT32(mbuf, offset)) -#define RTE_MBUF_METADATA_UINT64_PTR(mbuf, offset) \ - (&RTE_MBUF_METADATA_UINT64(mbuf, offset)) - /** * Given the buf_addr returns the pointer to corresponding mbuf. */ diff --git a/lib/librte_port/rte_port.h b/lib/librte_port/rte_port.h index 1d763c2..6bd5039 100644 --- a/lib/librte_port/rte_port.h +++ b/lib/librte_port/rte_port.h @@ -50,6 +50,28 @@ extern "C" { #include #include +/** + * Macros to allow accessing metadata stored in the mbuf headroom + * just beyond the end of the mbuf data structure returned by a port + */ +#define RTE_MBUF_METADATA_UINT8(mbuf, offset) \ + (((uint8_t *)&(mbuf)[1])[offset]) +#define RTE_MBUF_METADATA_UINT16(mbuf, offset) \ + (((uint16_t *)&(mbuf)[1])[offset/sizeof(uint16_t)]) +#define RTE_MBUF_METADATA_UINT32(mbuf, offset) \ + (((uint32_t *)&(mbuf)[1])[offset/sizeof(uint32_t)]) +#define RTE_MBUF_METADATA_UINT64(mbuf, offset) \ + (((uint64_t *)&(mbuf)[1])[offset/sizeof(uint64_t)]) + +#define RTE_MBUF_METADATA_UINT8_PTR(mbuf, offset) \ + (&RTE_MBUF_METADATA_UINT8(mbuf, offset)) +#define RTE_MBUF_METADATA_UINT16_PTR(mbuf, offset) \ + (&RTE_MBUF_METADATA_UINT16(mbuf, offset)) +#define RTE_MBUF_METADATA_UINT32_PTR(mbuf, offset) \ + (&RTE_MBUF_METADATA_UINT32(mbuf, offset)) +#define RTE_MBUF_METADATA_UINT64_PTR(mbuf, offset) \ + (&RTE_MBUF_METADATA_UINT64(mbuf, offset)) + /* * Port IN * -- 1.9.3