From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Oct 2017 02:04:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,400,1503385200"; d="scan'208";a="164920133" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by fmsmga006.fm.intel.com with ESMTP; 19 Oct 2017 02:04:47 -0700 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.49]) by irsmsx105.ger.corp.intel.com ([163.33.3.28]) with mapi id 14.03.0319.002; Thu, 19 Oct 2017 10:04:46 +0100 From: "Ananyev, Konstantin" To: Akhil Goyal , "dev@dpdk.org" 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" Thread-Topic: [PATCH v4 10/12] net/ixgbe: enable inline ipsec Thread-Index: AQHTRTrLmmjEr5R+pU+nk9OQ+YL6eqLq517g 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> In-Reply-To: <20171014221734.15511-11-akhil.goyal@nxp.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmEwOWI4MzEtZTQwNS00ZDZmLTk2OTAtM2UyOTdjZDQyYzJiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Im9Td1BqOTl0TVpCUVRUMHUwODViM2haQ3ZBTHdFXC9LSW5mMERFN21XM1BBPSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v4 10/12] net/ixgbe: enable inline ipsec 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, 19 Oct 2017 09:04:52 -0000 > 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