From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0075.outbound.protection.outlook.com [104.47.42.75]) by dpdk.org (Postfix) with ESMTP id 75EB31B1D3 for ; Wed, 10 Jan 2018 10:43:32 +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=3v8ND+nvoygtfcxRLMy21MQQiWQdiv23GhraQuQ9ujutOvBmlUBAIHn1Tnm4EHGp1aM5V94G+N2J+Pfnvhte3TPzjinKRTnl8IPz0T86jI9mmk3feOY5DsvUNL/gIMSvHdrpZmiVqpxRzjfkd4eXwqFf/OAYI09d6oBOz3nvq6k= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by CY4PR12MB1509.namprd12.prod.outlook.com (10.172.68.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Wed, 10 Jan 2018 09:43:30 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com Date: Wed, 10 Jan 2018 04:42:47 -0500 Message-Id: <1515577379-18453-7-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515577379-18453-1-git-send-email-Ravi1.kumar@amd.com> References: <1515145198-97367-1-git-send-email-Ravi1.kumar@amd.com> <1515577379-18453-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: MAXPR0101CA0024.INDPRD01.PROD.OUTLOOK.COM (10.174.62.34) To CY4PR12MB1509.namprd12.prod.outlook.com (10.172.68.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 414be89f-43bb-4f38-6d0b-08d5580e9c11 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020049)(4652020)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:CY4PR12MB1509; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1509; 3:78kj/KblX+H8ohG0tZ9VD6G8VCaCAZiCeGbH3xrMDaxzDIxE+2BlYXqUU3fckCYRTAUoFbIJEf1AKZBGFyvRCil+PLF8I07hXhp02PILeQd26P9BRynpTafo7nXZoy3WZaF6TSi/S1hk0GcUp4pcRgGzVpxLv7bG3EF3ksiqlOio0nZucqLnH0ihvvw6cAnpQ//3JV5xZxKH/3THDuzANkQ2RKZe15mcVmeq1KuaAeyUqCF3PI/tbqYcYzVPw786; 25:9HnJH2FGBsA9bNdSb8/Ll1GeXFHQUQPJfEKmGSB9Q1c9aA0JRgvFLFBkiJe7xwOQ1RtrRhVz4hATa1nwIMFR0Yo0RY73TrciZsdlwwXLpYeDvl3ylNAf5tUlFTAqF+AWpRgngmcTBuxwAufOEwJP5pWPnk8tJTlEP7n5kKlb3fmvvokmb79xG2RW+7GoFSvlInogrOHefemJKvy2phJ/gkLB7jF6BJqt5Fuz4qP7CpMEe+X1J8ns+0Kqdp58NDlMYtoHRTFDvS1Z2Tp4M9B0qi5phZtMkQ16nz6l7GZP8dVpk6E1oBra7Cmw52rIuEmLJ0pFD2vYNy78/jRXFdweQw==; 31:LEDaH2XG0ecsh6ldSYFfE2RtN3jCKGaGMyBccf0IscWfldFxsgU5jqE5Mrp+N24t8OQdGiqosXdV1dRYkWC7iQGrAELX+LHE3Oyk82ZUP+HUFgsXU8s9NdHbfM4re974yTIRfNIzsA/nb3Ve0Ee2oSmyB+kuK3XtDbe4DsSv6AH9A5C+5f74U53Z0QHWRnglUazuxci8TUBl8P5YrtWZUvNnd4JfUE/BM/WLDQzioK8= X-MS-TrafficTypeDiagnostic: CY4PR12MB1509: X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1509; 20:1huY3snFqQWTne3nQmJ859ef606dDX2busUjxVeXmbYV47PuTQBpPGdY/3kXzxzVGutnKOvimeyQ3Abg1xwqY2RyomvLzbS3TKK5ylFasxq2zuXHvIYBsHM4d+jq4bzGmNvAAWqn7tOhKyQmSLaZ8biH8sb8AkuEHFKk937YHB6mjdAVk3jAOL1GswQp2j8l5i7e/O3+NzUhOLhDjtdrBI6Q8+bqjR3PkZ+YSu9f7hvuMFx2/vvN+gkgty+B54R7/4gZhjNafrQcYYY3AJx1hTZmb2wZI5oUauhPRj1irQqHBMG3586nmOwdxY3k1/I/DTIWlsYkr7mRqFkBeelDeqrtfvQ9tsxBWMBov7MZZ116COf5AgGa1v4GEhoezfMI7ahadOQbfJGKVT6HLLMu0u8yMY/HWnSymMcU2KX/VhC3IwH0fF0o9+l0FnrN3dC0+O184RBLaq4uYKSfOhFzgBf/iDek0fR4o1rzEFZQPEaPc3gTvciFypInXT9fMijq; 4:nlDnHgWj1HcLqGEDEJ6dNj/SOW222JwwWmHpWiNYyMJTj0KvnbDAhNoSs7U5l826Y2gzFjwR0AIZRaDfx5hDedE5+c5D3+TXTf4K2EW96lQ1DDs1tWiXbUhIepGytLgxjTvrJTAC9jCOY4wSa1dltsMVDV7cPOGqW6Fy/h++bZ6w1jitLtGLsqld2QZgv9v4dQCJ2UgZqNEzcF7z5SrhLKvFEsGGIT086hevibA3u8IsETQ8SIX607HTxipN6nXmGvP9RLPqvDVLSJCOMZE7L5FGFnqRxtFIR19Gf+Nr5JbkLqfQs6ReMi04GCJsIneV X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(3231023)(944501119)(6055026)(6041268)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:CY4PR12MB1509; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR12MB1509; X-Forefront-PRVS: 0548586081 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(396003)(346002)(376002)(39380400002)(189003)(199004)(25786009)(8676002)(81166006)(47776003)(48376002)(6666003)(2950100002)(81156014)(6916009)(66066001)(50226002)(68736007)(36756003)(8936002)(16586007)(72206003)(50466002)(16526018)(316002)(53936002)(478600001)(5660300001)(86362001)(4326008)(386003)(2361001)(2351001)(6486002)(53416004)(97736004)(51416003)(76176011)(106356001)(105586002)(7736002)(6116002)(3846002)(2906002)(305945005)(7696005)(52116002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1509; H:wallaby-smavila.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; CY4PR12MB1509; 23:OkaGblabnXwuInT2Uf/wul8Zbs9qjF+Xh2/sUEPS5?= =?us-ascii?Q?lEPMnWUS2IHnes6dl6EfL3BC5lj4EflFYW4VmXQfkNtfKzdLrWttgi15vALu?= =?us-ascii?Q?SBg6Y/QOGtcijvJhiseIGHLceymoFB57LIsSQ4qTVObrPZ2zod723+OI4TgH?= =?us-ascii?Q?toHiGBJSfsYqmm2qXBm5oEahMc1n1Cg4eHEkVeU7XEALD3RWmNTAgRPJcKzW?= =?us-ascii?Q?7KbgKBWRNehn8dwlPXT8b+P5yhiWXlnfvLxcEL7LhKY8zuSvFSu40YDbtj3M?= =?us-ascii?Q?rsJ2JkMFfH5YcTCbJjGN6l3mnEu5vR0ZZfTskM5/1d1o7Vkoe4U5i2CJoXjK?= =?us-ascii?Q?WwLqTboYvdQeUWJUsD2F5RfSLLAtRyMEUMFXtlzMeQAyJbV5FkiYPRR+UnvJ?= =?us-ascii?Q?3koFmILsW4yTBc93nXs2RWnp69lfd69tjhH7wTQm6H9OcW426DdzsO4hahWr?= =?us-ascii?Q?mzfWd3Pc4p8Fke3Mta+jAESYENorrR56S68Gw6+4/v3tcVioQsp1ENd7veHK?= =?us-ascii?Q?M4lEDGT+Lbnoya7iL25Lz3pXNHaJxmCoJP58OVunH28fm0p46KpnPvcgrAVc?= =?us-ascii?Q?k+k+zUKyAM5PZ0f//qV6EkR1t9I5GLvIa9vLDCS6qecx24+OedRilPIU+c2X?= =?us-ascii?Q?C87xHyx1SOYBl8zZRDzPUIUtraCb8++AtzIeF51DvYqd1sHW9SZmO2FsWNxZ?= =?us-ascii?Q?ToycO4vZ2bKZ6IOzhlQfCk1PNlYi6fW6sk/wOi1YctQIqbMKdNBPA1K4lO7u?= =?us-ascii?Q?nd8GawXRpITzA+QHa8DFtvYOdnLL9GcqjNttvZi5fkyxlU8NXmvtcV6iBp8L?= =?us-ascii?Q?xOM+jyshRy3/ljVioT97qo1qsP3jWFDZJKGve8Rghj9o2g483xxr3bpHx9XB?= =?us-ascii?Q?EsSy9IXgW6i03NzXlMO6b0HOlhI8oe6zi00yCColhmmvSBinlP/ditERAr4h?= =?us-ascii?Q?IAQ580N2Vm5cUa4tk2dU6gdgsN6Zdpd+Z/eJ3rO+jjq41wx7GEuYewkzGZgD?= =?us-ascii?Q?/mnKK9S70cM8rbcKYcQeF4Qy0xive+v08kPlmWcrw2zUoGUKU40T8PoyycVZ?= =?us-ascii?Q?jZHjSE9QbZg8AuQlL1X8Sptk17470ZlKXowBwf1HAzuwLEmtV+3kxlkL2lyt?= =?us-ascii?Q?ouRJAo87hcNn2vvmPzBIqBZ1oUD0ydh?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1509; 6:iqNLPnsCmruUtUFtYyx+J2ArXTQDd+ZSksYI4lAYK1LdxTPnxg3HHwXtLMg+9ozplCoyoKnivu2sU98E9qNSZ8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uIng/Z+hMFrzDPbU3ccp5Md0vgZyY5lflfms45PPHYVaboD2y2JqJPrTUGXjNkTqEl6oDA9d80mfXNYGs X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 09:43:30.4748 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 414be89f-43bb-4f38-6d0b-08d5580e9c11 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1509 Subject: [dpdk-dev] [PATCH v3 07/19] crypto/ccp: 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: Wed, 10 Jan 2018 09:43:33 -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