From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0063.outbound.protection.outlook.com [104.47.37.63]) by dpdk.org (Postfix) with ESMTP id B6B381B82D for ; Tue, 24 Oct 2017 16:18:54 +0200 (CEST) Received: from CY1PR03CA0034.namprd03.prod.outlook.com (10.174.128.44) by CY1PR03MB2361.namprd03.prod.outlook.com (10.166.207.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.178.6; Tue, 24 Oct 2017 14:18:53 +0000 Received: from BY2FFO11OLC001.protection.gbl (2a01:111:f400:7c0c::113) by CY1PR03CA0034.outlook.office365.com (2603:10b6:600::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.178.6 via Frontend Transport; Tue, 24 Oct 2017 14:18:53 +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 BY2FFO11OLC001.mail.protection.outlook.com (10.1.15.185) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.156.4 via Frontend Transport; Tue, 24 Oct 2017 14:18:52 +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 v9OEIVHV029613; Tue, 24 Oct 2017 07:18:47 -0700 From: Akhil Goyal To: CC: , , , , , , , , , , , , Date: Tue, 24 Oct 2017 19:45:37 +0530 Message-ID: <20171024141545.30837-4-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171024141545.30837-1-akhil.goyal@nxp.com> References: <20171014221734.15511-1-akhil.goyal@nxp.com> <20171024141545.30837-1-akhil.goyal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131533283330538564; (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)(346002)(376002)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(189998001)(498600001)(316002)(47776003)(81166006)(50986999)(1076002)(76176999)(50226002)(50466002)(48376002)(2906002)(8936002)(305945005)(4326008)(15650500001)(8676002)(68736007)(104016004)(36756003)(356003)(53936002)(81156014)(86362001)(575784001)(77096006)(5890100001)(7416002)(85426001)(54906003)(33646002)(5003940100001)(16586007)(2950100002)(105606002)(6916009)(6666003)(8656005)(106466001)(8656005)(97736004)(2351001)(5660300001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2361; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC001; 1:36jDzYGQl1J5q9qrLvqB78NjXMnswsYSQk6euTgB42p0sXaULnczNdbKPlUqFUtbStXyDnV9B5rsBuY0HQSrVC6dvb00JGNaIrgGxThdfC2xoVx8Hqsup4gpwU+nwnIQ MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5c967286-e8e8-48be-5ae7-08d51aea2783 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4628075)(201703131517081)(2017052603199); SRVR:CY1PR03MB2361; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2361; 3:p3D40ZxrVwEIuFtOl/3HUy2HsSy4ozdEQIzwkElZ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lPNfflaFZm80iI9lN1ckrJ3YqLQ5v4c/ggtLIZXkeER5tkdbqOEBKOUbMjmuOr3PIyvNR3k+fC6JujaHIjCY6rRn3TeVSZnDl/gAfMs3tniPrxQDY4v5sasnfm1XnE/Xx7r+sI0EEtxLEDJDDzBefGtjOIATZt/Fd1aRp4LvbuOLjB03uyel+g49rKIn1eCXZ3Wdw/MflQzL96n1rXKNK5MzNGrwb9RWZmsw7YioGH+26o9ezOEHp+W+KFrfOsWTpAyxCF5ld4YQc/SAuKhjvwMZ5pSsK2X 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)(93006095)(93001095)(3002001)(10201501046)(3231020)(100000703101)(100105400095)(6055026)(6096035)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123556025)(20161123563025)(20161123559100)(20161123565025)(20161123561025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR03MB2361; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR03MB2361; X-Forefront-PRVS: 047001DADA X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2361; 23:2sp8n2GVPij0gRIcPUrNeXPmHL/4zcf32KT627WLr?= =?us-ascii?Q?SUAfN1JLFD+DXlZaAuY/TACCKPeebbQ7DMkVoRoOxt38iXQkfS1UKw07ZyW5?= =?us-ascii?Q?UuLaUcC4qElYq3aJymurVdKgWZt65RtBMVI3fb9VW/ulZsUYYahO8gFaIl5p?= =?us-ascii?Q?ZO+67VGlT0ekUG01AnuK3iW8vHJQbylw5E4Bdnhdu+rZiPGhxBhfFlqsjSWW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z2W6FXzYNGszSemwZ5VXTEqiw1ywAD4ci5tCtRb7KKIi9KN+BtANFQT36yvKA4xxX0DqvmgR+udA+hRTiNAViKK78MHn9//toDb6SSdaFH+494lODJsYdA8G SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2017 14:18:52.7574 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5c967286-e8e8-48be-5ae7-08d51aea2783 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: CY1PR03MB2361 Subject: [dpdk-dev] [PATCH v5 03/11] 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: Tue, 24 Oct 2017 14:18:55 -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