From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0070.outbound.protection.outlook.com [104.47.38.70]) by dpdk.org (Postfix) with ESMTP id BD1427CF1 for ; Fri, 9 Mar 2018 09:35:52 +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=40yVIigF2hLDhMgw3Cap0wgyfPNKTC+5W0KoCWXNN7E=; b=ouamf3GUozq5CkPVdDHlkuPHwPKwtjopaAvPbjSl/X1WdyNa/avRtZhWK6sT/FpShhTHAG8K1x7ZxbtBKqt06a5UOvr7DtW8+VkuL4Qo465PF4bx+pz+vU59x9nAwkDtXbvmnd30ly9+iUU6v5+m3+GWY5XUbYuyEXQ3hslxFso= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by MWHPR12MB1518.namprd12.prod.outlook.com (2603:10b6:301:b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.14; Fri, 9 Mar 2018 08:35:50 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com Date: Fri, 9 Mar 2018 03:35:07 -0500 Message-Id: <1520584520-130522-7-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520584520-130522-1-git-send-email-Ravi1.kumar@amd.com> References: <1515577379-18453-1-git-send-email-Ravi1.kumar@amd.com> <1520584520-130522-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: MA1PR0101CA0050.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:20::12) To MWHPR12MB1518.namprd12.prod.outlook.com (2603:10b6:301:b::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e107dd2f-6b2f-4360-e9d5-08d58598c437 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:MWHPR12MB1518; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1518; 3:Ibbl/li4T2CeH3FsgIyepBrr+6kfvfe/900Uc3RwrbMZNPGUn4Z2XyDPYvgEhsHWm4cvm4aodfcnbVeBKMVSQhhR8y2nicyuQddur0ffLrvGPvWbCrKwW/EgI/dskuGXS2fuIzPJpYCGflSRteJONvsCH8/HiuAtA1XYSTwf+AcCnOBr9Z9V08hDcPa7j6EKJsHTnSkz6fsd4CDMYvzvhfRV8WVYQxnp7cFpFX9JoX+HcQBoCBww1MKnHWvjJtkd; 25:VPYPfiYkq+/WEyT6rvfbPXkIZ0VciKLb8trp1wpYCaUM0RtaS5xEHxoi1Ui2Gh7175AOv14w3y0xFg4d5/cCwB5QKWjxEbXqRTfih4FkDSdxzw2Yc+1Cimun6OJnBY+C7JldBfWGatny2mA/K/8ZX2vbi4HGydJsvdZIyfVY6AgZhx8rf/PjOqPAoQnrp4hnzrRoSYx7HxAAnpNhTJa9W2sI0dJ8YGWkzURTsJebfpNjcSWuShqBWzpvaUwYuVWy7ssVDq2KowNliCdjpwjaYHkH/5zoR/YQMyt+bgNpLapiaouAdliaPgahoap82G3YvN4/Z2ydBvCER0RNq5or8w==; 31:1P3oI7U5QLVPOWHxpfozPu+U20HH0z1YmQAqJlO7W75FaxzRexiWRqdBfMVDJD0zKldXuAYN4q6zuCteNn+DmYshoUPF+vE7ox83b4xQkNbkEs66mtOKPUW2eob1wV+L+P6RNiIkJKVZLqmL2dBGA+6ZCMiA8Wjz8i07tZKyixQ/zBFTzixAbhEzP9mGAUI0177XO558rDM7JgDzoPL2pLk46AKDsvDrbdnqA/CB4ck= X-MS-TrafficTypeDiagnostic: MWHPR12MB1518: X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1518; 20:nZYSX41maVwzLn0pI2AsuOzUk+KLnk/SPfqBHFtb7GbSFzp0A1uUpqpdV5OB0nL2xA5MvuNKmcC6RJed6kPUmYvLVJSE02ePA1SwpvC01igBWpuaw6hUK8GlStyBmjHlvCTSdL5nVv+72zCQMEn5oBRdzCsDxzYhdHsGK4qUgZPqukhhGbpRAT3nUtO3CV1xmCQYmnUZ1Bv6xy9FtXxIdI4hot9yUfvJlL1u+O3ChR3tcAf3UKRrqge+tSmXc3v4YZCKaCxlbIxoQaGtenf0aT0C9WUyJ6ZuG+2DjXNvKq4nnT6KyeGZLuPkpM6gI/VjOgFjSduYjLj6UvNePOvXmkxs3jcZVgfZeUFqb67LjhJj9dL/Xyyc9ALB2jdfMGHIgiWeLsK7pcguXLiaOdL1yHsBZxhgglZQvgAsQhdDN9mdddfwprwqtITBRAxQef+OfjRX55Zau5eg7kfU9a7CDXyUYXi/6Gb2oqViVJzAwE8+uBstvh2Npffho0+eue79; 4:bf6KGnGMZ1orSFymXwcgd2fm6YO2eXbNDOrVic0VYvz+odFK26fVwRMVnQ32wD+y/jF9FD/0JZ+3FyXSaqzQ9PO3ZvN1AJGZtyNkztpgO0mdf/kDmpg5kc0XobJMOKvv/OkbGHvlGfcIH4wVE5Tv4oOAivibwBQQ34yvLrSs0xaeeYJOYmenpNL8FgeDvBawzmhkqXIJfvccCy+H48k0jxop+zlYzt5FWjo6x0T0+EPO8YaScE64KrVPGC+bnic31T1v7UoX20Zfy5g2MqZxIk2p7ifkfmp9n759SpELvIvs2clSoltD8R33Pzy5OKL1 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)(3002001)(3231220)(944501244)(52105095)(10201501046)(93006095)(93001095)(6055026)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:MWHPR12MB1518; BCL:0; PCL:0; RULEID:; SRVR:MWHPR12MB1518; X-Forefront-PRVS: 0606BBEB39 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(39380400002)(396003)(366004)(376002)(346002)(199004)(189003)(16586007)(26005)(81156014)(16526019)(8676002)(186003)(81166006)(25786009)(7736002)(3846002)(386003)(305945005)(4326008)(6116002)(6666003)(316002)(86362001)(76176011)(52116002)(8936002)(51416003)(50226002)(5660300001)(2906002)(2950100002)(6916009)(7696005)(36756003)(106356001)(105586002)(6486002)(68736007)(48376002)(97736004)(53416004)(2361001)(2351001)(53936002)(50466002)(478600001)(47776003)(66066001)(72206003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1518; 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; MWHPR12MB1518; 23:8VNK+JGxmuudrdpNTCTw+ZeF1yDOzqImlvN95cYb4?= =?us-ascii?Q?FNioBeDBFD3Fpspl9K3jog1g9g4KcvKqvYvqt5qKakfHVWuw/HE0gIlxhfc+?= =?us-ascii?Q?QQigVcuNIFUFV0Dapi9yU/WVinhGmjG+z2NmEDZIu+rIDdpwknWKuOgsBVMz?= =?us-ascii?Q?UXIS6XmoI+fO5nGkebW5q/SMlGOChbhCEVpWaGSXZCd36OaGTQd2+iJbsjyh?= =?us-ascii?Q?gz27IE9OIL//OR6We10q6XmmkV0j2N6Ev/m8BRk/Bb9uTJ899XUjdE49Mnte?= =?us-ascii?Q?y6sD5JKam/4kDvqpuEixvn5SfnNcI792+f6UaABW9pY4rP/Z2FqJwopMDkU7?= =?us-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ptOHfBiJ0/TNshynizVo7n2Md2HvSI5YB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1518; 20:c/NPf3oCsm9fjOJRcvUsDIYAA6dUNH9JYbiT9VI5ZUETtjS3QBdXhEQWxQ0SFT70vuFF1/he8CKBmi2PzTw/WWvmPX6U0el7fTaap0oCBLe0U73/yY7LsjSeaV1koaGtiPG+D2W63lQMft2McemZTA97PbSABi4Pue7VXX70x3uukXgKa+vvWk56ongkKV35eolpAFvg8M8DyaDFOUTA/LnCzQEubw14ZtFSBQwgQwGPd/HurKfIEVTwBfSB59+W X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2018 08:35:50.7877 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e107dd2f-6b2f-4360-e9d5-08d58598c437 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1518 Subject: [dpdk-dev] [PATCH v4 07/20] 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: Fri, 09 Mar 2018 08:35:53 -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 ed6ca5d..23d3af3 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