From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0076.outbound.protection.outlook.com [104.47.37.76]) by dpdk.org (Postfix) with ESMTP id 435A8FA58 for ; Mon, 19 Dec 2016 16:21:29 +0100 (CET) Received: from CY4PR03CA0019.namprd03.prod.outlook.com (10.168.162.29) by DM5PR03MB2473.namprd03.prod.outlook.com (10.168.233.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.789.14; Mon, 19 Dec 2016 15:21:28 +0000 Received: from BN1AFFO11FD007.protection.gbl (2a01:111:f400:7c10::124) by CY4PR03CA0019.outlook.office365.com (2603:10b6:903:33::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.789.14 via Frontend Transport; Mon, 19 Dec 2016 15:21:28 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1AFFO11FD007.mail.protection.outlook.com (10.58.52.67) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.789.10 via Frontend Transport; Mon, 19 Dec 2016 15:21:27 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id uBJFKMhf029110; Mon, 19 Dec 2016 08:21:24 -0700 From: Hemant Agrawal To: CC: , , , , , , Hemant Agrawal Date: Tue, 20 Dec 2016 02:23:55 +0530 Message-ID: <1482180853-18823-17-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1482180853-18823-1-git-send-email-hemant.agrawal@nxp.com> References: <1480875447-23680-1-git-send-email-hemant.agrawal@nxp.com> <1482180853-18823-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131266344877649359; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(7916002)(39860400002)(39400400002)(39410400002)(39850400002)(39380400002)(39450400003)(39840400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(626004)(92566002)(5003940100001)(105606002)(104016004)(6916009)(305945005)(77096006)(189998001)(48376002)(76176999)(5660300001)(85426001)(33646002)(106466001)(36756003)(50986999)(50466002)(86362001)(97736004)(2906002)(110136003)(6666003)(2950100002)(8936002)(2351001)(50226002)(38730400001)(8676002)(69596002)(356003)(68736007)(4326007)(81156014)(47776003)(81166006)(8666005)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2473; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD007; 1:JDwoTYwqkgqGsKWsJ8nfipS2YDZlOyqPqVMOk5MYjmPxDWpt6M36L9ZhEKiAoFXhF8Et7afv8jQZvuS+SV3NJhPeSN2NMVz37RbJjpDJCK5liDf7x0WwPFZCxkpvwFLiVG0bL61c4jmELT89UL18QMjgLu1s+JZvKm91dKDzCk0kH+bTrA3n3iCrVvvYXL0vTwHwkKs1uPaYYjJEx3IEXZuW2Oygxgp3/h1AztbajNE2+sseaXM3BuFsRXtTNumcZKiXI1RQJ5OUqDZVfvSjfAqqhySP//aS7e68+K4HOdKvYBjb1ysmtnUdC7uSPoW+rDC5G7swI+Q7sxgu1eh/MQGC1AXmT+VEhtHNrtizZfD1bSjGtXqy+mkjLWiOOcScCkprvFI7CWf+TdafvdwfETS0/IF3YYUawfta1uCBA86Rdp2kJQqmDrCdPrREXxMBpN3rOMbbIToft7mA5aXwkuU5B8RsZ2O6g0bv2N8NCiMMqBr8HkOxWtQK0lM2rnKoj3uFF4fCmXKzB8vSpSPkfrH5iM/u+pPxIsXOHwgLMMq/DGQSnY7zeAPMu2QpBUIy3DTYh8kPdVxdClgQUMir3niU90rTKTjzFVk8ixY2cPx48z5V8Nz2FwPbg9jvslwJAQmTzRdqPGmgaRJvqNW0WXxJmv8s/z18Yr9r2iAsVraSlJeCHLhDHvx4CCDfCL+OJ2p123RY5uyBUDvcgW3jvxWXa2GZ6A0/35xRtxDTdFu3Aupb/PZ7uVf/i1F68ourDhUfhFI9Fyu99fIxPm6oAA== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 6e88bb76-8aa7-4f5b-0c6d-08d42822b3da X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DM5PR03MB2473; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2473; 3:6oufexm/woVyMfAhjoISxdR++OjeOsnFaAn5Ec8HDGBWgt58oPAmMQdPglMT6zyl3P5ScbCF61fdmBFDw+XppkTihFEzzjjmRtelv8U2ii9ZFLfzRvblb17wCEMLTfBVkIQqY1xqMOdRkWajkyXRZ8dIQrGGNSLST4d7tO3QXmvpBrINjWUG6t0bdwJIsqUl9z3QAsQOcHTt3XugRBV11om5GT4fE3QR0PGo9MMNDqWLY/KBl2CInv37tztryLURdQK8dQM+OU7DU3q6l6s6cWoiWwFGiuxM2tYyXwxmz4SFgmRJqGSDxhFL2wKaeN06QMTtBl7xb8mZqFC8jMnVlGYcAR1iTDuBF4nxlXq0uJajrqLFQ61sHDBPloVS8eff; 25:EbrfmyxK8s9WKMVL3rWShAeNYHZKwrC83OyFMTJB3ieWkmzsCPG+Dvqj5j8lZuUqXbrDjjmfdy/gPIIdkQmpQS1o66t7wI+mjKHbs1fTPSA5LKe/MHuvSB3uhGEyeWbhhVDjfy1jzyW4bXe7BHQyuHJxfsTAvKTQEKx4P+8nv3f1v0PjTILnYb+VA6EnMMJvr8b1exFDGfpM/A2pI+RMCM40OU+UFS3fOSLixFXckArHhMnFHe7ujGCLO4CSc5G89i/L7c8/Ae/1uckqvPLlebPBT335EXEFEiZCE7mSav5xWJeVO/uVu029rOgF+VWR9WemPdYO8642JOI1Z3Bbfq1eB6jI03lXVwyNNM4DnnPC3UqdvZZ7E4m+z5NRAP7FvzJCWQkVDbNcQZliFdMk9Qka1a8wX6cffaCNqRVOPs/nLrxpakNSp8exssiNAmYiC8aLGJ7Z8WzUX8hH1LNmSw== X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2473; 31:DzBakNmqGuCKmgPgHQwPM2lvyVS9nJD0mOOX3BdlWvPp+18w/vBQwF/7jfhwQckPW3LIDLg+dVeTldDe92ThubbwRWyZwCftbHsE0IEcVjDwqrmTi1rjRSUZSB6zVEiBavWDiXQMqscP/Jce65A2fYykiB3dvOlqD/bL8pY5FQgyMZfIci9e6Tr0L80SsFyukLY65+ab730P2vmaN1jY0MbgWzjYtIGQbaEfaZRC9N0Qepd+Dy8ffzHxZtcRDN0fAYmCpQbvXBzseojQJpDy1KWImF1AlKBNcqEFX+mdcqY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(5005006)(8121501046)(13023025)(13024025)(13015025)(13017025)(13018025)(3002001)(10201501046)(6055026)(6096035)(20161123563025)(20161123561025)(20161123556025)(20161123565025)(20161123559025); SRVR:DM5PR03MB2473; BCL:0; PCL:0; RULEID:(400006); SRVR:DM5PR03MB2473; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2473; 4:KkCmMJXSIawrKNwgqs9lVCWBDsyuPSUDJazknc4R02bik2x8YxVZgNTIQdVHlvF1PzyBWJPi4HXb6MsZWJqMjEV7B78wtq0+axbuFVebil9OdUf+fwO2TJaMC45IL+22XZTZnAW+JmKlrP18xhbKX05Mu4ZTEMMP1bjP6A2v8aFgDooukwaBu6DKK2mxtLF1+/WOTK2M5bU5CfUSB3vQHwGuzC3U+G5lqjWWMXElrpi6KhIUzfdsqlR6mIPektY+Wr6RsJ4LQHsm+1u34zeMrZQ+u9ftkRYxKZeDQ4FodKTEnaz83K32Wv9Asm4s36Jeh/jpw+myWbimIIu7FU5n8SwjCnRSp+nVQdqKncmJBzSXIztOWutI/nFPw4T787Wj0EFtgbNZHYCdF3HRNeQSqClNUZeViy2wEK+lFjvBsDksc7cBfvN2ZszDnuS4wafFPx1aNTMEXyZkYcTIc+1ukUYaozfXDqDdGC4kGMQfx4RcPYjC+hjkmr0oCO93bAOJ5jAbWXAqfbO9C+g5splPn2VxUlmAcKPjgajsuzcMaoTeejYN33ne6M4iw8mwov3HR6hcCSx7gCR7NYNZ/hNd5/ijpSafkQmu165p0lVouqD7BEi/f32LnMkbmmIETdXW1Sr0fwey0tDTzmxKuQS5Ga8sRP6TXblWwV9lwCpmv1P13xOHgRyEgrFsXMTNFSwpOImIqDDa3Uqc008obcCJY+lc0lgkvlriBb3/Zi6xiNZ1wMcVBk2amGoGwrxw0ok1Tq85JIDwoaO1m5Y6nMllBw== X-Forefront-PRVS: 01613DFDC8 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB2473; 23:e5SEKgaSYzqhSUgU4s15+dj0EWtI5UQacQCh8yfxz?= =?us-ascii?Q?ch1s6F1AbIsdj4D8sbCJv5DcthgQmg+24yuo3yaKKy6ZeCj7oCpfaCBb6lzL?= =?us-ascii?Q?s3V8dqJoIdzVqKYYfenKnUoRY8Fxlxfx2rT4e6hMLLDCOf85RbKhhCNtF27d?= =?us-ascii?Q?SXT3IIjJFs+yQPEZPSg1KUDmEQpljFD6whTwfL1SkwSauhuc6cNbFY9occqU?= =?us-ascii?Q?ciB2XwIlIwXUoBkWkO8AoYsGkysDqX6a0RiNarrz+vHNN8JUyWQ0CvGgLrmZ?= =?us-ascii?Q?KytoSSLnYoSuFV4LNxRfXH8whtGmN3QZ7slYQa3VAC7AF1BKlQPFjR5I8bAW?= =?us-ascii?Q?iPpTeLXb/QIwzKYdldO7v/7+Ui+88yV28HQu7xtEM27q2G7vOpl7v18rWT+B?= =?us-ascii?Q?yvSxb71LHxepTSAgZmxpqRzV49tOeTg6dCmDiKVnQKMUL4Gm7b0bjWiUXixd?= =?us-ascii?Q?WU2lipQHMFmuApHmVUySmGFpdfZBUfCmsAyxmewYf4pAgziE5ThfDimOdTMu?= =?us-ascii?Q?ZyE56y2R4lVS5opTYwf2WALPVT716hgUHBHAVzQmj9mT7h08/YqPnOTnnR4v?= =?us-ascii?Q?S6VX6W0LH4HY8oF4tQQcbjdQha+UwiSnJK/gm6h0OotvWgNI6y6GccZ38+B5?= =?us-ascii?Q?raCUpZkC5Vw4C2PQYpjQ9KfqNFns6JMUiQn8kw1xVVDnSuFkBIBUoVdzZppw?= =?us-ascii?Q?hn9AWSwzmUWY8ArMqCGT1ao6UlmB5PyBHvOieaSJqPWZZllVSzTVrduPkQGh?= =?us-ascii?Q?iC5OEmdl6vHKzfYqx1x2A8FQRBhdMLvCc7KwK9+7UFHlUAbik/q2TIs0fYyU?= =?us-ascii?Q?UX49agSplVVUXLgEP5nmwAUuBjtLyBIu+saVqY3SSDaolY61IxhqAgFmEYIe?= =?us-ascii?Q?Le7Y+93soyc8aHgdKlfHmVj31tmztstoktArig00kgwYOFr2KQ8RlatcYDag?= =?us-ascii?Q?hBCLQ25SK4pvXk/KW8VC119un8RwxmhzAZbENMNiiPKe4QuMHwvwl80lIiQW?= =?us-ascii?Q?GnS8Fz2wDqjXktDBD5jCSc8NbIxpn39uPWQXSlP3zSg7KlVoY5d1gKem0D7+?= =?us-ascii?Q?Czeud/pukeCv4VHksH/0NWwHF4Az1fTnfcpcMEdZOuUBSd8LeA0M9zc9TuCs?= =?us-ascii?Q?QuQgA//inFdsmazOoshGeBkuohLkb6RzRhCPfd/Hc2Fa4D5/5fWLNxQoD0G9?= =?us-ascii?Q?cNNPCzgbLvNa0JGZS1V4CzHBXMkktJfyanlfszo4RKL3Axc7FrT5S9Kfndu3?= =?us-ascii?Q?E1dQwwxV2GOTDNEZjEQ62zDMumkR8yN2hWv99zSwMVZKWNpi/wLZBrJbLQiZ?= =?us-ascii?Q?dV2gjHBxxF1nZvDOI4V74w=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2473; 6:SpJYvAITU/xrZKes2A4PfZCg0270eKmwS4t1CzQzCdJjbD9uIGIqgOuhvFfzQxKaALZEx3YqIle0I39OjvgNPPjl5dSqf+QErXiTTDafAgOhHkc+5gqAFLxko+gcNsjWhhxn3t9DKylvhtO98GhrGKldV2AoEoQItbl4PbRalDUBlVGDPrh/pE66B6deACNchptK7atws1tqJ0AChRQiBYm/6uyjXHlz/E2bYGYN9aTvkzUZwx/CerZiObI1l31ZWthPlwPK9USLe4/8HUTX20eitKMqATj6GmcKulmFp0dt8QGCiI9fOtPMZkWHERoT3QjLrKS4y114tft6ug/L76CUKFXfdd9MNzivj4XPpNqHlPeCUdYiV6CtoMekLBSjajUTMv+EFR26451S88Qx/CukZncfHE4tCZbgrkVm7VzCv70vlk+lRPvBVU64raPe; 5:WvHw/FrIZBVfWevEqArPq3Ob3e/SnyM1txXOXO154rBu+vbEV6gvoJaMIc8Z/OIU8d6GA6nnyv/EUshYLyIRwZArnI5lvQ1mBivVejn6uPU8GOEZM6ZoUINsDkPHtO05q5pianqGFV2ShmtrxpfGb5tNYb+HvX0x8egjxi5CdsWuB/+rUjpVZqQZ+uOFmleQ; 24:+I/1PJXPSznW9MqyLV+T76qctX/8O9ZHvGgGsRl87tmMk5okkE1c2l56sXzLSCEIRmVXX9Iu0gKJK7oSwVlCcTFPf3zc2y+daCX+3Ybh1qw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2473; 7:qBAUo1943EuC/A2QiYw3n/+ffpgI5d8BnK8FEiraJykyF1hWGm+8YQ4zcDr8ek5GEtPhUAuTTf8/dl+fgsVDI5BLsFnlmDq8gYlLJsHxSYhk8Ypj2+oukVl2UclridQqPwIuiNjULLO/OY6Q8G0euSHNXRBWygxsNgNpMcNk4kRR7KJ+L0Un8ieEUHeDyo75Tt70n32DKi94rH2Hv4bK0KhbDmjJbpxQtImoaxVn+3oG7i1FWPBx2m7WfZlgx6Qbh1ef4tzvHLJclf6siVflN2KEGHEJAgaBhJykcKRJBuj03HzQ+jbFcQMQly0M6urAobTeitxxe42JHwVr9mXaiF/6LwIwPoWOoni7p/gYoV2Kdod7PJNosh9q7iyByQSk6hZhP9Jc7eQCrjmKbFTtFoMHEC4MLSfiqox/xjmZFrPFqDZ82scUguBXMy8HUwFDyK18+UHyqEvGIubN+JDNZw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2016 15:21:27.5153 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2473 Subject: [dpdk-dev] [PATCHv2 16/34] drivers/pool/dpaa2: adding hw offloaded 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: Mon, 19 Dec 2016 15:21:31 -0000 Adding NXP DPAA2 architecture specific mempool support Each mempool instance is represented by a DPBP object from the FSL-MC bus. This patch also registers a dpaa2 type MEMPOOL OPS Signed-off-by: Hemant Agrawal --- config/common_base | 1 + config/defconfig_arm64-dpaa2-linuxapp-gcc | 4 + drivers/Makefile | 1 + drivers/bus/fslmc/Makefile | 1 + drivers/bus/fslmc/fslmc_vfio.c | 10 +- drivers/common/Makefile | 3 + drivers/common/dpaa2/dpio/dpaa2_hw_pvt.h | 7 + drivers/pool/Makefile | 38 +++ drivers/pool/dpaa2/Makefile | 66 ++++ drivers/pool/dpaa2/dpaa2_hw_mempool.c | 362 ++++++++++++++++++++++ drivers/pool/dpaa2/dpaa2_hw_mempool.h | 104 +++++++ drivers/pool/dpaa2/rte_pmd_dpaa2_pool_version.map | 8 + mk/rte.app.mk | 1 + 13 files changed, 605 insertions(+), 1 deletion(-) create mode 100644 drivers/pool/Makefile create mode 100644 drivers/pool/dpaa2/Makefile create mode 100644 drivers/pool/dpaa2/dpaa2_hw_mempool.c create mode 100644 drivers/pool/dpaa2/dpaa2_hw_mempool.h create mode 100644 drivers/pool/dpaa2/rte_pmd_dpaa2_pool_version.map diff --git a/config/common_base b/config/common_base index d605e85..493811f 100644 --- a/config/common_base +++ b/config/common_base @@ -276,6 +276,7 @@ CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_MBOX=n # Compile Support Libraries for NXP DPAA2 # CONFIG_RTE_LIBRTE_DPAA2_COMMON=n +CONFIG_RTE_LIBRTE_DPAA2_POOL=n # # Compile NXP DPAA2 FSL-MC Bus diff --git a/config/defconfig_arm64-dpaa2-linuxapp-gcc b/config/defconfig_arm64-dpaa2-linuxapp-gcc index d3bc9d8..7665912 100644 --- a/config/defconfig_arm64-dpaa2-linuxapp-gcc +++ b/config/defconfig_arm64-dpaa2-linuxapp-gcc @@ -42,10 +42,14 @@ CONFIG_RTE_ARCH_ARM_TUNE="cortex-a57+fp+simd" CONFIG_RTE_MAX_LCORE=8 CONFIG_RTE_MAX_NUMA_NODES=1 +CONFIG_RTE_PKTMBUF_HEADROOM=256 + # # Compile Support Libraries for DPAA2 # CONFIG_RTE_LIBRTE_DPAA2_COMMON=y +CONFIG_RTE_LIBRTE_DPAA2_POOL=n +CONFIG_RTE_MBUF_DEFAULT_MEMPOOL_OPS="dpaa2" # # Compile NXP DPAA2 FSL-MC Bus diff --git a/drivers/Makefile b/drivers/Makefile index bdae63b..609523d 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -34,6 +34,7 @@ include $(RTE_SDK)/mk/rte.vars.mk DIRS-y += common DIRS-y += bus DIRS-y += net +DIRS-y += pool DIRS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += crypto include $(RTE_SDK)/mk/rte.subdir.mk diff --git a/drivers/bus/fslmc/Makefile b/drivers/bus/fslmc/Makefile index cc6d7c2..a830701 100644 --- a/drivers/bus/fslmc/Makefile +++ b/drivers/bus/fslmc/Makefile @@ -48,6 +48,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/mc CFLAGS += -I$(RTE_SDK)/drivers/common/dpaa2/qbman/include CFLAGS += -I$(RTE_SDK)/drivers/common/dpaa2/dpio +CFLAGS += -I$(RTE_SDK)/drivers/pool/dpaa2 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal # versioning export map diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index 1c80bf9..8d6a3eb 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -63,6 +63,7 @@ #include "dpaa2_hw_pvt.h" #include "dpaa2_hw_dpio.h" +#include "dpaa2_hw_mempool.h" #define VFIO_MAX_CONTAINERS 1 @@ -270,7 +271,7 @@ int fslmc_vfio_process_group(struct rte_bus *bus) char path[PATH_MAX]; int64_t v_addr; int ndev_count; - int dpio_count = 0; + int dpio_count = 0, dpbp_count = 0; struct fslmc_vfio_group *group = &vfio_groups[0]; static int process_once; @@ -420,6 +421,11 @@ int fslmc_vfio_process_group(struct rte_bus *bus) if (!ret) dpio_count++; } + if (!strcmp(object_type, "dpbp")) { + ret = dpaa2_create_dpbp_device(object_id); + if (!ret) + dpbp_count++; + } } closedir(d); @@ -427,6 +433,8 @@ int fslmc_vfio_process_group(struct rte_bus *bus) if (ret) FSLMC_VFIO_LOG(DEBUG, "Error in affining qbman swp %d", ret); + FSLMC_VFIO_LOG(DEBUG, "DPAA2: Added dpbp_count = %d dpio_count=%d\n", + dpbp_count, dpio_count); return 0; FAILURE: diff --git a/drivers/common/Makefile b/drivers/common/Makefile index 434280f..0a6d8db 100644 --- a/drivers/common/Makefile +++ b/drivers/common/Makefile @@ -34,6 +34,9 @@ include $(RTE_SDK)/mk/rte.vars.mk CONFIG_RTE_LIBRTE_DPAA2_COMMON = $(CONFIG_RTE_LIBRTE_DPAA2_PMD) ifneq ($(CONFIG_RTE_LIBRTE_DPAA2_COMMON),y) +CONFIG_RTE_LIBRTE_DPAA2_COMMON = $(CONFIG_RTE_LIBRTE_DPAA2_POOL) +endif +ifneq ($(CONFIG_RTE_LIBRTE_DPAA2_COMMON),y) CONFIG_RTE_LIBRTE_DPAA2_COMMON = $(CONFIG_RTE_LIBRTE_FSLMC_BUS) endif diff --git a/drivers/common/dpaa2/dpio/dpaa2_hw_pvt.h b/drivers/common/dpaa2/dpio/dpaa2_hw_pvt.h index ef3eb71..dda6243 100644 --- a/drivers/common/dpaa2/dpio/dpaa2_hw_pvt.h +++ b/drivers/common/dpaa2/dpio/dpaa2_hw_pvt.h @@ -41,6 +41,13 @@ #define MC_PORTAL_INDEX 0 #define NUM_DPIO_REGIONS 2 +#define MEMPOOL_F_HW_PKT_POOL 0x8000 /**< mpool flag to check offloaded pool */ + +/* Maximum release/acquire from QBMAN */ +#define DPAA2_MBUF_MAX_ACQ_REL 7 + +#define MAX_BPID 256 + struct dpaa2_dpio_dev { TAILQ_ENTRY(dpaa2_dpio_dev) next; /**< Pointer to Next device instance */ diff --git a/drivers/pool/Makefile b/drivers/pool/Makefile new file mode 100644 index 0000000..4325edd --- /dev/null +++ b/drivers/pool/Makefile @@ -0,0 +1,38 @@ +# 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 + +CONFIG_RTE_LIBRTE_DPAA2_POOL = $(CONFIG_RTE_LIBRTE_DPAA2_PMD) + +DIRS-$(CONFIG_RTE_LIBRTE_DPAA2_COMMON) += dpaa2 + +include $(RTE_SDK)/mk/rte.subdir.mk diff --git a/drivers/pool/dpaa2/Makefile b/drivers/pool/dpaa2/Makefile new file mode 100644 index 0000000..c33e631 --- /dev/null +++ b/drivers/pool/dpaa2/Makefile @@ -0,0 +1,66 @@ +# 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_pmd_dpaa2_pool.a + +ifeq ($(CONFIG_RTE_LIBRTE_DPAA2_DEBUG_INIT),y) +CFLAGS += -O0 -g +CFLAGS += "-Wno-error" +else +CFLAGS += -O3 +CFLAGS += $(WERROR_FLAGS) +endif + +CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaa2/dpio +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaa2/qbman/include +CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal + +# versioning export map +EXPORT_MAP := rte_pmd_dpaa2_pool_version.map + +# Lbrary version +LIBABIVER := 1 + +# all source are stored in SRCS-y +# +SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_COMMON) += dpaa2_hw_mempool.c + +# library dependencies +DEPDIRS-y += lib/librte_eal +DEPDIRS-y += lib/librte_mempool + +include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/pool/dpaa2/dpaa2_hw_mempool.c b/drivers/pool/dpaa2/dpaa2_hw_mempool.c new file mode 100644 index 0000000..f609af7 --- /dev/null +++ b/drivers/pool/dpaa2/dpaa2_hw_mempool.c @@ -0,0 +1,362 @@ +/*- + * BSD LICENSE + * + * Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (c) 2016 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 Freescale Semiconductor, Inc 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 +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include "dpaa2_hw_mempool.h" + +static struct dpbp_node *g_dpbp_list; +static struct dpbp_node *avail_dpbp; + +struct dpaa2_bp_info bpid_info[MAX_BPID]; + +struct dpaa2_bp_list *h_bp_list; + +int +dpaa2_create_dpbp_device( + int dpbp_id) +{ + struct dpbp_node *dpbp_node; + int ret; + + /* Allocate DPAA2 dpbp handle */ + dpbp_node = (struct dpbp_node *)malloc(sizeof(struct dpbp_node)); + if (!dpbp_node) { + PMD_INIT_LOG(ERR, "Memory allocation failed for DPBP Device"); + return -1; + } + + /* Open the dpbp object */ + dpbp_node->dpbp.regs = mcp_ptr_list[MC_PORTAL_INDEX]; + ret = dpbp_open(&dpbp_node->dpbp, + CMD_PRI_LOW, dpbp_id, &dpbp_node->token); + if (ret) { + PMD_INIT_LOG(ERR, "Resource alloc failure with err code: %d", + ret); + free(dpbp_node); + return -1; + } + + /* Clean the device first */ + ret = dpbp_reset(&dpbp_node->dpbp, CMD_PRI_LOW, dpbp_node->token); + if (ret) { + PMD_INIT_LOG(ERR, "Failure cleaning dpbp device with" + " error code %d\n", ret); + return -1; + } + + dpbp_node->dpbp_id = dpbp_id; + /* Add the dpbp handle into the global list */ + dpbp_node->next = g_dpbp_list; + g_dpbp_list = dpbp_node; + avail_dpbp = g_dpbp_list; + + PMD_INIT_LOG(DEBUG, "Buffer pool resource initialized %d", dpbp_id); + + return 0; +} + +static int +hw_mbuf_create_pool(struct rte_mempool *mp) +{ + struct dpaa2_bp_list *bp_list; + struct dpbp_attr dpbp_attr; + uint32_t bpid; + int ret; + + if (!avail_dpbp) { + PMD_DRV_LOG(ERR, "DPAA2 resources not available"); + return -1; + } + + ret = dpbp_enable(&avail_dpbp->dpbp, CMD_PRI_LOW, avail_dpbp->token); + if (ret != 0) { + PMD_INIT_LOG(ERR, "Resource enable failure with" + " err code: %d\n", ret); + return -1; + } + + ret = dpbp_get_attributes(&avail_dpbp->dpbp, CMD_PRI_LOW, + avail_dpbp->token, &dpbp_attr); + if (ret != 0) { + PMD_INIT_LOG(ERR, "Resource read failure with" + " err code: %d\n", ret); + ret = dpbp_disable(&avail_dpbp->dpbp, CMD_PRI_LOW, + avail_dpbp->token); + return -1; + } + + /* Allocate the bp_list which will be added into global_bp_list */ + bp_list = (struct dpaa2_bp_list *)malloc(sizeof(struct dpaa2_bp_list)); + if (!bp_list) { + PMD_INIT_LOG(ERR, "No heap memory available"); + return -1; + } + + /* Set parameters of buffer pool list */ + bp_list->buf_pool.num_bufs = mp->size; + bp_list->buf_pool.size = mp->elt_size + - sizeof(struct rte_mbuf) - rte_pktmbuf_priv_size(mp); + bp_list->buf_pool.bpid = dpbp_attr.bpid; + bp_list->buf_pool.h_bpool_mem = NULL; + bp_list->buf_pool.mp = mp; + bp_list->buf_pool.dpbp_node = avail_dpbp; + bp_list->next = h_bp_list; + + bpid = dpbp_attr.bpid; + + /* Increment the available DPBP */ + avail_dpbp = avail_dpbp->next; + + bpid_info[bpid].meta_data_size = sizeof(struct rte_mbuf) + + rte_pktmbuf_priv_size(mp); + bpid_info[bpid].bp_list = bp_list; + bpid_info[bpid].bpid = bpid; + + mp->pool_data = (void *)&bpid_info[bpid]; + + PMD_INIT_LOG(DEBUG, "BP List created for bpid =%d", dpbp_attr.bpid); + + h_bp_list = bp_list; + /* Identification for our offloaded pool_data structure + */ + mp->flags |= MEMPOOL_F_HW_PKT_POOL; + return 0; +} + +static void +hw_mbuf_free_pool(struct rte_mempool *mp __rte_unused) +{ + /* TODO: + * 1. Release bp_list memory allocation + * 2. opposite of dpbp_enable() + * + */ + struct dpaa2_bp_list *bp; + + /* Iterate over h_bp_list linked list and release each element */ + while (h_bp_list) { + bp = h_bp_list; + h_bp_list = bp->next; + + /* TODO: Should be changed to rte_free */ + free(bp); + } +} + +static +void dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused, + void * const *obj_table, + uint32_t bpid, + uint32_t meta_data_size, + int count) +{ + struct qbman_release_desc releasedesc; + struct qbman_swp *swp; + int ret; + int i, n; + uint64_t bufs[DPAA2_MBUF_MAX_ACQ_REL]; + + if (unlikely(!DPAA2_PER_LCORE_DPIO)) { + ret = dpaa2_affine_qbman_swp(); + if (ret != 0) { + RTE_LOG(ERR, PMD, "Failed to allocate IO portal"); + return; + } + } + swp = DPAA2_PER_LCORE_PORTAL; + + /* Create a release descriptor required for releasing + * buffers into QBMAN + */ + qbman_release_desc_clear(&releasedesc); + qbman_release_desc_set_bpid(&releasedesc, bpid); + + n = count % DPAA2_MBUF_MAX_ACQ_REL; + + /* convert mbuf to buffers for the remainder*/ + for (i = 0; i < n ; i++) + bufs[i] = (uint64_t)obj_table[i] + meta_data_size; + + /* feed them to bman*/ + do { + ret = qbman_swp_release(swp, &releasedesc, bufs, n); + } while (ret == -EBUSY); + + /* if there are more buffers to free */ + while (n < count) { + /* convert mbuf to buffers */ + for (i = 0; i < DPAA2_MBUF_MAX_ACQ_REL; i++) + bufs[i] = (uint64_t)obj_table[n + i] + meta_data_size; + + do { + ret = qbman_swp_release(swp, &releasedesc, bufs, + DPAA2_MBUF_MAX_ACQ_REL); + } while (ret == -EBUSY); + n += DPAA2_MBUF_MAX_ACQ_REL; + } +} + +int hw_mbuf_alloc_bulk(struct rte_mempool *pool, + void **obj_table, unsigned int count) +{ +#ifdef RTE_LIBRTE_DPAA2_DEBUG_DRIVER + static int alloc; +#endif + struct qbman_swp *swp; + uint32_t mbuf_size; + uint16_t bpid; + uint64_t bufs[DPAA2_MBUF_MAX_ACQ_REL]; + int i, ret; + unsigned int n = 0; + struct dpaa2_bp_info *bp_info; + + bp_info = mempool_to_bpinfo(pool); + + if (!(bp_info->bp_list)) { + RTE_LOG(ERR, PMD, "DPAA2 buffer pool not configured\n"); + return -2; + } + + bpid = bp_info->bpid; + + if (unlikely(!DPAA2_PER_LCORE_DPIO)) { + ret = dpaa2_affine_qbman_swp(); + if (ret != 0) { + RTE_LOG(ERR, PMD, "Failed to allocate IO portal"); + return -1; + } + } + swp = DPAA2_PER_LCORE_PORTAL; + + mbuf_size = sizeof(struct rte_mbuf) + rte_pktmbuf_priv_size(pool); + + while (n < count) { + /* Acquire is all-or-nothing, so we drain in 7s, + * then the remainder. + */ + if ((count - n) > DPAA2_MBUF_MAX_ACQ_REL) { + ret = qbman_swp_acquire(swp, bpid, bufs, + DPAA2_MBUF_MAX_ACQ_REL); + } else { + ret = qbman_swp_acquire(swp, bpid, bufs, + count - n); + } + /* In case of less than requested number of buffers available + * in pool, qbman_swp_acquire returns 0 + */ + if (ret <= 0) { + PMD_TX_LOG(ERR, "Buffer acquire failed with" + " err code: %d", ret); + /* The API expect the exact number of requested bufs */ + /* Releasing all buffers allocated */ + dpaa2_mbuf_release(pool, obj_table, bpid, + bp_info->meta_data_size, n); + return -1; + } + /* assigning mbuf from the acquired objects */ + for (i = 0; (i < ret) && bufs[i]; i++) { + /* TODO-errata - observed that bufs may be null + * i.e. first buffer is valid, + * remaining 6 buffers may be null + */ + obj_table[n] = (struct rte_mbuf *)(bufs[i] - mbuf_size); + rte_mbuf_refcnt_set((struct rte_mbuf *)obj_table[n], 0); + PMD_TX_LOG(DEBUG, "Acquired %p address %p from BMAN", + (void *)bufs[i], (void *)obj_table[n]); + n++; + } + } + +#ifdef RTE_LIBRTE_DPAA2_DEBUG_DRIVER + alloc += n; + PMD_TX_LOG(DEBUG, "Total = %d , req = %d done = %d", + alloc, count, n); +#endif + return 0; +} + +static int +hw_mbuf_free_bulk(struct rte_mempool *pool, + void * const *obj_table, unsigned int n) +{ + struct dpaa2_bp_info *bp_info; + + bp_info = mempool_to_bpinfo(pool); + if (!(bp_info->bp_list)) { + RTE_LOG(ERR, PMD, "DPAA2 buffer pool not configured"); + return -1; + } + dpaa2_mbuf_release(pool, obj_table, bp_info->bpid, + bp_info->meta_data_size, n); + + return 0; +} + +static unsigned +hw_mbuf_get_count(const struct rte_mempool *mp __rte_unused) +{ + return 0; +} + +struct rte_mempool_ops dpaa2_mpool_ops = { + .name = "dpaa2", + .alloc = hw_mbuf_create_pool, + .free = hw_mbuf_free_pool, + .enqueue = hw_mbuf_free_bulk, + .dequeue = hw_mbuf_alloc_bulk, + .get_count = hw_mbuf_get_count, +}; + +MEMPOOL_REGISTER_OPS(dpaa2_mpool_ops); diff --git a/drivers/pool/dpaa2/dpaa2_hw_mempool.h b/drivers/pool/dpaa2/dpaa2_hw_mempool.h new file mode 100644 index 0000000..4d6d645 --- /dev/null +++ b/drivers/pool/dpaa2/dpaa2_hw_mempool.h @@ -0,0 +1,104 @@ +/*- + * BSD LICENSE + * + * Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (c) 2016 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 Freescale Semiconductor, Inc 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 _DPAA2_HW_DPBP_H_ +#define _DPAA2_HW_DPBP_H_ + +#define DPAA2_MAX_BUF_POOLS 8 + +struct dpbp_node { + struct dpbp_node *next; + struct fsl_mc_io dpbp; + uint16_t token; + int dpbp_id; +}; + +struct buf_pool_cfg { + void *addr; /*!< The address from where DPAA2 will carve out the + * buffers. 'addr' should be 'NULL' if user wants + * to create buffers from the memory which user + * asked DPAA2 to reserve during 'nadk init' + */ + phys_addr_t phys_addr; /*!< corresponding physical address + * of the memory provided in addr + */ + uint32_t num; /*!< number of buffers */ + uint32_t size; /*!< size of each buffer. 'size' should include + * any headroom to be reserved and alignment + */ + uint16_t align; /*!< Buffer alignment (in bytes) */ + uint16_t bpid; /*!< The buffer pool id. This will be filled + *in by DPAA2 for each buffer pool + */ +}; + +struct buf_pool { + uint32_t size; + uint32_t num_bufs; + uint16_t bpid; + uint8_t *h_bpool_mem; + struct rte_mempool *mp; + struct dpbp_node *dpbp_node; +}; + +/*! + * Buffer pool list configuration structure. User need to give DPAA2 the + * valid number of 'num_buf_pools'. + */ +struct dpaa2_bp_list_cfg { + struct buf_pool_cfg buf_pool; /* Configuration of each buffer pool*/ +}; + +struct dpaa2_bp_list { + struct dpaa2_bp_list *next; + struct rte_mempool *mp; + struct buf_pool buf_pool; +}; + +struct dpaa2_bp_info { + uint32_t meta_data_size; + uint32_t bpid; + struct dpaa2_bp_list *bp_list; +}; + +#define mempool_to_bpinfo(mp) ((struct dpaa2_bp_info *)(mp)->pool_data) +#define mempool_to_bpid(mp) ((mempool_to_bpinfo(mp))->bpid) + +extern struct dpaa2_bp_info bpid_info[MAX_BPID]; + +int dpaa2_create_dpbp_device(int dpbp_id); + +int hw_mbuf_alloc_bulk(struct rte_mempool *pool, + void **obj_table, unsigned int count); + +#endif /* _DPAA2_HW_DPBP_H_ */ diff --git a/drivers/pool/dpaa2/rte_pmd_dpaa2_pool_version.map b/drivers/pool/dpaa2/rte_pmd_dpaa2_pool_version.map new file mode 100644 index 0000000..d18e076 --- /dev/null +++ b/drivers/pool/dpaa2/rte_pmd_dpaa2_pool_version.map @@ -0,0 +1,8 @@ +DPDK_17.02 { + global: + bpid_info; + dpaa2_create_dpbp_device; + hw_mbuf_alloc_bulk; + + local: *; +}; diff --git a/mk/rte.app.mk b/mk/rte.app.mk index f380c88..1f1157f 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -113,6 +113,7 @@ ifeq ($(CONFIG_RTE_LIBRTE_DPAA2_COMMON),y) _LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += -lrte_pmd_dpaa2 _LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += -lrte_pmd_dpaa2_qbman _LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += -lrte_pmd_dpaa2_dpio +_LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += -lrte_pmd_dpaa2_pool _LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += -lrte_pmd_fslmcbus endif _LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000 -- 1.9.1