From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0073.outbound.protection.outlook.com [104.47.33.73]) by dpdk.org (Postfix) with ESMTP id 23B4CAA94 for ; Mon, 19 Mar 2018 13:24:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=cqBT4e0byXnriB9rYfbKJcceZkvI4NdZmv4nVpOXBgQ=; b=4zR/sbPFxDDJUtKougsPtSfu50p/E3HhY+4VhVBk8fPEuFF1Hgppd1h3o78CA1ehcSh8iqoUmyAvZYafV3bHPPKMrO46P0lWUJ3lX99IFo2+KGlzjlFwnsZhRgVuRDjcGaiyzllDlpP3Hx7hU8PFmjx9/2e4ABJc4b7qBdNRb4Y= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by BN6PR12MB1505.namprd12.prod.outlook.com (10.172.24.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.14; Mon, 19 Mar 2018 12:24:28 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com, hemant.agrawal@nxp.com Date: Mon, 19 Mar 2018 08:23:41 -0400 Message-Id: <1521462233-13590-7-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521462233-13590-1-git-send-email-Ravi1.kumar@amd.com> References: <1520584520-130522-1-git-send-email-Ravi1.kumar@amd.com> <1521462233-13590-1-git-send-email-Ravi1.kumar@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [202.56.249.162] X-ClientProxiedBy: MAXPR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (10.174.62.139) To BN6PR12MB1505.namprd12.prod.outlook.com (10.172.24.146) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a6493333-f73a-4d4e-b8f6-08d58d945cff X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BN6PR12MB1505; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1505; 3:cQo0mXMsnzl9iOtSOu1slEcD0sGXB3uNWYZLP/qe/8+liT02VfoLGNzQwZIlZ2lbmvkvka7uGkLVwB3cl64ErWy6YiaCxVyjtm9orLv8mO66jdcYZNXfP+CnmUXzKayvUciyrhdoTkFclqzT817IfW7RU9zujxecPupWeJm9XRqiLz/yTuwOHG64kL39rngxksPf1U5dJKI3E/ElU2uxYn2afofQHLXBbqy3C0MIRtMNfgc89LaoJHY1FyG1Kbbn; 25:Z4JFwUs16576U5ViN5MjAvRD1VCY27ztJDobZqr0vLipElCCG9eI4BLd8It6AGqnU1FFHYJ3FbutXmV806q6CDgkwm7hOISakweKtgYCnhUKTH6yBjnZzvqhNPTD3VJA5oXmwzm8zUVAg89sk2Dp22CRqTy6+FxxoXHhbf/2rlO3wGUGNSPcC3I+O7bpmVO72Fnsn+Pg0bjXFML/CgTjFajAqTxU9YGq+n2aD19lR+eDXwWVUWdgM+fLbf8T73TdZbNtc1A78kNFyNf4FRy23j1wvLlr5qadnkU8aBh4NuWLD3zJjAr+o1WfU+jFO+adMJUc1p99l7wdQZ4Fv5rLPg==; 31:Q3fLGqjMVhhQcS+qOpDFw2qDLT85bXR9Ym348LMY7nt9xiLetVpwXdLJFGYgY8vnS4Unbegvn4fUNI8ph1gPGV8YJ5XeUzhZua78K90Mwfne6zJ2RW6oNACbBLOZJoxyQrDXlu1rG2lFU+BhCPHnoehFh2VAcpCwxegGLcTLGkgcY5bq8D4enAloHuvbojGd6JODF+pPHvA/x+FlNhRWdomT+Vzl98Sfw8FGZm+mI6E= X-MS-TrafficTypeDiagnostic: BN6PR12MB1505: X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1505; 20:P2nu4JVsk3aAZe4gvz1YuW4XudC5ALAa1Byv1R4CSALVk/ac1LPiJ0kWH0+PpqKnSbrsEaeOTJJVBNm9paIvDIdyoaeSnflZdok2RlXFYxOcHxKhfmMxLm5FKm7hjZWqnihE+2tpFs0u3QA7E/DSwNZeFqgRk2ZbaOzzi5uTFYYfpJoE5Ob87Z1hsmJu1RiTmUi8+Fd5zA5b2aeekjnfevIRel9tWrbBD4MZNsFm1Us54Dt0IH4cwntGknE8SrUuWy62o9HwGJGRCdWC+JZ8HaQLHhnHnB5w0wft8ZaEX8jPPBU71KaLmGg+ZTDxoP3eIp4SkSWi3Cl49uTLepyuqn7Bvf6CRlBtZCZuqpqbHYeYPmw7fj9f1V0ADcCoyz3WA6aRGRPyfAPz7up6ABVgQVSXQpJf6rULI45HPoPSMEPfL+L009CdrTTay2AhL2L+Zpcie8LPwZS9T3E5CVs+7I9tw5dAC16+yqJ9wse3HSg6OSdkk8c/LQg3ABl+7s4s; 4:pxRYlWpp6KtntISpP6PF3R7yHvRjXQAnoqy2WzcjQ7IfG6KoKk3fCuyJ/u/LHVWED82n9zTszl3STFRzCM4PExuhMqfmSwtX5c2QQdZoFJTbEwpXcIqnwX8Hr85q8WYQRz/XhsWIlvKaRG2/pBe82dhl6OTlG2sEDqAqyY/4RYY5FJ538sdnNdttokiQ1o3EPZNijeRcnPe1luDRzPShtoNPK4Su+HzHDeQqnzCiBKVima5/diknezwcWKEbovBtZCBX6F/rutw6ZhfmWbER/xyjII4bRpUAeGQrnODv4jKlajxtOojcCWGkHiHIxdDb X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:BN6PR12MB1505; BCL:0; PCL:0; RULEID:; SRVR:BN6PR12MB1505; X-Forefront-PRVS: 06167FAD59 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39380400002)(39860400002)(346002)(376002)(366004)(199004)(189003)(97736004)(105586002)(2361001)(2351001)(72206003)(48376002)(4326008)(50226002)(76176011)(8676002)(26005)(316002)(8936002)(53936002)(106356001)(16586007)(186003)(7696005)(51416003)(16526019)(52116002)(386003)(81166006)(81156014)(8656006)(25786009)(66066001)(68736007)(86362001)(47776003)(6486002)(5660300001)(6666003)(7736002)(53416004)(6116002)(305945005)(3846002)(478600001)(2950100002)(36756003)(6916009)(2906002)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1505; H:wallaby-smavila.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR12MB1505; 23:0y7g7uPBohndlN3kD87/amJRNjU7zNtnG3wVxOEUI?= =?us-ascii?Q?rM8/b3OzWb4wfmDfqiC040CBQaLf2XNV9Odv41wRQnytFmsyczwispjbQF9T?= =?us-ascii?Q?PpFLwrbE+lhDEqN77H+PTdAmjyMCB4ZQebr8I3z0Ubt85ro/quc8mIL7H9z4?= =?us-ascii?Q?75C7oXu6N3bMqsqaUuZneKT3jbJR6YfYiPxxNdR3dLjl7uLjATYU2AJVKVKB?= =?us-ascii?Q?GFPa61THaJvpTTG+XP2T0t/81BPLFRyS437XV96lQiKW4/pUIskvrTwQ+U1T?= =?us-ascii?Q?qwn/pNJWhpdEDOtFdOT/gaer0CPCDTNaKzH9jJeiwgLGqhV7LgcG2R25gDMJ?= =?us-ascii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HvuzYZf5T2nUhyoxVUt4B1JdNeY4sPLcbTlgYrD/werS57dgCmyyrTqKhyIO3 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1505; 20:tqGWH3OTIhnN+uSeJaZt+lfQYC1rYkUKyKbSmSf9u5oIcknWK4Bcdh4WAnzWfcPjA/YNa6z9UeOG7rhHvGKN2Gj04VFrCY4nnpJe3JX4SAErRt4jMyd8OU+2aLc7m19ozG8fat+QdnylRN5SCinAu6osFXmJj8XAgAznB51W4yIf4H3y5kyAwHAfkO0ODGzuWFQL8z2ghIeKOO2Maa9c80LpJSUh4+L4WLPycVCezSoElWk64Sp7xAFfRKYJqTDz X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2018 12:24:28.4851 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a6493333-f73a-4d4e-b8f6-08d58d945cff X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1505 Subject: [dpdk-dev] [PATCH v5 07/19] crypto/ccp: support sessionless operations 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 Mar 2018 12:24:31 -0000 Signed-off-by: Ravi Kumar --- drivers/crypto/ccp/rte_ccp_pmd.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ccp/rte_ccp_pmd.c b/drivers/crypto/ccp/rte_ccp_pmd.c index fd7d2d3..b3b2651 100644 --- a/drivers/crypto/ccp/rte_ccp_pmd.c +++ b/drivers/crypto/ccp/rte_ccp_pmd.c @@ -23,7 +23,7 @@ static unsigned int ccp_pmd_init_done; uint8_t ccp_cryptodev_driver_id; static struct ccp_session * -get_ccp_session(struct ccp_qp *qp __rte_unused, struct rte_crypto_op *op) +get_ccp_session(struct ccp_qp *qp, struct rte_crypto_op *op) { struct ccp_session *sess = NULL; @@ -35,6 +35,27 @@ get_ccp_session(struct ccp_qp *qp __rte_unused, struct rte_crypto_op *op) get_session_private_data( op->sym->session, ccp_cryptodev_driver_id); + } else if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS) { + void *_sess; + void *_sess_private_data = NULL; + + if (rte_mempool_get(qp->sess_mp, &_sess)) + return NULL; + if (rte_mempool_get(qp->sess_mp, (void **)&_sess_private_data)) + return NULL; + + sess = (struct ccp_session *)_sess_private_data; + + if (unlikely(ccp_set_session_parameters(sess, + op->sym->xform) != 0)) { + rte_mempool_put(qp->sess_mp, _sess); + rte_mempool_put(qp->sess_mp, _sess_private_data); + sess = NULL; + } + op->sym->session = (struct rte_cryptodev_sym_session *)_sess; + set_session_private_data(op->sym->session, + ccp_cryptodev_driver_id, + _sess_private_data); } return sess; @@ -82,10 +103,18 @@ ccp_pmd_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops, uint16_t nb_ops) { struct ccp_qp *qp = queue_pair; - uint16_t nb_dequeued = 0; + uint16_t nb_dequeued = 0, i; nb_dequeued = process_ops_to_dequeue(qp, ops, nb_ops); + /* Free session if a session-less crypto op */ + for (i = 0; i < nb_dequeued; i++) + if (unlikely(ops[i]->sess_type == + RTE_CRYPTO_OP_SESSIONLESS)) { + rte_mempool_put(qp->sess_mp, + ops[i]->sym->session); + ops[i]->sym->session = NULL; + } qp->qp_stats.dequeued_count += nb_dequeued; return nb_dequeued; -- 2.7.4