From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0042.outbound.protection.outlook.com [104.47.32.42]) by dpdk.org (Postfix) with ESMTP id 120B31B398 for ; Tue, 3 Oct 2017 15:17:05 +0200 (CEST) Received: from MWHPR03CA0010.namprd03.prod.outlook.com (10.175.133.148) by BN3PR03MB2355.namprd03.prod.outlook.com (10.166.74.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Tue, 3 Oct 2017 13:17:04 +0000 Received: from BL2FFO11FD032.protection.gbl (2a01:111:f400:7c09::108) by MWHPR03CA0010.outlook.office365.com (2603:10b6:300:117::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.9 via Frontend Transport; Tue, 3 Oct 2017 13:17:04 +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 BL2FFO11FD032.mail.protection.outlook.com (10.173.160.73) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Tue, 3 Oct 2017 13:17:03 +0000 Received: from netperf2.ap.freescale.net ([10.232.133.164]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id v93DGfTE030592; Tue, 3 Oct 2017 06:16:58 -0700 From: Akhil Goyal To: CC: , , , , , , , , , , Date: Tue, 3 Oct 2017 18:44:04 +0530 Message-ID: <20171003131413.23846-4-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171003131413.23846-1-akhil.goyal@nxp.com> References: <20170914082651.26232-1-akhil.goyal@nxp.com> <20171003131413.23846-1-akhil.goyal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131515102237907237; (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)(39380400002)(346002)(39860400002)(376002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(104016004)(47776003)(69596002)(97736004)(50986999)(8936002)(85426001)(8676002)(76176999)(6666003)(81166006)(81156014)(356003)(2950100002)(1076002)(305945005)(6916009)(15650500001)(77096006)(189998001)(105606002)(2351001)(498600001)(50226002)(54906003)(36756003)(8656003)(5890100001)(86362001)(33646002)(106466001)(2906002)(68736007)(7416002)(4326008)(5660300001)(48376002)(5003940100001)(50466002)(316002)(53936002)(16586007); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2355; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD032; 1:F1toms1ue3xRypEnvyho+hbRfSgO5UU4/2xWj4WZoSvepKxaEeEKgxc6Jg/stNaLKeraUUfKXehN/ioywwD6L0LDlnAJIMd+YvCZiJAeolyP2bOlZM0+cL9OKe4clI19 MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e542c41b-b51c-4bec-f7c9-08d50a6109f1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:BN3PR03MB2355; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2355; 3:0ZsM8vMCEIj3v9zX7cKAvknT002lkgtVh5hYfo7VIhCmi6pHheFDRCRH9JjJjNph4BACdxRJ+lDGoNoOgbpxd+z9KgWO9LYQ6VYGArSwEHmnkrljfxkp0nrlu8tbwnBXrGEYL9bm30qZa13PWY/NfLVYRyvyz5IkrjX0PcNPGZUhONemeSXeki6EzUm1Q51w+9xXFXU1VouTaFGggwfKwd2auf2Mdm3Yc3ZD/EHMFdVqb+YzfNfGxC4YfYqW4jnrlp6CFuCP6bdpxSv7aIrY+v3CzwTT+7comq8/7VVVYMdiCYnWG1UsTa7Fkjk2J07E74yJra31AEB+0X0NkYs5cA==; 25:b+86gD/y2MwHj/WjhkX1wWvUpzCupGIQGeU/XUkn72jaeesjEtkPzk6M34JWLwH6mcelrq/1ZLfYzLrAKBDV/za+PWak2DYDElWFh3Ty64dUxbYAFAcA106BCKKoPDSz5l8UZw543ZYzAMqBgmWS4YLpkKhDwrN3B3Vaqb3hKHmjEWyMl058erbCRRWQjHHQtS9eGH+24D2iTGlJten8qJvXCzrM8manTaXSJKDv76B7zLurcvmlsSW1MevIOFJiJj0lJQbLye1jQUon/EyEcONd1hQpS4dCHdH/NYgutTc/+Tm7yTZ1FuiSfs8VAqiNjljxf7w3O8hM8HtP60zlUA==; 31:LL+mP2KnXsjYc1+9TbqT6goNoP9K9F/QXKaktpyeNMLW6GGbYJBQMaEwrE/dfGTqmcfDk55XOwl+VLk+mwq529MkbsuPNOTpdFtFtu6lgU5lAyojr4cQk5CA+SdbhjbToWpNJ52l/WYoJCakChifRtv46nBeXVdPZ+2WYaYS9FOY5TitFtZxlDt6Lwppo6g/BWhoWSOLBz2whASkMJsG7qegoxPT/UYu2tUgSr/H5s0= X-MS-TrafficTypeDiagnostic: BN3PR03MB2355: 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)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123565025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123561025)(20161123559100)(20161123563025)(20161123556025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN3PR03MB2355; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN3PR03MB2355; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2355; 4:ZSQ6gcPzmLyDfkpixA2luJynN5rfCwfpUPfieK32lyhQBFy30N6t6+0q7K8I2/4VBKP9BXlAo21vLg14jLfqsenX4tsWm0d1LzZDLEHTJfTXjZZDyRfRnU1VKAK+JlDT4BQlclq0WdZvi4moaplN/UJt/xpXqx18KtNxGvS42khuQL3ZkKmJl8xlJzg3lWvkawNW1iL6Jpe1y+P0P+mgpsDoGIKM8QT5mX6YGXBotBFsNpg+OS+9S1QVH2jf7eQJt/F/aaf1/PtZ57RHHz8hw7gvs7szv4ggI862d1zTHs9oe/JDaS4p+LzVPe7bXounAkp72EcwORPORoIsygFr/kqFW++YbJquA+ZEsy/8LNl2QTsx5944xeIn/V9SbHD2 X-Forefront-PRVS: 044968D9E1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB2355; 23:ocTtOCgbUrgXRq5uAkD9B1C4FLtTRcsGgLYijYELB?= =?us-ascii?Q?mvNBoi7CL1aiFArvYfe5lqJEVZ8f6xEuqicGjqczYZvFMnh2K0F0csTQxVv0?= =?us-ascii?Q?XOJl4rnhoBNWeuBdSDHuf8tREubdbdUTzki32U4O7JLrLkmYtxrRv4YsuXd1?= =?us-ascii?Q?XhpdxwIJreEA9rmTngnVxwdCLZV9FYDiM0rofLYxIwjiQlYCCr9Vn78kqZE8?= =?us-ascii?Q?LnCoUMq9VLQQgktCNJAFePbW1KLo33AYa4s7ynqn2VW9+FPaMHeUsu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DiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2017 13:17:03.5411 (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: BN3PR03MB2355 Subject: [dpdk-dev] [PATCH v2 03/12] cryptodev: extend cryptodev to 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, 03 Oct 2017 13:17:06 -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, 28 insertions(+), 3 deletions(-) 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..e52fc88 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 -1; +} + 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..867b5be 100644 --- a/lib/librte_cryptodev/rte_cryptodev.h +++ b/lib/librte_cryptodev/rte_cryptodev.h @@ -51,8 +51,6 @@ extern "C" { #include #include -extern const char **rte_cyptodev_names; - /* Logging Macros */ #define CDEV_LOG_ERR(...) \ @@ -351,6 +349,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 +761,9 @@ struct rte_cryptodev { /**< Flag indicating the device is attached */ } __rte_cache_aligned; +uint16_t +rte_cryptodev_get_sec_id(uint8_t dev_id); + /** * * The data part, with no function pointers, associated with each device. @@ -789,6 +792,7 @@ struct rte_cryptodev_data { void *dev_private; /**< PMD-specific private data */ + uint16_t sec_id; } __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