From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50056.outbound.protection.outlook.com [40.107.5.56]) by dpdk.org (Postfix) with ESMTP id 9A916F72 for ; Tue, 24 Jul 2018 14:49:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7/hZrDDFQ7MXpy1n1xTeQDk6ZAVpzJqx9deBrOL0Nyw=; b=DK/UWbawrD3k3KokYGCyq4vN/2yfDZsMnbJxbxxNuvQ368rZoZj1Vz+05CpdQyeGJKpzZrbh8uUqqZbVV/cRcDRdW09wEg2cHKaBUOoTgS/ZIRHkXANPC7o2s8BHIMxqzVhRTvmoAO4rtbaX85UH6uWr33W7LJkozYI/TULym6k= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; Received: from [10.232.134.144] (14.142.187.166) by VI1PR04MB1390.eurprd04.prod.outlook.com (2a01:111:e400:5348::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Tue, 24 Jul 2018 12:49:48 +0000 To: "Ananyev, Konstantin" , "dev@dpdk.org" Cc: "Nicolau, Radu" References: <1528208163-31560-1-git-send-email-konstantin.ananyev@intel.com> <1528208163-31560-2-git-send-email-konstantin.ananyev@intel.com> <36d2a552-e043-7451-ed66-70d13f0f6fe6@nxp.com> <2601191342CEEE43887BDE71AB977258C0C4009C@irsmsx105.ger.corp.intel.com> <2ff9fe7a-3965-ca79-e5e3-9890cc6ce49d@nxp.com> <2601191342CEEE43887BDE71AB977258C0C40347@irsmsx105.ger.corp.intel.com> <2601191342CEEE43887BDE71AB977258C0C406CF@irsmsx105.ger.corp.intel.com> <2601191342CEEE43887BDE71AB977258DF51CD64@irsmsx105.ger.corp.intel.com> From: Akhil Goyal Message-ID: Date: Tue, 24 Jul 2018 18:19:35 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <2601191342CEEE43887BDE71AB977258DF51CD64@irsmsx105.ger.corp.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BM1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::11) To VI1PR04MB1390.eurprd04.prod.outlook.com (2a01:111:e400:5348::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ffc9da98-922a-43c9-5a40-08d5f163f0fa X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(5600073)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB1390; X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB1390; 3:psBEP5VCe2c+5H4k+NW/yNuFbTP3pZkk9e2MScotuVpbiYzieJ3GMs9LLS69Dmteltuov+ra3J9HStkurxjPPAqefqedkCm61CdisXvjsj/en78IMOIeIyTxIWdHrP/QXfwuMNxRnAoeYPAFvLQ3YWujhHRNU8fboxUbQIMMACh/3z50SX1xXA7loJTovuRjOma+tur08prtT/mPyu6YUGQKLmM7Lg28UZZfxfNzTuzT6j5zd0wJhBRDHjS3B4Fd; 25:Bn5VjwdUbTRGGUg3P63QWzXTckNHePUT7nGwxhsqYIEtqKoQZsEYQD2x4Ra6IiGDoGoA+KsyDphqMIla4kwsFFeMQveBV9HRv9ddZkXosV7aV5521qvfXleFtZIiM5FgrYCzKb5WHbsYhDfJ1Y2lBMEjXjHisnuTJSJaMNPFTQo7RqfS65UEGB1creIsLA60K+Rx6HRkRnC32fEHqPVR0YyV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dU/GIuerTRPe5V/AAp0wW/Q9nJ058goH5CbedD8YBikSPjEYKyozPiQFE1bnEvxAgLNiUDuzdwZgBR4P1oPA5ldj2nT1Gstj0yb3dbY7w5YBJyv+zOKglVYwvRMVSS4cD/OLhq4rimCREdNAfy2bwWkGXlO0JL7126xrAVuXLlmbxgpU0ganQgEtSPFg9+5GCp+4aNZsavIF4R6dLTXZit/27FOHFZhmPIB+BNi9NijHTMWOZCJg8+uzZfub270e11xyCxuh61w= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231311)(944501410)(52105095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:VI1PR04MB1390; BCL:0; PCL:0; RULEID:; SRVR:VI1PR04MB1390; X-Forefront-PRVS: 0743E8D0A6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(376002)(346002)(39860400002)(396003)(366004)(136003)(13464003)(199004)(189003)(478600001)(23676004)(97736004)(53936002)(6486002)(229853002)(25786009)(3260700006)(4326008)(6246003)(31696002)(86362001)(66066001)(47776003)(65956001)(16576012)(3846002)(230700001)(6116002)(67846002)(8936002)(6666003)(65826007)(5009440100003)(65806001)(5660300001)(110136005)(58126008)(316002)(36756003)(7736002)(50466002)(105586002)(106356001)(186003)(31686004)(2906002)(476003)(2616005)(956004)(64126003)(44832011)(55236004)(386003)(68736007)(53546011)(486006)(14444005)(93886005)(2501003)(2486003)(11346002)(305945005)(16526019)(446003)(77096007)(26005)(52146003)(8676002)(52116002)(81166006)(76176011)(81156014)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB1390; H:[10.232.134.144]; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtWSTFQUjA0TUIxMzkwOzIzOmY3QzlyZTlWUU5UOXU4b2g0RHpVSWNDVHFN?= =?utf-8?B?STZia1RIcmg0UVVVbEhOaHhzK2IxcGJyU2FFWDNick9ZYi9MNXZOa0FqMS84?= =?utf-8?B?ZDFsSjAyVGtBcmZTemVRVEg4Sm11cGpXQVpwVmFxNHFQeGpmMHRUSi9udXJm?= =?utf-8?B?SDdNSS9reUZXUzVRYzllUWd2ODFkQ0czcTk1Q2FHcXpqYWErZDNHeWRSOEts?= =?utf-8?B?QTZyZUJ1QjlNeEVnYUpucW5MNVdYTjBiK1lHMVY1YlREMlRZMzZHNncwY0Z0?= =?utf-8?B?b0VteGxHVFVRbXNPTGx3dkxvUkFKdVVZN3YvOUxTbmhqSVdDU2tsTzlhNG5z?= =?utf-8?B?Y2xwdFdyQVh0THRZTi9EbVZMVnBKdXFUblZOR2UvN2paTUphc09JVDVQRkRI?= =?utf-8?B?MW1jaGJPczhjVTZrWXU1bE13Z2oyWUYvM2hxNDNkSk4yVnpyVDZ3VVlSUDk2?= =?utf-8?B?c0Zkb0JvUE1TOWliN0ZBUDRvNE91bWRMZGtxTlkzVlMxMXppL1FuMGRLQ2tE?= =?utf-8?B?bGo2U0pxcE5iZEJ4a3ZncHVQZkN2TWMxRnk4Yk5CVm5vdkxuL0d0YjlpYlR3?= =?utf-8?B?VHViQUswV1pHbFFFY1MwTnh4eURZSWRnbHVGZjJLd3cyc2tpYmt6ajJTMExV?= =?utf-8?B?SE0vTTg5di9iN1czVUZWdGdrb2xRTXpVZCsreDB2cnNVaDZUR0tWN1dacm5E?= =?utf-8?B?TzdKMTFTTk40WHFucEtBTXNxcG5RVGV6dFltcGtiNXYrOTBoZ2hyUlBFR1Bk?= =?utf-8?B?S2Z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1VkOiTSDE2kUg5J2cVT2TuLmOWlJI2oUNU7DU6WIGJ3Dak2DhM+OVD0rb/1X3AESrZ8B61TX3/al4vm3EViaYChODuMXsGGXMZi0Hmwu04Ed+osh8+vLDlFA1yVvPN9TJ8dcXvqsKmG2xWY19NpunA5xSQToxoJQcr7Favl4G6FfVyKtGolOvJH3Vevrgqkt6XOWoZ8OxUdZE2VRDV82DIcJtF8X9/TZZMX0GO9Ic6H+FFInoXjxkCVAke2oJS/5rogai7Xjdr5tZXB2kcKz7PvlxtUEigqzCk5nnNUrmjY1y1C/0MgjZWuucxNdVsfRQNzIiI759mN1daNX268FxW28Hzkjki30dRdTsUVIzuyyMYMuCeGS1+YEQO9u9hDbrtdRhJCglQoMD6XeBcXYQq5wCdMethRYxyWZW2lICwk3XGf8Qay1m1Y55kkSYRi1a2Xui9ngUw==; 5:a7k9KGg8hUrmOQsCaIgzV58XRmNdIgFg5yXOeekqLj+/LDVHkvVR/QnX60KcakNGTKw4ZNTCq3/VoUms/i+d/zAn6NnLMLL4GCZJfyDJ6JeJFgtJM4cwkT2sgWGjreIAKGNl5kWkMxpWFbs99G4ITMcS5TgPhN40ZHFCD4gYZMY=; 7:k6KP851ChHSgT4EBUM1tWF96sHNXOkR4b/dtWeltuvldUXUTUFhOvcQJOE/fuVGcscd+L4J/UYzrw+dvfNrCnM/p/KM/iGLwyy1hp81yhIXjo6Gd72qLUy3su5XySIU2+Yt2xyODkFIqcrXidJvkDfLhsiuOSQ+RsPLfwTuxq5PnP/7Ry+nNciofeVEZG8fB6jjkD7hzhh69JZyipLhG7TlFuR1dLRFKj+PuqcsF1o2dB/AmUe6gb2xMu9Yzxknz SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2018 12:49:48.2132 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ffc9da98-922a-43c9-5a40-08d5f163f0fa X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB1390 Subject: Re: [dpdk-dev] [PATCH 2/2] examples/ipsec-secgw: fix portmask option parsing 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: Tue, 24 Jul 2018 12:49:51 -0000 Hi Konstantin, On 7/24/2018 6:07 PM, Ananyev, Konstantin wrote: > Hi Akhil, > >> Hi Konstantin, >> >> On 6/22/2018 5:21 PM, Ananyev, Konstantin wrote: >> >>>> -----Original Message----- >>>> From: Akhil Goyal [mailto:akhil.goyal@nxp.com] >>>> Sent: Friday, June 22, 2018 11:41 AM >>>> To: Ananyev, Konstantin ; dev@dpdk.org >>>> Cc: Nicolau, Radu >>>> Subject: Re: [dpdk-dev] [PATCH 2/2] examples/ipsec-secgw: fix portmask option parsing >>>> >>>> >>>> >>>> On 6/22/2018 3:40 PM, Ananyev, Konstantin wrote: >>>>>> -----Original Message----- >>>>>> From: Akhil Goyal [mailto:akhil.goyal@nxp.com] >>>>>> Sent: Friday, June 22, 2018 11:01 AM >>>>>> To: Ananyev, Konstantin ; dev@dpdk.org >>>>>> Cc: Nicolau, Radu >>>>>> Subject: Re: [dpdk-dev] [PATCH 2/2] examples/ipsec-secgw: fix portmask option parsing >>>>>> >>>>>> Hi Konstantin, >>>>>> >>>>>> On 6/21/2018 8:32 PM, Ananyev, Konstantin wrote: >>>>>> >>>>>>> Hi Akhil, >>>>>>> >>>>>>>> -----Original Message----- >>>>>>>> From: Akhil Goyal [mailto:akhil.goyal@nxp.com] >>>>>>>> Sent: Thursday, June 21, 2018 2:49 PM >>>>>>>> To: Ananyev, Konstantin ; dev@dpdk.org >>>>>>>> Cc: Nicolau, Radu >>>>>>>> Subject: Re: [dpdk-dev] [PATCH 2/2] examples/ipsec-secgw: fix portmask option parsing >>>>>>>> >>>>>>>> Hi Konstantin, >>>>>>>> >>>>>>>> On 6/5/2018 7:46 PM, Konstantin Ananyev wrote: >>>>>>>>> parse_portmask() returns both portmask value and possible error code >>>>>>>>> as 32-bit integer. That causes some confusion for callers. >>>>>>>>> Split error code and portmask value into two distinct variables. >>>>>>>>> Also allows to run the app with unprotected_port_mask == 0. >>>>>>>> This would also allow cryptodev_mask == 0 to work well which should not be the case. >>>>>>>> >>>>>>>>> Fixes: d299106e8e31 ("examples/ipsec-secgw: add IPsec sample application") >>>>>>>>> >>>>>>>>> Signed-off-by: Konstantin Ananyev >>>>>>>>> --- >>>>>>>>> examples/ipsec-secgw/ipsec-secgw.c | 29 +++++++++++++++-------------- >>>>>>>>> 1 file changed, 15 insertions(+), 14 deletions(-) >>>>>>>>> >>>>>>>>> diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c >>>>>>>>> index fafb41161..5d7071657 100644 >>>>>>>>> --- a/examples/ipsec-secgw/ipsec-secgw.c >>>>>>>>> +++ b/examples/ipsec-secgw/ipsec-secgw.c >>>>>>>>> @@ -972,20 +972,19 @@ print_usage(const char *prgname) >>>>>>>>> } >>>>>>>>> >>>>>>>>> static int32_t >>>>>>>>> -parse_portmask(const char *portmask) >>>>>>>>> +parse_portmask(const char *portmask, uint32_t *pmv) >>>>>>>>> { >>>>>>>>> - char *end = NULL; >>>>>>>>> + char *end; >>>>>>>>> unsigned long pm; >>>>>>>>> >>>>>>>>> /* parse hexadecimal string */ >>>>>>>>> + errno = 0; >>>>>>>>> pm = strtoul(portmask, &end, 16); >>>>>>>>> - if ((portmask[0] == '\0') || (end == NULL) || (*end != '\0')) >>>>>>>>> + if (errno != 0 || *end != '\0' || pm > UINT32_MAX) >>>>>>>>> return -1; >>>>>>>>> >>>>>>>>> - if ((pm == 0) && errno) >>>>>>>>> - return -1; >>>>>>>>> - >>>>>>>>> - return pm; >>>>>>>>> + *pmv = pm; >>>>>>>>> + return 0; >>>>>>>>> } >>>>>>>>> >>>>>>>>> static int32_t >>>>>>>>> @@ -1063,6 +1062,7 @@ parse_args(int32_t argc, char **argv) >>>>>>>>> int32_t opt, ret; >>>>>>>>> char **argvopt; >>>>>>>>> int32_t option_index; >>>>>>>>> + uint32_t v; >>>>>>>>> char *prgname = argv[0]; >>>>>>>>> int32_t f_present = 0; >>>>>>>>> >>>>>>>>> @@ -1073,8 +1073,8 @@ parse_args(int32_t argc, char **argv) >>>>>>>>> >>>>>>>>> switch (opt) { >>>>>>>>> case 'p': >>>>>>>>> - enabled_port_mask = parse_portmask(optarg); >>>>>>>>> - if (enabled_port_mask == 0) { >>>>>>>>> + ret = parse_portmask(optarg, &enabled_port_mask); >>>>>>>>> + if (ret < 0 || enabled_port_mask == 0) { >>>>>>>>> printf("invalid portmask\n"); >>>>>>>>> print_usage(prgname); >>>>>>>>> return -1; >>>>>>>>> @@ -1085,8 +1085,8 @@ parse_args(int32_t argc, char **argv) >>>>>>>>> promiscuous_on = 1; >>>>>>>>> break; >>>>>>>>> case 'u': >>>>>>>>> - unprotected_port_mask = parse_portmask(optarg); >>>>>>>>> - if (unprotected_port_mask == 0) { >>>>>>>>> + ret = parse_portmask(optarg, &unprotected_port_mask); >>>>>>>>> + if (ret < 0) { >>>>>>>>> printf("invalid unprotected portmask\n"); >>>>>>>>> print_usage(prgname); >>>>>>>>> return -1; >>>>>>>>> @@ -1147,15 +1147,16 @@ parse_args(int32_t argc, char **argv) >>>>>>>>> single_sa_idx); >>>>>>>>> break; >>>>>>>>> case CMD_LINE_OPT_CRYPTODEV_MASK_NUM: >>>>>>>>> - ret = parse_portmask(optarg); >>>>>>>>> + ret = parse_portmask(optarg, &v); >>>>>>>> I think there is no need for v, enabled_cryptodev_mask can be used instead. >>>>>>> Right now - it can't as enabled_cryptodevmask is uint64_t. >>>>>>> To do what you suggesting we have either downgrade enabled_cryptodevmask 32-bits, >>>>>>> or upgrade enabled_port_mask to 64-bit and change parse_portmask() to accept 64-bit parameter. >>>>>> I am ok with any of the case. >>>>>> >>>>>>>>> if (ret == -1) { >>>>>>>> enabled_cryptodev_mask should not be 0 and should be checked here. >>>>>>> Could you explain a bit more why enabled_cryptodevmask==0 is not allowed? >>>>>> By default, the value of enabled_cryptodevmask is UINT64_MAX, which means all crypto >>>>>> devices are enabled, and if it is marked as 0, then all get disabled which is not >>>>>> correct as we need atleast 1 crypto device in ipsec application. >>>>> Might be user would like to run app with inline ipsec only, >>>>> or have app to work in bypass mode only (no encrypt/decrypt) at all. >>>>> Why that should be considered as a problem? >>>>> Konstantin >>>> Agreed with your point. But in case of inline ipsec, user may not be initializing the crypto device either. >>>> >>>> So the cryptodev_mask option would be redundant in that case and it may not give that parameter. >>> It is still not clear to me why you'd like to prohibit cryptodev_mask==0? >>> Would anything will be broken? >>> Konstantin >> Sorry for delayed response. I missed this one somehow. >> >> Nothing is broken, > Ok > >> but it looks very redundant in case of inline modes, > Why is that? > Let say I have a crypto device enabled for DPDK, but don't want to use it > for that particular run. crypto device will not be used in case of inline, whether you specify the cryptodev_mask or not. >> and it is not a valid value in case of other modes. > How that differs from any other invalid crypto-dev mask? > Let say right now, user can have only one crypto device, but nothing stops him to specify > --cryptodev_mask=0x10, or so. That can be an enhancement to the application to validate the cryptodev_mask before using. But in case it is 0, then it cannot be correct in any of the case, because atleast one crypto device needs to be enabled. -Akhil > > Konstantin > >>>> -Akhil >>>> >>>>>> So if the user doesn't >>>>>> want to give the cryptodev_mask then he may skip that parameter, but if it is giving, >>>>>> then it cannot be 0. >>>>>> >>>>>>> Konstantin >>>>>>> >>>>>>> >>>>>> -Akhil >>>