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 8B4E3426CE; Fri, 6 Oct 2023 11:38:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 21D31402A8; Fri, 6 Oct 2023 11:38:03 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id F205E4014F for ; Fri, 6 Oct 2023 11:38:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696585082; x=1728121082; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SBnN/h8elk84qCCl5geZdL97MnE+So7kda1QNWUUHS4=; b=NsOZgiw9jghIhNmBWvCDLMf8dXUVQM3gMYp6zxldGK6NZX8FJgyjk2AF UQSNAEys7ibwhP3JKvqgOk2J9OAFXYtB/EPEg4zUvYlvcGgg62XAvETOJ aQPrLOwjYQBsdjwOru6MQAmVXclYbus7qeRLKmLmtHwXtKmwZX4pYm3ip S6c8tFqhd0eF0SVV3iTRtuz0OwuEuSsPSnEwfyAvW6pkEfI1s34lFPuB6 bxFdx1Ks3J/8ItJTPPWBbIxQBgIyPsCIRoa/xoaCLlzW8MMyu3WE60SAy FVFxq8PS7gZ60/pn2SHjp1gIuVLXl2zyPPD3okpRM0YJs/B4t+/8lCbCX w==; X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="447904524" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="447904524" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2023 02:37:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="1083384840" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="1083384840" Received: from silpixa00401385.ir.intel.com ([10.237.214.135]) by fmsmga005.fm.intel.com with ESMTP; 06 Oct 2023 02:37:44 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Jerin Jacob Subject: [PATCH v2] eventdev: ensure 16-byte alignment for events Date: Fri, 6 Oct 2023 10:37:33 +0100 Message-Id: <20231006093733.73420-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231005115101.12276-1-bruce.richardson@intel.com> References: <20231005115101.12276-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 The event structure in DPDK is 16-bytes in size, and events are regularly passed as parameters directly rather than being passed as pointers. 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. Signed-off-by: Bruce Richardson Acked-by: Morten Brørup Acked-by: Jerin Jacob --- doc/guides/rel_notes/release_23_11.rst | 4 ++++ lib/eventdev/rte_eventdev.h | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst index 261594aacc..48c19ae52a 100644 --- a/doc/guides/rel_notes/release_23_11.rst +++ b/doc/guides/rel_notes/release_23_11.rst @@ -158,6 +158,10 @@ ABI Changes Also, make sure to start the actual text at the margin. ======================================================= +* The ``rte_event`` structure, used by eventdev library and DPDK "event" class drivers, + is now 16-byte aligned, as well as being 16-bytes in size. + In previous releases, the structure only required 8-byte alignement. + Known Issues ------------ diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h index 2ea98302b8..5b7c5b3399 100644 --- a/lib/eventdev/rte_eventdev.h +++ b/lib/eventdev/rte_eventdev.h @@ -1284,6 +1284,8 @@ struct rte_event_vector { /** * The generic *rte_event* structure to hold the event attributes * for dequeue and enqueue operation + * + * This structure must be kept at 16-bytes in size, and has 16-byte alignment. */ struct rte_event { /** WORD0 */ @@ -1356,7 +1358,9 @@ struct rte_event { struct rte_event_vector *vec; /**< Event vector pointer. */ }; -}; +} __rte_aligned(16); + +_Static_assert(sizeof(struct rte_event) == 16, "Event structure size is not 16-bytes in size"); /* Ethdev Rx adapter capability bitmap flags */ #define RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT 0x1 -- 2.39.2