From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0058.outbound.protection.outlook.com [104.47.0.58]) by dpdk.org (Postfix) with ESMTP id D6451559A for ; Thu, 26 Apr 2018 12:15:27 +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=GN1XxPP2mDLpTHgWcBfMBhLWrpOOj4upjAEainOErVY=; b=HBNZ+9W6X2VY+zoIoc3BqXaYjzQFT4Y8tZBLcMeLcSI2bYCpYQcziZD0myhcey787NVqoDmL0siQTSgbgLnyzikS5tDuX+ycfKtdnifJhcFPPNZbg8LayFqEJbOsEwX0AEC2KCGhLn88O6gdrD8I287AxbGCV0tqRw11oNVquog= 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 VI1PR0401MB2432.eurprd04.prod.outlook.com (2603:10a6:800:2a::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Thu, 26 Apr 2018 10:15:25 +0000 From: Nipun Gupta To: shreyansh.jain@nxp.com, thomas@monjalon.net, hemant.agrawal@nxp.com Cc: dev@dpdk.org, Nipun Gupta Date: Thu, 26 Apr 2018 15:44:50 +0530 Message-Id: <1524737696-3145-2-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1524737696-3145-1-git-send-email-nipun.gupta@nxp.com> References: <1523111645-8076-1-git-send-email-nipun.gupta@nxp.com> <1524737696-3145-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: PN1PR01CA0089.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::29) To VI1PR0401MB2432.eurprd04.prod.outlook.com (2603:10a6:800:2a::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2432; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0401MB2432; 3:n7ts58wGjPgBo6jsiQ1swQlR1Y41lgnRnDmQfYxuJwTpdXSEcwM48p2Qk3lQjT2vR6GVR+j4P9xG8IAk/m79M9qsjFkQ7V0XyfsLz4c3+4daieoqgFcRpItq71/jeJGf0+r5uNOixJNu+p9Z8/txAZw/hYN5jqc+tzZ9aUPHd/uDsD9NJSrB98cMHuwj3zgLiqe2xsy+z2cGQVuDxjKkVw87QVBW0wOzD20dnbIvn0aLRfaMqVKVsAPl2deGjOI/; 25:PMrytSyU4CIHr3iFMYq2u7AYo6FFG2Nyt5sZN9+jjcxzmGOiTUh/Q43OJcJ5Eo3w/TCBFUaaqP35Y5jHvphaPL0Vvi3mw2Vq4X1ptoIloqbullbNEIs6KPVqCEEsl4v1pZNpIES11xRo5y8lGjafB17kwQHMGwxKnZTuOoIWhH99Cf05R7YmAORps/2I7vPCV8oXX1DTYcCfnROsGNAygFvsWOg3ETx/CwlmHAncEAkvOMyqEccqz+m3vZQ7zYbm/diTkfk0kfl11EpNbqmsoTnjW+53mjp0Oa6dq4v8XqQE5LCPl5BgBNxAYIzjN3fjBt4g8HLBMfHEkzMW2MMd2Q==; 31:eG2py2KGUZTJ0vacsgTD5tzEC53MggjLwWs8MCZ2xk7yV9AQHliY5SuderPh6f1JnF7CZJvp4Dnn+91uHS2rbkSBgT0h9Q6NUwgHUUd1m22ABoJ3lw2GRLuH5WWY6PoeVmhFb7qH9Ne+Ikcxd3iCjsYtwivQeus0s00d/cwFfn21vuWdVf7En7XMJUm4m8k2bcH/g0tr8UZg/vwkSrWX6as+39ElBWdUwssIncZyBws= X-MS-TrafficTypeDiagnostic: VI1PR0401MB2432: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0401MB2432; 20:KFQ75BcsN7V8hkMmJe5OLaY47kXw3cmyaoK8UXywpP+/0yKbg8c8QE59kcQbBFQQiZWQevnJE+x06lVEGBKRcJ3kp9eIV21H9IK7PjfGR8wW6K98UNpl6Ypgh6+bMVXcbDHQu/KvSvFwzSSlAJj+JsuaVUJPNEb2dYnOJylhSKHH1tO6I6I6WfB9XiDSVXaunvgoS8BKy6Y+LlHAkB2aOKiSy5RpG8b8iG3c82foShKSr+Glsgk7/C/VUemLcvG/779rWZHqLpigaeo33SA/5u7dGvns6R19PVfpCMbiPKb+0H48oahiHs5Az9UJqkvMSx//3kvZEiRpTgapC6PNpmRuSvLcNLLS8lgwNvnRUYZrU2aT6o45egS1EsXC5+dDvIMIwPg4KVaEL6YHPysznAlRqHgMqOClcKHk+Iyi5QQGraFnhmDi1MXwXQ8tkVCVo+7vWekI8IAmtIUuLL0Z/hjaOamnURQAoBVmHyt0IE2CNjDD5Yf7Q4GlmH4Hs+5F; 4:/IfMCy7gWW4cuQymDNnEv70VumXxAWcCs8PoVRiTzLSXBc1Qr4HMhGQpsTBjtNHV6sSuwv2WnZDabGvPPx2CxsiIB1B12mUKSQ/+ECEcaJt3d3GPgQSjw4uMByBuWjJlewCCnMg8tlT+9khbaaoVyy5oXxBipZxJPqA+FVQNzbIVqjM0NscoOJ0Zd6HqR72i8SoZTDhnSgTZJe4PCqWGWAoWa4UNtPgcJ7/6rfWImgXOAE5EGYDn71uVtB5ntMRyg0KRnA484X1Agn3UzYYZ6Gr9jpVDIDShT7slP2a4bM455PxYYbrHC/35Ava3PWwZ4PXlxosKn0KWRc9VK29CJVO+mFx+ITr2GAHFiyXZrH0= 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)(10201501046)(93006095)(93001095)(3231232)(944501410)(52105095)(3002001)(6055026)(6041310)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:VI1PR0401MB2432; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2432; X-Forefront-PRVS: 0654257CF5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(376002)(366004)(39860400002)(346002)(396003)(199004)(189003)(106356001)(2906002)(3846002)(5009440100003)(6512007)(86362001)(478600001)(44832011)(36756003)(7736002)(5660300001)(6116002)(486006)(97736004)(4326008)(11346002)(956004)(476003)(6486002)(2616005)(446003)(386003)(6506007)(16586007)(53936002)(25786009)(81156014)(47776003)(52116002)(16526019)(66066001)(51416003)(6636002)(105586002)(316002)(50226002)(6666003)(8936002)(50466002)(8676002)(26005)(68736007)(305945005)(48376002)(81166006)(76176011)(110426005)(31153001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2432; H:b27504-OptiPlex-790.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0401MB2432; 23:m5aIB1YNifteBpAimz4PmDM5GwvZa0QtG9JE6Oc?= =?us-ascii?Q?R/H4eyEEy60k1D4KSghDlyraXPGA9pWG5/Haet4e8OrAIOWvA9MPxj8l9Y+W?= =?us-ascii?Q?6dfmUHwDe1HQtCBeejcAywC+SwnH9O7Omm9D99QGq/ZPBZZhYAciNlb8v2NS?= =?us-ascii?Q?hHn40O1/z4X52wACVJDPLFcYzdbxHNhDHa6LPA+o6CJEJ6dG7iCP2Z22EVD8?= =?us-ascii?Q?KBjRQUKVsZGYDyxGAF7r9XyRbdx9/6T5H8DGifpFuGfU282mIKo1KBE8fhFB?= =?us-ascii?Q?dLqhL/iTom1+H5lr3SFRAx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JQJxV8KPf9u/seitwvEV48eBmsNty2dVmRUmL4JmRy2cAWoy98oxVi7Q+3a03JxT4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0401MB2432; 7:TFPz99OtLr1hssgvnj5j0h5v30/EP5luO8cf1ff4WJI3m7L8Sq1fzONf0uw3g4Pg5+MLvbqx3Ehw/jXNs/jtSfV815vLq9cGo5rRfKGX9/9uWzP9QPmKfoope2sp6OsDC+gP+Xe1nSGaayfNAExQLXomJG5FGHhXNckOEEXTI2RuWz/pDM7XeH8yZp+zfPvWCewIsDvXQgAt+NcDvmN5B00MDGOJe9oMVXdm/23QjIuVf5QJvSxczw5jkvuZ+Dcx X-MS-Office365-Filtering-Correlation-Id: 964cc338-e84e-4a57-4c62-08d5ab5ea13c X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2018 10:15:25.2370 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 964cc338-e84e-4a57-4c62-08d5ab5ea13c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2432 Subject: [dpdk-dev] [PATCH 1/7 v3] 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, 26 Apr 2018 10:15:28 -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..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 #include #include +#include "rte_dpaa2_mempool.h" #include #include @@ -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 + +/** + * 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