From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0084.outbound.protection.outlook.com [104.47.2.84]) by dpdk.org (Postfix) with ESMTP id A814B2BAA for ; Thu, 3 May 2018 18:34:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=qUYCRUeEFshZjg/L0u+z4+WkLH/67q/323dlNrJHVeU=; b=QxnRdFhD2Xwo40ubMbZe5owHCCQCh8NN+XMlfdFmb5yxwAlStbGEaEmkj8fYIGTJuC/UWb44jb0435BvCpYLp59qzV7dQUQBYW8RJvYhDyVKRRCd4SJS9l/0ExXTcpi6I5GTG1LVe3bXTkeErvwFM+1ZDkj4KAfT10n+HHvgjC4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nipun.gupta@nxp.com; Received: from b27504-OptiPlex-790.ap.freescale.net (14.142.187.166) by HE1PR0401MB2425.eurprd04.prod.outlook.com (2603:10a6:3:25::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.715.18; Thu, 3 May 2018 16:34:16 +0000 From: Nipun Gupta To: thomas@monjalon.net, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com Cc: dev@dpdk.org, Nipun Gupta Date: Thu, 3 May 2018 22:03:47 +0530 Message-Id: <1525365233-5956-2-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1525365233-5956-1-git-send-email-nipun.gupta@nxp.com> References: <1525281329-27984-1-git-send-email-nipun.gupta@nxp.com> <1525365233-5956-1-git-send-email-nipun.gupta@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:d::33) To HE1PR0401MB2425.eurprd04.prod.outlook.com (2603:10a6:3:25::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:HE1PR0401MB2425; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0401MB2425; 3:3mWCE1BPK2URb20w1w1o4/EaAeNkiXwrh/4V8MHVh+1F6AVtoJvKh5o7FGS+vxRiPiTFprIIScIOgbjNVX+MlZd/YuaJKty9E0adSw0XHITxkjWW2xLmagld5K8tBsBgQx2+Clgb6eLXuHjywtyZTq36eBPFKfD8cYuLnCn69HogDjtb625x8AwsPYJnoO76A0zjXKd3ofgb4wTt6pQzxqCf16bnbn5mjPL1eVPwqeYmgkcOFXAzF4qjJoZOmvID; 25:5kZbE5FmDZeHIGeYgDm6JckO77x3+bdsbbrHSzQGA4kHFvbhTkLMK8mn4r1vcUMmkskfbpIcGhAi51ut7MQuQpa+lXAa6FQ7wPuwBZXu+wwZx7rZBlKtNvyc1qKWqN+PUK4YIvy537RsKwoUMwPsOxG5BF0uIFQTXP4WADnDalp2B6XcyLMu0faRe5g7ZnxJYHT5gryDsAneOsdgu92/zdTrn2d1OEc5u/1hP0+HlLGSYC3rl+QMieGjJ3VWblmqHE6RhXoqnhL9XLUq5UwFXQQNWyD8NTWfNhV7oM7pWIej71RfkCIs3/9qZERV1vJXRI6xBsTtCylf7TxMupNRBw==; 31:SXbxdd5fasgSaorOqZ4ryOmzDipA012/R4PJRXYfFwWe0Rk6lYtKB0B0qtGJGvBNAGW3IAPeBmcmV8bm3yUy1LZPLtxPUFiuidzFwgtGVRCuswtdZ9o3GytM9G8oeA7CTvcuAR7n43GjRrPyAbKIJJVklxrZxewN+urrcn63c0I4RFdPUxsemTlhZG5BAgZ/g8dGUCdFb8nDD14T8o8mIt/HC6K+dOdNvu9q+uYWr7c= X-MS-TrafficTypeDiagnostic: HE1PR0401MB2425: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0401MB2425; 20:Sd9dcon45inv0i6v1Nahf36uF6FWvJv5Ezf7nk38NMoQ1eFP9I1z7aEeROFD3W1kz4jcq8bRUbXgVdpGTc69VI8iXt4AE2oTbygsayZBnkXjSOs07ujTD4KB6BKcVIUW5OtQ6MIrq4FUBoiDyYjL/Y4AM18fymCyrOLtfOM3bzXWneaYpK7YSf+AVYauJQRqky/pus2SJjWMZMTJty/ne2ndnX148I2Whv8jZA8PXBivJ8CzAStnHOx1lO6ichfec38dFW+mlJD8ueYU3qzUhuH/IjCdgNnvdAvhQuQvxeovop1c0VbWdyzbFgoqwE+WIOsk6LQy1wSkoUb+ypkrPue1dSUWkhuhjN88VxXivEkd4h6pysb/f87wI22d7WH26waJS9hxjUVWltGgQ4Rn5h/qYDAhvIu7wG59TC5rIUGpH1097PtiS5Eerl4KOuf9h8WnJ2CO6FGoCauEfiWyJbr2vwdYGpFX/YYEbKXcFWWaxM5R7YuKHjEoi6ALYxyS; 4:dHjT6YruJgIm2joNAHbqFeN+sZmzKM+QUFIoCWkcKXCgSb4XvgWnOBm9E+b5zwuX3eYrong4g9GfndWWulgL5y3+HctKJ6i78W8n5/2Zdi73ke0BK7CfWacDaaAeBxpzkUv2K+mVQggkzqQbYw1kLOzFXK4AhPVCC8SoTCxzNmeNSI7LlCSDW6M1fwr8MfDMFprXmPQ0rYSdM3ytwjcPjdbCCE9zvNJwsLoCfjOgBuCiy7iXSyuMCE+cDFr+IhcMP4bLl4bv8elPcbKDUaVb3p0QxqVIigpOPlcj99tWQNAhlOrUkEHG3OdNxz10be4uwyOF/hbxOnEtjBmkhySwkJI7CzUYvj7WTQWYJ+lqsso= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397)(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231254)(944501410)(52105095)(10201501046)(3002001)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:HE1PR0401MB2425; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0401MB2425; X-Forefront-PRVS: 066153096A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(39380400002)(396003)(39860400002)(346002)(376002)(189003)(199004)(575784001)(86362001)(97736004)(6486002)(68736007)(478600001)(5009440100003)(316002)(16586007)(6512007)(5660300001)(4326008)(48376002)(106356001)(105586002)(53936002)(25786009)(8936002)(36756003)(81156014)(81166006)(47776003)(305945005)(8676002)(26005)(2906002)(66066001)(956004)(50226002)(7736002)(50466002)(6666003)(6636002)(11346002)(2616005)(386003)(6116002)(6506007)(186003)(55236004)(3846002)(76176011)(52116002)(486006)(16526019)(446003)(51416003)(44832011)(476003)(110426005)(31153001); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0401MB2425; H:b27504-OptiPlex-790.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0401MB2425; 23:gVoxobOUtL8a9hxmuPXIa1TRUWWJ6Hq1zhWpx7M?= =?us-ascii?Q?3LKHobyQ8E6ibf+XGLkNlnGP5LIbIwev90PAiZcTLeftT36eWPjQVrWpumB3?= =?us-ascii?Q?UAJdn9bgLii5o3zREjiKn6wGAd6Syf8igDZzPMQRf516ptkyN5ujDnTK1sr8?= =?us-ascii?Q?rkHz6aJyJCmD8kkPJwrZvgQpFXcx1HPTnOPk1ah0JoTPZ/PTsloTZcWDjkpN?= =?us-ascii?Q?tfdC8lAjl6E7Hqug7WE4pRq5/bhYu+374Ca1zGYAzdZCBfMxUUnGKcqRehWJ?= =?us-ascii?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EvUG1b0cZNyph0NVzDSXVsqCnMrtIU=; 24:LL0HwRtLJEQM+2wTHfnMrDUSsXA0KEm0pJOfs/hUbHcyulWDTZxukL4fSxZXEEKgapL78g+WknO42g9okoLbjJvkkK3yKSRtUmipo7E2YQw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0401MB2425; 7:/esWOPfy6Q+Uluxs1m7qpPcS22FIJYylLJm+PJZO9++61LvCv3G761BGBc9rOp46X7ae3A61C0fWFMzryyiMxiNf462xLh1NFKxcM6PVb9aCn/uEPy31arse7thxznJiFWAeY+N/wf3FtLby8MDQhmUPwJFzsDDsTT49Qj8Cq5iRFcnbz+/LG9d89kAGs9kD8QB+/RV5hNYmrocZeIFqqNNxJybI7fkxZqk4n0BylMAGcgM8VqPC6VzDBki0hgbZ X-MS-Office365-Filtering-Correlation-Id: 18494cfd-530d-44a5-d24b-08d5b113b72a X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2018 16:34:16.6449 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 18494cfd-530d-44a5-d24b-08d5b113b72a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0401MB2425 Subject: [dpdk-dev] [PATCH v5 1/7] mempool/dpaa2: add functions exposed to DPDK applications X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 May 2018 16:34:20 -0000 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 --- 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..dd57f55 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_mempool] (@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 88bee03..71fb6b2 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 5d057fb..e12a0ec 100644 --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c @@ -21,6 +21,7 @@ #include #include #include +#include "rte_dpaa2_mempool.h" #include #include @@ -244,6 +245,35 @@ struct dpaa2_memseg_list rte_dpaa2_memsegs } } +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 + +/** + * 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 82a5ec0..b9d996a 100644 --- a/drivers/mempool/dpaa2/rte_mempool_dpaa2_version.map +++ b/drivers/mempool/dpaa2/rte_mempool_dpaa2_version.map @@ -7,3 +7,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