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 EDD644550B;
	Thu, 27 Jun 2024 14:52:02 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 1578840E3A;
	Thu, 27 Jun 2024 14:52:02 +0200 (CEST)
Received: from fout6-smtp.messagingengine.com (fout6-smtp.messagingengine.com
 [103.168.172.149])
 by mails.dpdk.org (Postfix) with ESMTP id 91EB440E09;
 Thu, 27 Jun 2024 14:46:19 +0200 (CEST)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailfout.nyi.internal (Postfix) with ESMTP id E95431380545;
 Thu, 27 Jun 2024 08:46:18 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute1.internal (MEProxy); Thu, 27 Jun 2024 08:46:18 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 cc:cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm2; t=1719492378;
 x=1719578778; bh=or3gbEVZvmBCrJeHeqGOHKgm65yl9FCicZs4tGe94q4=; b=
 eD6wM/Cn6lo4mhD16M2trN6EDeA8jceLnJgi2alEV26OPhmm09I8omPlzyGCTmQV
 Yxd2pa+RzRWTNmVg5eIow+zjO9cZ+CssS+s2u4bHqxqr0pKNreWFfOURBJ7zn7lw
 J6FeKZl/dkkPiBQPGHUEoFWV00Fo77nFbQMAQ0pTvK0q9m/iQwMolmJh+/9k5JIw
 BGOKY2rbaDzw3TPkIoMpoP6fcSSzoGl9GNlkofInT6GaYamPReSm3/seSevz9b7A
 kU8ILN7aPWSWszmY0nHFcJ72fz7MEbUqR/8QoJoNf8rcVGjb9TEhESgUciwYeawn
 SK9JPTH9+DIQ/oWsP63WFg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1719492378; x=
 1719578778; bh=or3gbEVZvmBCrJeHeqGOHKgm65yl9FCicZs4tGe94q4=; b=a
 n31vOoA6X10Q06oDF+UKvZf6GTVMmQgb52CWHeRRlCtpy27+PCax+/+DPwtcs87N
 ac07Bk+yi6rKBUSkyAHDxVwthBEsNhKyg8ock/yhX7bnj9XCKWZvAycnhYI+Phof
 s9gJYs9mfSJOYyU6Cf4BIsFh2MhC8d4+XubZoJXlnDgFUz/xwRMemfdMC3rtrs2Q
 YyIYXBGsNjWQAvIwtrG5iP/WYDqOuAwvleU8imFfC0SNqIFzcla2cQDvw3v6Zxwh
 rJqRfGORmRoRyY9ipo1wXwqu7DmTYwra0KlRxxqWzzc3rHn0dheDCmy/CK2oCyPF
 dXvJSNxUehtqv5c5U2h3A==
X-ME-Sender: <xms:Gl99Zlq1F89cnR7T-jyHTxO7w7VHJNR5uz-YO18uAa6jiyNa5IERGw>
 <xme:Gl99Znov9fwsEWyUdhuTDpFunTWB1ybGpcG8EUjB_1hOYMua2OYKQ9vjIPepaqT5J
 pi-3OoSDe9y6A6Vvw>
X-ME-Received: <xmr:Gl99ZiMr5YQT7R6qrCnda27HArDng9ywF_gPQepAn0qnjHqC2jGfRlTlbIJLB3c711hhSBuxR2Kw0CrLvPbZmVfvRw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrtdeggdehhecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkjghfggfgtgesthfure
 dttddtjeenucfhrhhomhepvfhhohhmrghsucfoohhnjhgrlhhonhcuoehthhhomhgrshes
 mhhonhhjrghlohhnrdhnvghtqeenucggtffrrghtthgvrhhnpeejudevheeiveduuddtve
 ffgfdtgeekueevjeffjeegtdeggeekgfdvuefgfeekjeenucevlhhushhtvghrufhiiigv
 pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrd
 hnvght
X-ME-Proxy: <xmx:Gl99Zg48fN2vC8pVpguTqNNwPcosPudCG15-xGwVjwZlZwbkT3BVmg>
 <xmx:Gl99Zk7qBaln1KDvNDmxpYRpdx3v7GcLbQvJpB2iThGUyA-sxX5RaQ>
 <xmx:Gl99Zohz1Wx0Ens942Wxrgmg8ADMo_9_ctJzX4fG7rz25Ik1f_bjTQ>
 <xmx:Gl99Zm7yqwBnn9iIiU8dwQY9RYihQ6uDBCMo9irOaw9_K9gkxVD5BA>
 <xmx:Gl99ZjaMUVqnllLg5QrvmiunvoyeNzZNnC7sV3XTpzbpF3BDRgB_kL8O>
Feedback-ID: i47234305:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 27 Jun 2024 08:46:17 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: Wenwu Ma <wenwux.ma@intel.com>, fengchengwen <fengchengwen@huawei.com>,
 Tyler Retzlaff <roretzla@microsoft.com>
Cc: dev@dpdk.org, stable@dpdk.org, songx.jiale@intel.com,
 david.marchand@redhat.com
Subject: Re: [PATCH v3] dmadev: fix structure alignment
Date: Thu, 27 Jun 2024 14:46:16 +0200
Message-ID: <1835658.eZKxIzzdSt@thomas>
In-Reply-To: <ae2946c0-07f4-00cd-e1df-ef25cb5912fd@huawei.com>
References: <20240308053711.1260154-1-wenwux.ma@intel.com>
 <20240320072332.1433526-1-wenwux.ma@intel.com>
 <ae2946c0-07f4-00cd-e1df-ef25cb5912fd@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="utf-8"
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

20/03/2024 10:31, fengchengwen:
> Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
> 
> On 2024/3/20 15:23, Wenwu Ma wrote:
> > The structure rte_dma_dev needs to be aligned to the cache line, but
> > the return value of malloc may not be aligned to the cache line. When
> > we use memset to clear the rte_dma_dev object, it may cause a segmentation
> > fault in clang-x86-platform.
> > 
> > This is because clang uses the "vmovaps" assembly instruction for
> > memset, which requires that the operands (rte_dma_dev objects) must
> > aligned on a 16-byte boundary or a general-protection exception (#GP)
> > is generated.
> > 
> > Therefore, either additional memory is applied for re-alignment, or the
> > rte_dma_dev object does not require cache line alignment. The patch
> > chooses the former option to fix the issue.
> > 
> > Fixes: b36970f2e13e ("dmadev: introduce DMA device library")
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>

I keep thinking we should have a wrapper for aligned allocations,
with Windows support and fallback to malloc + RTE_PTR_ALIGN.

Probably not a reason to block this patch, so applied, thanks.