From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id E256BA0526;
	Mon, 20 Jan 2020 18:23:40 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 196B41C0DC;
	Mon, 20 Jan 2020 18:23:35 +0100 (CET)
Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])
 by dpdk.org (Postfix) with ESMTP id 3EEAD1C11C
 for <dev@dpdk.org>; Mon, 20 Jan 2020 18:23:33 +0100 (CET)
Received: from Internal Mail-Server by MTLPINE1 (envelope-from
 viacheslavo@mellanox.com)
 with ESMTPS (AES256-SHA encrypted); 20 Jan 2020 19:23:29 +0200
Received: from pegasus11.mtr.labs.mlnx (pegasus11.mtr.labs.mlnx
 [10.210.16.104])
 by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 00KHNTnH011351;
 Mon, 20 Jan 2020 19:23:29 +0200
Received: from pegasus11.mtr.labs.mlnx (localhost [127.0.0.1])
 by pegasus11.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id 00KHNTr3002505;
 Mon, 20 Jan 2020 17:23:29 GMT
Received: (from viacheslavo@localhost)
 by pegasus11.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id 00KHNTZL002504;
 Mon, 20 Jan 2020 17:23:29 GMT
X-Authentication-Warning: pegasus11.mtr.labs.mlnx: viacheslavo set sender to
 viacheslavo@mellanox.com using -f
From: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
To: dev@dpdk.org
Cc: matan@mellanox.com, rasland@mellanox.com, orika@mellanox.com,
 shahafs@mellanox.com, olivier.matz@6wind.com,
 stephen@networkplumber.org, thomas@mellanox.net
Date: Mon, 20 Jan 2020 17:23:19 +0000
Message-Id: <1579541003-2399-2-git-send-email-viacheslavo@mellanox.com>
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1579541003-2399-1-git-send-email-viacheslavo@mellanox.com>
References: <20191118094938.192850-1-shahafs@mellanox.com>
 <1579541003-2399-1-git-send-email-viacheslavo@mellanox.com>
Subject: [dpdk-dev] [PATCH v5 1/5] mbuf: introduce routine to get private
	mbuf pool flags
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

The routine rte_pktmbuf_priv_flags is introduced to fetch
the flags from the mbuf memory pool private structure
in unified fashion.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 lib/librte_mbuf/rte_mbuf.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 2d4bda2..9b0691d 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -306,6 +306,23 @@ struct rte_pktmbuf_pool_private {
 	uint32_t flags; /**< reserved for future use. */
 };
 
+/**
+ * Return the flags from private data in an mempool structure.
+ *
+ * @param mp
+ *   A pointer to the mempool structure.
+ * @return
+ *   The flags from the private data structure.
+ */
+static inline uint32_t
+rte_pktmbuf_priv_flags(struct rte_mempool *mp)
+{
+	struct rte_pktmbuf_pool_private *mbp_priv;
+
+	mbp_priv = (struct rte_pktmbuf_pool_private *)rte_mempool_get_priv(mp);
+	return mbp_priv->flags;
+}
+
 #ifdef RTE_LIBRTE_MBUF_DEBUG
 
 /**  check mbuf type in debug mode */
-- 
1.8.3.1