From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 0834745C14;
	Wed, 30 Oct 2024 12:21:17 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id EC3784028F;
	Wed, 30 Oct 2024 12:21:16 +0100 (CET)
Received: from us-smtp-delivery-124.mimecast.com
 (us-smtp-delivery-124.mimecast.com [170.10.129.124])
 by mails.dpdk.org (Postfix) with ESMTP id 1DC9940263
 for <dev@dpdk.org>; Wed, 30 Oct 2024 12:21:16 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1730287275;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=DJNJ4YyAunMTvwkEl9SU54Yso7UZx5KnnK8jS0iSfPM=;
 b=T9h6O1pcmm2BkTSpca4z31xmgO8pi7nmml4V2ObzoBhtd61sdShqFVFG1ghem3tO6X0Z+F
 3UyrglvYuGrl2fs2WRWCdXMcSyQDOWq4GtiqGtsIPMfnzy3LH8aQqejVQ1gm8u2wZB8p3S
 7Bc0l9VcN0VFye6QxhGqyu/d7/ni62w=
Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com
 [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-563-dfr3l-EJNxOlVUGQO25szQ-1; Wed, 30 Oct 2024 07:21:14 -0400
X-MC-Unique: dfr3l-EJNxOlVUGQO25szQ-1
Received: by mail-lj1-f200.google.com with SMTP id
 38308e7fff4ca-2fb3c9f3ba2so41792241fa.3
 for <dev@dpdk.org>; Wed, 30 Oct 2024 04:21:14 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1730287273; x=1730892073;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=DJNJ4YyAunMTvwkEl9SU54Yso7UZx5KnnK8jS0iSfPM=;
 b=GZ5VMNHgJcbkozCBYxRRyvaZ5dOQqIKeBIlKSBlmbx2ntojj3j77+VVk8OsfAiXI9v
 f0+LMqD1fwE1DyW7bUdeu5MYxxNoUNXa0igOqQGjIJMtOsj0FiIUtrKoUlIJNL3SpHBa
 5D0d8joq+erEGbEdgOyM0OZePHudOkIncsY+ZiEDehIAHAIjY+28hU0peK5p3dVj1ami
 g8glZurOifM3gWkClahrxHIDVptYwSmdtHzL+DPZlJqJ1VO5RDq9qGStusrzJmYRHD4z
 LK8G5bOZ/hLXox/r4ZDpEa2nMaRGLx3Iavif39fuRf74ZivnweOT3YoW2P4pb7EGM5Oh
 2hmw==
X-Gm-Message-State: AOJu0YwfvISBSWu3mozrZTIefWVp61+SREK9hZ4p92FF0VIM9RooSpHN
 huSSLunUQ3u8uUuvpQ7sZcpJE8z+1xAfKMjphmQv7Qd3hkMSMEY9BnRopPhisaBhSUqD8LUTjgP
 Mu4HqYhqJafiR9ZMQGw2cHiegDJvUwPUtiMuW9+PSkHXEqVtwjBVhj4xhXtvAdRDiq7zvBiK9yx
 o+/ZhjiAw9ItCT2Mc=
X-Received: by 2002:a05:651c:1545:b0:2fb:4ddd:a8f0 with SMTP id
 38308e7fff4ca-2fcbdf728d4mr68336101fa.15.1730287272641; 
 Wed, 30 Oct 2024 04:21:12 -0700 (PDT)
X-Google-Smtp-Source: AGHT+IGyJGKk3I+iNG+A7Nwvdg7VU2yAzLk5xa8BcrIOwVKaY9ZKOhvqMrQ2jhCoA9/aCOCKEPsYTRtIjKQE/d26Uuw=
X-Received: by 2002:a05:651c:1545:b0:2fb:4ddd:a8f0 with SMTP id
 38308e7fff4ca-2fcbdf728d4mr68335871fa.15.1730287272170; Wed, 30 Oct 2024
 04:21:12 -0700 (PDT)
MIME-Version: 1.0
References: <20241017142214.1669370-1-bruce.richardson@intel.com>
 <20241025165020.1856733-1-bruce.richardson@intel.com>
 <20241025165020.1856733-6-bruce.richardson@intel.com>
In-Reply-To: <20241025165020.1856733-6-bruce.richardson@intel.com>
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 30 Oct 2024 12:21:00 +0100
Message-ID: <CAJFAV8yNaLEZnshKES+YKQeo+z=hHa96WLF08=gxshqswXhnjA@mail.gmail.com>
Subject: Re: [PATCH v2 5/6] net: add smaller IPv4 cksum function for simple
 cases
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, Stephen Hemminger <stephen@networkplumber.org>, 
 =?UTF-8?Q?Morten_Br=C3=B8rup?= <mb@smartsharesystems.com>, 
 Jerin Jacob <jerinj@marvell.com>, Aman Singh <aman.deep.singh@intel.com>, 
 Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

Hello Bruce,

On Fri, Oct 25, 2024 at 6:51=E2=80=AFPM Bruce Richardson
<bruce.richardson@intel.com> 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 <bruce.richardson@intel.com>
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
> Acked-by: Morten Br=C3=B8rup <mb@smartsharesystems.com>

This added function triggers a build error with OVS because of -Wcast-align=
:
https://github.com/david-marchand/ovs/actions/runs/11401635820/job/32273090=
691#step:12:514

libtool: compile: env REAL_CC=3Dgcc "CHECK=3Dsparse -Wsparse-error -I
./include/sparse -I ./include -m64 -I /usr/local/include -I
/usr/include/x86_64-linux-gnu " cgcc -target=3Dx86_64
-target=3Dhost_os_specs -D__MMX__=3D1 -D__MMX_WITH_SSE__=3D1
-D__SSE2_MATH__=3D1 -D__SSE_MATH__=3D1 -D__SSE__=3D1 -D__SSE2__=3D1
-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=3Dstrict -mssse3
-I/home/runner/work/ovs/ovs/dpdk-dir/include -include rte_config.h
-mrtm -Werror -D_FILE_OFFSET_BITS=3D64 -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
=E2=80=98rte_ipv4_cksum_simple=E2=80=99:
/home/runner/work/ovs/ovs/dpdk-dir/include/rte_ip4.h:191:17: error:
cast increases required alignment of target type [-Werror=3Dcast-align]
191 | v16_h =3D (const unaligned_uint16_t *)&ipv4_hdr->version_ihl;
| ^
cc1: all warnings being treated as errors
make[1]: *** [Makefile:4736: lib/ofp-packet.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
cc1: all warnings being treated as errors
make[1]: *** [Makefile:4736: lib/ofp-print.lo] Error 1
make[1]: Leaving directory '/home/runner/work/ovs/ovs'
make: *** [Makefile:3110: all] Error 2



--=20
David Marchand