From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id E38CA1B305 for ; Sun, 15 Oct 2017 14:48:13 +0200 (CEST) Received: by mail-wm0-f66.google.com with SMTP id b189so28538562wmd.4 for ; Sun, 15 Oct 2017 05:48:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dev-mellanox-co-il.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=sebO2pcstS+/yJxw3RVKUjhlYYu6AyJybKN5IFsUmp0=; b=LPZDnIPYLXvLq39rtzGtwdDfteGqF6IBmIeEryAsOVda5mLp6rTmdpBi0XySBwvHMR GcJ7hcBZJjGvMKfxJspyLKSdX1gSf1EFcLGWlqu6emk1gg6Kklsi7IpVM1X7lX4A9zbm rOyPycRINf0wuhSlg7n1cyViUFnxMiJJFHniBrIhkRu9Zl0rbZWMjiYrG52R+7q7c77B Xhka2y5QXq73MCQuWd+N0dG1ZeOyAyLccB5wLsSjcZSL6xNP8VblowA8f1Fr7r8R6zTj 4cfAqfVAjGY8oWhq+/e8UjtxbwGK4vj4KiAr0ll8mjnVvl870UtRdwv+g4L5QI8ZqWrw Sz9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=sebO2pcstS+/yJxw3RVKUjhlYYu6AyJybKN5IFsUmp0=; b=JBSCh7wcwBsIZXJbNQ1nvhujOnUJtELbX6tLlUBrXONz8gCftLBN6D5pAONg5tmaf6 LQ8t6oMS7dDIC+etVrzA0xDQS1karCW5I2yhFjIS6Z2kG1zRFEaFNKK+20I/cdb30NWO eB1t0nxpabqiLC9eTfBqC1QgW/aMWgpQFe04djtxuEmkWaE4iCjge60oG9KifilknXtU p/8kZWMLrBVHzfBYafp7c+Rk+XfiJXNjTLw0DGKknBleOBMpb95LFI8Zs100PdwZ5K/i pEEYm5zWUmHYf3hyWzZ33KXnYFgIc2EBrGI+nVxRJdD1bErPoWy5PqgJ/fVc7y2c66K+ cGvQ== X-Gm-Message-State: AMCzsaW9cDwrjdiRsfG/mEOxb5mBnel0MIpJ49wTAiDMtcyVBl+igm/j gxTtAQbteLbZ3ruZddsWNoJnSg== X-Google-Smtp-Source: AOwi7QBBZhejH9UwMT2RtMPrpEwq4QTYabZGcQYbkVhdUSn8jvHRLmI0V7J6NCaMwEnfgTDXuJyl9w== X-Received: by 10.80.144.178 with SMTP id c47mr9622992eda.240.1508071693650; Sun, 15 Oct 2017 05:48:13 -0700 (PDT) Received: from [10.0.38.219] ([193.47.165.251]) by smtp.gmail.com with ESMTPSA id s26sm3686446eds.68.2017.10.15.05.48.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Oct 2017 05:48:12 -0700 (PDT) To: Akhil Goyal , dev@dpdk.org Cc: declan.doherty@intel.com, pablo.de.lara.guarch@intel.com, hemant.agrawal@nxp.com, radu.nicolau@intel.com, borisp@mellanox.com, aviadye@mellanox.com, thomas@monjalon.net, sandeep.malik@nxp.com, jerin.jacob@caviumnetworks.com, john.mcnamara@intel.com, konstantin.ananyev@intel.com, shahafs@mellanox.com, olivier.matz@6wind.com References: <20171006181151.4758-1-akhil.goyal@nxp.com> <20171014221734.15511-1-akhil.goyal@nxp.com> <20171014221734.15511-4-akhil.goyal@nxp.com> From: Aviad Yehezkel Message-ID: <19f3c45b-7c3e-9871-d23f-12acfbd08f90@dev.mellanox.co.il> Date: Sun, 15 Oct 2017 15:48:11 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171014221734.15511-4-akhil.goyal@nxp.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [dpdk-dev] [PATCH v4 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: Sun, 15 Oct 2017 12:48:14 -0000 On 10/15/2017 1:17 AM, Akhil Goyal wrote: > 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 | 7 +++++++ > lib/librte_cryptodev/rte_cryptodev_version.map | 1 + > 6 files changed, 23 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 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 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..5a2495b 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].data->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..546454b 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 */ > > > /** > @@ -774,6 +776,9 @@ struct rte_cryptodev { > /**< 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. > @@ -802,6 +807,8 @@ struct rte_cryptodev_data { > > void *dev_private; > /**< PMD-specific private data */ > + void *security_ctx; > + /**< Context for security ops */ > } __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 919b6cc..7ef1b0f 100644 > --- a/lib/librte_cryptodev/rte_cryptodev_version.map > +++ b/lib/librte_cryptodev/rte_cryptodev_version.map > @@ -84,5 +84,6 @@ DPDK_17.11 { > global: > > rte_cryptodev_name_get; > + rte_cryptodev_get_sec_ctx; > > } DPDK_17.08; Tested-by: Aviad Yehezkel