From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DC6D9A0C43; Wed, 28 Jul 2021 14:58:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6262240E64; Wed, 28 Jul 2021 14:58:48 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 3071540142 for ; Wed, 28 Jul 2021 14:58:47 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16SCvvJB007391; Wed, 28 Jul 2021 05:58:46 -0700 Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2109.outbound.protection.outlook.com [104.47.70.109]) by mx0b-0016f401.pphosted.com with ESMTP id 3a35pr0da1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 28 Jul 2021 05:58:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YRL/bleOoyCb35G0Wv3z2eM2UeRvOg8NAjUK9P7X7RbIJbvDcz+P5zySQ3qZ4MCliMip2okdwj/zaOh3Wyge7WkCYOFw7pVswoQE2abu10a6N6h+AH49a2xq5ukJMB4TYICxhJJechSYPF0sryU47Lv8fe3BkLWU53TLdC/nc+IiUyzFnvowkFXJTsbDGpBGeGqVZWtOwmVP9pB4TX+ZOv2TJtVHhiZ8eH8pnTB0DjD0t7pm9arqepstddtyXTVNdjcWld9xVzCAx6LZUI8YNRA1E5aoTYpc/TzvIBZE6ItkO9Cdhja5JyLpTqDpjzeoj5McT/3bgCvhfaP2REO9lA== 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=LrIlbhb1hT3MfNeA9dkdKnf7/KyHiCEgfGkCiYsUjQE=; b=Zgai7Ju0yiAZ37WQvebpck3LOSyd8uzATCSeGGFpZU02vC+vPfKt7v4QICaotkujnLLWnX/cOi+xmPV+V4MoEsZTIMMkK5brPZsRrP2lP+3nZSqjz14NIL91vN2W+dq4A7io6vk9dB5TAb0DrqdmQa6vnEfnyawLxgoXpPgLHV5qS5pVrpBIL6EgIeF5eMXGTSdDrkovH4wklCznZUzPCZn/p4LHWr908EsISULmCFSshLfQYIUYJAUcEFkSxYdfW1eYO//XNED9tU9NYmPVh49yeL7vRZSLd3+8837motBCVPOMnV211li4xb179H8jPJIgY+ox35ByDSU5I+5tgQ== 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=LrIlbhb1hT3MfNeA9dkdKnf7/KyHiCEgfGkCiYsUjQE=; b=DWeE0z9f21HQo6ympStdpXk0pQH8CtFKaQv8xIQJZckSwBxs6Y0Yf5tQZFsK5iYHGZZlROz/H3b7hDaorqigWMc8dNZE1+/PdoQa8rsTLGWXsEZQDgVDFBYdUCCm84BkaCl3IW3ROMk2lKdSdULYAnvrUJGfysZ20EXIpcxAzE4= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by CO6PR18MB4482.namprd18.prod.outlook.com (2603:10b6:5:355::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.18; Wed, 28 Jul 2021 12:58:44 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::1455:9a67:a6e7:e557]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::1455:9a67:a6e7:e557%7]) with mapi id 15.20.4373.018; Wed, 28 Jul 2021 12:58:43 +0000 From: Akhil Goyal To: "Ananyev, Konstantin" , Anoob Joseph , "Doherty, Declan" , "Zhang, Roy Fan" , "hemant.agrawal@nxp.com" CC: Jerin Jacob Kollanukkaran , Ankur Dwivedi , Tejasree Kondoj , "dev@dpdk.org" , Archana Muniganti Thread-Topic: [PATCH 2/2] lib/security: add SA lifetime configuration Thread-Index: AQHXfSwXa0JAhHVxJEmykXnTo0RT0atLZDUAgAnryQCAABJkUIABW52AgAB0IQCAARLkAIAAHpNA Date: Wed, 28 Jul 2021 12:58:43 +0000 Message-ID: References: <1626759974-334-1-git-send-email-anoobj@marvell.com> <1626759974-334-3-git-send-email-anoobj@marvell.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=marvell.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c4fd792a-c69b-4453-3ec0-08d951c76e26 x-ms-traffictypediagnostic: CO6PR18MB4482: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: B2+ISdH7fqcHvbR9VuZdUDbG30pewQL9oV0xHHSESm4IzExcNTY9t9yvwH8vzr47WPU/aLcsfbgcIBWF5/MYkUSmb59pdH/vvoCLN6PMVXJTSdQwBb3yN3NwwsOb0AS3gNTHOzAZtFysHQi8NDR6KP6+cTsctEy398StxbENicbL2B6BqgCwhfNSNoABiPaeVN1BSEUkLQCiv6ieVHWND6tKHBJv3Opu9ZAgrWBqKU8LIqkp/ZhdY91CFX+maj2e20dcHpMev60cm7Mv0rIyzCDjowli1aXdbdt+JAIPW28VasCMvLekIgR0zf1mNkxzPSzz3MlsC+1xfNwvAIvo/TFsZDRAMH+mWvA4JMqi5DJh5nCdMXR4H9wKC2vxSVy3c12tyusXhoLe190UfslGffvHgM9ZagrSAaZQosRlKMyuGcb1+QZ7OLin/WIQQGsLfhW6VpNOWHFgA4KBpdzmSXL349EtcnQLyCdKjwLtbI2EfUkWulHpxGzYzGkfEtbTGCYISd6m3A/gPJWcNHakOpWkyiIN0TuaeZc+Z7es8OhWsxdbwsBdwchxJ9SPGVr6b8pAn6VngNQMZAKfA8XAP/YCNIa14jphryZp6QWMeWsaCnTyfRquOqLkD9iBc1Bd8Z34lHdDvbQmR1yMjn3Icvk5z78r+1MKKhoN+ImY+ekMPOyzjaee30kDXX3yDN6j1NQAo1Pz7X3Dl1UPwWtur3UW7JJP4jlinHey4QjTI2grsSvT7OQ4uyJoAB1qKvYkVt7mzTECkC8xxS5+pQZfmQiz5m/GnMiD7Cr8zI3TGWI= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB4484.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(136003)(39860400002)(366004)(376002)(346002)(107886003)(38100700002)(7696005)(15650500001)(55236004)(52536014)(55016002)(122000001)(26005)(5660300002)(4326008)(86362001)(38070700005)(33656002)(6506007)(71200400001)(66556008)(64756008)(54906003)(186003)(110136005)(83380400001)(966005)(8936002)(66476007)(478600001)(66446008)(2906002)(76116006)(9686003)(316002)(8676002)(66946007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?cpvNqz5irgLMN0oriedtee5fDejPzfD90jgQvWk4ovwYXQFNlTXVCu47N7de?= =?us-ascii?Q?AE6kjj9xNqgtUdywnF4jzWc8Laqhx/QlLsDEXV+0R4KteSIJGJTB1lGC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NDdC1fhtEXl4sKMEGfbUb8cwfnMNiTzxh?= =?us-ascii?Q?0WEVcyEPIp0o+CHiLLdo/5EsZBiQ2DrCs95Pymb4P+Rs04Y2vAomdPNHkndb?= =?us-ascii?Q?0buc2pHDe3eBXP3o7ehum8dgDXoxgbNlfXcWEEgnv0s+fX4wNngqgNneeclw?= =?us-ascii?Q?A+XzS4b53MJ4F8emo2BNchoV2JklPenX1LvOBLC1pJ5BZObb0PdJFYLfbh2V?= =?us-ascii?Q?bC5m/iY5QcpuRzsf+ojCPAoDXjZnt7rXFRwRmquF81oL2UtARVR9CXbcBFrQ?= =?us-ascii?Q?uryHP8u+PbnIrb2tqs7J5YcCPi8NTI5eF/2VUfJBf9svXX6H4S6kSSs6V9vO?= =?us-ascii?Q?Lt9DKfn+Vc+amFfmZo00ojgQ?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR18MB4484.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c4fd792a-c69b-4453-3ec0-08d951c76e26 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jul 2021 12:58:43.4881 (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: ZMyhSOS7YjSggxPKRTJw5zq5FnFmVP4S1s7Rf1UbwoZwWtoWOXNNsRblbnqqrX40IMWO5rPJjeAbiAHbCcP2uA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR18MB4482 X-Proofpoint-ORIG-GUID: 6uUjru05_nVokKtc_U787uA4K2CvMJQm X-Proofpoint-GUID: 6uUjru05_nVokKtc_U787uA4K2CvMJQm X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-28_08:2021-07-27, 2021-07-28 signatures=0 Subject: Re: [dpdk-dev] [PATCH 2/2] lib/security: add SA lifetime configuration X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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 Konstantin, > Hi Akhil, >=20 > > > > > My vote would probably be for option #2 (use one of the reserved > fields > > > for > > > > > it). > > > > > That way - existing code wouldn't need to be changed. > > > > > > > > Adding a single enum or multiple enums is the same thing. Right wrt > code > > > changes? > > > > However, if the check is something like > > > > If (status !=3D RTE_CRYPTO_OP_STATUS_SUCCESS) > > > > Report appropriate error number > > > > App code will need to be updated to take care the warnings in both > > > options. > > > > It will be something like > > > > Option #1 > > > > If (status !=3D RTE_CRYPTO_OP_STATUS_SUCCESS) { > > > > If (status < RTE_CRYPTO_OP_STATUS_SUCCESS) > > > > Report appropriate error number. > > > > Else > > > > Report appropriate warning number probably in debug > > > prints. > > > > } > > > > Option #2 > > > > If (op->status !=3D RTE_CRYPTO_OP_STATUS_SUCCESS) { > > > > If (op->status =3D=3D RTE_CRYPTO_OP_STATUS_WARNING) { > > > > Report appropriate warning based on op->reserved[0] > > > > } else { > > > > Report appropriate error number > > > > } > > > > } > > > > Here both the options are same wrt performance. > > > > But in option #2, driver and app need to fill and decode 2 separate > > > variables > > > > As against 1 variable in option #1 > > > > > > > > In both the options, there will be similar code changes. > > > > Do you suspect any other code change? > > > > > > Hmm, I think there is some sort of contradiction here. > > > From Anoob original mail: > > > "Both the above will be an IPsec operation completed successfully but > with > > > additional information > > > that PMD can pass on to application for indicating status of offloads= ." > > > So my understanding after reading Anoob mail was : > > > a) warnings will be set when crypto-op completed successfully, i.e: > > > op->status =3D=3D RTE_CRYPTO_OP_STATUS_SUCCESS > > > b) It is not mandatory for the application to process the warnings. > > > Yes it is a recommended but still an optional. > > > > If we set op->status =3D RTE_CRYPTO_OP_STATUS_SUCCESS > > And then check for warnings with a separate variable there will be an > > extra check for every packet even for a success case with no warning. >=20 > Not really. warning will be within the same 32/64 bits as status. > Compilers these days are smart enough to generate code that would > read an check them as one value: > https://godbolt.org/z/M3f9891zq >=20 > > This may not be acceptable. >=20 > I don't think there would be any performance regression, see above. > If you are still nervous about possibility of this extra load, I think we= can go > even one step > further and reorder crypto_op fields a bit to have 'status' and 'warning' > fields consequent, and put them into one struct to make such optimization= s > explicit. > I.E: > union { > uint16_t status_warning; > struct {uint8_t status; uint8_t warning;} > }; Yes this looks a good option and as you checked, the compiled code look Same for both the cases, we can explore this option. With this union, it will be a single variable also. The major concern I had was performance hit. But if that is not an issue, We can work on this one. Thanks.