From patchwork Thu Jan 19 13:23:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 19798 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 99B4DFA55; Thu, 19 Jan 2017 14:25:58 +0100 (CET) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0054.outbound.protection.outlook.com [104.47.33.54]) by dpdk.org (Postfix) with ESMTP id A1BE6F961 for ; Thu, 19 Jan 2017 14:25:12 +0100 (CET) Received: from BN3PR03CA0109.namprd03.prod.outlook.com (10.174.66.27) by BN6PR03MB2465.namprd03.prod.outlook.com (10.168.223.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Thu, 19 Jan 2017 13:25:11 +0000 Received: from BL2FFO11FD033.protection.gbl (2a01:111:f400:7c09::193) by BN3PR03CA0109.outlook.office365.com (2603:10b6:400:4::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13 via Frontend Transport; Thu, 19 Jan 2017 13:25:11 +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; 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.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 BL2FFO11FD033.mail.protection.outlook.com (10.173.161.129) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Thu, 19 Jan 2017 13:25:11 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v0JDO4et015351; Thu, 19 Jan 2017 06:25:08 -0700 From: Hemant Agrawal To: CC: , , , , , , Hemant Agrawal Date: Thu, 19 Jan 2017 18:53:44 +0530 Message-ID: <1484832240-2048-20-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1484832240-2048-1-git-send-email-hemant.agrawal@nxp.com> References: <1484679174-4174-1-git-send-email-hemant.agrawal@nxp.com> <1484832240-2048-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131293059117555664; (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)(7916002)(336005)(39380400002)(39410400002)(39400400002)(39840400002)(39860400002)(39850400002)(39450400003)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(6666003)(36756003)(50986999)(5003940100001)(76176999)(189998001)(626004)(38730400001)(305945005)(92566002)(86362001)(575784001)(104016004)(110136003)(53936002)(2950100002)(6916009)(47776003)(2906002)(5660300001)(8936002)(4326007)(33646002)(97736004)(68736007)(81156014)(8656002)(85426001)(81166006)(50226002)(48376002)(356003)(77096006)(106466001)(50466002)(105606002)(8676002)(54906002)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2465; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD033; 1:xfiluTxyGCQ+iVzw5EhHHQDeFdPcykIgfNA3e4zLtOjJwp8JUnprn1rRSc2Th3S3QY6Gb9I9Gf/5hlmZ/s0vNGWcWBBh2kSlQj2UT9s3lkr77TonNDxe9IQUvN9GcTJij1enNGB467bp2x0469vTXu8ZNnmbbzajdKSyRBzH26HcAICV8yRCcZNyyOHC66g/EUd/eLyYEhw5TPTMWI43W8XOqGY9h0n+NUh/t5Ou6ir3HuWPBfLVncBXUKgBfARUQmZoYFfxQH+7D43zSIUj2JFce83IpdS5h0Bn6WoA2/eqXT4S6IoDLDvh2/ZzVjR25a/lRiHBG3VSn6TBwSy5A0eU7NRfUAqgbeQyaQJqv4ErZlgO/Zcc8lJ8ywKIXE9q6dg1rsGlJz4ifFGeAbAQNT0H6FCO9S67wl2uGTHF7wnm6mqz5TI5/XIqwPBazLRcchWzrcPfciFSVnZjS8WY6tcm8udPnQ0CbdrUnhP3kIJJ0XJlj+NwG+bYFL9rwaK1o8yFaHwTnrR8aBedlq9anJ0WO9RrXVuvQ6mWGxr/+mz3Uw2k6h9uAboeEZXGNBkyrsj6Gq2Qd/uCsc/d2KGAFf17uvUOlVDaZyYAnYRjvNSaaDDRiLoofXnnuBlwqmA2u2lVkVieF1Ya/9xTw7RSGuhtld/G5nz10gKWM1weB2LNpzyTsMua9EsAXfXtCZC9OcNdRNL3zHYzqvm/8By5N7UyL2fCApQIvNk5ARV5s7zw3aUqH+797jSHmywuFjDQ MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 810c0b04-7577-4f99-1fd0-08d4406e98a4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN6PR03MB2465; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2465; 3:YkUKoy4NwdIGWFY3gR3JCxv5aZNnNuu3nG24AU+/7L88fTPU5vgYq6KqxgknbfIxBHVc5fNjQH+xnHBN6Mt2nRf6nvYyUJGXfST2woQfz6Hrg1Uy1H+7R+89KJLKpKX6T5wplFML+d3qTMD3ci+HXcalIBpoIyMFc+X0Xu1zA4bQxzLIIvYBHfOgcvt/PSxhJhz6rSXgj9wXFowvBDdRT6BBDeMkrgNAVT2T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+TpCAj2qzlPB7j62THWmeKlPt/Rwe/+x2MMFHGezw8IuR6nEoGTSwr93VCVXn5szzJdPAkxu40Ahugcb2EzbQDpiWh++i3+ZuKjnftBpou8wtrK49+DrcX2kc5iT/o8UY7SdJtWjI2aqFcwhRF2PaJ3/Y3jxrCxdtuKwIazfDe6fbxrw3AKTiVHvWQCrNxKXDU6S/bs7yBq0+RzqgfMH9F5p9L1Js40w== 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)(13017025)(13015025)(13018025)(13024025)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123559025)(20161123563025)(20161123556025)(20161123561025); SRVR:BN6PR03MB2465; BCL:0; PCL:0; RULEID:(400006); SRVR:BN6PR03MB2465; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2465; 4:rmo6rdiaj9GvRwEyR3rcUdv0vX0kzx7wCyJYJIulch60ajlgmlOwra3T+HLeiyAPlBBgqJApcQj5fBTTjanwX0OZ3R+fTOajnQGTc1iTnvJK9tgIB1Y+BUx0XQdZvGXFrBExqbnTkCEO44unFhdyNwmL1Plbl0KOVMcRILrOpnvO8n0jfz2U+YBKiAbSi90V5xR3B9AU0I5bKqYYhzciPKUYXBHWJ/Zpv5Ffmy9z00rqdNDb22A0l+mq2kv4UzOMMPog7LnaVdNc5JeJg70jbKo0zF8WnTdD7GLO7FvSk44BdpAnSHoz+x0paC0TNvTTY510rnTmiTCFB1IknzfgaZIh5DqIMcYbhyez5qYBUdP6o7eN2AnbI+FX1x70+Tf28cXbTJUr8V9upc6rVZpPN2NS4gp0CtaYJx2RBhgkPIN17JL/xPT1mVWGyJpCxOTYdYIBsWqogq1FPChePexLCl7OxEx2Q56H2O0Ud+PXaUWVpjQXzsdmlbas1wJjtTsKutE2+5MooSAOimKWeg5V/B6tLfszpN0xX9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EkDzPW7oTg2GtS7bABRjEUhxYIgR6xbhkXgLRA7UAPR8AwPeL1HlWzmLT1tl5sdr8tKZuU7qFkVCI7Gl3LYnvQCmrxlSKsGT41i8yyOpBXx8i44D7F+uLG9WGIMuRiVG82WaqUUK4JDOiXjfN3x0VrzrTl8ieaCSM2efmltQ+4S6vA3ca/o60; 24:+JM/DhRUnZQaj6jRWdzONRxyEYmqb2xyTq9e/ZpZGwEgAXDqPNON3BMNOzSvmdeL5EPv2yNBa5uGKiz1tbFj+BQuHQPm2TLTT3VUc6FLy9o= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2465; 7:8WKLISSdSJ6tUbrWBmDIwac3tYv4++ttAMU++ZYuDTjZrhXAprMC0pgZTzK+2RW7KyklH5amDEPXzfkWOVIzWGMbOgWayCWWtUwnTiq0GUU0AzMx/m98sfByrMjwjW0CtSvaXaX65cEtK8rz9HyPSF6eLZdWn6opzsVsg/YkUXd+UyRRGT/F/zx/yMciMRz5uHVaKT2YG6hs3AyNJuD0hfkoNAtVLdhQxnn1YWH20ogkPXZd5H2wLA7l/dpzxt/bktD+CeRUMyChFFdx2jOe9g7SbFg5rU+cR+a2StSdsdZr2zVVqiUTY4rp5WNJo7MsgbBqb7pJLJecmLbD7P3dEYAl0/3+s9SiBkDgtjA3TDL0yXNjlVSjQaZzLifDiCf9lGzTp2sBBaT8vrMqk4TN+WcwXANkx12cSmR22yYQVCMQV/5xMmxfGnjb36VklpLtarJDms2/BDaNvBTlDml2sQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2017 13:25:11.5683 (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: BN6PR03MB2465 Subject: [dpdk-dev] [PATCHv5 17/33] drivers/common/dpaa2: dpio routine to affine to crypto threads 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 45 ++++++++++++++++++++++++++ drivers/bus/fslmc/portal/dpaa2_hw_dpio.h | 3 ++ drivers/bus/fslmc/rte_pmd_fslmcbus_version.map | 1 + 3 files changed, 49 insertions(+) diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index 011bd9f..d7de0d5 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -276,6 +276,51 @@ static inline struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(void) } int +dpaa2_affine_qbman_swp_sec(void) +{ + unsigned int lcore_id = rte_lcore_id(); + uint64_t tid = syscall(SYS_gettid); + + if (lcore_id == LCORE_ID_ANY) + lcore_id = rte_get_master_lcore(); + /* if the core id is not supported */ + else if (lcore_id >= RTE_MAX_LCORE) + return -1; + + if (dpaa2_io_portal[lcore_id].sec_dpio_dev) { + PMD_DRV_LOG(INFO, "DPAA Portal=0x%x (%d) is being shared" + " between thread %lu and current %lu", + dpaa2_io_portal[lcore_id].sec_dpio_dev, + dpaa2_io_portal[lcore_id].sec_dpio_dev->index, + dpaa2_io_portal[lcore_id].sec_tid, + tid); + RTE_PER_LCORE(_dpaa2_io).sec_dpio_dev + = dpaa2_io_portal[lcore_id].sec_dpio_dev; + rte_atomic16_inc(&dpaa2_io_portal + [lcore_id].sec_dpio_dev->ref_count); + dpaa2_io_portal[lcore_id].sec_tid = tid; + + PMD_DRV_LOG(DEBUG, "Old Portal=0x%x (%d) affined thread - %lu", + dpaa2_io_portal[lcore_id].sec_dpio_dev, + dpaa2_io_portal[lcore_id].sec_dpio_dev->index, + tid); + return 0; + } + + /* Populate the dpaa2_io_portal structure */ + dpaa2_io_portal[lcore_id].sec_dpio_dev = dpaa2_get_qbman_swp(); + + if (dpaa2_io_portal[lcore_id].sec_dpio_dev) { + RTE_PER_LCORE(_dpaa2_io).sec_dpio_dev + = dpaa2_io_portal[lcore_id].sec_dpio_dev; + dpaa2_io_portal[lcore_id].sec_tid = tid; + return 0; + } else { + return -1; + } +} + +int dpaa2_create_dpio_device(struct fslmc_vfio_device *vdev, struct vfio_device_info *obj_info, int object_id) diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h index 682f3fa..b1a1b8f 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h @@ -56,5 +56,8 @@ struct dpaa2_io_portal_t { /* Affine a DPIO portal to current processing thread */ int dpaa2_affine_qbman_swp(void); +/* Affine additional DPIO portal to current crypto processing thread */ +int dpaa2_affine_qbman_swp_sec(void); + #endif /* _DPAA2_HW_DPIO_H_ */ diff --git a/drivers/bus/fslmc/rte_pmd_fslmcbus_version.map b/drivers/bus/fslmc/rte_pmd_fslmcbus_version.map index 76029b9..6937ad0 100644 --- a/drivers/bus/fslmc/rte_pmd_fslmcbus_version.map +++ b/drivers/bus/fslmc/rte_pmd_fslmcbus_version.map @@ -2,6 +2,7 @@ DPDK_17.02 { global: dpaa2_affine_qbman_swp; + dpaa2_affine_qbman_swp_sec; dpaa2_alloc_dpbp_dev; dpaa2_free_dpbp_dev; dpbp_disable;