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 810D945C15; Wed, 30 Oct 2024 15:45:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 57B20433DA; Wed, 30 Oct 2024 15:45:50 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by mails.dpdk.org (Postfix) with ESMTP id 59F22402EE for ; Wed, 30 Oct 2024 15:45:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730299548; x=1761835548; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=kw5ySuvcB2G4OWe45cyPv0SpN2MKB7h2BaiEYPIBZZY=; b=aWXxU2Pjed+O/seHgo5IllJYkz7+FxwLVimRrj1TZv01o23LuSRAqN5k ru7i3S1aj27zwG3KmUQfSMylpkIMcBw1GpTnoM4EbZoHsr5QsdoWSL4Ap Xwmysf7w6O4PfBNUCwqpBd0O1jq6dw1jntfswfn2+vldIgBysKgkQxi7H TqmfhtsYZS8KCdXeQZ0Dh4uI6CJSA4ITFu3c+wbJZnDEh4ASPOht88rY8 0NlTautMh1ZIvKIz1jMJtPcnt2EC6HnaxQi1x0Af8Fca+r7keSYXbugtP bY4JoYD6DOo0ZAkLRJ6GCf/9NCCQhPC/E3dkbXu2vIGv+Ysyh6ElpnZoh w==; X-CSE-ConnectionGUID: XcUbSZwtSJmg+Ol5DoDXSQ== X-CSE-MsgGUID: 3oGb81BLQw2Ka2+4Vaw86w== X-IronPort-AV: E=McAfee;i="6700,10204,11241"; a="55409078" X-IronPort-AV: E=Sophos;i="6.11,245,1725346800"; d="scan'208";a="55409078" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2024 07:45:43 -0700 X-CSE-ConnectionGUID: kXhbjMrlQZKC/tDlCHgt2Q== X-CSE-MsgGUID: c0QD4zsyQbu+PECVxRxj2g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,245,1725346800"; d="scan'208";a="113186454" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa001.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 30 Oct 2024 07:45:43 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 30 Oct 2024 07:45:42 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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; Wed, 30 Oct 2024 07:45:42 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.174) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 30 Oct 2024 07:45:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QNeYimqJjz7YxHedRHhyv/1ymG/Kjrz2+f0DtRJVugV/yXNz0rtJetMGmEkEmSFbMsui/UOXQmFz7/foNbc00NiRZED/wxk/g4YohnZKhOSRKkshFM7VqphOQMUotJqe1KtqQjUEse+UczQ14M+Dd3TnN1bfTCer2GxTttsykq5RKDgvQUpBItfDJ/tsYIwD7WUamxTxX/x1scM9g2h1F5LtJMBUqBabHCHveaADICM93r3VJ3GC3QrQ7HqyGhIYmmIp9vi0YKjCjleVr59172LfvhezTps4tNDl6wKMbOndev4Mo8xf9exsa9acSpbuvEoXH5JBr2Dn8R0F74sfRg== 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=aI5oox/cRj/SGQGr0JLxLDV10OzJo9lTo8zFbM1nXkU=; b=UcyaDxb9JKv+oZvvjQQXKoPiDRj8FpglhTwJMjDi5+h3Dv3gJtQfRjLweDUKv/h1CDm1d1YYz50jGCOT01lwqDKlLZKk0MiOW3dxoYwTbgLDZTxC5jVSjmz4uuwKjMT+lniTHHuh6Crh4yvvZkim6FIO4x/v0FGi1sHoYEv+zSWfxnxmSGs79yzzW1xYylRB0/58quAL9IBHkkyd+sKrD0x3b7qwYG7e/gFxj60dAHx4wQXiAvq96x6MtQpROWc61LgYYSbuFCwCd5bYrwPyhBLJTstHATHQzYjNXRUdtNJAcdPFWuQn2N2BS+pMqk7vONaSkCTveDtaaUnARfk5vg== 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 LV2PR11MB6045.namprd11.prod.outlook.com (2603:10b6:408:17b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.27; Wed, 30 Oct 2024 14:45:36 +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; Wed, 30 Oct 2024 14:45:34 +0000 Date: Wed, 30 Oct 2024 14:45:28 +0000 From: Bruce Richardson To: David Marchand CC: Morten =?iso-8859-1?Q?Br=F8rup?= , , Stephen Hemminger , Jerin Jacob , Aman Singh , "Konstantin Ananyev" Subject: Re: [PATCH v2 5/6] net: add smaller IPv4 cksum function for simple cases Message-ID: References: <20241017142214.1669370-1-bruce.richardson@intel.com> <20241025165020.1856733-1-bruce.richardson@intel.com> <20241025165020.1856733-6-bruce.richardson@intel.com> <98CBD80474FA8B44BF855DF32C47DC35E9F84E@smartserver.smartshare.dk> Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: MI0P293CA0004.ITAP293.PROD.OUTLOOK.COM (2603:10a6:290:44::15) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|LV2PR11MB6045:EE_ X-MS-Office365-Filtering-Correlation-Id: 5867471e-b252-4fb4-736b-08dcf8f1829a 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|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?B?UXh3OEo5akFLSi9iak1QODUzai9oazRuTmZ5Nm93S1NORjU1Y3IrMVpSMDR2?= =?utf-8?B?UEZyeUhwK1R5eFM5STNFSGFxdkNxNFc3U0l3N0FMOFJhQ0V0NytRRElFV2FG?= =?utf-8?B?ZkIrZUwzaFBDWkl0OE55cFBEOEVsOXpHYnUzMDkybE9lK0NqYi9Dc3JBUFg5?= =?utf-8?B?b05XQTBMclhNcHQzZEFtUlhDQm91MEVYc1ZVT0ZtcndPQ3JJek43cmwrTHBw?= =?utf-8?B?ZlNUQWtJY3N6Mm84UmlrTTRwQ2t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W5vUTUvUEpsTFQ1NmQrR1FyN0lLR0hUcXlIYkU4RnZyTjAvY0th?= =?utf-8?B?RERXdnNhQlB1bUp5bkVBUmxOOEIwcVorTjA2bVJDVWdER213KzFWSFlHc1da?= =?utf-8?B?V2RqbnJGNVpuVHBlQStNSkVTRWRWSXBYYk81U3loaDQxVDJoR0pSMVdmZTFs?= =?utf-8?B?VnBCTzdiOGtCeG0xQ0RjZ2xHektDQVlNTnlxYVpmS3gyMUZrc3V0MzFVZ0RQ?= =?utf-8?B?YUZ5NlZUWHFwZlJKQ2VtOS91OU4vckllRjlyYjNVL0drWVB4WkhMWmtMM0pt?= =?utf-8?B?c3FGcmVndlM3anN5d1JVTnRzK1kwVkJOUEorWVFxVzc5K1pUSW10VmNIL1NP?= =?utf-8?B?c1B1T283UWQxanNFTmdiNkg4RVExNHhVdzlMR0RhRmhmQ0tZcldzNk1UTDU3?= =?utf-8?B?Q1pSZC9LNWRFOHdPUXA4dlRaemh4YXdoQkZkajEwSjl0RHl2WkdqVkdEUFFJ?= =?utf-8?B?ZHR0RC9RRXNSWTVkZjZLclZ5SEZhaXpWVStZN0VmZitFL1lwRk5jZU1jOXhz?= =?utf-8?Q?qqk0zoC1Ps/TSQb6nfDj?= 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)(376014)(366016)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SFR6RmlCMndKWWluMGxDempIVjlRRFBWbkh3bUNWQm9va2ZlREQ3QmM3MnFV?= =?utf-8?B?RXl2MEhCbGVVT1VVVEh1WnpwUkJ3WndFQlZEMEl1QWdNOU5Seks1dTliQ2pJ?= =?utf-8?B?UWNNQVVReTgwZjRrWG1Dd1dZU3Q5MWlpb0sxRUE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4MzJkOG9KblRVSDhEaWplTkk3SlRKcUxwSzl5?= =?utf-8?B?L1dyZ3BpQnY1SllNMC9ONFo2QWFTUWl1VklEL3UxU2pPTHord3RzdDNEZTJX?= =?utf-8?B?TEJUKzdwMjQ0KzA5WVo5eXgxaWsvYWk4NEh0L3VKRklNRitwZVZydzBVT3Y5?= =?utf-8?B?Vkx5cGVlRDN2dTF0dmlVSitybkpVZk1aMThmQ055MDBIVVhnZncrcnlhaGFZ?= =?utf-8?B?RVE9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 5867471e-b252-4fb4-736b-08dcf8f1829a X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2024 14:45:34.6327 (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: mX3l8k+CFLfsI/ej8ZPjjol/DpSHXrnaQvp8lxOvq6mZUSS2gsVpagJRulCUXuSQxU0bJACv3OE7V7267lb56qXcjCCGTfbKCKnn+lwFaug= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR11MB6045 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 Wed, Oct 30, 2024 at 03:08:06PM +0100, David Marchand wrote: > On Wed, Oct 30, 2024 at 12:32 PM Morten Brørup wrote: > > > > > From: Bruce Richardson [mailto:bruce.richardson@intel.com] > > > Sent: Wednesday, 30 October 2024 12.28 > > > > > > On Wed, Oct 30, 2024 at 12:21:00PM +0100, David Marchand wrote: > > > > Hello Bruce, > > > > > > > > On Fri, Oct 25, 2024 at 6:51 PM Bruce Richardson > > > > wrote: > > > > > > > > > > There are multiple instances in the DPDK app folder where we set up > > > an > > > > > IP header and then compute the checksum field by direct addition of > > > > > nine uint16_t values in the header (20 bytes less the cksum field). > > > > > The existing rte_ip.h checksum function is more general than > > > necessary > > > > > here and requires that the checksum field is already set to zero - > > > > > rather than having it skipped. > > > > > > > > > > Fix the code duplication present in the apps by creating a new > > > > > rte_ipv4_cksum_simple function - taking the code from the existing > > > > > testpmd icmpecho.c file - and using that in app/test, testpmd and > > > > > testeventdev. > > > > > > > > > > Within that new function, we can adjust slightly how the > > > typecasting to > > > > > uint16_t is done, and thereby ensure that the app can all be > > > compiled > > > > > without -Wno-address-of-packed-member compiler flag. > > > > > > > > > > Signed-off-by: Bruce Richardson > > > > > Acked-by: Stephen Hemminger > > > > > Acked-by: Morten Brørup > > > > > > > > This added function triggers a build error with OVS because of - > > > Wcast-align: > > > > https://github.com/david- > > > marchand/ovs/actions/runs/11401635820/job/32273090691#step:12:514 > > > > > > > > libtool: compile: env REAL_CC=gcc "CHECK=sparse -Wsparse-error -I > > > > ./include/sparse -I ./include -m64 -I /usr/local/include -I > > > > /usr/include/x86_64-linux-gnu " cgcc -target=x86_64 > > > > -target=host_os_specs -D__MMX__=1 -D__MMX_WITH_SSE__=1 > > > > -D__SSE2_MATH__=1 -D__SSE_MATH__=1 -D__SSE__=1 -D__SSE2__=1 > > > > -DHAVE_CONFIG_H -I. -I ./include -I ./include -I ./lib -I ./lib > > > > -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith > > > > -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter > > > > -Wbad-function-cast -Wcast-align -Wstrict-prototypes > > > > -Wold-style-definition -Wmissing-prototypes > > > > -Wmissing-field-initializers -fno-strict-aliasing -Wswitch-bool > > > > -Wlogical-not-parentheses -Wsizeof-array-argument -Wbool-compare > > > > -Wshift-negative-value -Wduplicated-cond -Wshadow > > > > -Wmultistatement-macros -Wcast-align=strict -mssse3 > > > > -I/home/runner/work/ovs/ovs/dpdk-dir/include -include rte_config.h > > > > -mrtm -Werror -D_FILE_OFFSET_BITS=64 -g -O2 -MT lib/ofp-protocol.lo > > > > -MD -MP -MF lib/.deps/ofp-protocol.Tpo -c lib/ofp-protocol.c -o > > > > lib/ofp-protocol.o > > > > In file included from /home/runner/work/ovs/ovs/dpdk- > > > dir/include/rte_ip.h:9, > > > > from /home/runner/work/ovs/ovs/dpdk-dir/include/rte_flow.h:25, > > > > from lib/netdev-dpdk.h:30, > > > > from lib/dp-packet.h:30, > > > > from lib/ofp-print.c:34: > > > > /home/runner/work/ovs/ovs/dpdk-dir/include/rte_ip4.h: In function > > > > ‘rte_ipv4_cksum_simple’: > > > > /home/runner/work/ovs/ovs/dpdk-dir/include/rte_ip4.h:191:17: error: > > > > cast increases required alignment of target type [-Werror=cast-align] > > > > 191 | v16_h = (const unaligned_uint16_t *)&ipv4_hdr->version_ihl; > > > > | ^ > > > Ok, I'll see if I can rework it to avoid issues. > > > > Would be easier if IP(v4/v6) headers were 2-byte aligned, like the Ethernet header. > > Just saying. ;-) > > Aligning rte_ipv4_hdr is not enough. > Pointing at a uint8_t triggers a warning (with clang at least). > > I guess we need something like: > > diff --git a/lib/net/rte_ip4.h b/lib/net/rte_ip4.h > index 4dd0058cc5..f9b8333332 100644 > --- a/lib/net/rte_ip4.h > +++ b/lib/net/rte_ip4.h > @@ -39,7 +39,7 @@ extern "C" { > /** > * IPv4 Header > */ > -struct rte_ipv4_hdr { > +struct __rte_aligned(2) rte_ipv4_hdr { > __extension__ > union { > uint8_t version_ihl; /**< version and header length */ > @@ -188,7 +188,7 @@ rte_ipv4_cksum_simple(const struct rte_ipv4_hdr *ipv4_hdr) > * Compute the sum of successive 16-bit words of the IPv4 header, > * skipping the checksum field of the header. > */ > - v16_h = (const unaligned_uint16_t *)&ipv4_hdr->version_ihl; > + v16_h = (const uint16_t *)ipv4_hdr; > ip_cksum = v16_h[0] + v16_h[1] + v16_h[2] + v16_h[3] + > v16_h[4] + v16_h[6] + v16_h[7] + v16_h[8] + v16_h[9]; > > Yes. For the latter assignment part, the original code use ipv4_hdr, but that triggered other warnings in DPDK build. With properly aligning the structure, I think it should be fine. Therefore, what you have above looks the best solution to me. /Bruce