[v2] eventdev: ensure 16-byte alignment for events
Checks
Commit Message
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(-)
@@ -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
------------
@@ -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