From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0058.outbound.protection.outlook.com [104.47.34.58]) by dpdk.org (Postfix) with ESMTP id 387A2567C for ; Fri, 16 Jun 2017 07:33:05 +0200 (CEST) Received: from BN6PR03CA0051.namprd03.prod.outlook.com (10.173.137.13) by CY1PR0301MB0602.namprd03.prod.outlook.com (10.160.142.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Fri, 16 Jun 2017 05:33:02 +0000 Received: from BY2FFO11FD042.protection.gbl (2a01:111:f400:7c0c::151) by BN6PR03CA0051.outlook.office365.com (2603:10b6:404:4c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1178.14 via Frontend Transport; Fri, 16 Jun 2017 05:33:02 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD042.mail.protection.outlook.com (10.1.14.227) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1157.12 via Frontend Transport; Fri, 16 Jun 2017 05:33:01 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.39]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v5G5WNFI001003; Thu, 15 Jun 2017 22:32:59 -0700 From: Shreyansh Jain To: CC: , Date: Fri, 16 Jun 2017 11:10:49 +0530 Message-ID: <1497591668-3320-20-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497591668-3320-1-git-send-email-shreyansh.jain@nxp.com> References: <1497591668-3320-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131420647821582748; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39840400002)(39400400002)(39380400002)(39860400002)(39450400003)(39850400002)(39410400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(9170700003)(4326008)(47776003)(50986999)(76176999)(38730400002)(8676002)(33646002)(189998001)(36756003)(2351001)(8656002)(53936002)(50226002)(110136004)(8936002)(85426001)(54906002)(77096006)(356003)(50466002)(2906002)(104016004)(86362001)(81166006)(6666003)(6916009)(106466001)(48376002)(305945005)(5003940100001)(5660300001)(2950100002)(498600001)(105606002)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB0602; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD042; 1:N67DJwWbEo7KfRY+Hc4ptuQc7v8EKsmGXIibT0ljPzIcu4E+JO1aki4yrQzzJUZv01mShBrXSATgqnKd6uG4nl/n9tneoHF8dg4HbGC1nD+AU03OGUNnDR8eSYLEcqMG1cM9+dpLFcW9xkdgvpM65kZjlezFGGg19EuX/FmsM4wuDFATi6nwIBWPbU9PQpVZY2pi4iEFBjE0pdD6P1n6s7FieH49ICE5sgWMev/thFZ+Pw4VH1bDfUsdSD41uUCd8UpBytOKFY6K+tL7iW80ENAGOzl6MyIoSW0orDByaWrlYKGx6H3c2pHBikUKoRCmwiq4feUWzSZQ2/gt1iK+71iAGFFe2MXu7R219YP2ImUrqJCkI5NETzEYPNPnp2Dj+8amjJwcam21cw2TUrJNIMETPmgyCp2V0QbN2JatLsmG3JGk4bgvRBvPrOgtguVFkvxm86GjxUqYbnIpn4iX0XRPMw26nTv3BWSujvfSbaSqLqlFhImQrWBiJW8zYax3Wan0x4ltsL8Rkvn0rf+f+SZ1NuDeO2rIrNBAjH1WQg6JggCXERvA+TqEHGH0P/gexkEPsP747xHm0bKINNWZhY89NiX1K4nW8Dnol/2jyK0XKvb4ilc4WvUu/QrUdBEhiCgIApdTeVSETfAVhjoG49F5a2jUoBuO0iS2QEV7U+7vkf7pnVPfILy6AQBRkzxiTrW7c9xLVj0cMHlBhKo37gdGDmglsGJQOuAz3tWi7Rc= MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY1PR0301MB0602: X-MS-Office365-Filtering-Correlation-Id: 2fdaa296-8609-4054-9694-08d4b47927f2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:CY1PR0301MB0602; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0602; 3:I04urcbtgv98cOApxbmIchu9g4iQsuTBLA/J1wt3+aXwIwh8VZKTdfRSz4pCfwEyPyDrSzaixSbrC59im1igJpb6DctKdwcE5lP0Rk9Dgh5IRVGN0BPmnPeGqf6Lh/NcaCoVgo45+pGJYZoHTwF9hY9ilAw1THm4IdaUYZsQSi0thRjmd5VvsnPLXuBNLcWUcl1mJCMECeOvYf5zVVcmIxWymx5sGWmdPhfTAhCqnGnK7hu/FvRtNm15SmG2fx0F/uNGukBwArpeG+ujYiqZ40idvGzmqdmScFjLA46+Uxa4saz3Vto8rVCu9yBssy2LZw6iKBfIK7oeRl3VIxh2rEAkhf2+4TBHCYrJJMzcMV4B/zqi62daVAk2X57305SXuFCl1F/KbtMbrwmQNUKsy4XcO9Y1wq/rvW/homdHhPbXoHg9SKTG8g9RzFcPhiFt; 25:BtMKFHCiWIlFD02F7C/UM228+zkrmYCQxLTS27laKnfJaDJYXoJTzWB3u28aJ5ZtedYVnG4mWHTEIawfrEe/RfZ5AE5/wOWvZ13rRqwA1bP4UsPXlPRSoH6cmaW5xVZAkz6r4ggG+AE52YZCr8JU9Tr/9zTnlw0lEOdyMmI3b8TfcxG4eOWOcjFLBzhy1PbILBeG33Ycws82r/jIHsO9A8GNEYe62qeQkcJwEWP7CTNawjOSi9KkfjHal/xvkUTWpxVl5Q1QEAiEqZdPeB4oSviFdJDFSrqN3zFp44v7Dsq0dN6fDFF39dwFnHCvw2i/+X84BlBjXPlnLwix3w74fScYRM8fStiWTqE0kLBiXr3Z2Lxf6qgH+zyE2mcgDvohKTlUdKpZYdVP4dDDB+cX9L0FfUAxL2+CUpbOU+k8457URpuYaltzQaWJxECWKHCn5JxYn63fsnR2XLg1Dp1lViRVEhSLiyoU4EE71UsvjzQ= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0602; 31:JNgTfEqP5ebflv3SKCPE/nGn1cpWTx5+uBizhj+b4qkNNpk7MXvxPiLyw3MGf7S9ApcG0rlOE1K06tT1TGIAPPSjVI+FUYwYyuewUO0IVNN6yZOphDmFji27jlRgXsVZ2VZMvgZiqpyuguk8yBmi+Eukhzzi/B3R7O7cNIuxNt+fTqimZThQcpdXQ+eHu3HkPQz6ydsdo1gupclX/67aquWbb8NlmPlZURBT3Dbd9Yqm7vX2g+urJyg37CgwuSCX X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13018025)(5005006)(13016025)(8121501046)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6055026)(6096035)(20161123563025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123565025)(20161123561025)(20161123556025)(20161123559100)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR0301MB0602; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR0301MB0602; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB0602; 4:FhceChT5hZNm8UBBMmOcS0+aNLUNHnsLVCK9lbph?= =?us-ascii?Q?97x8YHWpdsQmru64UouVQH4N3kN0nTTWZLwKEKmTEU3QkhoHSrc6rlndoD+u?= =?us-ascii?Q?SFztSFO7x+EsEq3s2d5TeFz0W7kCEh3dJIHFz3m9x85Cw+lTI05FCO4tgpRp?= =?us-ascii?Q?GS1yh5iJI/gpSudd7QWJAq7IEI4dUk0B/IN1kXEvyqKe+gaReFv9NLoX6wM8?= =?us-ascii?Q?XMRyPCpogGUXEiKyt2ODda1bG+zRqKUvKFxoSwR0l4bVWAAfD+KQFsPM1G0+?= =?us-ascii?Q?BgZ97ecbiVzx9ATFwWRsYOGXIzF7L/bD9/mxcNitukp/WuRqnUJKSPEhDloI?= =?us-ascii?Q?zp7W9l6wnwt9BCcvmF4w4CV/KeKDTwzUz3oOOgfQT8Mgd37tVSyPUrOhyyWP?= =?us-ascii?Q?IOQVDyXM/aCIU1KbmLnmmXyOsJuO+b483KE7MIY47Y5rkBbjiOgVSjyPmCbn?= =?us-ascii?Q?5A9IirxFDzoCXS5/9cie59Q53UOq/8fvz6vP2f8LdCzoxsVUrgWc44D4JfnA?= =?us-ascii?Q?dybiY6RUwX3WSmQveASfsVhLF3sa0fdrOuq/m7zCuSIc5dZN+OAXljoTYRLn?= =?us-ascii?Q?frMx4C+YYA0A3NRafVEgYvFUgi1xKmO9u3ek+p54Cyx58R8bWZ33S7+iWPTT?= =?us-ascii?Q?5A9oUpGCM/mn3pDXjtfscShzbjqmX+anXvLYQE+sCSEAE8z16SC1OS8DTiHr?= =?us-ascii?Q?qZcNNeqR/2GHUZ6wSASeE0mssdUzbVA54j09k99PzZ6kTs1eeb78BjmF06r9?= =?us-ascii?Q?Vgekta5nmo85/3fJQUUFMM2t3qIX8N2smt/8xchJ5kz99/R8xohQ0uWAZR4V?= =?us-ascii?Q?iewnOB2+357Sfcc3JQPjnZqOId519xo7MiN1E7xZViD9kWGvggIBtFEgJC4c?= =?us-ascii?Q?F4sNgXJ5F4bEvi/OfUoNWZC8kA0BURgkhh4PK3Gdc8Zl/943SKF8PwVqsYqL?= =?us-ascii?Q?mZ7t3caMI3jZuUHU21i45RulIVEoOUpzm+c9SiQ7russ9ol9wXcwADDbeKo+?= =?us-ascii?Q?WthVZA8D3VsCrtIl4/o4ECFgPJquQjx2kc8DMc49m9vYwJfCEkM9J96hRTxz?= =?us-ascii?Q?n4w7w6TmwVho14tmt8BvtQf8XyqAriFMAw3qsktV4Z9khtPo0go15wPXNPFy?= =?us-ascii?Q?pcwvRIe8jxLxfAMgGC1u1W5Fhh2SBBxclGdht7RJw9/P+krtsgK1auln2ZHq?= =?us-ascii?Q?ZwDwaTLpO1gLeEXfWb0HnzbTWGvNPPkY4bbFkENDAlF/NW+CcsG8N0qWZCF+?= =?us-ascii?Q?Xm+2BK+TeA5RgIOQK/kOzIMrkhvrGoeHikYVMsh7?= X-Forefront-PRVS: 0340850FCD X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB0602; 23:+CRuSxA/ZCLIQz60sqdpoBBXEhX3aS4BCTKe5bJ?= =?us-ascii?Q?AG00gVDsdMFXbqzfNmdyp7/SVPWn1mE8H6CghVBpCEoPfoBQbWk13rladIEc?= =?us-ascii?Q?8nPPXvDLp2wVXPFWSfoOiF2TgfcTkLPaqPwhe6Bibez8Lb8f7Rx66zH1jdtN?= =?us-ascii?Q?AjWzfasner1jm8NYjjtu4BUpXrMCIZ1Kbu6f8dPLZHMt+71Mzf/o0OP+QHX0?= =?us-ascii?Q?XA4YVng/imKEep8/1KeUfLl//F9lURpvRbzz6OVhA3akyQ83dDuqQi7WOl1f?= =?us-ascii?Q?7hwB+8C6qFohzRI5eVrSLOznU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qAWZFkI2o/asGNro+w3Zi03dkwkY6maRQgc2uaysKrfvBBHKuMmbimkKglacQTNzFltXOPsxILHTwreFj42EkdAO+l+/DXsBLVyzr5AobLUMbpTaOHafQbBniqCcWrRIEfsppUkT+kOZXUUj8uiWPyOpHZ1LiR4v2w==; 24:a9Qv9yIIw9XZFXGwOUH7RuZ4U9e6Dpweg9eSzX18zDSCuJ92UVcbAb3z9fgu3Jk1vWd19awFMLv4n/C9FG/Qf8lC//8Dj5W7yZgCjqsrs78= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0602; 7:+ifRh372XAn+FX6NKL0+znZ8dkHOkaH326QiKCa5fmjufzW/0Ap0vbt3JKFOhCBx9Vrhn1jCVpkTBmgvPmzeePIBXu+u5eaU8G0d/kctpT8EUbUXaZMxGrC8J5Ml58zTU/Kt+p8XDEG2M0I0rFE3SAezD1C0BVokf7TatphzYf/SzlVoG/6Ic1BtmRtBksi/CNJLtPsFoU3ciXJdQ7aTLAtiN4EAfG6V2KC0Z0eaCpWJYxIh7LFaIENmpsF8MairMAXuVgx533HT3OlFvKT1EnApnB4iNr859rlSzSdyVH8tBuZLEthe7r52V019GWnUWfGjefLLbL7KmBlfIcBDeg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2017 05:33:01.8462 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB0602 Subject: [dpdk-dev] [PATCH 19/38] mempool/dpaa: add support for NXP DPAA Mempool 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: Fri, 16 Jun 2017 05:33:06 -0000 This Mempool driver works with DPAA BMan hardware block. This block manages data buffers in memory, and provides efficient interface with other hardware and software components for buffer requests. This patch adds support for BMan. Compilation would be enabled in subsequent patches. Signed-off-by: Hemant Agrawal Signed-off-by: Shreyansh Jain --- drivers/mempool/dpaa/Makefile | 65 ++++++ drivers/mempool/dpaa/dpaa_mempool.c | 265 ++++++++++++++++++++++ drivers/mempool/dpaa/dpaa_mempool.h | 78 +++++++ drivers/mempool/dpaa/rte_mempool_dpaa_version.map | 6 + drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 2 +- 5 files changed, 415 insertions(+), 1 deletion(-) create mode 100644 drivers/mempool/dpaa/Makefile create mode 100644 drivers/mempool/dpaa/dpaa_mempool.c create mode 100644 drivers/mempool/dpaa/dpaa_mempool.h create mode 100644 drivers/mempool/dpaa/rte_mempool_dpaa_version.map diff --git a/drivers/mempool/dpaa/Makefile b/drivers/mempool/dpaa/Makefile new file mode 100644 index 0000000..45a1f7b --- /dev/null +++ b/drivers/mempool/dpaa/Makefile @@ -0,0 +1,65 @@ +# BSD LICENSE +# +# Copyright(c) 2016 NXP. All rights reserved. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of NXP nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +include $(RTE_SDK)/mk/rte.vars.mk + +# +# library name +# +LIB = librte_mempool_dpaa.a + +ifeq ($(CONFIG_RTE_LIBRTE_DPAA2_DEBUG_INIT),y) +CFLAGS += -O0 -g +CFLAGS += "-Wno-error" +else +CFLAGS += -O3 +CFLAGS += $(WERROR_FLAGS) +endif +CFLAGS += -D _GNU_SOURCE + +CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa +CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/ +CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa +CFLAGS += -I$(RTE_SDK)/lib/librte_mempool + +# versioning export map +EXPORT_MAP := rte_mempool_dpaa_version.map + +# Lbrary version +LIBABIVER := 1 + +# all source are stored in SRCS-y +# +SRCS-$(CONFIG_RTE_LIBRTE_DPAA_MEMPOOL) += dpaa_mempool.c + +LDLIBS += -lrte_bus_dpaa + +include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c new file mode 100644 index 0000000..ba98d48 --- /dev/null +++ b/drivers/mempool/dpaa/dpaa_mempool.c @@ -0,0 +1,265 @@ +/*- + * BSD LICENSE + * + * Copyright 2017 NXP. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of NXP nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* System headers */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +struct pool_info_entry rte_dpaa_pool_table[DPAA_MAX_BPOOLS]; + +static void +dpaa_buf_free(struct pool_info_entry *bp_info, uint64_t addr) +{ + struct bm_buffer buf; + int ret; + + PMD_TX_FREE_LOG(DEBUG, "Free 0x%lx to bpid: %d", addr, bp_info->bpid); + + bm_buffer_set64(&buf, addr); +retry: + ret = bman_release(bp_info->bp, &buf, 1, 0); + if (ret) { + PMD_TX_LOG(DEBUG, " BMAN busy. Retrying..."); + cpu_spin(CPU_SPIN_BACKOFF_CYCLES); + goto retry; + } +} + +static int +dpaa_mbuf_create_pool(struct rte_mempool *mp) +{ + struct bman_pool *bp; + struct bm_buffer bufs[8]; + uint8_t bpid; + int num_bufs = 0, ret = 0; + struct bman_pool_params params = { + .flags = BMAN_POOL_FLAG_DYNAMIC_BPID + }; + + PMD_INIT_FUNC_TRACE(); + + bp = bman_new_pool(¶ms); + if (!bp) { + PMD_DRV_LOG(ERR, "bman_new_pool() failed"); + return -ENODEV; + } + bpid = bman_get_params(bp)->bpid; + + /* Drain the pool of anything already in it. */ + do { + /* Acquire is all-or-nothing, so we drain in 8s, + * then in 1s for the remainder. + */ + if (ret != 1) + ret = bman_acquire(bp, bufs, 8, 0); + if (ret < 8) + ret = bman_acquire(bp, bufs, 1, 0); + if (ret > 0) + num_bufs += ret; + } while (ret > 0); + if (num_bufs) + PMD_DRV_LOG(WARNING, "drained %u bufs from BPID %d", + num_bufs, bpid); + + rte_dpaa_pool_table[bpid].mp = mp; + rte_dpaa_pool_table[bpid].bpid = bpid; + rte_dpaa_pool_table[bpid].size = mp->elt_size; + rte_dpaa_pool_table[bpid].bp = bp; + rte_dpaa_pool_table[bpid].meta_data_size = + sizeof(struct rte_mbuf) + rte_pktmbuf_priv_size(mp); + rte_dpaa_pool_table[bpid].dpaa_ops_index = mp->ops_index; + mp->pool_data = (void *)&rte_dpaa_pool_table[bpid]; + + PMD_DRV_LOG(INFO, "BMAN pool created for bpid =%d", bpid); + return 0; +} + +static void +dpaa_mbuf_free_pool(struct rte_mempool *mp) +{ + struct pool_info_entry *bp_info = DPAA_MEMPOOL_TO_POOL_INFO(mp); + + PMD_INIT_FUNC_TRACE(); + + bman_free_pool(bp_info->bp); + PMD_DRV_LOG(INFO, "BMAN pool freed for bpid =%d", bp_info->bpid); +} + +static int +dpaa_mbuf_free_bulk(struct rte_mempool *pool, + void *const *obj_table, + unsigned int n) +{ + struct pool_info_entry *bp_info = DPAA_MEMPOOL_TO_POOL_INFO(pool); + int ret; + unsigned int i = 0; + + PMD_TX_FREE_LOG(DEBUG, " Request to free %d buffers in bpid = %d", + n, bp_info->bpid); + + ret = rte_dpaa_portal_init((void *)0); + if (ret) { + PMD_DRV_LOG(ERR, "rte_dpaa_portal_init failed " + "with ret: %d", ret); + return 0; + } + + while (i < n) { + dpaa_buf_free(bp_info, (uint64_t)rte_mempool_virt2phy(pool, + obj_table[i]) + bp_info->meta_data_size); + i = i + 1; + } + + PMD_TX_FREE_LOG(DEBUG, " freed %d buffers in bpid =%d", + n, bp_info->bpid); + + return 0; +} + +static int +dpaa_mbuf_alloc_bulk(struct rte_mempool *pool, + void **obj_table, + unsigned int count) +{ + struct rte_mbuf **m = (struct rte_mbuf **)obj_table; + struct bm_buffer bufs[DPAA_MBUF_MAX_ACQ_REL]; + struct pool_info_entry *bp_info; + void *bufaddr; + int i, ret; + unsigned int n = 0; + + bp_info = DPAA_MEMPOOL_TO_POOL_INFO(pool); + + PMD_RX_LOG(DEBUG, " Request to alloc %d buffers in bpid = %d", + count, bp_info->bpid); + + if (unlikely(count >= (RTE_MEMPOOL_CACHE_MAX_SIZE * 2))) { + PMD_DRV_LOG(ERR, "Unable to allocate requested (%u) buffers", + count); + return -1; + } + + ret = rte_dpaa_portal_init((void *)0); + if (ret) { + PMD_DRV_LOG(ERR, "rte_dpaa_portal_init failed with " + "ret: %d", ret); + return 0; + } + + while (n < count) { + /* Acquire is all-or-nothing, so we drain in 7s, + * then the remainder. + */ + if ((count - n) > DPAA_MBUF_MAX_ACQ_REL) { + ret = bman_acquire(bp_info->bp, bufs, + DPAA_MBUF_MAX_ACQ_REL, 0); + } else { + ret = bman_acquire(bp_info->bp, bufs, count - n, 0); + } + /* In case of less than requested number of buffers available + * in pool, qbman_swp_acquire returns 0 + */ + if (ret <= 0) { + PMD_DRV_LOG(DEBUG, "Buffer acquire failed with" + " err code: %d", ret); + /* The API expect the exact number of requested + * buffers. Releasing all buffers allocated + */ + dpaa_mbuf_free_bulk(pool, obj_table, n); + return -1; + } + /* assigning mbuf from the acquired objects */ + for (i = 0; (i < ret) && bufs[i].addr; i++) { + /* TODO-errata - objerved that bufs may be null + * i.e. first buffer is valid, remaining 6 buffers + * may be null. + */ + bufaddr = (void *)rte_dpaa_mem_ptov(bufs[i].addr); + m[n] = (struct rte_mbuf *)((char *)bufaddr + - bp_info->meta_data_size); + rte_mbuf_refcnt_set(m[n], 1); + PMD_DRV_LOG(DEBUG, "Acquired %p address %p from BMAN", + (void *)bufaddr, (void *)m[n]); + n++; + } + } + + PMD_RX_LOG(DEBUG, " allocated %d buffers from bpid =%d", + n, bp_info->bpid); + return 0; +} + +static unsigned int +dpaa_mbuf_get_count(const struct rte_mempool *mp) +{ + struct pool_info_entry *bp_info; + + PMD_INIT_FUNC_TRACE(); + + bp_info = DPAA_MEMPOOL_TO_POOL_INFO(mp); + + return bman_query_free_buffers(bp_info->bp); +} + + +struct rte_mempool_ops dpaa_mpool_ops = { + .name = "dpaa", + .alloc = dpaa_mbuf_create_pool, + .free = dpaa_mbuf_free_pool, + .enqueue = dpaa_mbuf_free_bulk, + .dequeue = dpaa_mbuf_alloc_bulk, + .get_count = dpaa_mbuf_get_count, +}; + +MEMPOOL_REGISTER_OPS(dpaa_mpool_ops); diff --git a/drivers/mempool/dpaa/dpaa_mempool.h b/drivers/mempool/dpaa/dpaa_mempool.h new file mode 100644 index 0000000..b097667 --- /dev/null +++ b/drivers/mempool/dpaa/dpaa_mempool.h @@ -0,0 +1,78 @@ +/*- + * BSD LICENSE + * + * Copyright 2017 NXP. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of NXP nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef __DPAA_MEMPOOL_H__ +#define __DPAA_MEMPOOL_H__ + +/* System headers */ +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include + +#define CPU_SPIN_BACKOFF_CYCLES 512 + +/* total number of bpools on SoC */ +#define DPAA_MAX_BPOOLS 256 + +/* Maximum release/acquire from BMAN */ +#define DPAA_MBUF_MAX_ACQ_REL 8 + +struct pool_info_entry { + struct rte_mempool *mp; + struct bman_pool *bp; + uint32_t bpid; + uint32_t size; + uint32_t meta_data_size; + int32_t dpaa_ops_index; +}; + +#define DPAA_MEMPOOL_TO_POOL_INFO(__mp) \ + (struct pool_info_entry *)__mp->pool_data + +#define DPAA_MEMPOOL_TO_BPID(__mp) \ + ((struct pool_info_entry *)__mp->pool_data)->bpid + +extern struct pool_info_entry rte_dpaa_pool_table[DPAA_MAX_BPOOLS]; + +#define DPAA_BPID_TO_POOL_INFO(__bpid) (&rte_dpaa_pool_table[__bpid]) + +#endif diff --git a/drivers/mempool/dpaa/rte_mempool_dpaa_version.map b/drivers/mempool/dpaa/rte_mempool_dpaa_version.map new file mode 100644 index 0000000..5be8f56 --- /dev/null +++ b/drivers/mempool/dpaa/rte_mempool_dpaa_version.map @@ -0,0 +1,6 @@ +DPDK_17.08 { + global: + + rte_dpaa_pool_table; + +}; diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c index 5a5d6aa..60dd1c0 100644 --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c @@ -294,7 +294,7 @@ rte_dpaa2_mbuf_alloc_bulk(struct rte_mempool *pool, /* Releasing all buffers allocated */ rte_dpaa2_mbuf_release(pool, obj_table, bpid, bp_info->meta_data_size, n); - return ret; + return -1; } /* assigning mbuf from the acquired objects */ for (i = 0; (i < ret) && bufs[i]; i++) { -- 2.7.4