From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0062.outbound.protection.outlook.com [104.47.36.62]) by dpdk.org (Postfix) with ESMTP id D1F2B1B23B for ; Wed, 25 Oct 2017 17:10:27 +0200 (CEST) Received: from BN3PR03CA0108.namprd03.prod.outlook.com (10.174.66.26) by CY1PR03MB2364.namprd03.prod.outlook.com (10.166.207.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.178.6; Wed, 25 Oct 2017 15:10:26 +0000 Received: from BN1BFFO11FD029.protection.gbl (2a01:111:f400:7c10::1:191) by BN3PR03CA0108.outlook.office365.com (2603:10b6:400:4::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.178.6 via Frontend Transport; Wed, 25 Oct 2017 15:10:26 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; 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 BN1BFFO11FD029.mail.protection.outlook.com (10.58.144.92) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.156.4 via Frontend Transport; Wed, 25 Oct 2017 15:10:26 +0000 Received: from netperf2.ap.freescale.net ([10.232.133.164]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v9PFAECV009577; Wed, 25 Oct 2017 08:10:21 -0700 From: Akhil Goyal To: CC: , , , , , , , , , , , , Date: Wed, 25 Oct 2017 20:37:18 +0530 Message-ID: <20171025150727.30364-2-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171025150727.30364-1-akhil.goyal@nxp.com> References: <20171024141545.30837-1-akhil.goyal@nxp.com> <20171025150727.30364-1-akhil.goyal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131534178267737165; (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)(336005)(39380400002)(39860400002)(376002)(346002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(85426001)(498600001)(5660300001)(7416002)(2906002)(76176999)(50986999)(36756003)(1076002)(104016004)(2351001)(106466001)(105606002)(50226002)(81166006)(316002)(356003)(8936002)(8676002)(4326008)(189998001)(305945005)(15650500001)(77096006)(6916009)(16586007)(50466002)(54906003)(6666003)(2950100002)(48376002)(81156014)(575784001)(86362001)(53936002)(33646002)(47776003)(68736007)(97736004)(5890100001)(8656006)(5003940100001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2364; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD029; 1:jFV4V1XipaS5iR0riTBLAZz+kRsp44GyhAYBQv4gXt9n+Nbm7rXAtqm1woa2XijlSOWF8gEYotKiMGu5um4xrZl7+f1Ybi3KTY2IYgssKGXxfA2isewepQE2shKx2UDm MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: af45da31-356f-452f-a155-08d51bba85dc X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4628075)(201703131517081)(2017052603238); SRVR:CY1PR03MB2364; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2364; 3:lZXeoyu7T2SxqRihrLdHr2Xzxg4IgHH1bQ5OXUTEkJ1zSaRZ1kWgy9crUIlJEePw1LCs1+/p/y7IwRxre00ORKdLL/jo+AQYvescUiz+xK0+xAZDJXJ8RSODHNQiuED+hUjcT9DhBIcRarqiLHqNos0UjxxXANJla5lM8ufu+yKgWF9m2m8HQbksICF69pV/gPoJDmiGStLtEPNtUVdp3lsOTUp8EyVOLsXgnSKwF78/CWQmAyfRigV7gQAB/PpCCMcpvKhu+Q6yWauXbX8oQCFrpZqcLZCKqYbzHTOgodGwV+ew/NTt/QGpBkGc+TEOOn/bRVGO/8oRCgPtHEM9RB5Pi83FTPFLOgKryVrR9Os=; 25:yeXuBk+KXuq88XvhMxEj8sf2bXuKVZwYqzUT25dpTOZ2D5fnHUk3xh2tbxUIaifzRV7NXUzQXoAT4IHuem9QnekPu/oEH35nB2Q877bhBuuE57JkImfAVOqdbv9wqlVUPevSLxZosD3mpLy0tHMvHstGOKe9DfqVz/fqm0MtK8VuyaDtJrpziUquBvPfvKCfhbQ8s/OsFqwnxHOfNfTfmikyy391x412QSoMwojEyvMqZeZclfRhns+TSUzKAwNsRkB/r1X/PN6ugd+DSfVUaDl+Vt5Q8mF35DDSMl/jQUf+W6CzorrQNc7qg24/O+yWZY0JWAMN51dsiBFFRYU4qg== X-MS-TrafficTypeDiagnostic: CY1PR03MB2364: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2364; 31:R61dlLtLNCckxHibk+FPUZw8N4oOLb4So2ymIqr1OUSWktp35JEuCFkoPPKfcnF9LHI8PSma/QjNZLkiY6qi6nif8/swpGSvTbloS0ftAyVIamQKcip2a86HmWyrHs+GDo7ay/WVl3X4fItvAVH+2ukXcBJiKSEafmTNl9Che34cUNSY5kysCPMqkg0NNKvx5amVyuU++tS6y9Yja02on3QNFExSz6ez44m24XmoUrg=; 4:FF5VC69dsee4gE/Sn51aYlDKv0fQPu65hjzZWmuwLlHMIS9THDCX/65dqFXLcBndZSghZrPlgwJsHlnpH59I0X75WLLIF9nHLuhgxwD0QM+hGNvxG6mkzicaxww1punWRYOnb2NOijbPHfyc3YnKlr/4+ggJ5L2XHMsl8hA4iFkL9DjLHZNrH2dMr7L6EwmhNXmwJVB43zpS/P7GJszTqWdp0lWLrTNroidNPsHShiWru6k4mjIXQ8fK0wmHgiwDsi2aTV53nww1xbcU1sA9PrOvHStNvr3VQP96xCJ6e76VwCLa31gcI9jv5ZQCiBND60XdIANuugw1c4QwducQ5QVz+zMBP6MjuCEEiZ62PCRCwxnqIa0WECFocXL41lF3 X-Exchange-Antispam-Report-Test: UriScan:(192374486261705)(185117386973197)(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(8121501046)(5005006)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(3231020)(6055026)(6096035)(20161123565025)(20161123556025)(20161123559100)(20161123563025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123561025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR03MB2364; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR03MB2364; X-Forefront-PRVS: 0471B73328 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2364; 23:LhNpXEDJVw/F/TaKijja+gaE8CPGmy0IGJdtFzIyW?= =?us-ascii?Q?8MO/vxOULfER8+YaeiUqdrbzqlfpHGq2ww0VE0T13HQMURG0IxtZnam5mCwh?= =?us-ascii?Q?3tccnK/9ChNmieSxwPoeYDTa6pvNWIQ5AhZxZNW3XHGc77wfjaFPyTuBnaOa?= =?us-ascii?Q?lhrO+QF1H5aOXzcHbk8wADkv3SjppPD4hF6zLqckqBqcDy7MUWWkt25toShH?= =?us-ascii?Q?nPjx0hJicMZadw8x9ko8wcF06nO3HOg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00s1k7Pzy2YFE8GkimxNgW++s98YlyooLl+G7TlyaGIvYltCs/P/tqwZH3?= =?us-ascii?Q?UAFFhbIunLin5hCnLoX22gWUhjf4gszPgEWd3TUGE7z/bAWfihCwV/CXojhS?= =?us-ascii?Q?viH8nGkWIJTh/AhMjjq8fuOmfMABbJsPf7Iss0u?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2364; 6:j45vEx/NiJZ4yPZVw63IeD1RZlg0+wFU2Vuf42XLtKeTXFPDe112nxnl0VDE5a77FPRUlxUxa/tZCurTUvLIGn4LDimxAdOs9yLN7QT1tEvV0JBCp5x4Z/9WZmJd1UOmFS+TCGOg2i6sekUQPo+nlZvO+ttHaith55AA2cmQggdAfWxWUROVydMsK8O8r0vH28FPU5seOaQakZR0PVOKS6sd7TiOJtMkSEPossst0sRE906xryt0vmFfLZsJSdaoxwN7a2chOCiVn2IdrkFRhwwMRYL05hd+WQyAd0q44/yZVfR0dfwLgdewjO302AiAADunKg3Kr8M23vG1NsU8Puicmz0SnkkOTXlouPL/S7k=; 5:nnXTltIAIvF8aHaPbThHaUBPHsgShXs3i5G0vYh/RNcG/4JfXweTnXTy7o8JcsTQqqk2L3vPNQxRy5pZ8zH8541ZYBkA6SHqcg7OhACIDld0rn471u3357JEy1aV/nFYvmpkyuW4nWRngZ4+cA8MZBWGCsKq8oLEl6vlZ4danuo=; 24:7IcY+32uuqaNspZVGCt70+1IN6RzfH0jct5x2IMG9LubxYbPLriiVqONb1HiDIy1JFO21Nd2e+SU49TSYIaVYR8monN8OUCI9yrpG6WeF3Q=; 7:hfp9hLgdIQKNtlTMNChQX97vpkf4Rms9/Imzm4lK3qvZ9zvUS+OrhxprHLYhF+KTwBRkiOthbGuiF05UvCpWZyCWctSUTZuMIkVginUd500xr7azUp3P3ybJ63n0a4c597n5kDFbbrM6Wa2O7PsTXxNFhbCBMvG9LZkyJIdAahD3D5pCWiASlfVoZeUb9nciBcYSdOHUkZOFpZygGGX24WeCM7k8NH1Sqdv9YXyiWughxk8/Y6RZkRAx+DrK3lom SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2017 15:10:26.3993 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: af45da31-356f-452f-a155-08d51bba85dc 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: CY1PR03MB2364 Subject: [dpdk-dev] [PATCH v6 01/10] cryptodev: support security APIs 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, 25 Oct 2017 15:10:28 -0000 Security ops are added to crypto device to support protocol offloaded security operations. Signed-off-by: Akhil Goyal Signed-off-by: Declan Doherty --- doc/guides/cryptodevs/features/default.ini | 1 + lib/librte_cryptodev/rte_crypto.h | 3 ++- lib/librte_cryptodev/rte_crypto_sym.h | 2 ++ lib/librte_cryptodev/rte_cryptodev.c | 10 ++++++++++ lib/librte_cryptodev/rte_cryptodev.h | 8 ++++++++ lib/librte_cryptodev/rte_cryptodev_version.map | 1 + 6 files changed, 24 insertions(+), 1 deletion(-) diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini index c98717a..18d66cb 100644 --- a/doc/guides/cryptodevs/features/default.ini +++ b/doc/guides/cryptodevs/features/default.ini @@ -10,6 +10,7 @@ Symmetric crypto = Asymmetric crypto = Sym operation chaining = HW Accelerated = +Protocol offload = CPU SSE = CPU AVX = CPU AVX2 = diff --git a/lib/librte_cryptodev/rte_crypto.h b/lib/librte_cryptodev/rte_crypto.h index 3ef9e41..eeed9ee 100644 --- a/lib/librte_cryptodev/rte_crypto.h +++ b/lib/librte_cryptodev/rte_crypto.h @@ -86,7 +86,8 @@ enum rte_crypto_op_status { */ enum rte_crypto_op_sess_type { RTE_CRYPTO_OP_WITH_SESSION, /**< Session based crypto operation */ - RTE_CRYPTO_OP_SESSIONLESS /**< Session-less crypto operation */ + RTE_CRYPTO_OP_SESSIONLESS, /**< Session-less crypto operation */ + RTE_CRYPTO_OP_SECURITY_SESSION /**< Security session crypto operation */ }; /** diff --git a/lib/librte_cryptodev/rte_crypto_sym.h b/lib/librte_cryptodev/rte_crypto_sym.h index 0a0ea59..5992063 100644 --- a/lib/librte_cryptodev/rte_crypto_sym.h +++ b/lib/librte_cryptodev/rte_crypto_sym.h @@ -508,6 +508,8 @@ struct rte_crypto_sym_op { /**< Handle for the initialised session context */ struct rte_crypto_sym_xform *xform; /**< Session-less API crypto operation parameters */ + struct rte_security_session *sec_session; + /**< Handle for the initialised security session context */ }; RTE_STD_C11 diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index e48d562..b9fbe0a 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -488,6 +488,16 @@ rte_cryptodev_devices_get(const char *driver_name, uint8_t *devices, return count; } +void * +rte_cryptodev_get_sec_ctx(uint8_t dev_id) +{ + if (rte_crypto_devices[dev_id].feature_flags & + RTE_CRYPTODEV_FF_SECURITY) + return rte_crypto_devices[dev_id].security_ctx; + + return NULL; +} + int rte_cryptodev_socket_id(uint8_t dev_id) { diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h index fd0e3f1..cdc12db 100644 --- a/lib/librte_cryptodev/rte_cryptodev.h +++ b/lib/librte_cryptodev/rte_cryptodev.h @@ -351,6 +351,8 @@ rte_cryptodev_get_aead_algo_enum(enum rte_crypto_aead_algorithm *algo_enum, /**< Utilises CPU NEON instructions */ #define RTE_CRYPTODEV_FF_CPU_ARM_CE (1ULL << 11) /**< Utilises ARM CPU Cryptographic Extensions */ +#define RTE_CRYPTODEV_FF_SECURITY (1ULL << 12) +/**< Support Security Protocol Processing */ /** @@ -769,11 +771,17 @@ struct rte_cryptodev { struct rte_cryptodev_cb_list link_intr_cbs; /**< User application callback for interrupts if present */ + void *security_ctx; + /**< Context for security ops */ + __extension__ uint8_t attached : 1; /**< Flag indicating the device is attached */ } __rte_cache_aligned; +void * +rte_cryptodev_get_sec_ctx(uint8_t dev_id); + /** * * The data part, with no function pointers, associated with each device. diff --git a/lib/librte_cryptodev/rte_cryptodev_version.map b/lib/librte_cryptodev/rte_cryptodev_version.map index 919b6cc..3df3018 100644 --- a/lib/librte_cryptodev/rte_cryptodev_version.map +++ b/lib/librte_cryptodev/rte_cryptodev_version.map @@ -83,6 +83,7 @@ DPDK_17.08 { DPDK_17.11 { global: + rte_cryptodev_get_sec_ctx; rte_cryptodev_name_get; } DPDK_17.08; -- 2.9.3