[64/83] compress/zlib: move alignment attribute on types

Message ID 1710949096-5786-65-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Superseded
Delegated to: David Marchand
Headers
Series move alignment attribute on types |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tyler Retzlaff March 20, 2024, 3:37 p.m. UTC
  Move location of __rte_aligned(a) to new conventional location. The new
placement between {struct,union} and the tag allows the desired
alignment to be imparted on the type regardless of the toolchain being
used for both C and C++. Additionally, it avoids confusion by Doxygen
when generating documentation.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 drivers/compress/zlib/zlib_pmd_private.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
  

Patch

diff --git a/drivers/compress/zlib/zlib_pmd_private.h b/drivers/compress/zlib/zlib_pmd_private.h
index e36c5dc..46a33d4 100644
--- a/drivers/compress/zlib/zlib_pmd_private.h
+++ b/drivers/compress/zlib/zlib_pmd_private.h
@@ -30,7 +30,7 @@  struct zlib_private {
 	struct rte_mempool *mp;
 };
 
-struct zlib_qp {
+struct __rte_cache_aligned zlib_qp {
 	struct rte_ring *processed_pkts;
 	/**< Ring for placing process packets */
 	struct rte_compressdev_stats qp_stats;
@@ -39,7 +39,7 @@  struct zlib_qp {
 	/**< Queue Pair Identifier */
 	char name[RTE_COMPRESSDEV_NAME_MAX_LEN];
 	/**< Unique Queue Pair Name */
-} __rte_cache_aligned;
+};
 
 /* Algorithm handler function prototype */
 typedef void (*comp_func_t)(struct rte_comp_op *op, z_stream *strm);
@@ -47,19 +47,19 @@  struct zlib_qp {
 typedef int (*comp_free_t)(z_stream *strm);
 
 /** ZLIB Stream structure */
-struct zlib_stream {
+struct __rte_cache_aligned zlib_stream {
 	z_stream strm;
 	/**< zlib stream structure */
 	comp_func_t comp;
 	/**< Operation (compression/decompression) */
 	comp_free_t free;
 	/**< Free Operation (compression/decompression) */
-} __rte_cache_aligned;
+};
 
 /** ZLIB private xform structure */
-struct zlib_priv_xform {
+struct __rte_cache_aligned zlib_priv_xform {
 	struct zlib_stream stream;
-} __rte_cache_aligned;
+};
 
 int
 zlib_set_stream_parameters(const struct rte_comp_xform *xform,