From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: "Bruce Richardson" <bruce.richardson@intel.com>,
"Morten Brørup" <mb@smartsharesystems.com>,
"Jerin Jacob" <jerinj@marvell.com>
Subject: [PATCH v2] eventdev: ensure 16-byte alignment for events
Date: Fri, 6 Oct 2023 10:37:33 +0100 [thread overview]
Message-ID: <20231006093733.73420-1-bruce.richardson@intel.com> (raw)
In-Reply-To: <20231005115101.12276-1-bruce.richardson@intel.com>
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 <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
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
next prev parent reply other threads:[~2023-10-06 9:38 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-05 11:51 [RFC PATCH] " Bruce Richardson
2023-10-05 12:06 ` Bruce Richardson
2023-10-05 13:11 ` Jerin Jacob
2023-10-05 13:15 ` Bruce Richardson
2023-10-06 7:19 ` Jerin Jacob
2023-10-05 12:12 ` Morten Brørup
2023-10-05 13:02 ` Bruce Richardson
2023-10-06 9:37 ` Bruce Richardson [this message]
2023-10-06 9:45 ` [PATCH v3] " Bruce Richardson
2023-10-06 10:13 ` Morten Brørup
2023-10-06 10:16 ` Jerin Jacob
2023-10-06 10:19 ` Bruce Richardson
2023-10-06 10:24 ` Jerin Jacob
2023-10-06 10:27 ` Bruce Richardson
2023-10-06 10:16 ` Bruce Richardson
2023-10-06 10:35 ` Morten Brørup
2023-10-06 10:44 ` Bruce Richardson
2023-10-06 10:29 ` [PATCH v4] " Bruce Richardson
2023-11-12 0:01 ` Stephen Hemminger
2023-11-12 8:30 ` Morten Brørup
2023-11-12 23:31 ` Stephen Hemminger
2023-11-13 7:58 ` Morten Brørup
2024-01-19 21:05 ` Tyler Retzlaff
2023-10-06 12:15 ` [RFC PATCH] " Mattias Rönnblom
2023-10-06 12:19 ` Bruce Richardson
2023-10-06 12:29 ` Mattias Rönnblom
2024-01-19 22:30 ` Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231006093733.73420-1-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=mb@smartsharesystems.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).