[66/83] compress/octeontx: move alignment attribute on types

Message ID 1710949096-5786-67-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/octeontx/otx_zip.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
  

Patch

diff --git a/drivers/compress/octeontx/otx_zip.h b/drivers/compress/octeontx/otx_zip.h
index 7391360..bb19854 100644
--- a/drivers/compress/octeontx/otx_zip.h
+++ b/drivers/compress/octeontx/otx_zip.h
@@ -106,21 +106,21 @@  typedef int (*comp_func_t)(struct rte_comp_op *op, struct zipvf_qp *qp,
 			   struct zip_stream *zstrm, int num);
 
 /* Scatter gather list */
-struct zipvf_sginfo {
+struct __rte_aligned(16) zipvf_sginfo {
 	union zip_zptr_addr_s  sg_addr;
 	union zip_zptr_ctl_s   sg_ctl;
-} __rte_aligned(16);
+};
 
 /**
  * ZIP private stream structure
  */
-struct zip_stream {
+struct __rte_cache_aligned zip_stream {
 	union zip_inst_s *inst[ZIP_BURST_SIZE];
 	/* zip instruction pointer */
 	comp_func_t func;
 	/* function to process comp operation */
 	void *bufs[MAX_BUFS_PER_STREAM * ZIP_BURST_SIZE];
-} __rte_cache_aligned;
+};
 
 
 /**
@@ -140,7 +140,7 @@  struct zipvf_cmdq {
 /**
  * ZIP device queue structure
  */
-struct zipvf_qp {
+struct __rte_cache_aligned zipvf_qp {
 	struct zipvf_cmdq cmdq;
 	/* Hardware instruction queue structure */
 	struct rte_ring *processed_pkts;
@@ -158,12 +158,12 @@  struct zipvf_qp {
 	/* SGL pointers */
 	uint64_t num_sgbuf;
 	uint64_t enqed;
-} __rte_cache_aligned;
+};
 
 /**
  * ZIP VF device structure.
  */
-struct zip_vf {
+struct __rte_cache_aligned zip_vf {
 	int vfid;
 	/* vf index */
 	struct rte_pci_device *pdev;
@@ -177,7 +177,7 @@  struct zip_vf {
 	struct rte_mempool *zip_mp;
 	struct rte_mempool *sg_mp;
 	/* pointer to pools */
-} __rte_cache_aligned;
+};
 
 
 static inline int