DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nipun Gupta <nipun.gupta@nxp.com>
To: shreyansh.jain@nxp.com, thomas@monjalon.net, hemant.agrawal@nxp.com
Cc: dev@dpdk.org, Nipun Gupta <nipun.gupta@nxp.com>
Subject: [dpdk-dev] [PATCH 1/7 v3] mempool/dpaa2: add functions exposed to DPDK applications
Date: Thu, 26 Apr 2018 15:44:50 +0530	[thread overview]
Message-ID: <1524737696-3145-2-git-send-email-nipun.gupta@nxp.com> (raw)
In-Reply-To: <1524737696-3145-1-git-send-email-nipun.gupta@nxp.com>

There are two API's which are required by NXP specific Command Interface
Application (AIOP CMDIF). This patch exposes these two API's.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 doc/api/doxy-api-index.md                          |  1 +
 doc/api/doxy-api.conf                              |  1 +
 drivers/mempool/dpaa2/Makefile                     |  2 +
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c           | 30 ++++++++++++
 drivers/mempool/dpaa2/rte_dpaa2_mempool.h          | 53 ++++++++++++++++++++++
 .../mempool/dpaa2/rte_mempool_dpaa2_version.map    |  8 ++++
 6 files changed, 95 insertions(+)
 create mode 100644 drivers/mempool/dpaa2/rte_dpaa2_mempool.h

diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
index 437d903..12d3e5c 100644
--- a/doc/api/doxy-api-index.md
+++ b/doc/api/doxy-api-index.md
@@ -38,6 +38,7 @@ The public API headers are grouped by topics:
   [i40e]               (@ref rte_pmd_i40e.h),
   [bnxt]               (@ref rte_pmd_bnxt.h),
   [dpaa]               (@ref rte_pmd_dpaa.h),
+  [dpaa2]              (@ref rte_dpaa2_mempool.h),
   [dpaa2_qdma]         (@ref rte_pmd_dpaa2_qdma.h),
   [crypto_scheduler]   (@ref rte_cryptodev_scheduler.h)
 
diff --git a/doc/api/doxy-api.conf b/doc/api/doxy-api.conf
index 18a7ed4..0ab164f 100644
--- a/doc/api/doxy-api.conf
+++ b/doc/api/doxy-api.conf
@@ -31,6 +31,7 @@
 PROJECT_NAME            = DPDK
 INPUT                   = doc/api/doxy-api-index.md \
                           drivers/crypto/scheduler \
+                          drivers/mempool/dpaa2 \
                           drivers/net/bnxt \
                           drivers/net/bonding \
                           drivers/net/dpaa \
diff --git a/drivers/mempool/dpaa2/Makefile b/drivers/mempool/dpaa2/Makefile
index 5125ad1..9e4c87d 100644
--- a/drivers/mempool/dpaa2/Makefile
+++ b/drivers/mempool/dpaa2/Makefile
@@ -31,4 +31,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL) += dpaa2_hw_mempool.c
 LDLIBS += -lrte_bus_fslmc
 LDLIBS += -lrte_eal -lrte_mempool -lrte_ring
 
+SYMLINK-$(CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL)-include := rte_dpaa2_mempool.h
+
 include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index ce7a4c5..3c603f5 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -21,6 +21,7 @@
 #include <rte_cycles.h>
 #include <rte_kvargs.h>
 #include <rte_dev.h>
+#include "rte_dpaa2_mempool.h"
 
 #include <fslmc_logs.h>
 #include <mc/fsl_dpbp.h>
@@ -237,6 +238,35 @@
 	}
 }
 
+uint16_t
+rte_dpaa2_mbuf_pool_bpid(struct rte_mempool *mp)
+{
+	struct dpaa2_bp_info *bp_info;
+
+	bp_info = mempool_to_bpinfo(mp);
+	if (!(bp_info->bp_list)) {
+		RTE_LOG(ERR, PMD, "DPAA2 buffer pool not configured\n");
+		return -ENOMEM;
+	}
+
+	return bp_info->bpid;
+}
+
+struct rte_mbuf *
+rte_dpaa2_mbuf_from_buf_addr(struct rte_mempool *mp, void *buf_addr)
+{
+	struct dpaa2_bp_info *bp_info;
+
+	bp_info = mempool_to_bpinfo(mp);
+	if (!(bp_info->bp_list)) {
+		RTE_LOG(ERR, PMD, "DPAA2 buffer pool not configured\n");
+		return NULL;
+	}
+
+	return (struct rte_mbuf *)((uint8_t *)buf_addr -
+			bp_info->meta_data_size);
+}
+
 int
 rte_dpaa2_mbuf_alloc_bulk(struct rte_mempool *pool,
 			  void **obj_table, unsigned int count)
