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 28D70426D0; Fri, 6 Oct 2023 14:15:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A3A08402A8; Fri, 6 Oct 2023 14:15:03 +0200 (CEST) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by mails.dpdk.org (Postfix) with ESMTP id 0E17E4014F for ; Fri, 6 Oct 2023 14:15:03 +0200 (CEST) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 94F8120474 for ; Fri, 6 Oct 2023 14:15:02 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 88D932027D; Fri, 6 Oct 2023 14:15:02 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on hermod.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=ALL_TRUSTED,AWL autolearn=disabled version=3.4.6 X-Spam-Score: -1.5 Received: from [192.168.1.59] (h-62-63-215-114.A163.priv.bahnhof.se [62.63.215.114]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 3676620473; Fri, 6 Oct 2023 14:15:01 +0200 (CEST) Message-ID: Date: Fri, 6 Oct 2023 14:15:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH] eventdev: ensure 16-byte alignment for events To: Bruce Richardson , dev@dpdk.org Cc: Jerin Jacob References: <20231005115101.12276-1-bruce.richardson@intel.com> Content-Language: en-US From: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= In-Reply-To: <20231005115101.12276-1-bruce.richardson@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP 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 2023-10-05 13:51, Bruce Richardson wrote: > The event structure in DPDK is 16-bytes in size, and events are > regularly passed as parameters directly rather than being passed as > pointers. When are events passed by-value, rather than by-reference? There are no such examples in the public eventdev API. To help compiler optimize correctly, we can explicitly request > 16-byte alignment for events, which means that we should be able > to do aligned vector loads/stores (e.g. with SSE or Neon) when working > with those events. > That change is both helping and sabotaging the optimizer's work. Now every stack allocation needs to be 2-byte aligned - in DPDK code, and in the application. The effect this change has on an eventdev app using DSW is a ~3 cycle/event performance degradation on an AMD Zen 3 system, and a ~4 cycle/event performance degradation on a Skylake-generation Intel CPU. What scenarios do you have in mind, where this change would improve the generated code? Something where there are no unaligned loads available in the ISA, or they are much slower than their aligned counterparts? When I looked into the same issue for the DPDK IP checksumming routines, there basically were no such. Not that I could find. > Signed-off-by: Bruce Richardson > --- > lib/eventdev/rte_eventdev.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h > index 2ba8a7b090..bb0d59b059 100644 > --- a/lib/eventdev/rte_eventdev.h > +++ b/lib/eventdev/rte_eventdev.h > @@ -1344,7 +1344,7 @@ struct rte_event { > struct rte_event_vector *vec; > /**< Event vector pointer. */ > }; > -}; > +} __rte_aligned(16); > > /* Ethdev Rx adapter capability bitmap flags */ > #define RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT 0x1