[v4,34/39] cryptodev: 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/cryptodev/cryptodev_pmd.h | 8 ++++----
lib/cryptodev/rte_cryptodev_core.h | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
@@ -61,7 +61,7 @@ struct rte_cryptodev_pmd_init_params {
* This structure is safe to place in shared memory to be common among
* different processes in a multi-process configuration.
*/
-struct rte_cryptodev_data {
+struct __rte_cache_aligned rte_cryptodev_data {
/** Device ID for this instance */
uint8_t dev_id;
/** Socket ID where memory is allocated */
@@ -82,10 +82,10 @@ struct rte_cryptodev_data {
/** PMD-specific private data */
void *dev_private;
-} __rte_cache_aligned;
+};
/** @internal The data structure associated with each crypto device. */
-struct rte_cryptodev {
+struct __rte_cache_aligned rte_cryptodev {
/** Pointer to PMD dequeue function. */
dequeue_pkt_burst_t dequeue_burst;
/** Pointer to PMD enqueue function. */
@@ -117,7 +117,7 @@ struct rte_cryptodev {
struct rte_cryptodev_cb_rcu *enq_cbs;
/** User application callback for post dequeue processing */
struct rte_cryptodev_cb_rcu *deq_cbs;
-} __rte_cache_aligned;
+};
/** Global structure used for maintaining state of allocated crypto devices */
struct rte_cryptodev_global {
@@ -40,7 +40,7 @@ struct rte_cryptodev_qpdata {
struct rte_cryptodev_cb_rcu *deq_cb;
};
-struct rte_crypto_fp_ops {
+struct __rte_cache_aligned rte_crypto_fp_ops {
/** PMD enqueue burst function. */
enqueue_pkt_burst_t enqueue_burst;
/** PMD dequeue burst function. */
@@ -49,7 +49,7 @@ struct rte_crypto_fp_ops {
struct rte_cryptodev_qpdata qp;
/** Reserved for future ops. */
uintptr_t reserved[3];
-} __rte_cache_aligned;
+};
extern struct rte_crypto_fp_ops rte_crypto_fp_ops[RTE_CRYPTO_MAX_DEVS];