From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0060.outbound.protection.outlook.com [104.47.32.60]) by dpdk.org (Postfix) with ESMTP id 004FA1B1A2 for ; Fri, 5 Jan 2018 10:40:34 +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=xFr00zxVa1SZG19tdhyOWEAGQbkc4QIRu88C5GquhZQ=; b=ASkmb8DREbtIJY5P06YbIwNRRMAHsGXYEdCfgHF8JC/rYbIlWRqqAcwa2c4ilfkTfxeWCZXJK0m0H5vpxZijxUeNYanQWLHjZiuWt3+ybep560mYhiUHEQr+zcTv/gk6tIh0GG7et5FOkbPDGU5tJ5M/S3JSJpIKvtU9gM5fXzs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by BN6PR12MB1508.namprd12.prod.outlook.com (10.172.24.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Fri, 5 Jan 2018 09:40:32 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com Date: Fri, 5 Jan 2018 04:39:45 -0500 Message-Id: <1515145198-97367-7-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515145198-97367-1-git-send-email-Ravi1.kumar@amd.com> References: <1512047553-118101-1-git-send-email-Ravi1.kumar@amd.com> <1515145198-97367-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: PN1PR01CA0084.INDPRD01.PROD.OUTLOOK.COM (10.174.144.152) To BN6PR12MB1508.namprd12.prod.outlook.com (10.172.24.149) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 64aebd67-4f7a-4a03-498c-08d554205e0f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:BN6PR12MB1508; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1508; 3:EflMYB8HHFv+YytkgLij3MDa6psnl/7ZCBr/0X1equ1Vva0Au2SDqG1FQCcfhOUbhNv2ToqTBhZY4l4KU46A1nCn50Ixq1QcefWanv+P3BdpGr9jyZnzzz2f4MS3sjDyAQJ7vJFtwiIF64YTBRRb7K0+pfJYzyF8/UT1ZENT0+GMPcPwhkwTpkBTkquLlQM77Ajjfk7YztpI7ZhBrMwEDG4QK6z7lC95TRX1hWz4zn/lTja2gLBlnaqsGpfvXTLR; 25:50RIdsjE2jw1phVtY3ZcDfPGfTsBlR/2Tni8Xp5WdVVF0asoKVVG4hl9XiX3OKFceVzdA4ZDUr4Xbw2e3kCGZwV0EZpeAX/B+mMPVB7+x77brDzk3exqyIi0eGllQCtbVBQFACfjZaQm5EzOZqRawgcm32ycJdOe5oaFArNOugHoo6sIaA8/9rpnbVprpEBQaxpBJza1q8CL/WvWRtk9y2jREHxWVslQn1oiM5mmnLPlbhMDxywX9wFk/2oiYwf6g4tkuZoHDa/KdhyI1MFj+QOuWn3LwdLWruZkCvE40YT7+FtwslAeI6gXuP7nBfZL6ALxXU3ciFbXritHySyTYg==; 31:gnXi+RtYeMHnyd6jGLKEyjtP4atyCQwi4/p2kp/UH/MkjrGov+tnf6jQ3/iPJiqhTYJCZ4SZeQdVmLLdwiq8VS+xdmwhIHI2Dwp5+IusMr5AiKd03k80BG69bZA4P/Qxp55zCN44us9mraAYoTjBzuKVBJlzT6VxttZ1wP+1+wyaG2rGXjNppJ8rgKcc7JCH9SIsil6OjF/N99uLJTg24qOhYE5mHYYMa3EoLuRsLxc= X-MS-TrafficTypeDiagnostic: BN6PR12MB1508: X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1508; 20:RQ5epdSMT/23J3fjnYOqEOIMXwaWALy011E9ij30DN+vppuU+532GUjv0yQY0KCEntYvBjHHLjPuczdhlz7/dGyNx9/uKpkS9OtlzC0suT9oRZHy32e/GPlf3iDMglUONRL6BIMX5VFOHC2iNb03si+7XAgDrhYsT+tATwJChOzaGKWXmhOzPPAGhXUt8KUL2EbkjgIu/q3UUxth2WWXC973nu7i29kLfQKAAUo7GO094GvRHIJq92ZSOkDlQRFNGbQjT7ken9r2ZU52x1dPN0uoxQtOtKZ4qCTDSwMjikczyZS4sLY499D/u16kj+sq03cS8C7+an595jkLiSW0sO1ov9lUgiNhkgcHerUBS5EPa+zhv2+61OX1w35lM/8Uj8qUw0fVTDLC+WXv683+G9FkiFbKK1kyv0t8nEO8N6qv2vRgWHCWD0AZ4SwXvH7AFhdK8Co+0s1Cqi0qPb5lLZl+8/nHWWbFNKW5EmjrLx7s4sRd/1KyVCX5oF8c+vFt; 4:DAx5BiZ/PRNJ//wVlxYMf8ejawOgCnfLs2W/xKeOz3Cp+iHowq0wD1eYMM+/vdIPRnWD7xljol3GxNjWhRh0hR1Gdg85E4hfRQj8CFEuB+yh4zIU9F740J7Xkl24KP//7FzDALQ/3UTdcVMUzTtRmylSE0xePEHvADPa3CK5sYiFu9sEf3jn+E3JpbmsS5LwZ4RbppE7wl2AdyVBZYvquZhO4Zv1oHsqetVGvgpNBRNB+IMVpk/SDd8K1G+VZYSnwC60XGj68baXtX0nLgUp2bJflexeOkkVBtEJp0VGoctddA4k9USjiuqiba3Cd5bK X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(944501075)(6055026)(6041268)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:BN6PR12MB1508; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BN6PR12MB1508; X-Forefront-PRVS: 05437568AA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(366004)(346002)(39380400002)(376002)(199004)(189003)(6486002)(2361001)(6116002)(106356001)(386003)(105586002)(3846002)(6916009)(2950100002)(16586007)(6666003)(16526018)(36756003)(4326008)(2906002)(316002)(97736004)(25786009)(478600001)(86362001)(68736007)(8676002)(48376002)(51416003)(81166006)(2351001)(81156014)(52116002)(8936002)(53936002)(305945005)(50226002)(76176011)(72206003)(50466002)(53416004)(7696005)(47776003)(66066001)(5660300001)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1508; 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; BN6PR12MB1508; 23:XpCC9SO45swQYJOe2Rr9oyhAtYVzeCc1veL4xWaJ/?= =?us-ascii?Q?poMZNEZn0KQfh//y1Lbbdo+8wuuL0vlzNXXd608kVqX/IRk3nAiLvSa1uSb2?= =?us-ascii?Q?ekAK1ispppKFIm/lX+AU/IlpxKqUwsOTIwAI2KCuGekGNGXhl0JIVFwyGuaX?= =?us-ascii?Q?nmkP0Vho61CoaAeMGbKRBPY4N3mDXxQB+l+gDl+R7rXEX+mlRhBv0cRjMur0?= =?us-ascii?Q?/RQOZ5kds0d9eKdMRzU53haiyulmWyd/njKAufAruc7m6a/FeoN06gX8R46v?= =?us-ascii?Q?jCT2Sr3I8ec88PCL/oieVHriUxUJ2VPWWYPOrBQo3m6UA45SXE8jZf5cpXgv?= =?us-ascii?Q?uTnILwJYIPxqRLhpN7Kk2SZlPkGr6iwMJcQbK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DmXNJOu12qNfYzXBW1H+u6QaREuhL7x13o6GtzsaUMFx0ekOVe6t+s8HOebW26dcllhC X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2018 09:40:32.7476 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 64aebd67-4f7a-4a03-498c-08d554205e0f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1508 Subject: [dpdk-dev] [PATCH v2 07/20] crypto/ccp: add support for RTE_CRYPTO_OP_SESSIONLESS 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, 05 Jan 2018 09:40:35 -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 fb6d41e..011240b 100644 --- a/drivers/crypto/ccp/rte_ccp_pmd.c +++ b/drivers/crypto/ccp/rte_ccp_pmd.c @@ -49,7 +49,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; @@ -61,6 +61,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; @@ -108,10 +129,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