From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 196D943B1D;
	Wed, 14 Feb 2024 03:09:17 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id B843442E51;
	Wed, 14 Feb 2024 03:09:16 +0100 (CET)
Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32])
 by mails.dpdk.org (Postfix) with ESMTP id 9BD7F42DF9
 for <dev@dpdk.org>; Wed, 14 Feb 2024 03:09:14 +0100 (CET)
Received: from mail.maildlp.com (unknown [172.19.163.44])
 by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4TZM7B52YQz1vtYR;
 Wed, 14 Feb 2024 10:08:38 +0800 (CST)
Received: from dggpeml500024.china.huawei.com (unknown [7.185.36.10])
 by mail.maildlp.com (Postfix) with ESMTPS id AAED5140414;
 Wed, 14 Feb 2024 10:09:09 +0800 (CST)
Received: from [10.45.33.178] (10.45.33.178) by dggpeml500024.china.huawei.com
 (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 14 Feb
 2024 10:09:07 +0800
Content-Type: multipart/alternative;
 boundary="------------0mQRBWYzySE0Da9LTF74kasH"
Message-ID: <036a0e7d-9895-631f-5a8a-07bf0c86aeac@huawei.com>
Date: Wed, 14 Feb 2024 10:09:08 +0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
 Thunderbird/102.2.1
Subject: Re: [PATCH 11/14] dmadev: use C11 alignas
To: Tyler Retzlaff <roretzla@linux.microsoft.com>, <dev@dpdk.org>
CC: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>, Bruce Richardson
 <bruce.richardson@intel.com>, Cristian Dumitrescu
 <cristian.dumitrescu@intel.com>, David Christensen <drc@linux.vnet.ibm.com>,
 David Hunt <david.hunt@intel.com>, Ferruh Yigit <ferruh.yigit@amd.com>,
 Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>, Jasvinder Singh
 <jasvinder.singh@intel.com>, Jerin Jacob <jerinj@marvell.com>, Kevin Laatz
 <kevin.laatz@intel.com>, Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>, 
 Min Zhou <zhoumin@loongson.cn>, Ruifeng Wang <ruifeng.wang@arm.com>, Sameh
 Gobriel <sameh.gobriel@intel.com>, Stanislaw Kardach <kda@semihalf.com>,
 Thomas Monjalon <thomas@monjalon.net>, Vladimir Medvedkin
 <vladimir.medvedkin@intel.com>, Yipeng Wang <yipeng1.wang@intel.com>
References: <1707873986-29352-1-git-send-email-roretzla@linux.microsoft.com>
 <1707873986-29352-12-git-send-email-roretzla@linux.microsoft.com>
Content-Language: en-US
From: fengchengwen <fengchengwen@huawei.com>
In-Reply-To: <1707873986-29352-12-git-send-email-roretzla@linux.microsoft.com>
X-Originating-IP: [10.45.33.178]
X-ClientProxiedBy: dggpeml500010.china.huawei.com (7.185.36.155) To
 dggpeml500024.china.huawei.com (7.185.36.10)
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

--------------0mQRBWYzySE0Da9LTF74kasH
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit

Acked-by: Chengwen Feng <fengchengwen@huawei.com>

On 2024/2/14 9:26, Tyler Retzlaff wrote:
> * Move __rte_aligned from the end of {struct,union} definitions to
>    be between {struct,union} and tag.
>
>    The placement between {struct,union} and the tag allows the desired
>    alignment to be imparted on the type regardless of the toolchain being
>    used for all of GCC, LLVM, MSVC compilers building both C and C++.
>
> * Replace use of __rte_aligned(a) on variables/fields with alignas(a).
>
> Signed-off-by: Tyler Retzlaff<roretzla@linux.microsoft.com>
> ---
>   lib/dmadev/rte_dmadev_core.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/dmadev/rte_dmadev_core.h b/lib/dmadev/rte_dmadev_core.h
> index 0647856..1ba2c1f 100644
> --- a/lib/dmadev/rte_dmadev_core.h
> +++ b/lib/dmadev/rte_dmadev_core.h
> @@ -61,7 +61,7 @@ typedef uint16_t (*rte_dma_completed_status_t)(void *dev_private,
>    * The 'dev_private' field was placed in the first cache line to optimize
>    * performance because the PMD mainly depends on this field.
>    */
> -struct rte_dma_fp_object {
> +struct __rte_aligned(128) rte_dma_fp_object {
>   	/** PMD-specific private data. The driver should copy
>   	 * rte_dma_dev.data->dev_private to this field during initialization.
>   	 */
> @@ -73,7 +73,7 @@ struct rte_dma_fp_object {
>   	rte_dma_completed_t        completed;
>   	rte_dma_completed_status_t completed_status;
>   	rte_dma_burst_capacity_t   burst_capacity;
> -} __rte_aligned(128);
> +};
>   
>   extern struct rte_dma_fp_object *rte_dma_fp_objs;
>   
--------------0mQRBWYzySE0Da9LTF74kasH
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: 7bit

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><span style="font-family:SimSun">Acked-by: </span><span
        style="font-family:Calibri">Chengwen
        Feng <a class="moz-txt-link-rfc2396E" href="mailto:fengchengwen@huawei.com">&lt;fengchengwen@huawei.com&gt;</a></span></p>
    <div class="moz-cite-prefix">On 2024/2/14 9:26, Tyler Retzlaff
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:1707873986-29352-12-git-send-email-roretzla@linux.microsoft.com">
      <pre class="moz-quote-pre" wrap="">* Move __rte_aligned from the end of {struct,union} definitions to
  be between {struct,union} and tag.

  The placement between {struct,union} and the tag allows the desired
  alignment to be imparted on the type regardless of the toolchain being
  used for all of GCC, LLVM, MSVC compilers building both C and C++.

* Replace use of __rte_aligned(a) on variables/fields with alignas(a).

Signed-off-by: Tyler Retzlaff <a class="moz-txt-link-rfc2396E" href="mailto:roretzla@linux.microsoft.com">&lt;roretzla@linux.microsoft.com&gt;</a>
---
 lib/dmadev/rte_dmadev_core.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/dmadev/rte_dmadev_core.h b/lib/dmadev/rte_dmadev_core.h
index 0647856..1ba2c1f 100644
--- a/lib/dmadev/rte_dmadev_core.h
+++ b/lib/dmadev/rte_dmadev_core.h
@@ -61,7 +61,7 @@ typedef uint16_t (*rte_dma_completed_status_t)(void *dev_private,
  * The 'dev_private' field was placed in the first cache line to optimize
  * performance because the PMD mainly depends on this field.
  */
-struct rte_dma_fp_object {
+struct __rte_aligned(128) rte_dma_fp_object {
 	/** PMD-specific private data. The driver should copy
 	 * rte_dma_dev.data-&gt;dev_private to this field during initialization.
 	 */
@@ -73,7 +73,7 @@ struct rte_dma_fp_object {
 	rte_dma_completed_t        completed;
 	rte_dma_completed_status_t completed_status;
 	rte_dma_burst_capacity_t   burst_capacity;
-} __rte_aligned(128);
+};
 
 extern struct rte_dma_fp_object *rte_dma_fp_objs;
 
</pre>
    </blockquote>
  </body>
</html>

--------------0mQRBWYzySE0Da9LTF74kasH--