diff --git a/drivers/mempool/dpaa2/rte_dpaa2_mempool.h b/drivers/mempool/dpaa2/rte_dpaa2_mempool.h
new file mode 100644
index 0000000..4a22b7c
--- /dev/null
+++ b/drivers/mempool/dpaa2/rte_dpaa2_mempool.h
@@ -0,0 +1,53 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2018 NXP
+ */
+
+#ifndef __RTE_DPAA2_MEMPOOL_H__
+#define __RTE_DPAA2_MEMPOOL_H__
+
+/**
+ * @file
+ *
+ * NXP specific mempool related functions.
+ *
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <rte_mempool.h>
+
+/**
+ * Get BPID corresponding to the packet pool
+ *
+ * @param mp
+ *   memory pool
+ *
+ * @return
+ *   BPID of the buffer pool
+ */
+uint16_t
+rte_dpaa2_mbuf_pool_bpid(struct rte_mempool *mp);
+
+/**
+ * Get MBUF from the corresponding 'buf_addr'
+ *
+ * @param mp
+ *   memory pool
+ * @param buf_addr
+ *   The 'buf_addr' of the mbuf. This is the start buffer address
+ *   of the packet buffer (mbuf).
+ *
+ * @return
+ *   - MBUF pointer for success
+ *   - NULL in case of error
+ */
+struct rte_mbuf *
+rte_dpaa2_mbuf_from_buf_addr(struct rte_mempool *mp, void *buf_addr);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __RTE_DPAA2_MEMPOOL_H__ */
diff --git a/drivers/mempool/dpaa2/rte_mempool_dpaa2_version.map b/drivers/mempool/dpaa2/rte_mempool_dpaa2_version.map
index a8aa685..b45e7a9 100644
--- a/drivers/mempool/dpaa2/rte_mempool_dpaa2_version.map
+++ b/drivers/mempool/dpaa2/rte_mempool_dpaa2_version.map
@@ -6,3 +6,11 @@ DPDK_17.05 {
 
 	local: *;
 };
