From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E9A5CA0566; Tue, 10 Mar 2020 17:24:36 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C0E2A1BFFB; Tue, 10 Mar 2020 17:24:36 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id B12F21BFFA for ; Tue, 10 Mar 2020 17:24:35 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02AGONMK009042; Tue, 10 Mar 2020 09:24:35 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=5zmnAIQ0WlDsQsLZnKCdJdRZTYc2mqWvnoTZvR+4qLo=; b=CuvQtD+uQ2Lslqz9lxrjej2UDEOpK9Wbxcav7xVcQ8PWU/Oi7GINm1hKqu0I/9ejLD9v uimTz9OgOBsOzLpC6n/lCiS7Vn6RhmLT6kWNt+gUaSe2l6RtQGXoQtw2I2K7k07X40fi tTYSEYoLIteb10bdHo7x4aaRBQL23kRqJhGnlKv12JIs/aB1fObjyGuETJRH8w/cuAwD BCOFu/0xhcno5nMswndL6ol5FYhKkCxhwWr86tHYg1nz3+z4SeVNkqkmJfSlmG11qfq4 ws2RUddF/+ThSd9xe0YzTQvuDWZEocSIOx9b01vuIlxApNdz8PMzIt2EMK2nzPHS/+ty /g== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2yp04fmfa0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 10 Mar 2020 09:24:34 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 10 Mar 2020 09:24:32 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (104.47.38.59) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Tue, 10 Mar 2020 09:24:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ndHXEz1lPvGhy8YyIq5NLkCHaKLKithIoVAQr2EMg0cUJO6jg+iHEkGF+7xuFmDqTeGOrijH70CM70tTz8atZybKJhHnBF/pJpkWg39WjeYM1OL8hvKZEO9wrzrN5rWxvm1VprwR6hiMsGGLm0EoV7IujZT+dfbDOV2YvxdlovY/Tdy2Omr3L7HoFboeRB0N3Eh6a0EkRZTPi3XwiZ/Fv+dufulTNtlkZZrQaYg5m4eci8QHxVn2QP/6AfNFZ/gM0Qu3GY4BPDnctoMNC4zfSpQIUShPBPw56nf2oqhvG/O6mgHRElHn8f/aeBPmAJB4lgjrmDp7w1Lcvp+scz4jIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5zmnAIQ0WlDsQsLZnKCdJdRZTYc2mqWvnoTZvR+4qLo=; b=j0p8dbdxQ46bMJOyCwkD5wtXak0WgMWh1WTVy1bygN4JFvtL0HpRmomgxEXIAp9/WAAewBR1Ox2HgWezicwBhir0FBy4uXudJV5BjhY4AROXk9ZDwv54D2ShTO5UkCYXrMrwmiQHMfPu+W4rFg3AZKc9CDwhBrYPGw/bjQsZIxnlEXkBAridpkTpOOU16wzBSZlC+iLcP+IedhqUupjAwLYeq3DaLgn8Kx0iUivNTDIu82lGq88lHonEKsX4LDVtny2pP7YaqvrlDNe6CRJu3bYTu/z69VvbfE3/pBFm8QF7Et9OKXHHJWqZ3DhRDKY+bnWR8IOulrsZhg/QSgo+jA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5zmnAIQ0WlDsQsLZnKCdJdRZTYc2mqWvnoTZvR+4qLo=; b=liKj+FMVCSHxQ2hMaZF3VTMtRXlhSFu8tr0B5Oc0MklxKRcc2uvnFTTUFMYbe/rSkKJyVRIwxt71ex8/lspOHiq7kF0NYOe4CJVrMNdFSBSWjknUe/Ps+Lj8BKbfaQV7aZNIiBE50cKP+ZiEIMA4ysQw4b3DYq6kQqAKi3msDPc= Received: from MN2PR18MB2877.namprd18.prod.outlook.com (2603:10b6:208:3b::26) by MN2PR18MB3357.namprd18.prod.outlook.com (2603:10b6:208:167::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.14; Tue, 10 Mar 2020 16:24:31 +0000 Received: from MN2PR18MB2877.namprd18.prod.outlook.com ([fe80::648f:e7fa:f95e:191b]) by MN2PR18MB2877.namprd18.prod.outlook.com ([fe80::648f:e7fa:f95e:191b%2]) with mapi id 15.20.2793.013; Tue, 10 Mar 2020 16:24:31 +0000 From: Anoob Joseph To: "Shetty, Praveen" , "dev@dpdk.org" , "Doherty, Declan" , "Iremonger, Bernard" , "Ananyev, Konstantin" Thread-Topic: [dpdk-dev] [PATCH v1] examples/ipsec-secgw: load/unload esp-ah DDP file Thread-Index: AQHV85bptWBTyWSm+Eyfk6Ra/QhC96g7SUxggAZxEACAAE5EAA== Date: Tue, 10 Mar 2020 16:24:30 +0000 Message-ID: References: <20200306055609.11734-1-praveen.shetty@intel.com> In-Reply-To: Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [27.34.247.38] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e1dc90c8-93b9-4e1a-5293-08d7c50f8313 x-ms-traffictypediagnostic: MN2PR18MB3357: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:222; x-forefront-prvs: 033857D0BD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(366004)(376002)(396003)(39860400002)(136003)(189003)(199004)(8936002)(478600001)(81156014)(66946007)(66446008)(81166006)(64756008)(55016002)(86362001)(2906002)(71200400001)(5660300002)(9686003)(76116006)(53546011)(6506007)(316002)(52536014)(30864003)(186003)(66556008)(33656002)(26005)(66476007)(110136005)(7696005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB3357; H:MN2PR18MB2877.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cGadYPj8DlRsDB0Mxbx2L/jEFhPUDfxhdOi7VnqQvtTZ9LMpBlXxYJLYjDIsecgswBL9DiGwVARmPZsI6b+g4DBDmnHA4M7FTSa8wQ5N27QPyy9ikb8Ov0oihxTvJDPSMCIIZFqyhIfTsd5xE4Jsdok3gaJdig9Vhe/twMRIo9mAgDH24fuyYzYpss0Dfx9yuqqibQWtKqK6Oz2Clth5UUU3aY6XMP3xkXTxdoRbY0K0Dw7Zvw4STfPuO2fPCOPX1xAGKoMCkU7LJEGCikbsJVVNbia1qLRtxb8+PHgftM1DhUesTjv7XEtTvnipXJ+7QC/Rc9D3aMVkDnFrcrFrSgAT8IralxOalFK8dWgUxNdOL5m/1gRyN1UnVImhM35iHmaA8xFLXSCEKowmY6BHwVQlv4oy2SotDmvlSymimn9fPzl7qz6hGso+y0ATZo5T x-ms-exchange-antispam-messagedata: ifHChhktWvGtnK7mxQL7qQfhyMQH8h3tavC2O7K3Wk6PgCYmRbKrJVuNg1VGRlwKQEi/8FDaKGkTTTVvPJOLMHtvJViJkcfhXL97sRdH/ZmycMGiTVt7fSxyYsYl5DgyaBtKW9goghPB1PXFohqgcw== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: e1dc90c8-93b9-4e1a-5293-08d7c50f8313 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Mar 2020 16:24:30.9717 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: NvOXYxg1Z+iQsLZZesl/8u6v6M4wSpzjtD3Dy01nyQznXtH+70dJf8nUNmbv4ECtqKhDST/zuXqRDyuHZRnvOA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB3357 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-03-10_11:2020-03-10, 2020-03-10 signatures=0 Subject: Re: [dpdk-dev] [PATCH v1] examples/ipsec-secgw: load/unload esp-ah DDP file 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Praveen, [Anoob] Rather than calling PMD specific functions from all applications, i= t might be better to introduce the same via 'devargs' to the PMD. [Praveen Shetty] We will investigate further on this. Probably let's converge on this before sending v2. I don't think we should = add a new option just specific to one PMD. Devargs already provides the req= uired framework and other PMDs are already using it. @Konstatin, @Akhil, What is your take on this? Thanks, Anoob > -----Original Message----- > From: Shetty, Praveen > Sent: Tuesday, March 10, 2020 5:11 PM > To: Anoob Joseph ; dev@dpdk.org; Doherty, Declan > ; Iremonger, Bernard > ; Ananyev, Konstantin > > Subject: [EXT] RE: [dpdk-dev] [PATCH v1] examples/ipsec-secgw: load/unloa= d > esp-ah DDP file >=20 > External Email >=20 > ---------------------------------------------------------------------- > Hi Anoob, >=20 > Thanks for the review. > Please see my response inline. >=20 > Regards, > Praveen >=20 > -----Original Message----- > From: Anoob Joseph > Sent: Friday, March 6, 2020 3:30 PM > To: Shetty, Praveen ; dev@dpdk.org; Doherty, > Declan ; Iremonger, Bernard > ; Ananyev, Konstantin > > Subject: RE: [dpdk-dev] [PATCH v1] examples/ipsec-secgw: load/unload esp-= ah > DDP file >=20 > Hi Praveen, >=20 > Please see inline. >=20 > Thanks, > Anoob >=20 > > -----Original Message----- > > From: dev On Behalf Of Praveen Shetty > > Sent: Friday, March 6, 2020 11:26 AM > > To: dev@dpdk.org; declan.doherty@intel.com; > > bernard.iremonger@intel.com; konstantin.ananyev@intel.com > > Subject: [dpdk-dev] [PATCH v1] examples/ipsec-secgw: load/unload > > esp-ah DDP file > > > > Modified Secuirty gateway application to support load/unload esp-ah > > ddp package on i40e NIC from ipsec-secgw application. > > > > Signed-off-by: Praveen Shetty > > --- > > examples/ipsec-secgw/ipsec-secgw.c | 67 +++++++++++- > > examples/ipsec-secgw/ipsec.c | 158 > > +++++++++++++++++++++++++++++ > > examples/ipsec-secgw/ipsec.h | 6 +- > > 3 files changed, 228 insertions(+), 3 deletions(-) > > > > diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec- > > secgw/ipsec-secgw.c index 4799bc90c..214b8a625 100644 > > --- a/examples/ipsec-secgw/ipsec-secgw.c > > +++ b/examples/ipsec-secgw/ipsec-secgw.c > > @@ -198,7 +198,10 @@ struct app_sa_prm app_sa_prm =3D { > > .cache_sz =3D SA_CACHE_SZ > > }; > > static const char *cfgfile; > > - > > +static const char *ddp_file; > > +static const char *ddp_bkp_file; > > +static uint16_t fdir_portid; > > +static int16_t ddp_unload_flag; > > struct lcore_rx_queue { > > uint16_t port_id; > > uint8_t queue_id; > > @@ -1286,6 +1289,8 @@ print_usage(const char *prgname) > > " [-e]" > > " [-a]" > > " [-c]" > > + " [-L (portid,ddp_file_path,ddp_backup_file_path)]" > > + " [-U (portid,ddp_backup_file_path)]" >=20 > [Anoob] This is applicable only to i40e NIC, right? Probably mention that= . > [Praveen Shetty] Yes. We will do this in V2. >=20 > > " -f CONFIG_FILE" > > " --config (port,queue,lcore)[,(port,queue,lcore)]" > > " [--single-sa SAIDX]" > > @@ -1307,6 +1312,8 @@ print_usage(const char *prgname) > > " -a enables SA SQN atomic behaviour\n" > > " -c specifies inbound SAD cache size,\n" > > " zero value disables the cache (default value: 128)\n" > > + " -L To load ddp profile on NIC\n" > > + " -U To unload ddp profile from NIC\n" > > " -f CONFIG_FILE: Configuration file\n" > > " --config (port,queue,lcore): Rx queue configuration\n" > > " --single-sa SAIDX: Use single SA index for outbound traffic,\n" > > @@ -1379,6 +1386,33 @@ parse_decimal(const char *str) > > return num; > > } > > > > +static int32_t > > +parse_ddp_load_args(char *str) > > +{ > > + int16_t num_args =3D 0; > > + char *file_fld[3]; > > + num_args =3D rte_strsplit(str, strlen(str), file_fld, 3, ','); > > + if (num_args !=3D 3) > > + return -1; > > + fdir_portid =3D atoi(file_fld[0]); > > + ddp_file =3D file_fld[1]; > > + ddp_bkp_file =3D file_fld[2]; > > + return 0; > > +} > > + > > +static int32_t > > +parse_ddp_unload_args(char *str) > > +{ > > + int16_t num_args =3D 0; > > + char *file_fld[2]; > > + num_args =3D rte_strsplit(str, strlen(str), file_fld, 2, ','); > > + if (num_args !=3D 2) > > + return -1; > > + fdir_portid =3D atoi(file_fld[0]); > > + ddp_bkp_file =3D file_fld[1]; > > + return 0; > > +} > > + > > static int32_t > > parse_config(const char *q_arg) > > { > > @@ -1459,7 +1493,7 @@ parse_args(int32_t argc, char **argv) > > > > argvopt =3D argv; > > > > - while ((opt =3D getopt_long(argc, argvopt, "aelp:Pu:f:j:w:c:", > > + while ((opt =3D getopt_long(argc, argvopt, "aelp:Pu:L:U:f:j:w:c:", > > lgopts, &option_index)) !=3D EOF) { > > > > switch (opt) { > > @@ -1483,6 +1517,25 @@ parse_args(int32_t argc, char **argv) > > return -1; > > } > > break; > > + case 'L': > > + printf("Loading ddp package selected\n"); > > + ret =3D parse_ddp_load_args(optarg); > > + if (ret < 0) { > > + printf("Invalid ddp load args: %s\n", optarg); > > + print_usage(prgname); > > + return -1; > > + } > > + break; > > + case 'U': > > + printf("Unloading ddp package selected\n"); > > + ret =3D parse_ddp_unload_args(optarg); > > + if (ret < 0) { > > + printf("Invalid ddp unload args: %s\n", > > optarg); > > + print_usage(prgname); > > + return -1; > > + } > > + ddp_unload_flag =3D 1; > > + break; > > case 'f': > > if (f_present =3D=3D 1) { > > printf("\"-f\" option present more than " > > @@ -2505,6 +2558,16 @@ main(int32_t argc, char **argv) > > sa_check_offloads(portid, &req_rx_offloads, > &req_tx_offloads); > > port_init(portid, req_rx_offloads, req_tx_offloads); > > } >=20 > [Anoob] Following checks are not valid for non i40e PMDs, right? Is there= a > capability we can check before doing the below? > [Praveen Shetty] Yes, that's true. We can skip this for non i40e PMD by= adding > #ifdef RTE_LIBRTE_I40E_PMD before the following checks. We will do this = in > V2. >=20 > > + if (ddp_file !=3D NULL && ddp_bkp_file !=3D NULL) { > > + ret =3D load_ddp_esp_package(fdir_portid, ddp_file, > > ddp_bkp_file); > > + if (ret < 0) > > + printf("loading ddp package failed\n"); > > + } > > + if (ddp_unload_flag && ddp_bkp_file !=3D NULL) { > > + ret =3D unload_ddp_esp_package(fdir_portid, ddp_bkp_file); > > + if (ret < 0) > > + printf("unloading ddp package failed\n"); > > + } > > > > cryptodevs_init(); > > > > diff --git a/examples/ipsec-secgw/ipsec.c > > b/examples/ipsec-secgw/ipsec.c index 6e8120702..3840a0848 100644 > > --- a/examples/ipsec-secgw/ipsec.c > > +++ b/examples/ipsec-secgw/ipsec.c > > @@ -4,6 +4,9 @@ > > #include > > #include > > #include > > +#include > > +#include > > +#include > > > > #include > > #include > > @@ -14,6 +17,9 @@ > > #include > > #include > > #include > > +#ifdef RTE_LIBRTE_I40E_PMD > > +#include > > +#endif > > > > #include "ipsec.h" > > #include "esp.h" > > @@ -155,6 +161,158 @@ create_lookaside_session(struct ipsec_ctx > > *ipsec_ctx, struct ipsec_sa *sa, > > return 0; > > } > > > > +static int > > +close_file(uint8_t *buf) > > +{ > > + if (buf) { > > + free((void *)buf); > > + return 0; > > + } > > + > > + return -1; > > +} > > + > > +static uint8_t * > > +open_file(const char *file_path, uint32_t *size) { > > + int fd =3D open(file_path, O_RDONLY); > > + off_t pkg_size; > > + uint8_t *buf =3D NULL; > > + int ret =3D 0; > > + struct stat st_buf; > > + > > + if (size) > > + *size =3D 0; > > + > > + if (fd =3D=3D -1) { > > + printf("%s: Failed to open %s\n", __func__, file_path); > > + return buf; > > + } > > + > > + if ((fstat(fd, &st_buf) !=3D 0) || (!S_ISREG(st_buf.st_mode))) { > > + close(fd); > > + printf("%s: File operations failed\n", __func__); > > + return buf; > > + } > > + > > + pkg_size =3D st_buf.st_size; > > + if (pkg_size < 0) { > > + close(fd); > > + printf("%s: File operations failed\n", __func__); > > + return buf; > > + } > > + > > + buf =3D (uint8_t *)malloc(pkg_size); >=20 > [Anoob] The cast is not required. > [Praveen Shetty] We will fix this in V2. >=20 > > + if (!buf) { > > + close(fd); > > + printf("%s: Failed to malloc memory\n", __func__); > > + return buf; > > + } > > + > > + ret =3D read(fd, buf, pkg_size); > > + if (ret < 0) { > > + close(fd); > > + printf("%s: File read operation failed\n", __func__); > > + close_file(buf); >=20 > [Anoob] close_file() just frees the buffer and returns 0 is the buffer is= not NULL, > and returns -1 if NULL. Do we need a separate function just for that? Als= o, the > return value of close_file is ignored in all cases. >=20 > [Praveen Shetty] Yes, We will address this in V2. >=20 > > + return NULL; > > + } > > + > > + if (size) > > + *size =3D pkg_size; > > + > > + close(fd); > > + > > + return buf; > > +} > > + > > +static int > > +save_file(const char *file_path, uint8_t *buf, uint32_t size) { > > + FILE *fh =3D fopen(file_path, "wb"); > > + > > + if (fh =3D=3D NULL) { > > + printf("%s: Failed to open %s\n", __func__, file_path); > > + return -1; > > + } > > + > > + if (fwrite(buf, 1, size, fh) !=3D size) { > > + fclose(fh); > > + printf("%s: File write operation failed\n", __func__); > > + return -1; > > + } > > + > > + fclose(fh); > > + > > + return 0; > > +} > > + > > +/* Load dynamic device personalization profile */ int > > +load_ddp_esp_package(uint16_t fdir_portid, const char *ddp_file, > > + const char *ddp_bkp_file) > > +{ > > + uint8_t *buff; > > + uint32_t size; > > + int ret =3D -ENOTSUP; > > + > > + buff =3D open_file(ddp_file, &size); > > + if (!buff) > > + return -1; > > + > > +#ifdef RTE_LIBRTE_I40E_PMD > > + ret =3D rte_pmd_i40e_process_ddp_package(fdir_portid, > > + buff, size, > > + > > RTE_PMD_I40E_PKG_OP_WR_ADD); #endif > > + >=20 > [Anoob] Rather than calling PMD specific functions from all applications,= it > might be better to introduce the same via 'devargs' to the PMD. >=20 > [Praveen Shetty] We will investigate further on this. >=20 > > + if (ret =3D=3D -EEXIST) > > + printf("Profile has already existed.\n"); > > + else if (ret < 0) { >=20 > [Anoob] When i40e is not enabled (using RTE_LIBRTE_I40E_PMD), the error > message would be "Failed to load profile", though the right reason is fea= ture > being not supported. >=20 > [Praveen Shetty] In V2 the following code will be executed only when i40= e is > enabled. In that case error message can be intact. >=20 > > + printf("Failed to load profile.\n"); > > + close_file(buff); > > + return -1; > > + } else > > + printf("loading ddp profile success\n"); > > + if (ddp_bkp_file !=3D NULL) > > + save_file(ddp_bkp_file, buff, size); > > + > > + close_file(buff); > > + return 0; > > +} > > + > > +/* Unload dynamic device personalization profile */ int > > +unload_ddp_esp_package(uint16_t fdir_portid, const char > > +*ddp_bkp_file) { > > + > > + uint8_t *buff; > > + uint32_t size; > > + int ret =3D -ENOTSUP; > > + > > + buff =3D open_file(ddp_bkp_file, &size); > > + if (!buff) > > + return -1; > > + > > +#ifdef RTE_LIBRTE_I40E_PMD > > + ret =3D rte_pmd_i40e_process_ddp_package(fdir_portid, > > + buff, size, > > + > > RTE_PMD_I40E_PKG_OP_WR_DEL); #endif > > + > > + if (ret =3D=3D -EACCES) { > > + printf("Profile does not exist.\n"); > > + close_file(buff); > > + return -1; > > + } else if (ret < 0) { > > + printf("Failed to delete profile.\n"); > > + close_file(buff); > > + return -1; > > + } else > > + printf("ddp profile deleted successfully\n"); > > + close_file(buff); > > + return 0; > > +} > > + >=20 > [Anoob] All the above functions are just about loading the ddp package. M= ay be > we can move all that into a new file. >=20 > [Praveen Shetty ] Yes we can do this. We will address this in V2. >=20 > > int > > create_inline_session(struct socket_ctx *skt_ctx, struct ipsec_sa *sa, > > struct rte_ipsec_session *ips) > > diff --git a/examples/ipsec-secgw/ipsec.h > > b/examples/ipsec-secgw/ipsec.h index 4f2fd6184..73eec47ab 100644 > > --- a/examples/ipsec-secgw/ipsec.h > > +++ b/examples/ipsec-secgw/ipsec.h > > @@ -383,5 +383,9 @@ create_lookaside_session(struct ipsec_ctx > > *ipsec_ctx, struct ipsec_sa *sa, int create_inline_session(struct > > socket_ctx *skt_ctx, struct ipsec_sa *sa, > > struct rte_ipsec_session *ips); > > - > > +int > > +load_ddp_esp_package(uint16_t fdir_portid, const char *ddp_file, > > + const char *ddp_bkp_file); > > +int > > +unload_ddp_esp_package(uint16_t fdir_portid, const char > > +*ddp_bkp_file); > > #endif /* __IPSEC_H__ */ > > -- > > 2.17.1