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 6A97C426CE; Fri, 6 Oct 2023 11:45:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EB331402A8; Fri, 6 Oct 2023 11:45:53 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 3C7174014F for ; Fri, 6 Oct 2023 11:45:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696585552; x=1728121552; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+h0rmcu8FqS45F7mPku6PYjEl3/aYDY9bqvgnkOq9hY=; b=gS3VjqlFV/GY71fTsP61G2iqftWMkeAWVFSgGqAcnQ5vXUkPWkMlXOow U56GHtKUKSNBwFkZOQAVo5pxZRt1rCEdUn83KI+28UGUCcBH7cUm30/LC 5Id+nnnPgF2ywOPPF9ypamGkrzAswduw8tu7d2QAQ3Mf8Qdzfdw90EIYS /3Gpi43EvkiTOKCZX/vAbR0SUusUZdDcJ2JWvlLGWIC5VXZB5zIKvRbMn 4mPCCzB0OQd5rDUpXQ4sfAfxe6T/u0yOpSHw/tPS9+pTF3qGqpsgJ8cUa LxikdnpmUwi5LePDesSJYp9duqdra9ZAiNinwkmf2x1Fy/fqeE43V5DUM g==; X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="387598455" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="387598455" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2023 02:45:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="868283437" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="868283437" Received: from silpixa00401385.ir.intel.com ([10.237.214.135]) by fmsmga002.fm.intel.com with ESMTP; 06 Oct 2023 02:45:37 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Jerin Jacob Subject: [PATCH v3] eventdev: ensure 16-byte alignment for events Date: Fri, 6 Oct 2023 10:45:27 +0100 Message-Id: <20231006094527.73867-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 --- v3: Fix spelling mistake in RN entry rebase on latest eventdev tree HEAD v2: added release note entry for ABI change added structure comment on 16-byte size and alignment added static assert for structure size --- 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 0903046b0c..33fed3e433 100644 --- a/doc/guides/rel_notes/release_23_11.rst +++ b/doc/guides/rel_notes/release_23_11.rst @@ -209,6 +209,10 @@ ABI Changes fields, to move ``rxq`` and ``txq`` fields, to change the size of ``reserved1`` and ``reserved2`` fields. +* 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 alignment. + 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