From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BFDAC48BC3 for ; Mon, 19 Feb 2024 10:26:21 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9B28D40289; Mon, 19 Feb 2024 11:26:20 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by mails.dpdk.org (Postfix) with ESMTP id A99E540275 for ; Mon, 19 Feb 2024 11:26:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708338379; x=1739874379; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=OYTBIQwJlmC5kWeMqUZTmAUn3UGYyi7G5Vs4n/142Qk=; b=ZNVlPvMuooDhjIpqSDWzIOCYj6mboC1NpUoKQimC0GIPgEylP/TdL6fT 5KBPokBZ7t8wHDNBK1ejOzv5q1SKxNSsHA8Av1Yp4aW1iIWFCwbbzit8M VLnw2TN/i0lHyByUDg732g/TAo7kYhVMXhWGVcZU/+L7Z7u6V5HA+iEtp sVO39DxIzWBVUxNV2IAMIooft9NFSCfwtE08eP5fepJLGHYxH3M82KsZt fvdKOo6OpRWmRASkII4cHoF7xfUHMPj8YpDE/4ipvD29Bun8qgHRP2NBj 9vySjcLz6VJ7sQh+VXpUIdPMz1an2U/fERfetUs22svlO92fhaV0nRjYp Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10988"; a="2534683" X-IronPort-AV: E=Sophos;i="6.06,170,1705392000"; d="scan'208";a="2534683" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Feb 2024 02:26:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,170,1705392000"; d="scan'208";a="4460865" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orviesa009.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 19 Feb 2024 02:26:17 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 19 Feb 2024 02:26:16 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Mon, 19 Feb 2024 02:26:16 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.168) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 19 Feb 2024 02:26:16 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rp2s5+RolrdT/Ss68JDnW8Lgqo6IAws5eR8BHH3ae2ZCrNZdKmGdPzjcfd/CPUbKSX6rWec0IVJ7axTL4+mJXP++lXYIjYAV9EzUdLhRITmez5Kxm79gy6U3P8ontLQENWgPYaJGibs1EhrhVDpQhwsPyjVfN1SI+NAn8UCw3F/CdGUD0WshFTE6XFcJjUZu+PUn9fOTbDEmLAin5f92RSvBWn58H8SkbE8MNGl+ieAH8Y518xFH2UxFVck78xtRA7MskDsZG/40cUqKGiCvS/WKLAK8lsLe70RVSDpsPlzKfvGXyPymBrqbcZddfpqBcOzX4S8bfz+X7m28+4SLWg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LlrL0ESOz2hytCfZJjR4h8JcnjL4/Vfq9E5WzYG075M=; b=mdF0s5uFMEt2AEJDedULyzcLH8B9MoTyg5LpKxxy0YlVB9FtdRIVLOW67OcJiy3yRh5xuc3VilakYoq5pVu1SNa7nPJrs5t93s9HXiEl8cCnHEZeXL9D8cBQC7sH6XjHCm3jQs/sgY1vbCdX+xrZ5xudM6o7qpqpAHn4uEB/+9GehapEo+zGH1fLTLVfwxDrOzYjXZGVr9L8LJY0v5QuWrmbDXR6UYox4JJJy3c7+dRvtynP2ZHASICUyb+7ywZ0MLGr/T1hb83RL/VJh1DuWQZpuPXkmiBS8BbygppEu1uwJsEz9lgSJi9Nv7zSOZcPflXgHwHI8ploZuwEIXnPNw== 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 MW4PR11MB6861.namprd11.prod.outlook.com (2603:10b6:303:213::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.38; Mon, 19 Feb 2024 10:26:13 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::d10:3009:a8d3:1d2e]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::d10:3009:a8d3:1d2e%7]) with mapi id 15.20.7292.036; Mon, 19 Feb 2024 10:26:13 +0000 Date: Mon, 19 Feb 2024 10:26:08 +0000 From: Bruce Richardson To: Morten =?iso-8859-1?Q?Br=F8rup?= CC: Stephen Hemminger , Chaoyong He , , , "Long Wu" , Peng Zhang Subject: Re: [PATCH] net/nfp: add support of UDP fragmentation offload Message-ID: References: <20240217015410.2163102-1-chaoyong.he@corigine.com> <20240217084725.5a1c6f34@hermes.local> <98CBD80474FA8B44BF855DF32C47DC35E9F228@smartserver.smartshare.dk> <20240217101122.37734606@hermes.local> <98CBD80474FA8B44BF855DF32C47DC35E9F229@smartserver.smartshare.dk> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F229@smartserver.smartshare.dk> X-ClientProxiedBy: DU2PR04CA0037.eurprd04.prod.outlook.com (2603:10a6:10:234::12) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|MW4PR11MB6861:EE_ X-MS-Office365-Filtering-Correlation-Id: ca10f26c-15ac-4fa6-0457-08dc313532c7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LQt6He8rHKFRrPtbXfARwzOsHtYA6fajtyi1JOq5ZpU382obJAoYiLlW/dKWpV8g+74XX0cfY5FddQVpZrd1YUzTsxuSs/7b8SKpYMRjL/brDk1DIfZHCbTv4/mibXxtB851dor8PfJ4b9CY4NGmrDY/y/SyUpwedUmw1Uu55hGk1Ezd3pMuLMcXGgzuaFJaCka4zOG35ih5oOoHSGYj0NCCR5F3j5oTpHeE2FAisW2GyoativkMLbYxpmghw4zF/PoeK3ScP8NPITYo4IIvSZgFZCWjjb8zaMVORp/HS1mOVFjLD6rBAvTuHm069XfxbQ2WRuhtuFx59rGLyb6TmAnLpUTUQUNqFn4VtwYlhCbSvrnRr6skKgGfAAkkOSri4KLZjSY2kkBJjVdLJcmo+c1OXk6aFS0DC1LsxkB29jRI6qOE24zbfriu4pf+xQlx4INar2ylENPJJNbkRUupAFdDPp+GdAueJ/aBLmcZe9CxNeutBk7t9ahQppf/V9fFex0wOOhuqcwoslIk1Su5TxkzwHIf0xtVPu4sDToqsg8= 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:(13230031)(366004)(136003)(346002)(396003)(376002)(39860400002)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(5660300002)(66476007)(8676002)(8936002)(66946007)(66556008)(4326008)(44832011)(2906002)(6916009)(86362001)(82960400001)(66574015)(54906003)(26005)(83380400001)(41300700001)(6506007)(6486002)(966005)(38100700002)(478600001)(6512007)(6666004)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?1i3wZfdRXnVou5lwEto5avNGnOIhavnyxZFGL3if1c1Lz3erdDNOU+rp10?= =?iso-8859-1?Q?PFbA1vsMtMDvOL4y6kCq/bhZVKWe1NZdy7u+pw+FbWRin6P/PALXfZs6MS?= =?iso-8859-1?Q?sOu3FGCosDZlIyW6UnpINOlI9UkNBf7GjiWHjVTKMLRfrw5vnVU2UJ64kC?= =?iso-8859-1?Q?gk2Erc8H3Kw34SWGDKyJoNEH6SeFjJZdFcTMIRCegvlXb2He9RiaytjC+T?= =?iso-8859-1?Q?IU6QvmaQ20zyoD+gPqWUaEAOJt+k1dWWv20/4v6Rdf8yqR1dsC3H+dCOz2?= =?iso-8859-1?Q?iReT6BIBlZze41bJUjCYp7e7ssqnx9DDqAKgyeQm20MGlFMfT17GTzpR9K?= =?iso-8859-1?Q?afSczKQTaHxn3/pedfNDOys9Md8C+zSb1W0hL855hyKQPaeqsx51FodeSx?= =?iso-8859-1?Q?inquOtvA+6IRpo4mlZWcC/gWe1zknEEqteQCEb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k6iNelQCgkEIF6jOWthjUG9KZeY8XVGwm3PwqcxHT?= =?iso-8859-1?Q?nbNqH5EF4XH0FXE19jK0+z9niByTIQv41h4vhcNJdnUjS2s7cBq9iY9c+n?= =?iso-8859-1?Q?hZMEaXyG4at+2xtJrG4hxzzJxXruvJWWPo7NhPYy4+M/4eUw/R0dUy373q?= =?iso-8859-1?Q?piTlCR58CV27Z/qvjjcnxF2uJGsyMvOFjK1m86nACNk0XIdT+XwAuLaku0?= =?iso-8859-1?Q?GQ8lxhhzI1eRlhyg2D6yBwJgtidICjiwy9AjCz1VexBQ0EcwvzQNlUCCBt?= =?iso-8859-1?Q?7ege/tHB9O7GJosg7Lqh0EsiSAWnFDEvO6t4/ZcDSzMMnON8Ow+MvtKw?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: ca10f26c-15ac-4fa6-0457-08dc313532c7 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2024 10:26:13.6639 (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: /omrxqi/zNOxjB5ITvhcP0ReO2WIIeKV3i3QMSrUH4jSUmiREMB+CnUJ6Sl0kuoVEl4lQK4sZzySngoJAh/tRHf2JkOj19QjEUzZHx1mzWY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR11MB6861 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 Sun, Feb 18, 2024 at 11:05:35AM +0100, Morten Brørup wrote: > > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > > Sent: Saturday, 17 February 2024 19.11 > > > > On Sat, 17 Feb 2024 19:02:30 +0100 > > Morten Brørup wrote: > > > > > Not formally... it follows the official DPDK Coding Style [1]. > > > > > > [1]: > > https://doc.dpdk.org/guides/contributing/coding_style.html#general > > > > > > > Should be: > > > > > > > > if ((ol_flags & RTE_MBUF_F_TX_TCP_SEG) == 0 && > > > > (ol_flags & RTE_MBUF_F_TX_UDP_SEG) == 0) > > > > goto clean_txd; > > > > > > This indentation style is mentioned as an alternative in the guide. > > But the example in the guide also uses two tabs for a similar long > > comparison. > > > > > > Personally, I also prefer the style suggested by Stephen, so we might > > want to update the Coding Style. ;-) > > > > > > The two tabs is an Intel thing, and I prefer the kernel, line up the > > conditional style. > > I prefer 4 space indentation, which is sufficient to notice the indentation. 8 spaces seems overkill to me, and quickly makes the lines too long. > With the editor configured to show tab as 4 spaces, the kernel alignment style ends up with the same indentation for the condition and the code block: > > if (a && > b) > ctr++; > > Whereas with the "tab as 4 spaces" editor configuration, the double indentation style clearly separates the continued condition from code block: > > if (a && > b) > ctr++; > These two above are the main reasons I much prefer the double indent on continuation, though I'd also add a third one: it means we don't have a mix of tabs and spaces for indentation. However, as stated already indent can be a matter of taste, and there will be some disagreement about it. The existing coding standards document what was done in the code base when they were written, and I don't think we should look to change them. It's a bit annoying having 2 standards for continuation rather than 1, but it's not exactly a free-for-all, and it's not something that applies to every line, only to a small subset. > On the other hand, complex conditions are easier readable when aligning logically instead of by a fixed number of tabs, e.g.: > > if (a | > (b & > (c ^ d)) | > (e ^ f) | > g) > ctr++; > Apart from the alignment of the increment at the end, yes, I admit it is a little more readable. However, I also think that it's still pretty complex even with the helpers! > Placing the operators at the beginning also makes the code more readable: > > if (a > | (b > & (c ^ d)) > | (e ^ f) > | g) > ctr++; > +1 to this. I think having operators at the beginning of lines is good. It also makes it visually clearer that the indent is for line continuation. > I guess that coding styles are mostly a matter of taste. > > I wonder if any research into coding styles has reached any conclusions or recommendations, beyond mixing coding styles is bad for readability. > > > We really should have a style that can be describe by clang format. > > Other projects like VPP have a target that reformats the code and uses > > one of the clang format templates. > > Automated code formatting seems like a good idea. > Yep. The trouble is that, if you don't do this from the start, the deltas will be massive, and confusing in our git history. /Bruce