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 437BC45F23; Mon, 23 Dec 2024 12:03:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A7B5406BC; Mon, 23 Dec 2024 12:03:30 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 2551C4068E for ; Mon, 23 Dec 2024 12:03:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734951807; 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=ZTkwEeh0mq1Y2JJP1ZIhm026MvJJ1dvx2DD3dAijJFc=; b=QWHJ4R+Ho2wazpQUNeZE26we7SskZT2V2GCTRDV7N8Slbi11ESyuY0py8K2FgGH8AhatK+ EvKK/fSDrZZM2gYNX73r0STAephSabOxjQnGABWARJYMSE2nzi67lsvkKg2Ce3B98gl4db L5z/CRB49nvYVtdA8vIt/qlMPCxjIQ0= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-46-l-Kt5XvbNhSeQad1DxKUiQ-1; Mon, 23 Dec 2024 06:03:26 -0500 X-MC-Unique: l-Kt5XvbNhSeQad1DxKUiQ-1 X-Mimecast-MFC-AGG-ID: l-Kt5XvbNhSeQad1DxKUiQ Received: by mail-lf1-f72.google.com with SMTP id 2adb3069b0e04-540294014e4so2226942e87.3 for ; Mon, 23 Dec 2024 03:03:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734951805; x=1735556605; 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=ZTkwEeh0mq1Y2JJP1ZIhm026MvJJ1dvx2DD3dAijJFc=; b=lZfIYrPpb5ffcN/C/kD45zrqRAFBCh8/ITr478MF7GA0mN/XnIc3orzbL55MgOE3L9 PisPGaznoKCmTTX8uVLSB7eHdiB9MXHK6LXl5xaf0+CftsXME/6B4Dc4YvlzoNLIIPCi b3SVIrbY0PrZfmCeuZGayF3CD5brA8kqbLjwpBS519oOOIKEUW83ZX/dN9F25y0r3aO/ x4VcA4qkd/YGAoe7gN5o0stIKtS4T1/JVLM6pQpbdigG+n51DyQzaSoIAPDMXGVt98h5 vBgtVcIAzrib/MdbXQ0lZrnBx0pkyXCfKIhJpVmvNhocvbS2E4NAito9xvd0ungQf2zD logQ== X-Forwarded-Encrypted: i=1; AJvYcCVNAmnaL7kKRIQmqx11zFid/X87XoNPKFJya0AJV+5kBn63GmEMa0aCV5PKTYnVEzpWhrk=@dpdk.org X-Gm-Message-State: AOJu0Yx340vzTZSoU6qwcdXDyamnr6D+EM08w5Rgv/og2NgWPT6BL3wx RUQe/rf2vNXJcX4DPNCfSvS/LYs8O+u2WOz8ntnnFlTi4h8jYtPj/X3jKgK3ZZ4VuM1a7ljXLqz T5igEAj9D0JtrwAd2lhgp81LDrz1211bveVyFvoM4RyEHJ6ho8elE9no+6a8uxeh1LnSPcB9k1Q 39Mv25/ZyU+/2dvvo= X-Gm-Gg: ASbGncvCTBZ+gr8EN67WHhBE5UAWBiDYsepV5fgzEYD1TeF+zvSU5LJfU2UCa04FyJm AT1qT2flG1Y0DaNNQ0z7atSOEiunBxItFBkhcyidS X-Received: by 2002:a05:6512:3a91:b0:540:1d58:da75 with SMTP id 2adb3069b0e04-54229532e14mr3970241e87.14.1734951804810; Mon, 23 Dec 2024 03:03:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IH/LbtJmDpAyG+fiDUyHDDBbTMIjTMNWnl2EgroSWlsftJNok6mAdpiDXZHrgFGTjujUtLoftYvWHHkfKInY18= X-Received: by 2002:a05:6512:3a91:b0:540:1d58:da75 with SMTP id 2adb3069b0e04-54229532e14mr3970223e87.14.1734951804421; Mon, 23 Dec 2024 03:03:24 -0800 (PST) MIME-Version: 1.0 References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> <1732668761-5556-1-git-send-email-andremue@linux.microsoft.com> In-Reply-To: <1732668761-5556-1-git-send-email-andremue@linux.microsoft.com> From: David Marchand Date: Mon, 23 Dec 2024 12:03:13 +0100 Message-ID: Subject: Re: [PATCH v6 00/30] fix packing of structs when building with MSVC To: Andre Muezerie Cc: roretzla@linux.microsoft.com, aman.deep.singh@intel.com, anatoly.burakov@intel.com, bruce.richardson@intel.com, byron.marohn@intel.com, conor.walsh@intel.com, cristian.dumitrescu@intel.com, david.hunt@intel.com, dev@dpdk.org, dsosnowski@nvidia.com, gakhil@marvell.com, jerinj@marvell.com, jingjing.wu@intel.com, kirill.rybalchenko@intel.com, konstantin.v.ananyev@yandex.ru, matan@nvidia.com, orika@nvidia.com, radu.nicolau@intel.com, ruifeng.wang@arm.com, sameh.gobriel@intel.com, sivaprasad.tummala@amd.com, skori@marvell.com, stephen@networkplumber.org, suanmingm@nvidia.com, vattunuru@marvell.com, viacheslavo@nvidia.com, vladimir.medvedkin@intel.com, yipeng1.wang@intel.com X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: ANpqxfHva1V9mUIqz5rRDD0nbagf5Zc13Ea8Q4vCwOI_1734951805 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 Hello Andre, On Wed, Nov 27, 2024 at 1:53=E2=80=AFAM Andre Muezerie wrote: > > MSVC struct packing is not compatible with GCC. Provide a macro > (__rte_packed_begin) that can be used to push existing pack value > and sets packing to 1-byte. The existing __rte_packed macro is > replaced with __rte_packed_end and restores the pack value > prior to the push. > > Instead of providing macros exclusively for MSVC and for GCC, > macro __rte_packed_end is deliberately utilized to trigger a > MSVC compiler warning if no existing packing has been pushed allowing > easy identification of locations where the __rte_packed_begin is > missing. > > Macro __rte_packed is removed and the two new macros represent the > new way to enable packing in the DPDK code. > > Script checkpatches.sh was enhanced to ensure __rte_packed_begin and > __rte_packed_end show up in pairs when checking patches. > > If as a part of review maintainers identify structs they believe > don't require packing so long as they are explicitly identified > I'll remove the __rte_packed as a part of this series. > > v6: > * replace __rte_msvc_pack with __rte_packed_begin > * replace __rte_packed with __rte_packed_end > * update checkpatches.sh to ensure __rte_packed_begin and > __rte_packed_end are used in pairs I had mentionned this in a separate thread. Why not do like OVS and have a RTE_PACKED() macro? #ifdef RTE_TOOLCHAIN_MSVC #define RTE_PACKED(...) __pragma(pack(push, 1)) __VA_ARGS__ __pragma(pack(p= op)) #else #define RTE_PACKED(...) __VA_ARGS__ __attribute__((__packed__)) #endif This removes the need for updating checkpatch. Plus, builds on Linux will catch issues (hopefully by the author of the change, before submitting). > * remove __rte_packed Please mark it deprecated for now (see RTE_DEPRECATED / add a deprecation notice) and we will remove it in 25.11. --=20 David Marchand