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 7CCA345C88; Tue, 5 Nov 2024 12:02:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 41D0C402B3; Tue, 5 Nov 2024 12:02:47 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by mails.dpdk.org (Postfix) with ESMTP id D969C40151 for ; Tue, 5 Nov 2024 12:02:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730804566; x=1762340566; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=hmKqX9vNOC/T/8BzySQTOjk//goWszgdv2+XFXlbbvc=; b=AdtjEdbKfcplpQTQL4SQNl+EeSnlBl/xG/2T/WaWiCb6hXOumkE329fg 39f3KrNE6FyDyXEhXqYaMqejLeyXGSn69YU5jUP8rgLXD0gVenetIJ2sv gCCiDxKnCb1pdoGsT4u96uY/t4FhxDUwQYaoANc39IqgmLtrbeScKumgO LiP3bU+z4jQ88FdirOsxd/a8h5sU6FyuoTy8AYQCseJ4l7psKJ2ikf2cA nTn8TH9PIMNc68VbFUaVqziig5ZljrlVbf45PyVmY1Rnim6bKvJcw/cFo RSt+RcXhLb47tzMDo2sKejer6cHqUpfIZWGC92Tc7iBXELO/P/yUvG/TR g==; X-CSE-ConnectionGUID: jBl06y3XTA2fUw8tC54/yA== X-CSE-MsgGUID: q51qbN5OSn6qGcg5Nnm0Lg== X-IronPort-AV: E=McAfee;i="6700,10204,11246"; a="41139169" X-IronPort-AV: E=Sophos;i="6.11,259,1725346800"; d="scan'208";a="41139169" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Nov 2024 03:02:44 -0800 X-CSE-ConnectionGUID: U99lMF8bT7+da+6OnAxivw== X-CSE-MsgGUID: jynot1S6Q7iysT9znqJE0A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,259,1725346800"; d="scan'208";a="83864314" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orviesa009.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 05 Nov 2024 03:02:44 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 5 Nov 2024 03:02:44 -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; Tue, 5 Nov 2024 03:02:44 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) 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; Tue, 5 Nov 2024 03:02:43 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XlUCDXQ+9QGHPMO+zKkLFIk9kc4nvcLXEKBT3aJIUTP2jDqK1SB+fybJfmU1a4UCyUBmNuHeRELYama2fk8F5GL5X+04BlLllYY4kKMjQf2vBHSwVYdMWk6f3y+qryacXe4czBVoAxfU0yJWjapmm4fTcYuxr030/zYJHebxhmi+VkeO9+wAvqeywWceQK/3akuBRReP6mULo9O3rdvGatAs9gNbqGUUKm7zpHH92JkTJ94SzsK+chQ8ge0Kem7LbFoar9kmvmUfK0OSkgwBWfB7sMEB/gZcwDnvatIR2u4Mf9KzXvK8oEwTfZnkzCYpAXmNecZ0BGvktRHPV6XEkw== 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=Z/bddpOvw+Ahi6mgNpXU+oU6FelbVwh5mchUmA42X3Q=; b=C6Mu6O/TFAv6pA08oYwewnku1CT5CpoD8WBBLVoBTojqSVnMHcZdym9wGWGe2rJ0lef7lkMEkC2AHiN2Gom3Waw1M9seqBcb8PYoam6KN2/6/BuMAX688AweQ4eLD0GGO1TD4PQzjovpH1bOKiVSQ+zCYsDNp28/qc4r+hXIjvq6l+iEvGpvY8jUA/DOky7hLQCForzRBrP5BvWVRt2eNFhT5kSytba0HoVSp1XFl0vHLo0A+CiJSs91MpcalxpaTXvnfJtU5KDFuh6LZDPMRtNZ5xZ3si+4aEQQwIa/rxzMrAbhJvyzcstD47bKxN9GwcNwu5uE20h2atdWUWnOLA== 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 MW4PR11MB7029.namprd11.prod.outlook.com (2603:10b6:303:22e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.29; Tue, 5 Nov 2024 11:02:41 +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; Tue, 5 Nov 2024 11:02:40 +0000 Date: Tue, 5 Nov 2024 11:02:34 +0000 From: Bruce Richardson To: David Marchand CC: Morten =?iso-8859-1?Q?Br=F8rup?= , "Andre Muezerie" , , Robin Jarry , Stephen Hemminger , "Chengwen Feng" , Thomas Monjalon Subject: Re: [PATCH] net: fix IPv4 cksum simple function Message-ID: References: <20241105085912.4148208-1-david.marchand@redhat.com> <98CBD80474FA8B44BF855DF32C47DC35E9F877@smartserver.smartshare.dk> <98CBD80474FA8B44BF855DF32C47DC35E9F879@smartserver.smartshare.dk> Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: DU7P191CA0012.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:54e::23) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|MW4PR11MB7029:EE_ X-MS-Office365-Filtering-Correlation-Id: 1aac1fdb-6150-40a1-24d0-08dcfd895ddd X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?YXVqUnd4eVQ5RlBQejRpNklNaGFpRHhlZkhaYlJCNGlhYWNTeDN6aWVESjlC?= =?utf-8?B?MHZPNjh5aGhjSHJ1THpxckpuRFVMbGVkKzdMUWNPZkNwSGhoMEUrUmFuSThi?= =?utf-8?B?YkhJeHRlMHI4QnREYUZSeUJUb2JnZlJscTFsNnVPZWx1L1JlSzZZZzJ0bGp6?= =?utf-8?B?VUh1R0xNaFR2eE1QbGN0RW5VZ0pBNitDbWd2dnlqSkxiMVllcU05anNtODJY?= =?utf-8?B?L2pTaXBvaXl4NlA3allGZHFid0RkM2RHaUZiTHFDcS9EcE05Y2pkb1RrS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IMVdDNjJT?= =?utf-8?B?NHp1bGtpQ3hFS3NKRlpwWlJxQ1VVRCt3QThFYmsvWGh6cjJPc1dsTWQzbDcw?= =?utf-8?B?S3JMMnJMSDJjTmVTdVUxMXFTSlVkdWlGSkRIcllKeU93NE5FL0lNemlpWXNQ?= =?utf-8?B?Q0h0b2pYTExtUEVLNys1RUhlTERoeTlFM21LK0YzMDN6bjZPNHdwUityQjlZ?= =?utf-8?B?WWN4N1kyeUxvVkFPYWdtbFd6U0xxVldlSUZ5ZGdtRFFyQ3BKR0dVa3VRQXlN?= =?utf-8?B?UXVIdmllYm1rT01CcTFCVkJkUFMvdG5Ucmx5VHl6bzJhQ3VFUzVka2Q0dyt1?= =?utf-8?B?NTlCeXZGQncvb1dibUpOcGRuK0hoUXdxa3hkbi9iMWlHTDFDYUdJTXJLd1ly?= =?utf-8?B?VmkvS1RMeUJOZWpvWWd4NSt3eWs3MVpUanhuaStJdE1ZSGZJRjhJVVFGd21V?= =?utf-8?B?TzNRazdUZ2E1U1NhS3JOTW0yMWZqVUNFL3JGOTJtNlRmNGQrS1o2U21WMURB?= =?utf-8?B?eW1jeEFWcmtscmtIWnY0VU5SZE9lSm5VaVpWZGtyK08ydjd0UGRoeS9RVSt4?= =?utf-8?Q?0dSm55+5r+eGJk8YPauiCtZ1PJe/W86cBDx65tX?= 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)(1800799024)(366016)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SWJkdnppS2VFMnYycGt1cXVldTVLUjNJSmVETnBqYmZGUDlCNVh1WVFrZ1M3?= =?utf-8?B?TmpGZlRkazE2SDYvZW5COWM4Z3VicFRydVVJL0RCOERYbDhvdUEwNjVYRDRj?= =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UVTlEUWM3N08vZHhFdldmNUc2VTFPejZPd0hDNXYzdStw?= =?utf-8?B?b2JaYlNHZEdSN0RoNVVxM29WVnNlejJ0LzRPaVZ2dXVHZzFvcTlCNVhpUWE5?= =?utf-8?B?ODlvMktxUmRpTEd0UXhxWGNvN2xSWmlscldWQmhVZnQ4YjVtbFlrRkJ3UTJj?= =?utf-8?B?amZGUVBSUGduTEg5SnNEZXIybXBXbWs5RTYyYzd5U0xBQmk5QmNZTVpNWGtP?= =?utf-8?B?eXdlUlU1YjIxdTMrOUNWVWxaQTJHTXh0NWcxT0hKR3ZxcFpHU0RNRlNMQ2JH?= =?utf-8?B?Y1E9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 1aac1fdb-6150-40a1-24d0-08dcfd895ddd X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2024 11:02:40.8226 (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: +Kbj6iiLlWmOufozwZs2kHN4oUah6CqHBH6IJJAUCv1xQUzAyfT1/VwoNGRAhfw3SY8G8KkkH98SchwPBSoEI3InDYsa53EgJIGl7FxP340= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR11MB7029 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 Tue, Nov 05, 2024 at 11:49:52AM +0100, David Marchand wrote: > On Tue, Nov 5, 2024 at 11:20 AM Morten Brørup wrote: > > > But there is still the question of packed structures with MSVC. > > > Tyler proposal seemed to rely on the current __rte_packed conventional > > > position. > > > https://patchwork.dpdk.org/project/dpdk/patch/1713225913-20792-2-git- > > > send-email-roretzla@linux.microsoft.com/ > > > Note that I am not a fan of this push/pop stuff. > > > > > > Maybe Andre will find a better solution. > > > > If we cannot come up with a clean solution that looks like an attribute (like GCC), we should accept MSVC's style with push/pop and learn to live with it. > > Well, there is probably not many solutions. > OVS does the same as what you suggest. > > > > > > Perhaps something like: > > > > #ifdef RTE_TOOLCHAIN_MSVC > > #define __RTE_PACKED(...) \ > > __pragma(pack(push, 1)) \ > > __VA_ARGS__ \ > > __pragma(pack(pop)) > > #else > > #define __RTE_PACKED(...) __VA_ARGS__ __attribute__((__packed__)) > > #endif > > > > This would also move the "packed" information to the top of the struct, making the code easier to read - i.e. easier to notice that the structure is packed when not hidden away at the end of the structure. > > __RTE_PACKED(struct __rte_aligned(2) rte_ipv4_hdr { > ... > }); > > Agreed, looks better. > Not convinced it looks better myself. Rather than packing the structure, can we instead put aligned(2) on the 32-bit fields inside it? /Bruce