+
+DPDK_18.05 {
+	global:
+
+	rte_dpaa2_mbuf_from_buf_addr;
+	rte_dpaa2_mbuf_pool_bpid;
+
+} DPDK_17.05;
-- 
1.9.1

  reply	other threads:[~2018-04-26 10:15 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-22  9:34 [dpdk-dev] [PATCH 0/9] Introduce DPAA2 Command Interface raw driver Nipun Gupta
2018-02-22  9:34 ` [dpdk-dev] [PATCH 1/9] mempool/dpaa2: add functions exposed to DPDK applications Nipun Gupta
2018-02-22  9:34 ` [dpdk-dev] [PATCH 2/9] bus/fslmc: expose API to free dpci device Nipun Gupta
2018-02-22  9:34 ` [dpdk-dev] [PATCH 3/9] bus/fslmc: keep Tx queues information for DPCI devices too Nipun Gupta
2018-02-22  9:34 ` [dpdk-dev] [PATCH 4/9] bus/fslmc: add preprocessors to get flc and frc from fd Nipun Gupta
2018-02-22  9:34 ` [dpdk-dev] [PATCH 5/9] raw/dpaa2_cmdif: introduce DPAA2 command interface driver Nipun Gupta
2018-02-22 13:12   ` Shreyansh Jain
2018-02-23  6:35     ` Nipun Gupta
2018-02-22 14:31   ` Jerin Jacob
2018-02-23  6:35     ` Nipun Gupta
2018-02-22  9:34 ` [dpdk-dev] [PATCH 6/9] raw/dpaa2_cmdif: add attribute get functionality Nipun Gupta
2018-02-22  9:34 ` [dpdk-dev] [PATCH 7/9] raw/dpaa2_cmdif: support enqueue dequeue operations Nipun Gupta
2018-02-22  9:34 ` [dpdk-dev] [PATCH 8/9] doc: add DPAA2 CMDIF rawdev guide Nipun Gupta
2018-02-22  9:34 ` [dpdk-dev] [PATCH 9/9] doc: add dpaa2 command interface rawdev to release notes Nipun Gupta
2018-04-07 14:33 ` [dpdk-dev] [PATCH v2 0/9] Introduce DPAA2 Command Interface raw driver Nipun Gupta
2018-04-07 14:33   ` [dpdk-dev] [PATCH v2 1/9] mempool/dpaa2: add functions exposed to DPDK applications Nipun Gupta
2018-04-07 14:33   ` [dpdk-dev] [PATCH v2 2/9] bus/fslmc: expose API to free dpci device Nipun Gupta
2018-04-07 14:33   ` [dpdk-dev] [PATCH v2 3/9] bus/fslmc: keep Tx queues information for DPCI devices too Nipun Gupta
2018-04-25  1:47     ` Shreyansh Jain
2018-04-25  3:53     ` Shreyansh Jain
2018-04-07 14:34   ` [dpdk-dev] [PATCH v2 4/9] bus/fslmc: add preprocessors to get flc and frc from fd Nipun Gupta
2018-04-07 14:34   ` [dpdk-dev] [PATCH v2 5/9] raw/dpaa2_cmdif: introduce DPAA2 command interface driver Nipun Gupta
2018-04-25  4:18     ` Shreyansh Jain
2018-04-07 14:34   ` [dpdk-dev] [PATCH v2 6/9] raw/dpaa2_cmdif: add attribute get functionality Nipun Gupta
2018-04-07 14:34   ` [dpdk-dev] [PATCH v2 7/9] raw/dpaa2_cmdif: support enqueue dequeue operations Nipun Gupta
2018-04-07 14:34   ` [dpdk-dev] [PATCH v2 8/9] doc: add DPAA2 CMDIF rawdev guide Nipun Gupta
2018-04-16 12:40     ` Hemant Agrawal
2018-04-07 14:34   ` [dpdk-dev] [PATCH v2 9/9] doc: add dpaa2 command interface rawdev to release notes Nipun Gupta
2018-04-23 12:23     ` Kovacevic, Marko
2018-04-25  1:50     ` Shreyansh Jain
2018-04-07 14:43   ` [dpdk-dev] [PATCH v2 0/9] Introduce DPAA2 Command Interface raw driver Nipun Gupta
2018-04-26 10:14   ` [dpdk-dev] [PATCH 0/7 v3] " Nipun Gupta
2018-04-26 10:14     ` Nipun Gupta [this message]
2018-04-26 10:14     ` [dpdk-dev] [PATCH 2/7 v3] bus/fslmc: expose API to free dpci device Nipun Gupta
2018-05-01  9:45       ` Shreyansh Jain
2018-04-26 10:14     ` [dpdk-dev] [PATCH 3/7 v3] bus/fslmc: keep Tx queues information for DPCI devices too Nipun Gupta
2018-04-26 10:14     ` [dpdk-dev] [PATCH 4/7 v3] raw/dpaa2_cmdif: introduce DPAA2 command interface driver Nipun Gupta
2018-04-26 10:14     ` [dpdk-dev] [PATCH 5/7 v3] raw/dpaa2_cmdif: add attribute get functionality Nipun Gupta
2018-04-26 10:14     ` [dpdk-dev] [PATCH 6/7 v3] raw/dpaa2_cmdif: support enqueue dequeue operations Nipun Gupta
2018-04-26 10:14     ` [dpdk-dev] [PATCH 7/7 v3] doc: add DPAA2 CMDIF rawdev guide Nipun Gupta
2018-05-01  9:45     ` [dpdk-dev] [PATCH 0/7 v3] Introduce DPAA2 Command Interface raw driver Shreyansh Jain
2018-05-02 17:15     ` [dpdk-dev] [PATCH v4 0/7] " Nipun Gupta
2018-05-02 17:15       ` [dpdk-dev] [PATCH v4 1/7] mempool/dpaa2: add functions exposed to DPDK applications Nipun Gupta
2018-05-03 13:49         ` Shreyansh Jain
2018-05-02 17:15       ` [dpdk-dev] [PATCH v4 2/7] bus/fslmc: expose API to free dpci device Nipun Gupta
2018-05-02 17:15       ` [dpdk-dev] [PATCH v4 3/7] bus/fslmc: keep Tx queues information for DPCI devices too Nipun Gupta
2018-05-02 17:15       ` [dpdk-dev] [PATCH v4 4/7] raw/dpaa2_cmdif: introduce DPAA2 command interface driver Nipun Gupta
2018-05-03 14:10         ` Shreyansh Jain
2018-05-02 17:15       ` [dpdk-dev] [PATCH v4 5/7] raw/dpaa2_cmdif: add attribute get functionality Nipun Gupta
2018-05-02 17:15       ` [dpdk-dev] [PATCH v4 6/7] raw/dpaa2_cmdif: support enqueue dequeue operations Nipun Gupta
2018-05-02 17:15       ` [dpdk-dev] [PATCH v4 7/7] doc: add DPAA2 CMDIF rawdev guide Nipun Gupta
2018-05-03 16:33       ` [dpdk-dev] [PATCH v5 0/7] Introduce DPAA2 Command Interface raw driver Nipun Gupta
2018-05-03 16:33         ` [dpdk-dev] [PATCH v5 1/7] mempool/dpaa2: add functions exposed to DPDK applications Nipun Gupta
2018-05-03 16:33         ` [dpdk-dev] [PATCH v5 2/7] bus/fslmc: expose API to free dpci device Nipun Gupta
2018-05-03 16:33         ` [dpdk-dev] [PATCH v5 3/7] bus/fslmc: keep Tx queues information for DPCI devices too Nipun Gupta
2018-05-03 16:33         ` [dpdk-dev] [PATCH v5 4/7] raw/dpaa2_cmdif: introduce DPAA2 command interface driver Nipun Gupta
2018-05-03 16:33         ` [dpdk-dev] [PATCH v5 5/7] raw/dpaa2_cmdif: add attribute get functionality Nipun Gupta
2018-05-03 16:33         ` [dpdk-dev] [PATCH v5 6/7] raw/dpaa2_cmdif: support enqueue dequeue operations Nipun Gupta
2018-05-03 16:33         ` [dpdk-dev] [PATCH v5 7/7] doc: add DPAA2 CMDIF rawdev guide Nipun Gupta
2018-05-04  7:15         ` [dpdk-dev] [PATCH v5 0/7] Introduce DPAA2 Command Interface raw driver Nipun Gupta
2018-05-04 10:11         ` [dpdk-dev] [PATCH v6 " Nipun Gupta
2018-05-04 10:11           ` [dpdk-dev] [PATCH v6 1/7] mempool/dpaa2: add functions exposed to DPDK applications Nipun Gupta
2018-05-04 10:11           ` [dpdk-dev] [PATCH v6 2/7] bus/fslmc: expose API to free dpci device Nipun Gupta
2018-05-04 10:11           ` [dpdk-dev] [PATCH v6 3/7] bus/fslmc: keep Tx queues information for DPCI devices too Nipun Gupta
2018-05-04 10:11           ` [dpdk-dev] [PATCH v6 4/7] raw/dpaa2_cmdif: introduce DPAA2 command interface driver Nipun Gupta
2018-05-04 10:11           ` [dpdk-dev] [PATCH v6 5/7] raw/dpaa2_cmdif: add attribute get functionality Nipun Gupta
2018-05-04 10:11           ` [dpdk-dev] [PATCH v6 6/7] raw/dpaa2_cmdif: support enqueue dequeue operations Nipun Gupta
2018-05-04 10:11           ` [dpdk-dev] [PATCH v6 7/7] doc: add DPAA2 CMDIF rawdev guide Nipun Gupta
2018-05-08 12:08             ` Thomas Monjalon
2018-05-05 18:44           ` [dpdk-dev] [PATCH v6 0/7] Introduce DPAA2 Command Interface raw driver Shreyansh Jain
2018-05-08 12:27             ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1524737696-3145-2-git-send-email-nipun.gupta@nxp.com \
    --to=nipun.gupta@nxp.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=shreyansh.jain@nxp.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).