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 1324C4550B for ; 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 E4EBE40E09; Thu, 27 Jun 2024 14:52:01 +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: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrtdeggdehhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkjghfggfgtgesthfure dttddtjeenucfhrhhomhepvfhhohhmrghsucfoohhnjhgrlhhonhcuoehthhhomhgrshes mhhonhhjrghlohhnrdhnvghtqeenucggtffrrghtthgvrhhnpeejudevheeiveduuddtve ffgfdtgeekueevjeffjeegtdeggeekgfdvuefgfeekjeenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrd hnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 27 Jun 2024 08:46:17 -0400 (EDT) From: Thomas Monjalon To: Wenwu Ma , fengchengwen , Tyler Retzlaff 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: References: <20240308053711.1260154-1-wenwux.ma@intel.com> <20240320072332.1433526-1-wenwux.ma@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 20/03/2024 10:31, fengchengwen: > Reviewed-by: Chengwen Feng > > 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 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.