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 3441845C87; Tue, 5 Nov 2024 11:50:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C4B79402B3; Tue, 5 Nov 2024 11:50:07 +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 23EF640151 for ; Tue, 5 Nov 2024 11:50:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730803806; 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=NhxVRCX6foXDsOdd5Px2u29YVPN1DiqW2ZAvVIO8G44=; b=Lx5MfJvWTSAtgovdtGvAHA2WwJqxC+0aOApvMuMkhDf7ZpZ8pnjghv6vrYqFdZQ2Nwoqaz MJRso2EixBhLXHrhMJAIsXQiz4d27SAIoeRjNzor1yOQ1Id6zTiTlAjlrxyRk12YSdlDwI bkvHG1qoo38cP4wPLSILJXoeTtdkJDA= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-527-KxT--jNUMRu7xhU69_4O-Q-1; Tue, 05 Nov 2024 05:50:05 -0500 X-MC-Unique: KxT--jNUMRu7xhU69_4O-Q-1 Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2fc969f6e27so23504561fa.3 for ; Tue, 05 Nov 2024 02:50:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730803804; x=1731408604; 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=NhxVRCX6foXDsOdd5Px2u29YVPN1DiqW2ZAvVIO8G44=; b=HYSthCp4kP2OCq4B+KTLCperE8k7EQ4700BttmoaL6pZCAHFoMT1jVrjZRgXg4LCV3 t+bs8d18+x8UqF0putzGgpLSseSGUybgR8WKnFrYJhNKwnrvqSxFwqNTtfwTdGOlGdDC ggEOmwtQDbDA10SBN2FPKS7DJDENHi70wHvMw2kMSuwFuXJHhsdM5/3fhgq9RDFaKkpS FuHMQE8ya7E5d2raVgp1NFFF1DmMRmUWEaSBJKhiUk3gCaCr7vDx4T5cdNWa+Y8d3qWx Om5UwFDE82lvlyErO7HoPXtafDsa5wIab8NnG6QlGph+CgUGTVQrcsMaVNYkAQLj5MZR XiIQ== X-Forwarded-Encrypted: i=1; AJvYcCXaDByTWPqiWhQXYicboKfhUlO1idfmP00fGbr1TichH9fcfNvt+Ye9d6nzBrUPC/vDNt8=@dpdk.org X-Gm-Message-State: AOJu0YwqEXwM20pXvGCu3udLf9e8W7ctGAoK9eXO4WFUN+I97vUcNdnW 5QbpigwefV1FlTPvCUgKAPlOcR8Gx9JnmZX8W9l/qR+wQWyEtpcI3xPghfx/gAD9wM79PsPIXas DnayLDjGf//LFY9lCfskWMC7kqYC8Qje0KDTtWgiLt3PWMkgzbQl1AtLWuXSZFgbxYZZ6HG+rbL DVT60jqJrfS5VdIws= X-Received: by 2002:a05:651c:1541:b0:2fb:5bb8:7c23 with SMTP id 38308e7fff4ca-2fcbe005e2dmr170041531fa.26.1730803803820; Tue, 05 Nov 2024 02:50:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IEVEmCO0XrvC5QtUcIttOcdivRjLoxQfYegzsr+gPyRBgmB1e1EzBdNPAQqEbeC5+dy8ER8qSmHw3UVinhyuqg= X-Received: by 2002:a05:651c:1541:b0:2fb:5bb8:7c23 with SMTP id 38308e7fff4ca-2fcbe005e2dmr170041351fa.26.1730803803385; Tue, 05 Nov 2024 02:50:03 -0800 (PST) MIME-Version: 1.0 References: <20241105085912.4148208-1-david.marchand@redhat.com> <98CBD80474FA8B44BF855DF32C47DC35E9F877@smartserver.smartshare.dk> <98CBD80474FA8B44BF855DF32C47DC35E9F879@smartserver.smartshare.dk> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F879@smartserver.smartshare.dk> From: David Marchand Date: Tue, 5 Nov 2024 11:49:52 +0100 Message-ID: Subject: Re: [PATCH] net: fix IPv4 cksum simple function To: =?UTF-8?Q?Morten_Br=C3=B8rup?= Cc: Andre Muezerie , dev@dpdk.org, Robin Jarry , Stephen Hemminger , Chengwen Feng , Bruce Richardson , Thomas Monjalon 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, Nov 5, 2024 at 11:20=E2=80=AFAM Morten Br=C3=B8rup 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 wi= th 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, m= aking 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. --=20 David Marchand