Message ID | 1710968771-16435-8-git-send-email-roretzla@linux.microsoft.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Thomas Monjalon |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 15D1043D0A; Wed, 20 Mar 2024 22:06:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A50542E39; Wed, 20 Mar 2024 22:06:23 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 9C0C642D80 for <dev@dpdk.org>; Wed, 20 Mar 2024 22:06:14 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 4B18720B74C7; Wed, 20 Mar 2024 14:06:13 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4B18720B74C7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1710968773; bh=BrT9hdACPdp/8EWGtE/394YhBVX42Ds6F0MPJEnqGB0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AYNBwArHvx+uuk883TaR6dQpPUqnfGYNpgdOb5rNFGbw/LM07aJg5kB0jCT2gio7/ RM4eFEDGSveRqU/rPCc3mcREDkZhzPwX3MtdWnbKhDe+7zSvBoWkJNoSZYb6HfDsjr A3x+Cy+BF33FcA3j8Qzr2NmIjfwMecpfitOyNRFs= From: Tyler Retzlaff <roretzla@linux.microsoft.com> To: dev@dpdk.org Cc: Akhil Goyal <gakhil@marvell.com>, Aman Singh <aman.deep.singh@intel.com>, Anatoly Burakov <anatoly.burakov@intel.com>, Bruce Richardson <bruce.richardson@intel.com>, Byron Marohn <byron.marohn@intel.com>, Conor Walsh <conor.walsh@intel.com>, Cristian Dumitrescu <cristian.dumitrescu@intel.com>, Dariusz Sosnowski <dsosnowski@nvidia.com>, David Hunt <david.hunt@intel.com>, Jerin Jacob <jerinj@marvell.com>, Jingjing Wu <jingjing.wu@intel.com>, Kirill Rybalchenko <kirill.rybalchenko@intel.com>, Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>, Matan Azrad <matan@nvidia.com>, Ori Kam <orika@nvidia.com>, Radu Nicolau <radu.nicolau@intel.com>, Ruifeng Wang <ruifeng.wang@arm.com>, Sameh Gobriel <sameh.gobriel@intel.com>, Sivaprasad Tummala <sivaprasad.tummala@amd.com>, Suanming Mou <suanmingm@nvidia.com>, Sunil Kumar Kori <skori@marvell.com>, Vamsi Attunuru <vattunuru@marvell.com>, Viacheslav Ovsiienko <viacheslavo@nvidia.com>, Vladimir Medvedkin <vladimir.medvedkin@intel.com>, Yipeng Wang <yipeng1.wang@intel.com>, Yuying Zhang <Yuying.Zhang@intel.com>, Tyler Retzlaff <roretzla@linux.microsoft.com> Subject: [PATCH 07/15] dma/ioat: pack structures when building with MSVC Date: Wed, 20 Mar 2024 14:06:03 -0700 Message-Id: <1710968771-16435-8-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> References: <1710968771-16435-1-git-send-email-roretzla@linux.microsoft.com> 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 |
Series |
fix packing of structs when building with MSVC
|
|
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
Commit Message
Tyler Retzlaff
March 20, 2024, 9:06 p.m. UTC
Add __rte_msvc_pushpack(1) to all __rte_packed structs to cause packing
when building with MSVC.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
drivers/dma/ioat/ioat_hw_defs.h | 1 +
1 file changed, 1 insertion(+)
Comments
On Wed, Mar 20, 2024 at 02:06:03PM -0700, Tyler Retzlaff wrote: > Add __rte_msvc_pushpack(1) to all __rte_packed structs to cause packing > when building with MSVC. > > Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com> > --- > drivers/dma/ioat/ioat_hw_defs.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/dma/ioat/ioat_hw_defs.h b/drivers/dma/ioat/ioat_hw_defs.h > index dc3493a..6e32807 100644 > --- a/drivers/dma/ioat/ioat_hw_defs.h > +++ b/drivers/dma/ioat/ioat_hw_defs.h > @@ -52,6 +52,7 @@ > #define IOAT_DMACAP_PQ (1 << 9) > #define IOAT_DMACAP_DMA_DIF (1 << 10) > > +__rte_msvc_pack > struct ioat_registers { > uint8_t chancnt; > uint8_t xfercap; This struct has all gaps explicitly filled, so packed should not be necessary. Struct has same size with and without the attribute. /Bruce
On Thu, Mar 21, 2024 at 04:13:32PM +0000, Bruce Richardson wrote: > On Wed, Mar 20, 2024 at 02:06:03PM -0700, Tyler Retzlaff wrote: > > Add __rte_msvc_pushpack(1) to all __rte_packed structs to cause packing > > when building with MSVC. > > > > Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com> > > --- > > drivers/dma/ioat/ioat_hw_defs.h | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/dma/ioat/ioat_hw_defs.h b/drivers/dma/ioat/ioat_hw_defs.h > > index dc3493a..6e32807 100644 > > --- a/drivers/dma/ioat/ioat_hw_defs.h > > +++ b/drivers/dma/ioat/ioat_hw_defs.h > > @@ -52,6 +52,7 @@ > > #define IOAT_DMACAP_PQ (1 << 9) > > #define IOAT_DMACAP_DMA_DIF (1 << 10) > > > > +__rte_msvc_pack > > struct ioat_registers { > > uint8_t chancnt; > > uint8_t xfercap; > > This struct has all gaps explicitly filled, so packed should not be > necessary. Struct has same size with and without the attribute. just eyeballing it i think uint32_t dmacapability; /* 0x10 */ with packing will not be aligned on a 4-byte boundary. maybe i miscounted though. > > /Bruce
diff --git a/drivers/dma/ioat/ioat_hw_defs.h b/drivers/dma/ioat/ioat_hw_defs.h index dc3493a..6e32807 100644 --- a/drivers/dma/ioat/ioat_hw_defs.h +++ b/drivers/dma/ioat/ioat_hw_defs.h @@ -52,6 +52,7 @@ #define IOAT_DMACAP_PQ (1 << 9) #define IOAT_DMACAP_DMA_DIF (1 << 10) +__rte_msvc_pack struct ioat_registers { uint8_t chancnt; uint8_t xfercap;