From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0070.outbound.protection.outlook.com [104.47.40.70]) by dpdk.org (Postfix) with ESMTP id 22A541B216 for ; Fri, 6 Oct 2017 20:14:54 +0200 (CEST) Received: from CY4PR03CA0010.namprd03.prod.outlook.com (10.168.162.20) by BN6PR03MB2689.namprd03.prod.outlook.com (10.173.144.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Fri, 6 Oct 2017 18:14:51 +0000 Received: from BL2FFO11FD026.protection.gbl (2a01:111:f400:7c09::104) by CY4PR03CA0010.outlook.office365.com (2603:10b6:903:33::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7 via Frontend Transport; Fri, 6 Oct 2017 18:14:51 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) 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.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD026.mail.protection.outlook.com (10.173.161.105) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Fri, 6 Oct 2017 18:14:50 +0000 Received: from netperf2.ap.freescale.net ([10.232.133.164]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id v96IERob027297; Fri, 6 Oct 2017 11:14:45 -0700 From: Akhil Goyal To: CC: , , , , , , , , , , , , Date: Fri, 6 Oct 2017 23:41:42 +0530 Message-ID: <20171006181151.4758-4-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171006181151.4758-1-akhil.goyal@nxp.com> References: <20171003131413.23846-1-akhil.goyal@nxp.com> <20171006181151.4758-1-akhil.goyal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131517872910276182; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(7966004)(346002)(376002)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(4326008)(81156014)(76176999)(8656003)(53936002)(36756003)(69596002)(68736007)(6666003)(105606002)(85426001)(316002)(50986999)(16586007)(97736004)(498600001)(1076002)(2950100002)(6916009)(77096006)(5890100001)(104016004)(15650500001)(5003940100001)(54906003)(189998001)(50226002)(7416002)(8676002)(106466001)(47776003)(81166006)(5660300001)(86362001)(305945005)(33646002)(2906002)(48376002)(356003)(8936002)(50466002)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2689; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD026; 1:roLWX1rSneC0FEAM7KpASswtv9fCm924qKgHtn8akk1deFRl26vIJBHhr2/PNpGWiVqTYJ2KQq3oEGAL2FpOqa2wFUIo3RvRBX1xBLwv6tn/mU8wGjZ4pHBJEhgNiFXx MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f000f204-91f0-4989-9656-08d50ce622e5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:BN6PR03MB2689; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2689; 3:rDoLRvNNBWDa2GE6BEzxQwdvZlBJkhVJXu8gArbdroepoRkZXcB3Iq09v0OYH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CrCHTxAnV40bvpPfcSAsbmN+Q5DIiiyNAxFuXlYNZkiHG/yRZpb8dKjO0oc+4ecGXtFAyYKUG9/kDE4bTicMFBvjb3dF2BlLieZuDYiHuQ+BCsGKLYbU5iBwKzkt5Zu8wOf4kaDWz62lo05/birCdttg/+bxcILQV0LI6+jzl4plAqepoKZ4MwC/60/Gax7WKxgyvNk+IJDsDPFAO0pNfWMLYW5wFiidwlXZ3RJcryJxZP1TkLbvYL+BL3CJxjVl1rbiHoDCp 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)(5005006)(8121501046)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123556025)(20161123563025)(20161123559100)(20161123561025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR03MB2689; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR03MB2689; X-Forefront-PRVS: 0452022BE1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2689; 23:JcJ/LGiclzstFpEMuDlnozb2Bgn1c07QjpOmpYq/4?= =?us-ascii?Q?lv56FlpsYlsUOqu7C5ddbgGjhnu1N4az5YzKKumSwHGM8sI3BpDL3aOvsDNi?= =?us-ascii?Q?xb9kfSrXiwlrjD58fNqoXfP/W9JiAwX9dlHrDusf8q1oi/cFT3b4vDLrDt0R?= =?us-ascii?Q?jsbnV3TKnmfA1bw0XxTHIaMHVfXspLsxeEyrBDI+tubsSfMlwoyJQMh5aOMq?= =?us-ascii?Q?Lo814DJtBw+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qLId0MMjSlnWuLn2JBqanvDTzdY9ChfeoE73vGY4Zfnk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2017 18:14:50.7936 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB2689 Subject: [dpdk-dev] [PATCH v3 03/12] 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: Fri, 06 Oct 2017 18:14:54 -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 | 7 +++++++ 6 files changed, 30 insertions(+), 1 deletion(-) diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini index 0926887..75e88a4 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 10fe080..3eb9ef9 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 0ceaa91..80d5fbb 100644 --- a/lib/librte_cryptodev/rte_crypto_sym.h +++ b/lib/librte_cryptodev/rte_crypto_sym.h @@ -505,6 +505,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 327d7e8..7a7c936 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; } +uint16_t +rte_cryptodev_get_sec_id(uint8_t dev_id) +{ + if (rte_crypto_devices[dev_id].feature_flags & + RTE_CRYPTODEV_FF_SECURITY) + return rte_crypto_devices[dev_id].data->sec_id; + + return INVALID_SEC_ID; +} + 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 7ec9c4b..806b255 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 */ /** @@ -761,6 +763,10 @@ struct rte_cryptodev { /**< Flag indicating the device is attached */ } __rte_cache_aligned; +#define INVALID_SEC_ID 0xFFFF +uint16_t +rte_cryptodev_get_sec_id(uint8_t dev_id); + /** * * The data part, with no function pointers, associated with each device. @@ -789,6 +795,8 @@ struct rte_cryptodev_data { void *dev_private; /**< PMD-specific private data */ + uint16_t sec_id; + /**< security instance identifier */ } __rte_cache_aligned; extern struct rte_cryptodev *rte_cryptodevs; diff --git a/lib/librte_cryptodev/rte_cryptodev_version.map b/lib/librte_cryptodev/rte_cryptodev_version.map index e9ba88a..3d4a411 100644 --- a/lib/librte_cryptodev/rte_cryptodev_version.map +++ b/lib/librte_cryptodev/rte_cryptodev_version.map @@ -79,3 +79,10 @@ DPDK_17.08 { rte_crypto_aead_operation_strings; } DPDK_17.05; + +DPDK_17.11 { + global: + + rte_cryptodev_get_sec_id; + +} DPDK_17.08; -- 2.9.3