[v4,33/39] compressdev: use C11 alignas
Checks
Commit Message
* Move __rte_aligned from the end of {struct,union} definitions to
be between {struct,union} and tag.
The placement between {struct,union} and the tag allows the desired
alignment to be imparted on the type regardless of the toolchain being
used for all of GCC, LLVM, MSVC compilers building both C and C++.
* Replace use of __rte_aligned(a) on variables/fields with alignas(a).
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
lib/compressdev/rte_comp.h | 4 ++--
lib/compressdev/rte_compressdev_internal.h | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
@@ -356,7 +356,7 @@ struct rte_comp_xform {
* Comp operations are enqueued and dequeued in comp PMDs using the
* rte_compressdev_enqueue_burst() / rte_compressdev_dequeue_burst() APIs
*/
-struct rte_comp_op {
+struct __rte_cache_aligned rte_comp_op {
enum rte_comp_op_type op_type;
union {
void *private_xform;
@@ -478,7 +478,7 @@ struct rte_comp_op {
* will be set to RTE_COMP_OP_STATUS_SUCCESS after operation
* is successfully processed by a PMD
*/
-} __rte_cache_aligned;
+};
/**
* Creates an operation pool
@@ -69,7 +69,7 @@ typedef uint16_t (*compressdev_enqueue_pkt_burst_t)(void *qp,
struct rte_comp_op **ops, uint16_t nb_ops);
/** The data structure associated with each comp device. */
-struct rte_compressdev {
+struct __rte_cache_aligned rte_compressdev {
compressdev_dequeue_pkt_burst_t dequeue_burst;
/**< Pointer to PMD receive function */
compressdev_enqueue_pkt_burst_t enqueue_burst;
@@ -87,7 +87,7 @@ struct rte_compressdev {
__extension__
uint8_t attached : 1;
/**< Flag indicating the device is attached */
-} __rte_cache_aligned;
+};
/**
*
@@ -96,7 +96,7 @@ struct rte_compressdev {
* This structure is safe to place in shared memory to be common among
* different processes in a multi-process configuration.
*/
-struct rte_compressdev_data {
+struct __rte_cache_aligned rte_compressdev_data {
uint8_t dev_id;
/**< Compress device identifier */
int socket_id;
@@ -115,7 +115,7 @@ struct rte_compressdev_data {
void *dev_private;
/**< PMD-specific private data */
-} __rte_cache_aligned;
+};
#ifdef __cplusplus
}