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 1D12645D10; Fri, 15 Nov 2024 12:00:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F1E6040295; Fri, 15 Nov 2024 12:00:43 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by mails.dpdk.org (Postfix) with ESMTP id 2EE7440285 for ; Fri, 15 Nov 2024 12:00:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1731668442; x=1763204442; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=NmRW6eQ9UZLc7EOUYvtxvOImt5mBiYOFOoyzVTImmwA=; b=CZy71CRwJzP0BHuOE1878D90CE+7zZ+bVvnw7T6ZAIMACQ+6umdyN2A5 0LcMdjTcxEOgu6++jfOJvJ5QOha4AI1CFiCBBwRwzX84QOCb/ia1ndmkV xDckGTbu8cB301jqgxsQAo3NOnq3TjWrDqbp8mAxZ0fmqiM7ILMkt09qG rfAy67rj5f00ePxqm9lnxz9KdsrpZzVpey4CGma9hAW8NstQebbw+fMol UO7wHtBRryCgZxVyj3eGhWsMV+lr9D6yZvextJZB8Yij5ttmUxb9kTFBe H+96zElVno447XwBLxUtohzVZEAhQhsJrfFzOe/7EvLXeAQhAbViE5X+A Q==; X-CSE-ConnectionGUID: 2vmU/YrPSSWrxjsz4vd3mg== X-CSE-MsgGUID: vw1NRrVkSjapzF3uGylOvA== X-IronPort-AV: E=McAfee;i="6700,10204,11256"; a="49200325" X-IronPort-AV: E=Sophos;i="6.12,156,1728975600"; d="scan'208";a="49200325" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2024 03:00:41 -0800 X-CSE-ConnectionGUID: z2DnTYz1QMCDq3NbNjaEhw== X-CSE-MsgGUID: zTbCuQQzSbeSG8hjhw1/Iw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,156,1728975600"; d="scan'208";a="93344688" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmviesa004.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 15 Nov 2024 03:00:41 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 15 Nov 2024 03:00:40 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Fri, 15 Nov 2024 03:00:40 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.46) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Fri, 15 Nov 2024 03:00:40 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AEpiqfEzM+xXjKY0ovkWIxCBZJbxvH4lQrR6aOh+lV0WWeW+dXRhpWTn3MZUmOrsPjdXBYAGvi4K5XcVJGENLcrlLfMH6PKUPPKnRnwGhkZpISSzrH4BrRYJw+XafxpODQVMjNLcxyuxXPPASa5a1KgqDMEQZv34NdE+7vPOfHBpEO8SZuOvhl0kXt7pTochHWIaldgz6ujruwV3QOTaznE9jZ+c6GVtUezGffvyZdmGEClH8gxOndE/+UWnql1UF1Iw4skA7en7BuWotJyYa3gJX9jvE4nGTQNV3N3JmAjuxLt9msFw4B93tsTFHMx0jTp/+X7d/0v/q55Yhi8TUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=a5idtp4I90vRMbT6derJC48ddu0C9Ufjzl/rMoofGTY=; b=Zrhnb8KdL3CbW44BrONGf59389b2erwcAAMxIYj9NiXQUFvRssgNLZr6jXuVuuyi5MqchDSXa/TquCSEnIXrFxp0FjEWVRQc6QD+Yhs7vlyGHLlSWUveFunBmIi6U/nYoMud1Q9/dYgI7fwDfKt0DYSwGg96Xni9YdbnXVMKpvpF2Jj5gGYAy/obeBZUFWLImr+RK4MxFVB+DoM+gqR4+kmt+DkDOn+p8Gl0TFiaEC7BJy/liFLtELfi8ZkIkHLA7P/E7K+1iVaYPriv5eu9awX5CWcxUYcQiErLfeuZqBC2NxsCcvX6Cq14Tqj8YVAfmorCFIhSQoFPU5E5DZW0Gg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by PH8PR11MB6779.namprd11.prod.outlook.com (2603:10b6:510:1ca::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.17; Fri, 15 Nov 2024 11:00:37 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b%4]) with mapi id 15.20.8093.018; Fri, 15 Nov 2024 11:00:37 +0000 Date: Fri, 15 Nov 2024 11:00:32 +0000 From: Bruce Richardson To: Stephen Hemminger CC: , Ian Stokes Subject: Re: [PATCH 05/16] net/i40e: remove duplicate code Message-ID: References: <20241115060738.313190-1-stephen@networkplumber.org> <20241115060738.313190-6-stephen@networkplumber.org> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20241115060738.313190-6-stephen@networkplumber.org> X-ClientProxiedBy: DB8PR04CA0015.eurprd04.prod.outlook.com (2603:10a6:10:110::25) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|PH8PR11MB6779:EE_ X-MS-Office365-Filtering-Correlation-Id: 567d5b3e-5080-41ca-80ee-08dd0564bc41 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Iu1jx9eU/NEc7kcCnZpKIFZW4AKqF1l3i2vP0zh9k7oUUbSimK1WVbhMahlj?= =?us-ascii?Q?n5vy4f0omzCq7lfIQCSD6+1tKTMY3/0jUqMLNXI8/6tJtZNLS+ay+Ku8pX57?= =?us-ascii?Q?A2P1tZ6yJZY8UTS9mcflBrrf7I4rMPoD6hxiugzlOY8RqqxeedYov7Ra+56v?= =?us-ascii?Q?YE1qPFfKG55SYzzcNwDIZYP619qwLozzclWCPWxT6+QCJiIBepKSdSD8r/U5?= =?us-ascii?Q?N4ftxKoEepfATkfdviiATvlLbUGfMi8GPkwAMTwMu0NboeArGVugFi4UBsKp?= =?us-ascii?Q?VCdWd3q0mEkihKPZeS1ucPIHFFEQdogtq5tVezvDOnKoaJbuAWxHekWucHIJ?= =?us-ascii?Q?44tN+1bNnbz3JmlBunCXibL7DpYtd76+cwm+AiGyur9jSAOIw3GPECvePO55?= =?us-ascii?Q?RvroymvvEnlxVoR+D6PSoNswiY51rPiWp214s4O9WQnWDCoA1dNtVxOFrnSb?= =?us-ascii?Q?/8Rwtlfzm8zb3nNObD2of+aVmyEPa04AJ6jfdyINSgYR9inGdT9KeSbIxbig?= =?us-ascii?Q?QXcwOyAjiM26fVQn76ianayG3knSxh95gUR8mH6ZYYtg+K7SAZMlWddG6Ne/?= =?us-ascii?Q?z1kDg0Yl3f8iIDewmgrPXyCqx144ryQ21wun4/Z6JItkrR/Pj8gfQBeSsaWp?= =?us-ascii?Q?vjB/izAzjty1aYHsV0aVwBnDVMnfcEZR5cNqtVIKaFITad8wS49fCtQA/h6o?= =?us-ascii?Q?Cqpb08CKqdg8euINXhb0vvOhzXvcGYlXNw9fm9dRZ1+qsEN7tAXZ6V2ICio8?= =?us-ascii?Q?k/0lcQGgh/YuRPbOrmEuBhtCHFG/rBUd1D1fM5fxOWmHEstKhoDv9opscMBc?= =?us-ascii?Q?tBZjQIV9/wv0KktF6oHpqzwHEi1GbkalV04B67KPmqkfni+STDqRRacNm4GA?= =?us-ascii?Q?1++ILiVyPygKL/ZVbojnUtOvDmKGbvaKg12nIqxAOt5je1TBIQs+1tH3jbMx?= =?us-ascii?Q?Z/+M8yRgy1lDjVLJZdtte5hZGI22AWkJzcwN8Z06D25vPMgRDfL2fXBX/MLu?= =?us-ascii?Q?GTKQJzRSb6beYjyE13xIMKhL+Yg5snu4ND8EhkfthgOvuAccdGfY0sexY604?= =?us-ascii?Q?o45nfy3chUCPYxzuIoLN5/CJPjgQE7W2v/uz2BIjRL7LedkifsQHD6mjzYv/?= =?us-ascii?Q?+Ai5qullYujviiLW4ljDLHUBsEPLozCjrA2XnNmK6iln6opb17bnD1x0h8/B?= =?us-ascii?Q?Dbao2oZbeJSX/nHufHT22rD72v5htGu/2dS3EBbAdvEPyoTO2rV+jpuS9B2G?= =?us-ascii?Q?FvOn2ZKeKfyMzqlPUVYw?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?RyXk9P4dkWAcpCG/RI5vzM7mmlwsUHW5gDyUYR0NvTCuUSVVGtISK0x4mWh/?= =?us-ascii?Q?uk4Auuf7nepmcadXRtD4u+R2HMLh1gcB65xKwDM4wzLZPc9DRRlm+CwW0eFv?= =?us-ascii?Q?IT0A8AkAnYLSxT9AaG+58qn9qGfzSuy4FMXaV//+pN+jESRvJlPKwgqJojN9?= =?us-ascii?Q?atX55zGM11AmSIHwBzXD/ujSbKt3lV4qUI6Pj+WhQbCBHOa0lVhUAvWGQaD/?= =?us-ascii?Q?6E+VAyMN9WzvYCfyIQHBYqpYzNMivHv3trSEMAZAeUXRqxZCCWl8ezldIvIF?= =?us-ascii?Q?n0t0VmJ+Fa5yjicepXvvDhglrd0PYWzAtlmUJsUUjRq6bKkmdxGk4JfxKVpr?= =?us-ascii?Q?6pyaKOOQT/rV9A7EOd1NxTeR6jMe6N+PllSxEuxSv4W9gH8yN8v1M6H7mjeN?= =?us-ascii?Q?waFCSnt+b9sn1EXdAyPiarzLxIbip/ARc81oHrIlX+zr4dJZfu4cSRa3hSaf?= =?us-ascii?Q?TUzu1/34WWnT+pNJCsde4BtmLpUvB7pL8G1DU5lcHptaU8z3LE6kX/+VQHM0?= =?us-ascii?Q?+ngbpyM9j+10nnxOUWS+pbkMPYix+o3VaYV58SEixhfHozhOHk1wk10TMbCT?= =?us-ascii?Q?MYRHgj4iatH3wLHbKZl11FXE0Y+pv+bh+0CCzdN+EIgHGFkFii3hNvCraOoe?= =?us-ascii?Q?tvGwi70qwdf0O+59KMPa4Wgq/ix1CogRus4s9hu1sjaMe2sSPCyaqi5y3Jjc?= =?us-ascii?Q?Fpr6FzcbBvh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ascii?Q?MA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 567d5b3e-5080-41ca-80ee-08dd0564bc41 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2024 11:00:37.0711 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DT8WNfBdxqAyx1tPdSthYTAtCV5tEbONRVVzboJljz5JblBEetyGtNJrNwyHtCAbwjGrrH5eOf0OGZYRmTBPRd2gj2Tr3I1fzM4wM1rbl0o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR11MB6779 X-OriginatorOrg: intel.com 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 On Thu, Nov 14, 2024 at 10:05:42PM -0800, Stephen Hemminger wrote: > There are two branches in the cascading if/else that have same > condition and code; remove one. Update the code to follow DPDK > style where all statements in if should have brackets if any > leg requires them. > Not actually DPDK style, that is just something that checkpatch recommends because it is kernel style. DPDK style guide says[1] "Braces that are not necessary should be left out." That said, most legs of this if-else block have it so ok to have that change included for consistency. [1] https://doc.dpdk.org/guides/contributing/coding_style.html#control-statements-and-loops > Link: https://pvs-studio.com/en/blog/posts/cpp/1183/ Fixes: 2ab5c84605f0 ("net/i40e: fix ESP flow creation") Acked-by: Bruce Richardson > > Signed-off-by: Stephen Hemminger > --- > drivers/net/i40e/i40e_fdir.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c > index 47f79ecf11..6861bea99a 100644 > --- a/drivers/net/i40e/i40e_fdir.c > +++ b/drivers/net/i40e/i40e_fdir.c > @@ -599,18 +599,16 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf, > } else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4_UDP) { > len = fill_ip4_head(fdir_input, raw_pkt, IPPROTO_UDP, > len, ether_type); > - } else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4_UDP) { > - len = fill_ip4_head(fdir_input, raw_pkt, IPPROTO_UDP, > - len, ether_type); > - } else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6) > + } else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6) { > len = fill_ip6_head(fdir_input, raw_pkt, IPPROTO_ESP, > len, ether_type); > - else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6_UDP) > + } else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6_UDP) { > len = fill_ip6_head(fdir_input, raw_pkt, IPPROTO_UDP, > len, ether_type); > - else if (cus_pctype->index == I40E_CUSTOMIZED_IPV6_L2TPV3) > + } else if (cus_pctype->index == I40E_CUSTOMIZED_IPV6_L2TPV3) { > len = fill_ip6_head(fdir_input, raw_pkt, IPPROTO_L2TP, > len, ether_type); > + } > } else { > PMD_DRV_LOG(ERR, "unknown pctype %u.", fdir_input->pctype); > return -1; > -- > 2.45.2 >