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 A174745F20; Mon, 23 Dec 2024 12:46:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2756740DD0; Mon, 23 Dec 2024 12:46:51 +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 4C50D406BC for ; Mon, 23 Dec 2024 12:46:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734954408; 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=E86Y2aczc9ntOoY144TYD9Usxsq7b9G73/ac8lOkC6o=; b=O+dizvgtTq6edByBBG8TgyHITwnpTIcgxVpl2FUugnuUAPWQLoUbVW40+H/ampFk2O1UYq 6rKZaqI4L/BPaWeumHTp6SHUzH2VOtAheqwG6xckXc9H4oLsA/s7k5toQMyT1KZHOdL+On NwOF5RkuevSOczBBYYmWV02qaIdiiQM= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-335-Qa9YfaTRPwqVMAXsoLS4AQ-1; Mon, 23 Dec 2024 06:46:47 -0500 X-MC-Unique: Qa9YfaTRPwqVMAXsoLS4AQ-1 X-Mimecast-MFC-AGG-ID: Qa9YfaTRPwqVMAXsoLS4AQ Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-5401b7d34ceso2366025e87.0 for ; Mon, 23 Dec 2024 03:46:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734954406; x=1735559206; 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=E86Y2aczc9ntOoY144TYD9Usxsq7b9G73/ac8lOkC6o=; b=nYAW8s29JsdBcFHtVDXwWmNoYnI5dEJxC/Ue7r76Mu8gcxQtDwQ/sKlkAj4GzKotPH phLLmBAjjb4pHxPiecGq+D5EtkD6OwEpO0L2fQZLdQDS/Ci6VQ+8AGifNeQkTLaDJ1X+ iG85Wby6iuV/ovo0gG0iJyOB3fnrXgXo8W9zpsQJIPaVuY+o44z6Wt7KftwREcpvz3De VU/wVeGos/LPlrfgFuaSwcTS4gtmpcXVdUV0QWojWkxjqBSsTbcjvn2woaZDpwgs3wOM AMFRCzR46XXwmuiiYj/m0ft0sfqthDbO2ycHakNrY8yMz/UEnjwcrKJa5DCdVUwkKhMh CYTA== X-Forwarded-Encrypted: i=1; AJvYcCVq68CpJEamOHJQWHno8gATtAjr3aDa5d0WItIvO/0Cl06yOCMX9go7U6u5IZNddWhuR9Q=@dpdk.org X-Gm-Message-State: AOJu0YzgVN83KHA8hgfXA26jAAz8G7ZfYBXqsPnE7yO77KHhq8Jz5sXk mRtRrycCV1BGHT8otHnd6/UveecWuhzDKwbvkNeWv8dM1uJrRpJbPpJzg2ZL2QRqO30gHDVR4Az 3ro7L6bET5XsPt8doYw4n6Deu7v7cr0JIKcGC5bqLpjsJkP/K2h9r6TSOPymZoPaPryBEC0DnZ1 pCVW5+XoSYhxQbmLE= X-Gm-Gg: ASbGncu7F1NVhbvdVXnz2bXInh/iUQ6vE7jfgsasu0BFxSIviId8WuGZId7nUjlE09u dLnCw9UE5oFGOj4Eq4hccnDAp+gYLzSTSTN8zjTE7 X-Received: by 2002:ac2:4c56:0:b0:542:2ef4:4884 with SMTP id 2adb3069b0e04-5422ef44939mr1980631e87.19.1734954405897; Mon, 23 Dec 2024 03:46:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IFNFYh6Z+1xZqPd70zZ9gzfIGYx+mTCnpgJp6R2imXCp7N6Aen+HBFbKzCquhR6GNM0FSXpicPsdtS1XHhsQjM= X-Received: by 2002:ac2:4c56:0:b0:542:2ef4:4884 with SMTP id 2adb3069b0e04-5422ef44939mr1980601e87.19.1734954405499; Mon, 23 Dec 2024 03:46:45 -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: From: David Marchand Date: Mon, 23 Dec 2024 12:46:34 +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: Hk5a-XsPqSevEpJzoa66lkBTj2VlUNHFQl-y-XwszTg_1734954406 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 Mon, Dec 23, 2024 at 12:03=E2=80=AFPM David Marchand wrote: > > 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= (pop)) > #else > #define RTE_PACKED(...) __VA_ARGS__ __attribute__((__packed__)) > #endif Mm, in practice, this would be problematic with struct where endianness matters (for example). In file included from ../../../git/pub/dpdk.org/main/lib/net/rte_ip.h:9, from ../../../git/pub/dpdk.org/main/lib/ethdev/rte_flow.h:= 25, from ../../../git/pub/dpdk.org/main/lib/ethdev/rte_eth_ctrl.h:11, from ../../../git/pub/dpdk.org/main/lib/ethdev/rte_ethdev.h:1472, from ../../../git/pub/dpdk.org/main/lib/ethdev/ethdev_driver.h:21, from ../../../git/pub/dpdk.org/main/drivers/net/failsafe/failsafe_ops.c:15: ../../../git/pub/dpdk.org/main/lib/net/rte_ip4.h:48:1: error: embedding a directive within macro arguments is not portable [-Werror] 48 | #if RTE_BYTE_ORDER =3D=3D RTE_LITTLE_ENDIAN | ^ ../../../git/pub/dpdk.org/main/lib/net/rte_ip4.h:51:1: error: embedding a directive within macro arguments is not portable [-Werror] 51 | #elif RTE_BYTE_ORDER =3D=3D RTE_BIG_ENDIAN | ^ ../../../git/pub/dpdk.org/main/lib/net/rte_ip4.h:54:1: error: embedding a directive within macro arguments is not portable [-Werror] 54 | #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. Still, please rework this part. --=20 David Marchand