From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0085.outbound.protection.outlook.com [104.47.1.85]) by dpdk.org (Postfix) with ESMTP id 3EB121B040 for ; Thu, 22 Feb 2018 10:35:20 +0100 (CET) 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=PKIzxKXnRgLMrxNU+Lab0+Z7vdN7k8MSdMgzLfUGV2c=; b=Xw3152JZLgsnlg8GfQ8eYJPkpPiKVNyO2vFmhb0/ghlInzIgE04nbF3mAx7iVu3eV89Y/me2iX0bctiLuJf+ljsUafre2+BJCJxgu6tpjnw/YscSlngESMmnhiLU2ZCiohycYMDz/t9l/L0wvfjIvVFKYRFwOJrtwQttreXjSFY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nipun.gupta@nxp.com; Received: from b27504-OptiPlex-790.ap.freescale.net (192.88.169.1) 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.527.15; Thu, 22 Feb 2018 09:35:17 +0000 From: Nipun Gupta To: thomas@monjalon.net, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com Cc: dev@dpdk.org, Nipun Gupta Date: Thu, 22 Feb 2018 15:04:41 +0530 Message-Id: <1519292089-13851-2-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1519292089-13851-1-git-send-email-nipun.gupta@nxp.com> References: <1519292089-13851-1-git-send-email-nipun.gupta@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.88.169.1] X-ClientProxiedBy: BM1PR0101CA0061.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::23) To HE1PR0401MB2425.eurprd04.prod.outlook.com (2603:10a6:3:25::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: af30b92b-e065-41a0-1fde-08d579d7963c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:HE1PR0401MB2425; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0401MB2425; 3:ljqCUlbm0HqFA+YaY/ppr0A6JV49Z3z3uRT4w1pDkiJx3k2gu/dkuTid+KGRhlwvhd5lBDYI5LPVhrukwFixJU037CVcaLJjRTxJvkzoZ2IMs1WxotKCGMlOpZytmM9J9OpD0SClDnofTf442byA3OZF+P/kOND4LZxZ9c+45lRTt980b6aFJEb6+7I7T52WRcw0b530R0NYOfucshRkY/UAxqOrWB8AWnK326K8yEcZGWxXPxIVqvg+X5ZvZ/KB; 25:I9gLZHLITcFm5ZhR/54UX2xWQNU2CSyWurUlDsXNh1Qd09T2fFAG6iKrR9uck+auNYL6wE1j3/sODSJIGK2FhnbxSwuIUlnK0S7Eub8pYNuqhaEY3EE1Nety4C4BS0hMKNxYUgF7WnbkGub+ItREpC4IJiDVogt1hkuem+O301DdEAVt8BFoOyr+pfagwJixcO+ko+N5KDFRGh4MalN1El0etw4yr/N95ZXZj/96JO0JKFV6qFUAE6wdfJB7/E5hBNkXbyrQXvVgulgbM6dDftWlGjEB6qUDhGcRymB0a7HpoezpYccDpJneYii6N1vo5MSdwdNuevdK/vxwWqPGAQ==; 31:mL1nGGj3h7quY4rUAIo0V+wwSHV7/uZlhVcz6DbGpWRw6LKhF8NdFibAy7B7PkShuLt5nCf8lZ/1E8y1PXFmG43zBUd4sfgsvBSYcoW+3FXJBgMHtVByDDuf4mQpMlHf0b5GV9rFecatWv+Bvms138EAkkFBERvL+VDrBX6pyhy7EdYtmJt+MwVNcyr6pEo7CnlCQg7UrW9+AnvrPhOCiEUV9UHHDgFfitcDsgYuNns= X-MS-TrafficTypeDiagnostic: HE1PR0401MB2425: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0401MB2425; 20:Z87mOp+WSLcCmrg11O0gHqnl5tNhPO6y6OXgj4k3IEjdT0hnngNU8ZQFO/Q8qT1fahiEgSYJJJK6oVBnb/aG5JNzxzf9E+2Q7ghfsjemQEVvA/elcdiZfklM+pTfsHDUYgkP4R2FcR1G3f1UsK0onpcx9xcJTmbJd/gzXayF8OqHC9fMV2j/Usuq9w48QpFY2Ai9E62s87p7Vmc+7+EZqXt2siQuiGnZXHgo7zW6eadRD79i40wurg6xO3TuakChedlCTb9GmQVKbhUQ2lEHxbKqDXITALCWCRLA9nsK+ugzSRrwO5tergz9yduBLBu7lrfu53rziQFWEjeL2N6e+p178+HYp8jqZ67SVM5x52le1ra5bhFiEO6sugixoZHfYtHbnHYQ5dVHlGk4vX3ZwUHNwk39XUBjJmGJviJC+KBVmbKUMxBIKuZNmY2MP6Mz81x7n0wdZVxf4uOq/BwlxlihDVr4ZNZnxT5leuJgEd1ouiVwGzhXDfUEf98hMRgm; 4:7qPGNGwpWU7m/VXVRO8a0iNpGFFL+4Nz1VjFRbTLqh82vuE58yFR/LcXOT1Rs2QdEDgB8J41UfS53GXDhtI4W066Rk7uisl0fF73W07lohUqoyn37l9lESvRUMcjHrvM9FABUHIkyp1is1TdgmTY/HktqueY90xRPCe+eCHIG4gXM6+/roAG9peRgteP8sxaGMa9sFOoJsMCw6F3wSNHt86gYmCCoyXTJphroEu1lL21HAi+EBWatBjB8Es9rHB2Tp9OqGV65/WPDyiXMpGUKcpO+58kMoXNZrCi/DNUapxza2gn4YeSVryjkeAbDKqTlJ+7l1tttrT6EgXg8jAcWMTFcaJPDpmc+VqtcGy7CPs= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397)(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001077)(6040501)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231101)(944501161)(6055026)(6041288)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:HE1PR0401MB2425; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0401MB2425; X-Forefront-PRVS: 059185FE08 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(39860400002)(376002)(346002)(366004)(396003)(199004)(189003)(7736002)(66066001)(26005)(316002)(305945005)(16586007)(25786009)(4326008)(97736004)(386003)(6506007)(478600001)(50226002)(6486002)(47776003)(36756003)(105586002)(2906002)(81156014)(8936002)(6666003)(106356001)(81166006)(48376002)(86362001)(52116002)(6512007)(51416003)(53936002)(16526019)(5660300001)(186003)(50466002)(6636002)(6116002)(8676002)(68736007)(3846002)(2950100002)(76176011)(31153001); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0401MB2425; H:b27504-OptiPlex-790.ap.freescale.net; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0401MB2425; 23:hU3/bO5Qi++ehneC4f+jicSNuKHMNytfiCRPh1Z?= =?us-ascii?Q?Ew3XnDDixSjVRSB4Oru1EDvZavzAzrRaliAp/lR3yQeMMJnX78OPGeIz4d46?= =?us-ascii?Q?9pw/VaKzd53A7To9FMie9dQ0F5sugNXCJtS+pz+BrPG+7ouEM52yeDISXzae?= =?us-ascii?Q?PRTgtKR50QhrYXsHJ4cFAaCMIEnVZhV4+YJ/THqz0OhBi98lCYrPUlHz5F+2?= =?us-ascii?Q?s6shgDMB5NqypC0+OxoSEjbqbRLIkbw9kBrYxUnAyCp/D4IEG1t9LZt3qvPV?= =?us-ascii?Q?r2r9GEZnkDztRoCg5sDtjx58QmkEQTkNGD3Ub9tS6FOTA8b1mH6Arr6wVKck?= =?us-ascii?Q?RnifJ4BQ38NsLRmn0Zz9A85o7YIx0XdSIuCoxY8tvmDBPcY6Wflger7AQoU3?= =?us-ascii?Q?QNgZE4sF8yf8GfKMui4JtWf4vxUd+Fgz/l6N7a+TMGUswdjXbQPkpaw+Pk1g?= =?us-ascii?Q?gJaMYqaLTHUEdeSusOH+qLMd6D4szOE79v+QcZXhSzZbC23uRxhAy78OwLTG?= =?us-ascii?Q?xW9vECf0/djjMwZ1HhbthKpbevncwHtmSej730z2Bh1E71bdhcrFIQM+yj3i?= =?us-ascii?Q?GYhK9TjszWK0DvioH94dJVEshHyqJb1FMNZHz0Irg3Sx2Gh6FQqsw7fcoqDX?= =?us-ascii?Q?2Vnc1wZxdpBxTidS50b4j+kp0Iif0iKI1b5ffC97v6j6nfA8D/8b0AteCVq/?= =?us-ascii?Q?pX/8YsmJbGjyx+rga+YGHEdE84uum0W3kLq+yWrOzSTWovChj+Ya89nYhFIC?= =?us-ascii?Q?lVVH0CrHNlRzGvIDYV56M27eqamr1hs3syKCXnn5Uoplo22hJsromYwDjVhg?= =?us-ascii?Q?rbU1LQq4mNXuoISbO5tVwOFDl1/Mfb453qb+x7Tmi7QLOZJ0HzHFAjmZUbVs?= =?us-ascii?Q?fuZC2WCoUpcyduuWcZuDTDkNt69P9eMghFMgvSUOUZd7PU6FWhCc4ANg0blC?= =?us-ascii?Q?KSZwFThhkmHYACM3Nxe4vKTq8fAEN63xfexDDIEWCGy+llgtGVV7aIIx+CRX?= =?us-ascii?Q?pVKmUaDW7wX/rt0aAseLOFGxXxXBA8ZHbORqdc7MEwcNERA9m5r+jtxtI6PE?= =?us-ascii?Q?Xqw8q5bBUeGnZ3rFjxmae+pFeFKgHe9+1Y00lqiDEnm7W7tuJkApd/gUIy3L?= =?us-ascii?Q?EzAizt4QAvhc=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0401MB2425; 6:kqD8lxQzFvz+I54wVnXBoFjjSurZdDjoc2CXjsGLi9HskkSrXUYkqyVXoqS1072bP9SRhNEgT76WL9m346hxXmYHV4VBtWPjm9amV7iY8uTrlHiN8EaKQuvYyq1BDjSSucLngHQzBI1YztR/Xrvj9hzyzvNcCsaaTKntNmUnkl64sdU6AFcFkmiOzQy/QxkUWlj2Muoeds+q7+Ik+K+DWjGoWFOCLFI83YWfjHHXwHRsd/rR6URqsq7Dsmbb+QqnXm9Zx4/QYdMLyLyAsCLGXzkXeudAvd2FuvWxARpHXnzDj5un8Tspqc/Orugnn1yfyT+NutXUOksYm7NePPYoVG7+9kFayfivT8PP1fUwIxM=; 5:plQIWomkkZZRBpNVaBh8/eNMe7vzcRXSc5Iv8LiwBnSE1vy7JPlXn38k+hpeuAqh9Y+9MMM29SZyNf9QvY6lWmEa+mhzF4TN+pOZJT8Xo26MPt6tuztgN83f7ioFGbQ8+jPuebC9ZiIvmshnIChwKrgAYMsejipdbUktHhshjPg=; 24:xxlROps3uzjV2ONmcjX9ulK2ZVeE4hVo49m8tXhS+X2D9pL5Gn2T5kt9C/c3kxyXbMtj0z70bimK8yJyEMRPdO+90Bcp0MW6IcIkfA8ThFI=; 7:NK8tk8aef80HdJXS+SBhiQ/p4pryD1TctAxTh1fPrUc3KOfPDNpvY7stXEzaGMyPurtgAe6eBXOGETN8s5SigTrpiOPN6qLqoErrfllHinz9a4PyRHeEhinOzmS+sfb9RmqSFYdakIw5nYKEGXmIjX5f1JlfyX0bDP/00cjwqwACkeKIhiI5akm6ecIgm53+VtDMVohxvjYb/UC0+nXtEtsUjHKeFI8BIas3kq22FjOzHc3s71RN2CYPA4NzGTUe SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2018 09:35:17.5745 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: af30b92b-e065-41a0-1fde-08d579d7963c 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 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: Thu, 22 Feb 2018 09:35: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 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 efaac96..c9c2511 100644 --- a/drivers/mempool/dpaa2/Makefile +++ b/drivers/mempool/dpaa2/Makefile @@ -34,4 +34,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 2bd62e8..7d35530 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 @@ -233,6 +234,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