From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0054.outbound.protection.outlook.com [104.47.40.54]) by dpdk.org (Postfix) with ESMTP id 57B431B1A0 for ; Thu, 14 Sep 2017 10:29:23 +0200 (CEST) Received: from BN3PR03CA0053.namprd03.prod.outlook.com (10.167.1.141) by DM5SPR00MB235.namprd03.prod.outlook.com (10.173.215.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11; Thu, 14 Sep 2017 08:29:21 +0000 Received: from BN1AFFO11FD013.protection.gbl (2a01:111:f400:7c10::170) by BN3PR03CA0053.outlook.office365.com (2a01:111:e400:7a4d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10 via Frontend Transport; Thu, 14 Sep 2017 08:29:21 +0000 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 BN1AFFO11FD013.mail.protection.outlook.com (10.58.52.73) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.13.11 via Frontend Transport; Thu, 14 Sep 2017 08:29:21 +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 v8E8T36H025953; Thu, 14 Sep 2017 01:29:17 -0700 From: Akhil Goyal To: CC: , , , , , , , , Date: Thu, 14 Sep 2017 13:56:43 +0530 Message-ID: <20170914082651.26232-4-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170914082651.26232-1-akhil.goyal@nxp.com> References: <20170914082651.26232-1-akhil.goyal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131498513614627754; (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)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(1076002)(54906002)(8936002)(50226002)(33646002)(8676002)(81166006)(81156014)(2351001)(2906002)(106466001)(5890100001)(53936002)(498600001)(316002)(104016004)(97736004)(16586007)(4326008)(8656003)(305945005)(356003)(110136004)(36756003)(86362001)(50466002)(50986999)(76176999)(47776003)(15650500001)(48376002)(189998001)(68736007)(5660300001)(7416002)(105606002)(2950100002)(6916009)(6666003)(5003940100001)(77096006); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5SPR00MB235; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD013; 1:xEteHDjlwHtFnG+z/Up2UtXW4l32q7ivFol6FqnonspUoqnyXc2ziQZRekeeq85fm68bln4lx97oX0fu0NbBmIbVzlVPHbcNzlHgs9A6u8mnOcUkzXoTaV3cY+4VxjZ/ MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 269f14ee-0869-4d29-824c-08d4fb4ab2f2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DM5SPR00MB235; X-Microsoft-Exchange-Diagnostics: 1; DM5SPR00MB235; 3:F1/t0/nc0ZshC/SjCkAKNUiuG7Ugw9JRGKstzQAyYJFsZtmVUeTJN3ab6gNsr4FbEKxFSi5wITLnqWI3Qar6UlmvaPD2DVDkNQO/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vhvl85Vjfm/HUEkTR56d98+Hrd0rAtd/g7JF5YAPjoUyoNykq7OCFyouI3N7LoNEX8UMXpMPVUvP5rlNuzEapuzae8NMDWyRyWLSCOtW2rTUNp43lyqQU1jYzyspwYYgVzMNFqVHlyv+bT/EBpUDFCZ5qEATE0G3R9bRTb+rtxQHEAafIw5ZG6WEDtll6SbIVFBF8eB7QXOEqWDiYcItylkIkFiLr9BT 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)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6055026)(6096035)(20161123556025)(20161123563025)(20161123561025)(20161123559100)(20161123565025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5SPR00MB235; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5SPR00MB235; X-Forefront-PRVS: 0430FA5CB7 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5SPR00MB235; 23:pMLMXmgUZRwA7Ucmm+AnOZyV9/70M2pUQAKWGGsqb?= =?us-ascii?Q?LkG7JpBv+fNLVDMX24KAi4DOhLGtsnEih5w9OIgXwwT/lSsQEraS+SCd7ptI?= =?us-ascii?Q?Qj2IX3DYJktlmJ+bPC1e3Q8v8tsS8VRmBLBai1n/fNpQCgcKh2D0SbC3AAkx?= =?us-ascii?Q?/GZOIDPlSDOB2/5BPPL4tkPRwMU3oSkOtdcwSMcsMkyzQHxO+X5Z9BMXAmE1?= =?us-ascii?Q?vN7pY+TUsoeyTSEUp8GbyPuzdfqD2cKK/jM86b91u94GC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M X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2017 08:29:21.2911 (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.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5SPR00MB235 Subject: [dpdk-dev] [PATCH 03/11] 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: Thu, 14 Sep 2017 08:29:23 -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