From mboxrd@z Thu Jan 1 00:00:00 1970 From: Akhil Goyal Subject: Re: [PATCH v4 01/12] lib/rte_security: add security library Date: Sat, 21 Oct 2017 21:24:34 +0530 Message-ID: <66a5a72d-ba2f-5310-6cd6-30980d5cb5e6@nxp.com> References: <20171006181151.4758-1-akhil.goyal@nxp.com> <20171014221734.15511-1-akhil.goyal@nxp.com> <20171014221734.15511-2-akhil.goyal@nxp.com> <2601191342CEEE43887BDE71AB9772585FAAB11D@IRSMSX103.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Cc: "Doherty, Declan" , "De Lara Guarch, Pablo" , "hemant.agrawal@nxp.com" , "Nicolau, Radu" , "borisp@mellanox.com" , "aviadye@mellanox.com" , "thomas@monjalon.net" , "sandeep.malik@nxp.com" , "jerin.jacob@caviumnetworks.com" , "Mcnamara, John" , "shahafs@mellanox.com" , "olivier.matz@6wind.com" To: "Ananyev, Konstantin" , "dev@dpdk.org" Return-path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0085.outbound.protection.outlook.com [104.47.36.85]) by dpdk.org (Postfix) with ESMTP id 75C441B2F4 for ; Sat, 21 Oct 2017 17:54:43 +0200 (CEST) In-Reply-To: <2601191342CEEE43887BDE71AB9772585FAAB11D@IRSMSX103.ger.corp.intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 10/19/2017 3:00 PM, Ananyev, Konstantin wrote: > > >> + >> +/** >> + * Security context for crypto/eth devices >> + * >> + * Security instance for each driver to register security operations. >> + * The application can get the security context from the crypto/eth device id >> + * using the APIs rte_cryptodev_get_sec_ctx()/rte_eth_dev_get_sec_ctx() >> + * This structure is used to identify the device(crypto/eth) for which the >> + * security operations need to be performed. >> + */ >> +struct rte_security_ctx { >> + enum { >> + RTE_SECURITY_INSTANCE_INVALID, >> + /**< Security context is invalid */ >> + RTE_SECURITY_INSTANCE_VALID >> + /**< Security context is valid */ >> + } state; > > As a nit - why do you need state now? > As I understand if device doesn't have its security context setup properly, > then rte_eth_dev_get_sec_ctx() would just return 0. > Konstantin Ok would remove it in v5. > >> + /**< Current state of security context */ >> + void *device; >> + /**< Crypto/ethernet device attached */ >> + struct rte_security_ops *ops; >> + /**< Pointer to security ops for the device */ >> + uint16_t sess_cnt; >> + /**< Number of sessions attached to this context */ >> +}; >