From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Ananyev, Konstantin" Subject: Re: [PATCH v4 10/12] net/ixgbe: enable inline ipsec Date: Thu, 19 Oct 2017 09:04:46 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772585FAAB0C1@IRSMSX103.ger.corp.intel.com> References: <20171006181151.4758-1-akhil.goyal@nxp.com> <20171014221734.15511-1-akhil.goyal@nxp.com> <20171014221734.15511-11-akhil.goyal@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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: Akhil Goyal , "dev@dpdk.org" Return-path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id B06471AF03 for ; Thu, 19 Oct 2017 11:04:51 +0200 (CEST) In-Reply-To: <20171014221734.15511-11-akhil.goyal@nxp.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" > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_e= thdev.c > index 14b9c53..fcabd5e 100644 > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > @@ -61,6 +61,7 @@ > #include > #include > #include > +#include >=20 > #include "ixgbe_logs.h" > #include "base/ixgbe_api.h" > @@ -1132,6 +1133,7 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev) > IXGBE_DEV_PRIVATE_TO_FILTER_INFO(eth_dev->data->dev_private); > struct ixgbe_bw_conf *bw_conf =3D > IXGBE_DEV_PRIVATE_TO_BW_CONF(eth_dev->data->dev_private); > + struct rte_security_ctx *security_instance; > uint32_t ctrl_ext; > uint16_t csum; > int diag, i; > @@ -1139,6 +1141,17 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev) > PMD_INIT_FUNC_TRACE(); >=20 > eth_dev->dev_ops =3D &ixgbe_eth_dev_ops; > + security_instance =3D rte_malloc("rte_security_instances_ops", > + sizeof(struct rte_security_ctx), 0); > + if (security_instance =3D=3D NULL) > + return -ENOMEM; > + security_instance->state =3D RTE_SECURITY_INSTANCE_VALID; > + security_instance->device =3D (void *)eth_dev; > + security_instance->ops =3D &ixgbe_security_ops; > + security_instance->sess_cnt =3D 0; > + As another nit - can we move the code above into a separate function into ixgbe_ipsec.c? Something like ixgbe_ipsec_ctx_create() or so? Konstantin > + eth_dev->data->security_ctx =3D security_instance; > + > eth_dev->rx_pkt_burst =3D &ixgbe_recv_pkts; > eth_dev->tx_pkt_burst =3D &ixgbe_xmit_pkts; > eth_dev->tx_pkt_prepare =3D &ixgbe_prep_pkts; > @@ -1169,6 +1182,7 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev) >=20 > rte_eth_copy_pci_info(eth_dev, pci_dev); > eth_dev->data->dev_flags |=3D RTE_ETH_DEV_DETACHABLE; > + eth_dev->data->dev_flags |=3D RTE_ETH_DEV_SECURITY; >=20 > /* Vendor and Device ID need to be set before init of shared code */ > hw->device_id =3D pci_dev->id.device_id; > @@ -1401,6 +1415,8 @@ eth_ixgbe_dev_uninit(struct rte_eth_dev *eth_dev) > /* Remove all Traffic Manager configuration */ > ixgbe_tm_conf_uninit(eth_dev); >=20 > + rte_free(eth_dev->data->security_ctx); > + > return 0; > } >=20