From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0055.outbound.protection.outlook.com [104.47.34.55]) by dpdk.org (Postfix) with ESMTP id 28E97FA3C for ; Sun, 4 Dec 2016 13:44:17 +0100 (CET) Received: from BN6PR03CA0051.namprd03.prod.outlook.com (10.173.137.13) by BN6PR03MB2467.namprd03.prod.outlook.com (10.168.223.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.9; Sun, 4 Dec 2016 12:44:16 +0000 Received: from BN1BFFO11FD030.protection.gbl (2a01:111:f400:7c10::1:117) by BN6PR03CA0051.outlook.office365.com (2603:10b6:404:4c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.9 via Frontend Transport; Sun, 4 Dec 2016 12:44:16 +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 BN1BFFO11FD030.mail.protection.outlook.com (10.58.144.93) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.734.4 via Frontend Transport; Sun, 4 Dec 2016 12:44:16 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:726; Count:10 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id uB4ChXbI032240; Sun, 4 Dec 2016 05:44:13 -0700 From: Hemant Agrawal To: CC: , , , Hemant Agrawal Date: Sun, 4 Dec 2016 23:47:10 +0530 Message-ID: <1480875447-23680-16-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1480875447-23680-1-git-send-email-hemant.agrawal@nxp.com> References: <1480875447-23680-1-git-send-email-hemant.agrawal@nxp.com> X-IncomingHeaderCount: 10 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131253290563547804; (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)(2980300002)(1109001)(1110001)(339900001)(336004)(199003)(189002)(50226002)(2906002)(110136003)(2950100002)(47776003)(6916009)(92566002)(85426001)(8936002)(104016004)(189998001)(8676002)(81156014)(81166006)(38730400001)(39410400001)(5660300001)(575784001)(86362001)(77096006)(39450400002)(4326007)(626004)(39400400001)(39380400001)(36756003)(50986999)(97736004)(76176999)(8666005)(305945005)(33646002)(68736007)(7846002)(50466002)(48376002)(356003)(105606002)(106466001)(2351001)(5003940100001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2467; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD030; 1:BmhmU0Q2a6bs9MALQ9WJDcOCgSME0nPgiHClDSKnRoukR+kAtHN/0m3s+r/tDfipeMgt4xTC4+E1qd2gjt6Z6CSc0zrsMxMYbUyBsSKV46qveUkRg3VubWQJ1n+RqGO7OKdqWk0q8PY6PMyHX/02qq+pEkEEAgI1ayz8ujyk/78Rl8ZJ5+7vrXdxUNRyrmGSZxqQTpHYTEgKefbZtiHX1GOA4f7yHEYqUfD2DORlNiTDzDW6v9c9w2CHrNFLVgYJ8fv/C7HjMgUl+u+FfLuYBwAXB/+WzvakBEIO3PqLlUAF8tRQzrTWXvWlKkcVPrcfDVZZ8bu0Q7xNzjTEM5x525Li8m3qEvhaZGfim/DRXCdTcHRb6+GalddeEwVG4rYYnqHQXkDwjRFJq5CZY3ftTaqhW5LnDnynCneHMVXdnMAOY5/iUxVH0OKhIu0tI6WKnMoe1jY65wupZvnhSql25Ovh7tI2veh9OfkMBaouXmYc89r7j5myHdvmQ6sNIXZhnIBkm+oDNcPNrwbU3jUiTqFY3Y3vWwtb0W2u37Q6cYPFJ5viAOEZ3943OadbGOBwL//iHJOdD3/xJLOYu/DVsi5qyfpxDeAlbFhMKXk+CPpQPSH70LlUw46SYQKqN8wsDH7pbDU/1byRxWk3xDkpxKnDby8iZHz9h4Qy8J+rmJO5PwzS2wLPs8u3FZwbbOtXSFnrNOKK9Q/bscuB+0S0SzJ1/VpUUol1CeUu0dRw56HviHz60g27RZ/YO/mdVMK+rXWJyAzRJQT2g5El5nmxtg== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 23f90d65-b101-4577-c633-08d41c434205 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN6PR03MB2467; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2467; 3:Y2zQ31xQPOd9/p/E5ILzcTt19wLBobjUkgW21gmPZw530++XjYxrhq2shR8YJKw0pI17jYntWQRefQX2wcjayFbXra1pfrXjKPAKNTPzyXSvmwe1+YFv6bxp9d7FT7OyUHbpbTylc2IR2UmhDOQ2AMVA64VRv/DtnWwqEHbNnm62bty5HCl1Dz9paq761zoiKcyS5zsKj8Ir3VDjvsZJ564udrvd+4FO53eTfZs+vAa+C/WQ28M2VXqYVm+BiylLEM9Emy7CcRbz/rvqW2EZfWXNe0cpYhfz349RXvPAsZJzLRc2qEffYsR8StMuPAPB1hDn2u008VIhL7nUuAGxQNsKBNBZl69jduTE04YrIFtxcS2AK4IYT/TxFH4FmYAy X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2467; 25:lzWXXNS7Y2O8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NGnlCQ== 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)(13024025)(13023025)(13018025)(13017025)(13015025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6096035)(20161123565025)(20161123563025)(20161123556025)(20161123561025)(20161123559025); SRVR:BN6PR03MB2467; BCL:0; PCL:0; RULEID:(400006); SRVR:BN6PR03MB2467; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2467; 4:7+mczmjRPkvIJUdmhWTKXaicVioqq4xmXmKFUYbEP/phzrilB97+4p1IGkP4tIXhj9xG3ED3egIPbA0HxFr5nj4ov13wD42TD89HPTTq6zbgVVF+ATIhRSZLSVuoakTsP79xzQafCGEY6X0Nivs8ZxwyxS0bS2x+BY5aOgHTPE2kJa0aQpsf4JgH5u4wCo3y9BeOpgFYUuZm1TyIHHLH4xHd9pGthIaqgk+ouO91GZsp7eAOIXAumByhC7DlqpudjL5dIjvEXHHXUpBrERn/+cC6Hepnp6s2+xIppz+yGJSAHsSVb45auG69+Qj1vcPQ7oNg1bMHf8yG4TtVaXCemc0yOHrrs3KSZ/WpwSSuVvx/Sk8x/EPAgYq/bKFf4bWO5wtlQFSSDdmvMltWHEDlaljEGcLewnFMy8lAk+E1yR47xx4zq86EglWQpY8GEyHJY1GksLCA/oINrVB11dj0yp9XK0vDsuMH/YccM7AyJqu6V1OY4UD65DlPhRFcg56/kRAppqQHdWB6asoYbG+SAeyudFTZphPy86nkXQqxzY7zkHpVtRpgiys3rT4In2enOBlT1WHwqWdfLFuKjUmAjeABCwg4Sid0SNfiKXRA2N8udM69ZCGwNDTi2gqcXJ+Yeo3vgkF51X5MFNGHedVF3mWmvw08nFSSBCGjOvRv+lTEaI3SlWlFsRHGTL1MvrX669RgJ26Ezn4r6U2+tgpWlI9NvZfcQG80ajpUkHRAYDaYBXoCUb1RbfSnVI1L6EMwpnDEenDo4GaKaHnj6qUYKA== X-Forefront-PRVS: 014617085B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2467; 23:lF/tiyw2NVC+ZGTdAnF4GkL2fIFHng5aT9HIh89jw?= =?us-ascii?Q?m79M3eiRRakVZGx+Fp/BtdUEcrYMpLU1zUY9r5AWzANH4+slIacGQs+V0Kuj?= =?us-ascii?Q?Uq4H4Yf4OhpZjm+EbihINUV+Hi53vu3rRCASmD40sxu3yuZMENNf4QQU23x5?= =?us-ascii?Q?mVD+Fbaosl49a0+GdEG2Y+HiZ3aGzUdnrSfnCCGF04bJYvgW8IfhgJjW3j9v?= =?us-ascii?Q?ukPV0sEL5UayAxqo4R1k2CLPFfTrFjWYVsQCz5871p8F4yjPFfte9+IDaUr0?= =?us-ascii?Q?Zq+SqgrM6hENz5lonLDXWuk2d83gGwakTgg9blBgT0JISThIy/tCAC7EM5/E?= =?us-ascii?Q?W+ru5IZLQ/SOvwp5robo6a7HEuC7/SzDMy8us6vd1UPDnxboORP1qAbAqj1h?= =?us-ascii?Q?Uu/9lI0TZNCXZatrok2pb30vlyL7vIUSzIhhuGI2sNmdY7cKg85cgriq9rTb?= =?us-ascii?Q?lBNFEG2tDyEk0+nxOZ7IIY5UTsE6TbXLSjV/3IgTL0skZg7iNoc68VdAbYiT?= =?us-ascii?Q?1EbVpmCpYeQi1Bni/MliBJXqb45rWYfNpT4A9kU0DuzN1jK0GwEYBjjLqMHh?= =?us-ascii?Q?YMbOXuG7L+WUq1vAyhNh0YWCaRT/H2YC95mrxZHGTZnqP+Z27eql+AQYTgDq?= =?us-ascii?Q?bDRsjQwNFxekoThPQiWUF7LxAK4cW1CthKt79rv4pX05d/M+25elRx2HdEIR?= =?us-ascii?Q?V2ecSf3ICYO5OscFHN5bqn8P2vk+1H7vNmOJg7x3R1lsllBesu8cx0QUuOJ7?= =?us-ascii?Q?8wRXcdVtyqWIom5FFs5V+Ip4vNAqylAaV2Jbz+CI4mJV8NLPEO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dw3Ejx5vXaWmbMqhA0XX8fqSob7FWUN6WKFKwI99Yo+us749+n+stq54tn02v5u2Lbput834yqI0lSRghF5LEJIMmjfp9miIJg/Adn+Ljncfzqzfh4PSVmgCg6jufAmDDEECQJAlIHxYXt; 24:UEHf2p06J5JdAWTUNMuINvPT7Fy6mimwIuJtAxdraWbqyK7vmv61ARuUrf605kTeOL3p/g55XBJ2ItBa4S+8+x459V1bAtvVDt8dNSuyjQ8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2467; 7:Q01W3014eZlhHyOB6cIeeHE7HUqT+p0m6zlHyjfyGgqB5mMU4CR7lX7A01gfl3zd13Es3gyx+Y9xuylptOmx7Sc/VhXiLK5WdtVCdtC7uXoDJOifkd3b4oTsWu+MkpK3thpI4Ry3OnPhHCNXpx67v4b9IdU/0v7sQIR+6YCT+8uP89kslvBUyiNtmvwUBaXxOAYAGBphXPdPPvPENpJhV57Ot86CLnYxqTVfVugwyv4PBqJKxSVmmSNPgkZRfbqnqW19iMTXZ554+OzDLX5ZZ6NGTkayhUGZc4ZCjinNrv+Z8eRj6KsUieEWOxaBYx7RtvstA86fqdhxigLcZz1iatz8cluuOz8yxs5whQQ43KKU1vgyMqN3EVwSrMR+aBP2C5sHF0LaUogwai076sXlbXaX9x9a6v5mO0mas8ZPpqf2r3UxfuCQbxJFirM9szIqtxq6QOSYUubvN4zqhH45jg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2016 12:44:16.0427 (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: BN6PR03MB2467 Subject: [dpdk-dev] [PATCH 15/32] net/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: , X-List-Received-Date: Sun, 04 Dec 2016 12:44:18 -0000 Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/base/dpaa2_hw_dpio.c | 45 ++++++++++++++++++++++++++++++++++ drivers/net/dpaa2/base/dpaa2_hw_dpio.h | 3 +++ 2 files changed, 48 insertions(+) diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpio.c b/drivers/net/dpaa2/base/dpaa2_hw_dpio.c index 4a0a638..9c6eb96 100644 --- a/drivers/net/dpaa2/base/dpaa2_hw_dpio.c +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpio.c @@ -275,6 +275,51 @@ static inline struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(void) } int +dpaa2_affine_qbman_swp_sec(void) +{ + unsigned 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 dpaa2_vfio_device *vdev, struct vfio_device_info *obj_info, int object_id) diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpio.h b/drivers/net/dpaa2/base/dpaa2_hw_dpio.h index d90b900..8480ce3 100644 --- a/drivers/net/dpaa2/base/dpaa2_hw_dpio.h +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpio.h @@ -57,6 +57,9 @@ 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); + /* create dpio device */ int dpaa2_create_dpio_device(struct dpaa2_vfio_device *vdev, struct vfio_device_info *obj_info, -- 1.9.1