From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00082.outbound.protection.outlook.com [40.107.0.82]) by dpdk.org (Postfix) with ESMTP id CFEC21C885 for ; Sat, 7 Apr 2018 16:34:44 +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=UXB5aZwpMXEGglH5kibloAj3hIJRO47gcvvTfIPZxxg=; b=RVvuw86rXAHjrOudmWVgEByPYg//77FUNdb+eno5jaxJl+LYe0Mz3HBGQF68jPAckTuVw0F45YyGyVfuAzRfkDtTtBHMaUnLHxSDPjzj5WtBoyBjK9xPY4rwK0w287/3WmU7VKHJOCwzFZgT0uoijQ6eCq06jqwWlA6AvAAbR+Q= 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 DB6PR0401MB2424.eurprd04.prod.outlook.com (2603:10a6:4:4a::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.653.12; Sat, 7 Apr 2018 14:34:41 +0000 From: Nipun Gupta To: thomas@monjalon.net, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com Cc: dev@dpdk.org, Nipun Gupta Date: Sat, 7 Apr 2018 20:03:57 +0530 Message-Id: <1523111645-8076-2-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1523111645-8076-1-git-send-email-nipun.gupta@nxp.com> References: <1519292089-13851-1-git-send-email-nipun.gupta@nxp.com> <1523111645-8076-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: PN1PR0101CA0017.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::27) To DB6PR0401MB2424.eurprd04.prod.outlook.com (2603:10a6:4:4a::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 190044f9-07af-4495-d37c-08d59c94b3b3 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB6PR0401MB2424; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0401MB2424; 3:XAdXyG7io7WcObRQonavG9s/1Kw+i+JsPZoMEfJPBFC2pspgONCnhVjLyUaxJzFHJFc4VR1Gm6xujjsaLBmlrHqVJc3tA+aXRzP0+Y6cwdGFl7+1yEe1bx/8380d1rszL7QoLrwTfbgoK27+ep/sTi12QpBwoztlaCnCgQzNhXDWdhIuZZEHB8ckKkII4om+adhyfox1q3mgva/qhlXYWNLZF9ykJrfIbQYmifUv2lGmE1bFDkIyCr70RR3l9ycE; 25:l5wX85GHal/dtrhE74tocvnQy0Rz/QBbl2G110i3o3aa2PiyU1Qi/UjDtOusB6Nay5/ER32ImLmoRwuV4xOtLSpkemmJVvAaO+IXvufWyT71Ef3iyNASMIVhyE5UP+iCC8Dmk2NLsdDDOl0xITqCAzq0jEd20ZpDWb/Gvh11NUJDTxK6cfu1cYs33iLigB66Ri3yyK3ecOR7bhQO2Pj7tkqY1W3ZG7IrE3X5UsyRgcB7mpcoTKYDXS3zsI3yh8x8Nae83LMom9mqR/oTJo/1P8IJ06uVnYKqSV9e4OxAd7mG9nyYSE0L5I8iK57UWouy/2EBPSHqJkR9j2qYCrVVuw==; 31:4rP/FbLcSNX3zY6bYj7UlqgBW4ON5oJjZ4jLSBsTWtCPgkcAT+z6P7mrtVsaFaPanEoFJ+maAJXpBryc1XHhb9hzOur7HHuDi76taIZZxoK58DKpW1WmKxdclBmevy2fFKlCB3LXVCBZaAlNaEV/Ba/vERarYrnNEKQwFzm9rrZOiUM58qrP+ktHeXBJrIcy81D/SMUlmWsduBRBurAWowtl+0oI4NSs5vxFOc4hLTM= X-MS-TrafficTypeDiagnostic: DB6PR0401MB2424: X-Microsoft-Exchange-Diagnostics: 1; DB6PR0401MB2424; 20:On7Wjz+JEvFJWoqaqaXKA6dnq0j8Hs1NHbzMAUv3FbOhhM/A4hhc1XrYtNrXc2sR+qyF6y8rMnNPuUwTuzIFQwgHYWv14cqENhabrj7PO/T7htBA5EKBaFMCbL9EP+TYiSCA9o3sRo4cs5YbxKtjQvmL5RZ+b3PAid0iLmCVjAr7R08+6zU/+8RD3JL7jl40s8wPMyu8KTZhzCsfERldHIZEB7svH5bBNUSDyufhWdMN8Xs4bEde/q5NAqb91vTR+7dKZHW00ONkbj/tix1VaUX5im1MwM+LMBo/8RslefWzNPiuoxUUwm9pSDuVpWgIVsGkbF2PRK48Gg4OpxoI2m1b41o+YKmOvmh768EJVvnhq80w7OAmrwFV1PSndLDg/QUm0DZctJeSraM0EyKw9so6gxrahtpMk3yk3XN/rAnWGwhs1hwCs4PCx7/ZFwfLzrGzFzEqO/oxsi5HAQwmDcSX6x7EneBLmnaX4ystu0HvHv8TRbbAf9wYh7UYoiVT; 4:yqHmojjJJydI/NJsAK9z+OZ1t2o4NqNnzZt1hIhnzWn0W3g/RASW+HB1e8tNGS2PYhRTgWvnbZw/DZTw68QILTTwpY/H4Y6/v31HH2bs6Wt8Ca6YGHTnBF7CYzRZblWjGLo1W0wqnt2KYlWSZ3AJ+/qqPjGn+DJWqb3niy3x7VkeroRwM05lWf3XIQB8tQ8E2OS1B3HyVmcYS05mKA7JJ5ri1rYNtBe+pwiQFQ3wl7qvLcaynB5G0n6zLE7QWXsp0D56DZ8qmHUcZxb7jfC6neSe97JC+OcqBYyBqtsPGm2kUtzpwKZIoU7tMyK0HUeVDTaurn9sJq3u8Xhuh4tgFu30ff4f+J8C36nxQ9hFjH4= 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)(5005006)(8121501046)(3002001)(3231221)(944501327)(52105095)(10201501046)(93006095)(93001095)(6055026)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DB6PR0401MB2424; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0401MB2424; X-Forefront-PRVS: 0635D5275E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39380400002)(366004)(376002)(346002)(39860400002)(189003)(199004)(105586002)(26005)(446003)(5009440100003)(48376002)(50226002)(186003)(16526019)(53936002)(47776003)(50466002)(52116002)(476003)(6486002)(36756003)(76176011)(305945005)(575784001)(86362001)(66066001)(6512007)(6116002)(2616005)(51416003)(956004)(2906002)(16586007)(3846002)(4326008)(7736002)(8936002)(478600001)(81156014)(81166006)(486006)(11346002)(5660300001)(97736004)(316002)(6636002)(55236004)(6666003)(8676002)(25786009)(386003)(106356001)(6506007)(68736007)(110426004)(31153001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0401MB2424; 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; DB6PR0401MB2424; 23:mLh/YBBEWEOCQ7QagULeoHQ1061XvuH0Ed12UD1?= =?us-ascii?Q?INSToR1dzTA52APgFDVjzNKaZvxBUFONybqoblLJBAfj9a5pN9R8T/vkSmKl?= =?us-ascii?Q?9YUOHtWioZABal7vmd1xg1PBtPU1T1drPrLN2sYYxd1AO60haJQ7ZJObOdko?= =?us-ascii?Q?QMsR1hkxfX/aw1qzNuGyeg/RNij9DWiOMPUsHb797FiScBgngBuD5ZHP6VCO?= =?us-ascii?Q?k04OmXgCATw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IOEABhfobamNt2AN4LIsqA3Kg0zN?= =?us-ascii?Q?p5xOWtfaDiYCWBOJiWaxVwro2LZ3lWBftj9uaJG0FDtl2CP0qMYES1vuErMU?= =?us-ascii?Q?wAqYrv12VPZkrAWv0ffNwB19trzQfZv+QkZ8mz1HLgWE305WJMXNx9pP4b/v?= =?us-ascii?Q?osa+VbLCZb8QofTAdAIY19jsui3qXytjhAc+fogmSF6eDI4BK56g7xPZ4CP1?= =?us-ascii?Q?GNw=3D=3D?= X-Microsoft-Antispam-Message-Info: +fgunD5eRrAptOes0nps8NM0J6UHRnbOnIzqXnQyeNV3EQb87x/Kl+yG64EzeFrBtvCbh4Ct+RPA8n+mdUu+UO0eziCbPpWXEMw9scilu3kNPMJlTocRcNxBc8O24IXD7nYeH8WUheA9RQ65DGS2R8vtSPQ0IEgEgRybtXrqclhYUQnBlR6+/4Cna6o7Xke5 X-Microsoft-Exchange-Diagnostics: 1; DB6PR0401MB2424; 6:wmtVWL/5WnaG+vUCgt/NiBm/ECPFXvX01y5GACnWbnG6eSRTD81S3xzmhLmAe3aUa7fkx277YTuJU5XNEDPaXlm5kctG53d/tWFSsF9H5vcNSjWkbjk9heCdC30r7NkZ8NWOt45EQnhIswpROHoS4csos9klf2qxoorr9kSHjte7bj9Pur8IFQYkgHuSSJJyFzaOspg5VhxIujBBv39fQdE50bNdYuV+c9H1LReSGOz4yOOhEhc4Q5F//6TobD0wmMMaFA6wgX3zb0sChLyhhELhjJoKrJ12C9oHwBxZEo3DMgDWBh1wvwDFajRYGbR7Z+6+PTCs+B/qZcHpkF6nJmd4HpxLsJt7HjzCDfXiLvJOhG2RovoH7U6eeuwhEBdjKhAyfWyqxdivAZb9wOFsbq/54l5lpJpusKEQu0JaupoCrAJpclenjG6T3ywmdQ1dStUlc1W66IuMbEXWOsSlng==; 5:ANyQwLZVXAx7RAiBmtBKtIR25w+X61xHRSchRj2DpZ8Y4/rhf2m3RW4Xy1PhKMyfD2T7laHwgHkw45aeoqVQyGvYGaCavkvdFAXJxxDb2sD7DAO7IsO+eQdMymAdrDdEcTltMu0cb9apOrcVocIDqBoNmyQ6uCiWIOR+f1uCprU=; 24:AhcwE5m+V04GdJdZMj2YXNC2j3WJxubMBrE8lJHWG0cQD84Gj4eKofrJcwRA7+I9J1143LTzss3OVc6FObDbI1ma1PlITGA4V7/hVmZSRUo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0401MB2424; 7:Y01z5Lidv1iEueThW0zlR9R69OchxvIUBsJmZVrk+AT395z/P3MYuFrHA2C4riuctBWB3q/Ye29fnDfsDkGGCMeiuz62/xRrBFEToBh/BAThY1JfELCUa4quTa2tBpCnrgZZ6bQu56DIxM6/BIdzSZC4yPhgyf317PEYvqH+L3698YJ4idaINZ+aY54MvYgbkPuyL5Gj6jGm0R1yWNTTtOQq+WBrmd0fB+f4n+fA2I3jkVDOy4IldFvIKGgOK/OP X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2018 14:34:41.5855 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 190044f9-07af-4495-d37c-08d59c94b3b3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0401MB2424 Subject: [dpdk-dev] [PATCH v2 1/9] 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: Sat, 07 Apr 2018 14:34:45 -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 d77f205..49fcec4 100644 --- a/doc/api/doxy-api-index.md +++ b/doc/api/doxy-api-index.md @@ -63,6 +63,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), [crypto_scheduler] (@ref rte_cryptodev_scheduler.h) - **memory**: diff --git a/doc/api/doxy-api.conf b/doc/api/doxy-api.conf index cda52fd..59cb580 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 f0edb32..6a69114 100644 --- a/drivers/mempool/dpaa2/Makefile +++ b/drivers/mempool/dpaa2/Makefile @@ -28,4 +28,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