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 298D343D17; Thu, 21 Mar 2024 16:32:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 19FD3427E6; Thu, 21 Mar 2024 16:32:25 +0100 (CET) Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by mails.dpdk.org (Postfix) with ESMTP id 914B1427E1 for ; Thu, 21 Mar 2024 16:32:23 +0100 (CET) Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-6e6f6d782e4so916736b3a.0 for ; Thu, 21 Mar 2024 08:32:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711035143; x=1711639943; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=hm1OTAMdHak3NbBxSrPP4LsZWdw5mX/ARGo1ho6Tf78=; b=S69CZ+xFggLE4T4p4TOHoShot+XGKHeLl8cX1PPLAoOHy1HlKDFmGsC6o119ppU/c4 2YQlHQH8tMg9Cx+oK7iTa9oEtGYTh0bbd1ABwwXAmVcbNOgioxGKOIBlfca7ROViHF4k EHV2aaOxj/RCgvvw03d6U3kVh5ey+uWRPIGX2irswfSmEWL1iDaEaqmkNgnebeBM1Z/b +jHwbqhlIfvxhy1OTW9/t7bCDycpTcBHgK5L1n7SOtPOIYLEpHpqfwks5WHy+oYzAUCF f1Mdx11PRLXSN1IvwqKlVYPG6oAmgIyKvOvXEExr1bj3vGcXYF1rz1g5/hucBnOkkRKg hzcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711035143; x=1711639943; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hm1OTAMdHak3NbBxSrPP4LsZWdw5mX/ARGo1ho6Tf78=; b=aR3DgcLNxbGXsC+t/NOW8Y8h694c3vg6QoWCMVmPBfwbaxYsHrJYmtCbcD0fna0G0+ aGd+l9sYey9re/3ZqAyB3W5V4IFqh6XvwwJJYvhewFPR0QOaljXPuYarcBXYiEs/CWmA sgTvQ+JXd3BCPXMdvTELcTE9WoBPbpw9SC4gWRVtL72Wf3ZI8hm4PgHmIZfBs3yqkGpN /hkIXCrF7NEGH3VnQJaOTNDTt3J5I3k2BVaU0tLjT8DeVM0Ku0OR65wbeaDGrWuOvviv wIeSbkDZa1vjZCTNDZtkmyhW4ncLH34iSCDA7h2AStRfej1BJNH2ScZzXic/EHneFByS 0cZQ== X-Gm-Message-State: AOJu0YwDxSEWjyWNfkEyiGpPesdDdpGY9aeic+h36Fi4Ag5ETQ8yTCaS WsU1yj1L3sEBrA+UpJkilbqfTQRCB5e0O36TGTe1lgxQxIfUfd+wycOnduf/fQ8= X-Google-Smtp-Source: AGHT+IGsf0nVpgkkQhNnFbo419mfYOoOmzM3jUzVbMnn0wVsOZRP7oaVwnz7gzZc4s4mYLU3p0nkrA== X-Received: by 2002:a05:6a00:3ccb:b0:6e6:42ef:ed1b with SMTP id ln11-20020a056a003ccb00b006e642efed1bmr2979886pfb.31.1711035142510; Thu, 21 Mar 2024 08:32:22 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id z7-20020aa79e47000000b006e510c61d49sm13605457pfq.183.2024.03.21.08.32.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 08:32:22 -0700 (PDT) Date: Thu, 21 Mar 2024 08:32:19 -0700 From: Stephen Hemminger To: Tyler Retzlaff Cc: dev@dpdk.org, Akhil Goyal , Aman Singh , Anatoly Burakov , Bruce Richardson , Byron Marohn , Conor Walsh , Cristian Dumitrescu , Dariusz Sosnowski , David Hunt , Jerin Jacob , Jingjing Wu , Kirill Rybalchenko , Konstantin Ananyev , Matan Azrad , Ori Kam , Radu Nicolau , Ruifeng Wang , Sameh Gobriel , Sivaprasad Tummala , Suanming Mou , Sunil Kumar Kori , Vamsi Attunuru , Viacheslav Ovsiienko , Vladimir Medvedkin , Yipeng Wang , Yuying Zhang Subject: Re: [PATCH 00/15] fix packing of structs when building with MSVC Message-ID: <20240321083219.5504c54f@hermes.local> In-Reply-To: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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, 20 Mar 2024 14:05:56 -0700 Tyler Retzlaff wrote: > MSVC struct packing is not compatible with GCC provide a macro that can > be used to push existing pack value and sets packing to 1-byte. The > existing __rte_packed macro is then used to restore the pack value > prior to the push. > > Instead of providing macros exclusively for MSVC and for GCC the > existing macro is deliberately utilized to trigger a warning if no > existing packing has been pushed allowing easy identification of > locations where the __rte_msvc_pack is missing. > > I've decided to only add the macro to packed structs that are built > for Windows. It seems there is little value in adding the macro tree > wide and if new code arrives that is built on Windows the __rte_packed > will flag where the preamble macro is required. > Why is packed used so many places in DPDK? Packed should be reserved for things like network protocols with unaligned fields. Many of these structure have no holes and are naturally packed. Adding packed attribute unnecessarily can generate poor code on architectures that do not support unaligned access.