DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__
@ 2020-02-10 16:20 Thomas Monjalon
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 01/15] app/bbdev: replace constructor syntax with common macro Thomas Monjalon
                   ` (15 more replies)
  0 siblings, 16 replies; 20+ messages in thread
From: Thomas Monjalon @ 2020-02-10 16:20 UTC (permalink / raw)
  To: dev

Almost all usages of __attribute__ keyword are replaced
by a macro (existing or new) with prefix __rte_.
It makes code more consistent and will help changing
compiler behaviour, or adapting to new compilers,
in a central place.

Kernel and BPF files cannot use macros from rte_common.h.
Some rare attributes are also kept unchanged.


Thomas Monjalon (15):
  app/bbdev: replace constructor syntax with common macro
  net/mlx5: replace destructor syntax with common macro
  net/memif: use common macros for cache line marker
  common/mlx5: replace alignas keyword
  replace alignment attributes
  replace packed attributes
  replace always-inline attributes
  replace no-inline attributes
  replace unused attributes
  replace used attributes
  replace hot attributes
  replace cold attributes
  replace no-return attributes
  replace printf format attributes
  devtools: check use of compiler attributes

 app/test-acl/main.c                           |   2 +-
 app/test-bbdev/main.h                         |   3 +-
 app/test-cmdline/cmdline_test.c               |   4 +-
 app/test-cmdline/commands.c                   |  40 +-
 app/test-crypto-perf/cperf_test_common.c      |   2 +-
 app/test-eventdev/test_order_atq.c            |   2 +-
 app/test-eventdev/test_order_common.h         |   4 +-
 app/test-eventdev/test_order_queue.c          |   2 +-
 app/test-eventdev/test_perf_atq.c             |   4 +-
 app/test-eventdev/test_perf_common.h          |   4 +-
 app/test-eventdev/test_perf_queue.c           |   4 +-
 app/test-pipeline/main.c                      |   2 +-
 app/test-pipeline/pipeline_hash.c             |  10 +-
 app/test-pmd/bpf_cmd.c                        |   8 +-
 app/test-pmd/cmdline.c                        | 832 ++++++++---------
 app/test-pmd/cmdline_mtr.c                    |  56 +-
 app/test-pmd/cmdline_tm.c                     |  88 +-
 app/test-pmd/csumonly.c                       |   2 +-
 app/test-pmd/txonly.c                         |   2 +-
 app/test/commands.c                           |  20 +-
 app/test/test_atomic.c                        |  14 +-
 app/test/test_cmdline_lib.c                   |  18 +-
 app/test/test_efd.c                           |   2 +-
 app/test/test_func_reentrancy.c               |  14 +-
 app/test/test_hash.c                          |   8 +-
 app/test/test_hash_readwrite.c                |   2 +-
 app/test/test_hash_readwrite_lf_perf.c        |   8 +-
 app/test/test_malloc.c                        |   6 +-
 app/test/test_mcslock.c                       |   4 +-
 app/test/test_member.c                        |   2 +-
 app/test/test_mempool.c                       |   6 +-
 app/test/test_mempool_perf.c                  |   2 +-
 app/test/test_per_lcore.c                     |   6 +-
 app/test/test_rwlock.c                        |   4 +-
 app/test/test_spinlock.c                      |   6 +-
 app/test/test_table.c                         |  10 +-
 app/test/test_table.h                         |  10 +-
 app/test/test_table_pipeline.c                |  22 +-
 app/test/test_ticketlock.c                    |   6 +-
 app/test/test_timer.c                         |  10 +-
 app/test/test_timer_racecond.c                |   2 +-
 devtools/checkpatches.sh                      |   8 +
 .../prog_guide/packet_classif_access_ctrl.rst |   2 +-
 doc/guides/sample_app_ug/cmd_line.rst         |   2 +-
 doc/guides/sample_app_ug/flow_classify.rst    |   2 +-
 doc/guides/sample_app_ug/hello_world.rst      |   2 +-
 .../sample_app_ug/l3_forward_power_man.rst    |   2 +-
 .../sample_app_ug/performance_thread.rst      |   2 +-
 doc/guides/sample_app_ug/skeleton.rst         |   2 +-
 doc/guides/sample_app_ug/timer.rst            |   4 +-
 drivers/baseband/fpga_lte_fec/fpga_lte_fec.c  |   6 +-
 drivers/bus/dpaa/base/qbman/qman.c            |   2 +-
 drivers/bus/dpaa/include/fsl_bman.h           |   2 +-
 drivers/bus/dpaa/include/fsl_fman.h           |   2 +-
 drivers/bus/dpaa/include/fsl_qman.h           |   2 +-
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h       |   4 +-
 drivers/bus/ifpga/rte_bus_ifpga.h             |   6 +-
 drivers/common/cpt/cpt_common.h               |   4 -
 drivers/common/cpt/cpt_ucode.h                |   2 +-
 drivers/common/cpt/cpt_ucode_asym.h           |   4 +-
 drivers/common/dpaax/caamflib/compat.h        |   4 +-
 drivers/common/dpaax/compat.h                 |   4 +-
 drivers/common/dpaax/dpaax_iova_table.h       |   2 +-
 drivers/common/iavf/iavf_osdep.h              |   4 +-
 drivers/common/mlx5/mlx5_glue.c               |   4 +-
 drivers/common/mlx5/mlx5_nl.c                 |   2 +-
 drivers/common/octeontx2/otx2_common.h        |   5 -
 drivers/crypto/caam_jr/caam_jr_desc.h         |   4 +-
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c   |   4 +-
 drivers/crypto/octeontx/otx_cryptodev_ops.c   |  18 +-
 drivers/crypto/octeontx2/otx2_cryptodev_ops.c |   8 +-
 drivers/crypto/qat/qat_asym.h                 |   2 +-
 drivers/event/octeontx/ssovf_worker.c         |  16 +-
 drivers/event/octeontx/ssovf_worker.h         |   4 -
 drivers/event/octeontx2/otx2_worker.c         |  28 +-
 drivers/event/octeontx2/otx2_worker_dual.c    |  28 +-
 drivers/mempool/octeontx/octeontx_fpavf.c     |   8 +-
 drivers/mempool/octeontx2/otx2_mempool_ops.c  |   6 +-
 drivers/net/ark/ark_pktchkr.h                 |   4 +-
 drivers/net/ark/ark_pktdir.h                  |   2 +-
 drivers/net/ark/ark_pktgen.h                  |   2 +-
 drivers/net/atlantic/atl_types.h              |   2 +
 drivers/net/atlantic/hw_atl/hw_atl_utils.h    |  60 +-
 .../net/atlantic/hw_atl/hw_atl_utils_fw2x.c   |   4 +-
 drivers/net/avp/rte_avp_common.h              |   6 +-
 drivers/net/bnxt/bnxt.h                       |   4 +-
 drivers/net/bnxt/bnxt_rxtx_vec_sse.c          |   2 +-
 drivers/net/bnxt/hsi_struct_def_dpdk.h        | 854 +++++++++---------
 drivers/net/bonding/rte_eth_bond_8023ad.h     |  16 +-
 drivers/net/bonding/rte_eth_bond_pmd.c        |   4 +-
 drivers/net/dpaa/dpaa_rxtx.h                  |  14 +-
 drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h  |   2 +-
 drivers/net/dpaa2/dpaa2_ethdev.h              |   2 +-
 drivers/net/dpaa2/dpaa2_rxtx.c                |  30 +-
 drivers/net/enetc/enetc_rxtx.c                |   2 +-
 drivers/net/enic/base/vnic_dev.c              |   4 +-
 drivers/net/enic/base/vnic_devcmd.h           |  20 +-
 drivers/net/fm10k/fm10k_ethdev.c              |   4 +-
 drivers/net/fm10k/fm10k_rxtx_vec.c            |  12 +-
 drivers/net/hinic/hinic_pmd_rx.c              |   2 +-
 drivers/net/hns3/hns3_ethdev.c                |   2 +-
 drivers/net/hns3/hns3_ethdev_vf.c             |   4 +-
 drivers/net/hns3/hns3_fdir.c                  |   4 +-
 drivers/net/i40e/base/i40e_osdep.h            |   4 +-
 drivers/net/i40e/i40e_ethdev.c                |  10 +-
 drivers/net/i40e/i40e_rxtx.c                  |  10 +-
 drivers/net/i40e/i40e_rxtx_vec_altivec.c      |   8 +-
 drivers/net/i40e/i40e_rxtx_vec_neon.c         |   8 +-
 drivers/net/i40e/i40e_rxtx_vec_sse.c          |   8 +-
 drivers/net/iavf/iavf_rxtx_vec_sse.c          |  12 +-
 drivers/net/ice/base/ice_osdep.h              |  16 +-
 drivers/net/ice/ice_rxtx.c                    |  10 +-
 drivers/net/ice/ice_rxtx_vec_sse.c            |   8 +-
 drivers/net/ionic/ionic_rxtx.c                |  24 +-
 drivers/net/ixgbe/ixgbe_ethdev.c              |   6 +-
 drivers/net/ixgbe/ixgbe_rxtx.c                |  58 +-
 drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c       |  14 +-
 drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c        |  14 +-
 drivers/net/memif/memif.h                     |   2 +-
 drivers/net/mlx5/mlx5.h                       |   1 -
 drivers/net/mlx5/mlx5_rxtx_vec.c              |   4 +-
 drivers/net/mlx5/mlx5_rxtx_vec_altivec.h      |  16 +-
 drivers/net/mlx5/mlx5_socket.c                |   3 +-
 drivers/net/nfp/nfp_net_pmd.h                 |  10 +-
 drivers/net/octeontx/octeontx_rxtx.c          |   4 +-
 drivers/net/octeontx/octeontx_rxtx.h          |   4 -
 drivers/net/octeontx2/otx2_rx.c               |   6 +-
 drivers/net/octeontx2/otx2_tx.c               |   6 +-
 drivers/net/pfe/base/pfe.h                    |   2 +-
 drivers/net/qede/base/bcm_osal.h              |   2 +-
 drivers/net/qede/qede_filter.c                |   6 +-
 drivers/net/softnic/rte_eth_softnic_cli.c     |  10 +-
 drivers/net/tap/tap_bpf.h                     |   2 +-
 drivers/net/tap/tap_bpf_program.c             |   4 +-
 drivers/net/tap/tap_rss.h                     |   2 +-
 drivers/net/thunderx/base/nicvf_mbox.c        |   2 +-
 drivers/net/thunderx/nicvf_rxtx.c             |  46 +-
 drivers/net/thunderx/nicvf_rxtx.h             |   8 +-
 drivers/net/virtio/virtio_pci.h               |   2 +-
 drivers/net/virtio/virtio_rxtx_simple.c       |   2 +-
 drivers/net/virtio/virtio_user/vhost_user.c   |   2 +-
 drivers/net/virtio/virtqueue.h                |   6 +-
 drivers/raw/dpaa2_qdma/dpaa2_qdma.h           |   2 +-
 drivers/raw/ifpga/base/ifpga_compat.h         |   2 +-
 drivers/raw/ifpga/base/opae_hw_api.h          |   2 +-
 drivers/raw/ioat/rte_ioat_spec.h              |   2 +-
 drivers/vdpa/ifc/base/ifcvf.h                 |   2 +-
 examples/bond/main.c                          |  28 +-
 examples/cmdline/commands.c                   |   8 +-
 examples/cmdline/parse_obj_list.c             |   2 +-
 examples/ethtool/ethtool-app/main.c           |   2 +-
 .../fips_validation/fips_validation_aes.c     |   4 +-
 .../fips_validation/fips_validation_hmac.c    |   4 +-
 .../fips_validation/fips_validation_sha.c     |   4 +-
 .../fips_validation/fips_validation_tdes.c    |   6 +-
 examples/flow_classify/flow_classify.c        |   2 +-
 examples/helloworld/main.c                    |   2 +-
 examples/ip_fragmentation/main.c              |   2 +-
 examples/ip_pipeline/cli.c                    |  10 +-
 examples/ip_reassembly/main.c                 |   2 +-
 examples/ipsec-secgw/ipsec-secgw.c            |   2 +-
 examples/ipsec-secgw/ipsec.h                  |   2 +-
 examples/l2fwd-cat/l2fwd-cat.c                |   2 +-
 examples/l2fwd-jobstats/main.c                |   2 +-
 examples/l2fwd-keepalive/main.c               |   6 +-
 examples/l2fwd/main.c                         |   2 +-
 examples/l3fwd-acl/main.c                     |   2 +-
 examples/l3fwd-power/main.c                   |  18 +-
 examples/l3fwd/l3fwd.h                        |  20 +-
 examples/l3fwd/l3fwd_em.c                     |  14 +-
 examples/l3fwd/l3fwd_lpm.c                    |  10 +-
 examples/link_status_interrupt/main.c         |   2 +-
 .../client_server_mp/mp_server/main.c         |   2 +-
 examples/multi_process/hotplug_mp/commands.c  |  16 +-
 examples/multi_process/simple_mp/main.c       |   2 +-
 .../multi_process/simple_mp/mp_commands.c     |  12 +-
 examples/multi_process/symmetric_mp/main.c    |   2 +-
 examples/ntb/ntb_fwd.c                        |  34 +-
 .../performance-thread/l3fwd-thread/main.c    |  12 +-
 .../performance-thread/pthread_shim/main.c    |   4 +-
 .../pthread_shim/pthread_shim.h               |   2 +-
 examples/ptpclient/ptpclient.c                |  18 +-
 examples/qos_meter/main.c                     |   4 +-
 examples/qos_sched/cmdline.c                  |  46 +-
 examples/qos_sched/main.c                     |   2 +-
 examples/rxtx_callbacks/main.c                |   2 +-
 examples/server_node_efd/server/main.c        |   2 +-
 examples/skeleton/basicfwd.c                  |   2 +-
 examples/timer/main.c                         |  12 +-
 examples/vdpa/main.c                          |  14 +-
 examples/vhost_blk/blk_spec.h                 |   2 +-
 .../guest_cli/vm_power_cli_guest.h            |   2 +-
 examples/vm_power_manager/main.c              |   4 +-
 examples/vm_power_manager/oob_monitor_nop.c   |   8 +-
 examples/vm_power_manager/vm_power_cli.c      |  20 +-
 examples/vm_power_manager/vm_power_cli.h      |   2 +-
 examples/vmdq/main.c                          |   2 +-
 lib/librte_acl/acl_run.h                      |   2 +-
 lib/librte_acl/acl_run_altivec.h              |   2 +-
 lib/librte_acl/acl_run_neon.h                 |   2 +-
 lib/librte_cmdline/cmdline.c                  |   2 +-
 lib/librte_cmdline/cmdline.h                  |   3 +-
 lib/librte_cmdline/cmdline_parse_etheraddr.c  |   4 +-
 lib/librte_cmdline/cmdline_parse_portlist.c   |   4 +-
 lib/librte_eal/common/eal_common_options.c    |   2 +-
 lib/librte_eal/common/eal_private.h           |   2 +-
 lib/librte_eal/common/eal_thread.h            |   2 +-
 .../common/include/arch/arm/rte_vect.h        |   2 +-
 .../common/include/arch/ppc_64/rte_vect.h     |   2 +-
 .../common/include/arch/x86/rte_rtm.h         |   6 +-
 lib/librte_eal/common/include/rte_common.h    |  41 +-
 lib/librte_eal/common/include/rte_debug.h     |   6 +-
 lib/librte_eal/common/include/rte_dev.h       |   8 +-
 lib/librte_eal/common/include/rte_devargs.h   |   2 +-
 .../common/include/rte_function_versioning.h  |   2 +-
 lib/librte_eal/common/include/rte_log.h       |   6 +-
 lib/librte_eal/common/include/rte_memzone.h   |   2 +-
 lib/librte_eal/freebsd/eal/eal.c              |   2 +-
 lib/librte_eal/freebsd/eal/eal_thread.c       |   4 +-
 lib/librte_eal/linux/eal/eal.c                |   2 +-
 lib/librte_eal/linux/eal/eal_interrupts.c     |   2 +-
 lib/librte_eal/linux/eal/eal_log.c            |   2 +-
 lib/librte_eal/linux/eal/eal_thread.c         |   4 +-
 lib/librte_eal/linux/eal/eal_timer.c          |   2 +-
 lib/librte_efd/rte_efd.c                      |   4 +-
 lib/librte_ethdev/rte_ethdev.h                |   2 +-
 lib/librte_hash/rte_thash.h                   |   2 +-
 lib/librte_ip_frag/rte_ip_frag.h              |   2 +-
 lib/librte_ipsec/crypto.h                     |   8 +-
 lib/librte_mbuf/rte_mbuf.c                    |   6 +-
 lib/librte_net/rte_arp.h                      |   4 +-
 lib/librte_net/rte_esp.h                      |   4 +-
 lib/librte_net/rte_ether.h                    |   6 +-
 lib/librte_net/rte_gre.h                      |   2 +-
 lib/librte_net/rte_gtp.h                      |   2 +-
 lib/librte_net/rte_icmp.h                     |   2 +-
 lib/librte_net/rte_ip.h                       |   4 +-
 lib/librte_net/rte_mpls.h                     |   2 +-
 lib/librte_net/rte_sctp.h                     |   2 +-
 lib/librte_net/rte_tcp.h                      |   2 +-
 lib/librte_net/rte_udp.h                      |   2 +-
 lib/librte_net/rte_vxlan.h                    |   4 +-
 lib/librte_pipeline/rte_table_action.c        |  34 +-
 lib/librte_power/power_kvm_vm.c               |  14 +-
 lib/librte_power/rte_power_empty_poll.c       |  18 +-
 lib/librte_sched/rte_sched_common.h           |   2 +-
 lib/librte_vhost/vhost_user.h                 |   2 +-
 247 files changed, 1776 insertions(+), 1758 deletions(-)

-- 
2.25.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-dev] [PATCH 20.05 01/15] app/bbdev: replace constructor syntax with common macro
  2020-02-10 16:20 [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon
@ 2020-02-10 16:20 ` Thomas Monjalon
  2020-02-10 21:06   ` Chautru, Nicolas
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 02/15] net/mlx5: replace destructor " Thomas Monjalon
                   ` (14 subsequent siblings)
  15 siblings, 1 reply; 20+ messages in thread
From: Thomas Monjalon @ 2020-02-10 16:20 UTC (permalink / raw)
  To: dev; +Cc: Nicolas Chautru

There is a macro RTE_INIT for constructors,
which is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 app/test-bbdev/main.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/app/test-bbdev/main.h b/app/test-bbdev/main.h
index 23b4d58a53..836f6d6efd 100644
--- a/app/test-bbdev/main.h
+++ b/app/test-bbdev/main.h
@@ -104,8 +104,7 @@ void add_test_command(struct test_command *t);
 		.command = RTE_STR(name), \
 		.callback = test_func_##name, \
 	}; \
-	static void __attribute__((constructor, used)) \
-	test_register_##name(void) \
+	RTE_INIT(test_register_##name) \
 	{ \
 		add_test_command(&test_struct_##name); \
 	}
-- 
2.25.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-dev] [PATCH 20.05 02/15] net/mlx5: replace destructor syntax with common macro
  2020-02-10 16:20 [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 01/15] app/bbdev: replace constructor syntax with common macro Thomas Monjalon
@ 2020-02-10 16:20 ` Thomas Monjalon
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 03/15] net/memif: use common macros for cache line marker Thomas Monjalon
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 20+ messages in thread
From: Thomas Monjalon @ 2020-02-10 16:20 UTC (permalink / raw)
  To: dev; +Cc: Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko

There is a macro RTE_FINI for destructors,
which is now used where appropriate for consistency.

The destructor function mlx5_pmd_socket_uninit does not need
to be declared separately in mlx5.h.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/net/mlx5/mlx5.h        | 1 -
 drivers/net/mlx5/mlx5_socket.c | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index d7c519bae0..2affcd2ba3 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -764,7 +764,6 @@ void mlx5_mp_uninit_secondary(void);
 /* mlx5_socket.c */
 
 int mlx5_pmd_socket_init(void);
-void mlx5_pmd_socket_uninit(void);
 
 /* mlx5_flow_meter.c */
 
diff --git a/drivers/net/mlx5/mlx5_socket.c b/drivers/net/mlx5/mlx5_socket.c
index cf2b433c00..a79896cb33 100644
--- a/drivers/net/mlx5/mlx5_socket.c
+++ b/drivers/net/mlx5/mlx5_socket.c
@@ -218,8 +218,7 @@ mlx5_pmd_socket_init(void)
 /**
  * Un-Initialize the pmd socket
  */
-void __attribute__((destructor))
-mlx5_pmd_socket_uninit(void)
+RTE_FINI(mlx5_pmd_socket_uninit)
 {
 	if (!server_socket)
 		return;
-- 
2.25.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-dev] [PATCH 20.05 03/15] net/memif: use common macros for cache line marker
  2020-02-10 16:20 [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 01/15] app/bbdev: replace constructor syntax with common macro Thomas Monjalon
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 02/15] net/mlx5: replace destructor " Thomas Monjalon
@ 2020-02-10 16:20 ` Thomas Monjalon
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 04/15] common/mlx5: replace alignas keyword Thomas Monjalon
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 20+ messages in thread
From: Thomas Monjalon @ 2020-02-10 16:20 UTC (permalink / raw)
  To: dev; +Cc: Jakub Grajciar

The macros RTE_MARKER and __rte_cache_aligned can be used
for consistency for describing MEMIF_CACHELINE_ALIGN_MARK.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/net/memif/memif.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/memif/memif.h b/drivers/net/memif/memif.h
index a4d88c044b..b912308904 100644
--- a/drivers/net/memif/memif.h
+++ b/drivers/net/memif/memif.h
@@ -162,7 +162,7 @@ typedef struct __rte_packed {
 } memif_desc_t;
 
 #define MEMIF_CACHELINE_ALIGN_MARK(mark) \
-	uint8_t mark[0] __rte_aligned(RTE_CACHE_LINE_SIZE)
+	RTE_MARKER mark __rte_cache_aligned;
 
 typedef struct {
 	MEMIF_CACHELINE_ALIGN_MARK(cacheline0);
-- 
2.25.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-dev] [PATCH 20.05 04/15] common/mlx5: replace alignas keyword
  2020-02-10 16:20 [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon
                   ` (2 preceding siblings ...)
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 03/15] net/memif: use common macros for cache line marker Thomas Monjalon
@ 2020-02-10 16:20 ` Thomas Monjalon
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 05/15] replace alignment attributes Thomas Monjalon
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 20+ messages in thread
From: Thomas Monjalon @ 2020-02-10 16:20 UTC (permalink / raw)
  To: dev; +Cc: Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko

The keyword alignas can be replaced with __rte_aligned macro
for consistency and allow compilers compatibility control.

The macro __rte_cache_aligned is a shortcut including __rte_aligned
and RTE_CACHE_LINE_SIZE constant.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/common/mlx5/mlx5_glue.c | 4 ++--
 drivers/common/mlx5/mlx5_nl.c   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_glue.c b/drivers/common/mlx5/mlx5_glue.c
index 0af0b86677..428de0ffd9 100644
--- a/drivers/common/mlx5/mlx5_glue.c
+++ b/drivers/common/mlx5/mlx5_glue.c
@@ -1182,8 +1182,8 @@ mlx5_glue_dv_free_var(struct mlx5dv_var *var)
 #endif
 }
 
-alignas(RTE_CACHE_LINE_SIZE)
-const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue){
+__rte_cache_aligned
+const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue) {
 	.version = MLX5_GLUE_VERSION,
 	.fork_init = mlx5_glue_fork_init,
 	.alloc_pd = mlx5_glue_alloc_pd,
diff --git a/drivers/common/mlx5/mlx5_nl.c b/drivers/common/mlx5/mlx5_nl.c
index 549e787b04..d9f0d4129e 100644
--- a/drivers/common/mlx5/mlx5_nl.c
+++ b/drivers/common/mlx5/mlx5_nl.c
@@ -1342,7 +1342,7 @@ mlx5_nl_vlan_vmwa_create(struct mlx5_nl_vlan_vmwa_context *vmwa,
 	struct ifinfomsg *ifm;
 	char name[sizeof(MLX5_VMWA_VLAN_DEVICE_PFX) + 32];
 
-	alignas(RTE_CACHE_LINE_SIZE)
+	__rte_cache_aligned
 	uint8_t buf[NLMSG_ALIGN(sizeof(struct nlmsghdr)) +
 		    NLMSG_ALIGN(sizeof(struct ifinfomsg)) +
 		    NLMSG_ALIGN(sizeof(struct nlattr)) * 8 +
-- 
2.25.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-dev] [PATCH 20.05 05/15] replace alignment attributes
  2020-02-10 16:20 [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon
                   ` (3 preceding siblings ...)
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 04/15] common/mlx5: replace alignas keyword Thomas Monjalon
@ 2020-02-10 16:20 ` Thomas Monjalon
  2020-02-10 19:11   ` David Christensen
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 06/15] replace packed attributes Thomas Monjalon
                   ` (10 subsequent siblings)
  15 siblings, 1 reply; 20+ messages in thread
From: Thomas Monjalon @ 2020-02-10 16:20 UTC (permalink / raw)
  To: dev
  Cc: Hemant Agrawal, Sachin Saxena, Gagandeep Singh, John Griffin,
	Fiona Trahe, Deepak Kumar Jain, Steven Webster, Matt Peters,
	Chas Williams, Wei Hu (Xavier), Min Hu (Connor),
	Yisen Zhuang, Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko,
	Heinrich Kuhn, Jan Gutter, Keith Wiles, Maxime Coquelin,
	Tiwei Bie, Zhihong Wang, Anatoly Burakov, Konstantin Ananyev,
	Jerin Jacob, Gavin Hu, Jan Viktorin, David Christensen,
	Ferruh Yigit, Andrew Rybchenko, Yipeng Wang, Sameh Gobriel,
	Bruce Richardson, Olivier Matz, Cristian Dumitrescu,
	Jasvinder Singh

There is a common macro __rte_aligned for alignment,
which is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/bus/dpaa/base/qbman/qman.c               |  2 +-
 drivers/bus/dpaa/include/fsl_bman.h              |  2 +-
 drivers/bus/dpaa/include/fsl_qman.h              |  2 +-
 drivers/common/dpaax/compat.h                    |  2 +-
 drivers/crypto/caam_jr/caam_jr_desc.h            |  4 ++--
 drivers/crypto/qat/qat_asym.h                    |  2 +-
 drivers/net/avp/rte_avp_common.h                 |  2 +-
 drivers/net/bonding/rte_eth_bond_8023ad.h        | 14 +++++++-------
 drivers/net/hns3/hns3_fdir.c                     |  4 ++--
 drivers/net/mlx5/mlx5_rxtx_vec_altivec.h         | 16 ++++++++--------
 drivers/net/nfp/nfp_net_pmd.h                    |  4 ++--
 drivers/net/tap/tap_bpf.h                        |  2 +-
 drivers/net/virtio/virtqueue.h                   |  2 +-
 examples/multi_process/symmetric_mp/main.c       |  2 +-
 lib/librte_acl/acl_run.h                         |  2 +-
 lib/librte_acl/acl_run_altivec.h                 |  2 +-
 lib/librte_acl/acl_run_neon.h                    |  2 +-
 .../common/include/arch/arm/rte_vect.h           |  2 +-
 .../common/include/arch/ppc_64/rte_vect.h        |  2 +-
 lib/librte_eal/common/include/rte_common.h       |  6 +++---
 lib/librte_ethdev/rte_ethdev.h                   |  2 +-
 lib/librte_hash/rte_thash.h                      |  2 +-
 lib/librte_net/rte_arp.h                         |  4 ++--
 lib/librte_net/rte_ether.h                       |  4 ++--
 lib/librte_pipeline/rte_table_action.c           | 12 ++++++------
 lib/librte_sched/rte_sched_common.h              |  2 +-
 26 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c
index b53eb9e5ee..b596e79c2f 100644
--- a/drivers/bus/dpaa/base/qbman/qman.c
+++ b/drivers/bus/dpaa/base/qbman/qman.c
@@ -94,7 +94,7 @@ struct qman_portal {
 	 * address (6 bits for address shift + 4 bits for the DQRR size).
 	 */
 	struct qm_dqrr_entry shadow_dqrr[QM_DQRR_SIZE]
-		    __attribute__((aligned(1024)));
+		    __rte_aligned(1024);
 #endif
 };
 
diff --git a/drivers/bus/dpaa/include/fsl_bman.h b/drivers/bus/dpaa/include/fsl_bman.h
index 0c74aba449..f9cd972153 100644
--- a/drivers/bus/dpaa/include/fsl_bman.h
+++ b/drivers/bus/dpaa/include/fsl_bman.h
@@ -65,7 +65,7 @@ struct bm_buffer {
 		};
 		u64 opaque;
 	};
-} __attribute__((aligned(8)));
+} __rte_aligned(8);
 static inline u64 bm_buffer_get64(const struct bm_buffer *buf)
 {
 	return buf->addr;
diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h
index 4deea5e75e..1b3342e7e6 100644
--- a/drivers/bus/dpaa/include/fsl_qman.h
+++ b/drivers/bus/dpaa/include/fsl_qman.h
@@ -193,7 +193,7 @@ struct qm_fd {
 		u32 cmd;
 		u32 status;
 	};
-} __attribute__((aligned(8)));
+} __rte_aligned(8);
 #define QM_FD_DD_NULL		0x00
 #define QM_FD_PID_MASK		0x3f
 static inline u64 qm_fd_addr_get64(const struct qm_fd *fd)
diff --git a/drivers/common/dpaax/compat.h b/drivers/common/dpaax/compat.h
index 12c9d99179..5b11c2d927 100644
--- a/drivers/common/dpaax/compat.h
+++ b/drivers/common/dpaax/compat.h
@@ -63,7 +63,7 @@
 #define noinline	__attribute__((noinline))
 #endif
 #define L1_CACHE_BYTES 64
-#define ____cacheline_aligned __attribute__((aligned(L1_CACHE_BYTES)))
+#define ____cacheline_aligned __rte_aligned(L1_CACHE_BYTES)
 #define __stringify_1(x) #x
 #define __stringify(x)	__stringify_1(x)
 
diff --git a/drivers/crypto/caam_jr/caam_jr_desc.h b/drivers/crypto/caam_jr/caam_jr_desc.h
index 6683ea8350..64e0c00bc8 100644
--- a/drivers/crypto/caam_jr/caam_jr_desc.h
+++ b/drivers/crypto/caam_jr/caam_jr_desc.h
@@ -263,7 +263,7 @@ struct load_command_s {
  */
 struct sec_sd_t {
 	uint32_t rsvd[MAX_DESC_SIZE_WORDS];
-} __attribute__((packed, aligned(64)));
+} __attribute__((packed) __rte_aligned(64);
 
 /* Structure encompassing a job descriptor which processes
  * a single packet from a context. The job descriptor references
@@ -280,6 +280,6 @@ struct sec_job_descriptor_t {
 	uint32_t in_ext_length;
 	struct load_command_s load_dpovrd;
 	uint32_t dpovrd;
-} __attribute__((packed, aligned(64)));
+} __attribute__((packed) __rte_aligned(64);
 
 #endif
diff --git a/drivers/crypto/qat/qat_asym.h b/drivers/crypto/qat/qat_asym.h
index 551edc3034..2838aee76f 100644
--- a/drivers/crypto/qat/qat_asym.h
+++ b/drivers/crypto/qat/qat_asym.h
@@ -15,7 +15,7 @@
 typedef uint64_t large_int_ptr;
 #define MAX_PKE_PARAMS	8
 #define QAT_PKE_MAX_LN_SIZE 512
-#define _PKE_ALIGN_ __attribute__((__aligned__(8)))
+#define _PKE_ALIGN_ __rte_aligned(8)
 
 #define QAT_ASYM_MAX_PARAMS			8
 #define QAT_ASYM_MODINV_NUM_IN_PARAMS		2
diff --git a/drivers/net/avp/rte_avp_common.h b/drivers/net/avp/rte_avp_common.h
index 478c01a169..ab7d175083 100644
--- a/drivers/net/avp/rte_avp_common.h
+++ b/drivers/net/avp/rte_avp_common.h
@@ -116,7 +116,7 @@ struct rte_avp_desc {
 	uint32_t pad3;
 	uint16_t vlan_tci; /**< VLAN Tag Control Identifier (CPU order). */
 	uint32_t pad4;
-} __attribute__ ((__aligned__(RTE_CACHE_LINE_SIZE), __packed__));
+} __attribute__ ((__packed__)) __rte_cache_aligned;
 
 
 /**{ AVP device features */
diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bonding/rte_eth_bond_8023ad.h
index 62265f449f..0b5d0a4351 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.h
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.h
@@ -60,7 +60,7 @@ struct slow_protocol {
 struct slow_protocol_frame {
 	struct rte_ether_hdr eth_hdr;
 	struct slow_protocol slow_protocol;
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 struct port_params {
 	uint16_t system_priority;
@@ -73,7 +73,7 @@ struct port_params {
 	/**< Priority of this (unused in current implementation) */
 	uint16_t port_number;
 	/**< Port number. It corresponds to slave port id. */
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 struct lacpdu_actor_partner_params {
 	uint8_t tlv_type_info;
@@ -81,7 +81,7 @@ struct lacpdu_actor_partner_params {
 	struct port_params port_params;
 	uint8_t state;
 	uint8_t reserved_3[3];
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 /** LACPDU structure (5.4.2 in 802.1AX documentation). */
 struct lacpdu {
@@ -99,13 +99,13 @@ struct lacpdu {
 	uint8_t tlv_type_terminator;
 	uint8_t terminator_length;
 	uint8_t reserved_50[50];
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 /** LACPDU frame: Contains ethernet header and LACPDU. */
 struct lacpdu_header {
 	struct rte_ether_hdr eth_hdr;
 	struct lacpdu lacpdu;
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 struct marker {
 	uint8_t subtype;
@@ -121,12 +121,12 @@ struct marker {
 	uint8_t tlv_type_terminator;
 	uint8_t terminator_length;
 	uint8_t reserved_90[90];
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 struct marker_header {
 	struct rte_ether_hdr eth_hdr;
 	struct marker marker;
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 struct rte_eth_bond_8023ad_conf {
 	uint32_t fast_periodic_ms;
diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c
index ca3c78e1ce..a395eb1f83 100644
--- a/drivers/net/hns3/hns3_fdir.c
+++ b/drivers/net/hns3/hns3_fdir.c
@@ -686,8 +686,8 @@ static int hns3_config_key(struct hns3_adapter *hns,
 	struct hns3_fd_key_cfg *key_cfg;
 	uint8_t *cur_key_x;
 	uint8_t *cur_key_y;
-	uint8_t key_x[MAX_KEY_BYTES] __attribute__((aligned(4)));
-	uint8_t key_y[MAX_KEY_BYTES] __attribute__((aligned(4)));
+	uint8_t key_x[MAX_KEY_BYTES] __rte_aligned(4);
+	uint8_t key_y[MAX_KEY_BYTES] __rte_aligned(4);
 	uint8_t vf_id = rule->vf_id;
 	uint8_t meta_data_region;
 	uint8_t tuple_size;
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
index aa43cab084..8e8d59ae83 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
@@ -732,13 +732,13 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
 		/* A.1 load cqes. */
 		p3 = (unsigned int)((vector unsigned short)p)[3];
 		cqes[3] = (vector unsigned char)(vector unsigned long){
-			*(__attribute__((__aligned__(8))) unsigned long *)
+			*(__rte_aligned(8) unsigned long *)
 			&cq[pos + p3].sop_drop_qpn, 0LL};
 		rte_compiler_barrier();
 
 		p2 = (unsigned int)((vector unsigned short)p)[2];
 		cqes[2] = (vector unsigned char)(vector unsigned long){
-			*(__attribute__((__aligned__(8))) unsigned long *)
+			*(__rte_aligned(8) unsigned long *)
 			&cq[pos + p2].sop_drop_qpn, 0LL};
 		rte_compiler_barrier();
 
@@ -751,12 +751,12 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
 		/* A.1 load a block having op_own. */
 		p1 = (unsigned int)((vector unsigned short)p)[1];
 		cqes[1] = (vector unsigned char)(vector unsigned long){
-			*(__attribute__((__aligned__(8))) unsigned long *)
+			*(__rte_aligned(8) unsigned long *)
 			&cq[pos + p1].sop_drop_qpn, 0LL};
 		rte_compiler_barrier();
 
 		cqes[0] = (vector unsigned char)(vector unsigned long){
-			*(__attribute__((__aligned__(8))) unsigned long *)
+			*(__rte_aligned(8) unsigned long *)
 			&cq[pos].sop_drop_qpn, 0LL};
 		rte_compiler_barrier();
 
@@ -783,10 +783,10 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
 			vec_sel((vector unsigned short)cqes[2],
 			(vector unsigned short)cqe_tmp1, cqe_sel_mask1);
 		cqe_tmp2 = (vector unsigned char)(vector unsigned long){
-			*(__attribute__((__aligned__(8))) unsigned long *)
+			*(__rte_aligned(8) unsigned long *)
 			&cq[pos + p3].rsvd3[9], 0LL};
 		cqe_tmp1 = (vector unsigned char)(vector unsigned long){
-			*(__attribute__((__aligned__(8))) unsigned long *)
+			*(__rte_aligned(8) unsigned long *)
 			&cq[pos + p2].rsvd3[9], 0LL};
 		cqes[3] = (vector unsigned char)
 			vec_sel((vector unsigned short)cqes[3],
@@ -846,10 +846,10 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
 			vec_sel((vector unsigned short)cqes[0],
 			(vector unsigned short)cqe_tmp1, cqe_sel_mask1);
 		cqe_tmp2 = (vector unsigned char)(vector unsigned long){
-			*(__attribute__((__aligned__(8))) unsigned long *)
+			*(__rte_aligned(8) unsigned long *)
 			&cq[pos + p1].rsvd3[9], 0LL};
 		cqe_tmp1 = (vector unsigned char)(vector unsigned long){
-			*(__attribute__((__aligned__(8))) unsigned long *)
+			*(__rte_aligned(8) unsigned long *)
 			&cq[pos].rsvd3[9], 0LL};
 		cqes[1] = (vector unsigned char)
 			vec_sel((vector unsigned short)cqes[1],
diff --git a/drivers/net/nfp/nfp_net_pmd.h b/drivers/net/nfp/nfp_net_pmd.h
index cc1055c49a..f0142e1ff7 100644
--- a/drivers/net/nfp/nfp_net_pmd.h
+++ b/drivers/net/nfp/nfp_net_pmd.h
@@ -243,7 +243,7 @@ struct nfp_net_txq {
 	int qidx;
 	int tx_qcidx;
 	__le64 dma;
-} __attribute__ ((__aligned__(64)));
+} __rte_aligned(64);
 
 /* RX and freelist descriptor format */
 #define PCIE_DESC_RX_DD                 (1 << 7)
@@ -374,7 +374,7 @@ struct nfp_net_rxq {
 	int qidx;
 	int fl_qcidx;
 	int rx_qcidx;
-} __attribute__ ((__aligned__(64)));
+} __rte_aligned(64);
 
 struct nfp_net_hw {
 	/* Info from the firmware */
diff --git a/drivers/net/tap/tap_bpf.h b/drivers/net/tap/tap_bpf.h
index 9192686a6a..f0b9fc7a2c 100644
--- a/drivers/net/tap/tap_bpf.h
+++ b/drivers/net/tap/tap_bpf.h
@@ -84,7 +84,7 @@ union bpf_attr {
 		__u32		kern_version;
 		__u32		prog_flags;
 	};
-} __attribute__((aligned(8)));
+} __rte_aligned(8);
 
 #ifndef __NR_bpf
 # if defined(__i386__)
diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index 58ad7309ae..d8cf5d4e2f 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -325,7 +325,7 @@ struct virtio_net_hdr_mrg_rxbuf {
 struct virtio_tx_region {
 	struct virtio_net_hdr_mrg_rxbuf tx_hdr;
 	struct vring_desc tx_indir[VIRTIO_MAX_TX_INDIRECT]
-		__attribute__((__aligned__(16)));
+		__rte_aligned(16);
 };
 
 static inline int
diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 7f491452a7..522f211c0f 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -66,7 +66,7 @@ struct port_stats{
 	unsigned rx;
 	unsigned tx;
 	unsigned drop;
-} __attribute__((aligned(RTE_CACHE_LINE_SIZE / 2)));
+} __rte_aligned(RTE_CACHE_LINE_SIZE / 2);
 
 static int proc_id = -1;
 static unsigned num_procs = 0;
diff --git a/lib/librte_acl/acl_run.h b/lib/librte_acl/acl_run.h
index bf7842d879..7d215de9d6 100644
--- a/lib/librte_acl/acl_run.h
+++ b/lib/librte_acl/acl_run.h
@@ -60,7 +60,7 @@ struct completion {
 	int32_t   priority[RTE_ACL_MAX_CATEGORIES]; /* running priorities. */
 	uint32_t  count;                            /* num of remaining tries */
 	/* true for allocated struct */
-} __attribute__((aligned(XMM_SIZE)));
+} __rte_aligned(XMM_SIZE);
 
 /*
  * One parms structure for each slot in the search engine.
diff --git a/lib/librte_acl/acl_run_altivec.h b/lib/librte_acl/acl_run_altivec.h
index b57f08ac92..2de6f27b1f 100644
--- a/lib/librte_acl/acl_run_altivec.h
+++ b/lib/librte_acl/acl_run_altivec.h
@@ -11,7 +11,7 @@ struct _altivec_acl_const {
 	rte_xmm_t xmm_index_mask;
 	rte_xmm_t xmm_ones_16;
 	rte_xmm_t range_base;
-} altivec_acl_const  __attribute__((aligned(RTE_CACHE_LINE_SIZE))) = {
+} altivec_acl_const __rte_cache_aligned = {
 	{
 		.u32 = {0x00000000, 0x04040404, 0x08080808, 0x0c0c0c0c}
 	},
diff --git a/lib/librte_acl/acl_run_neon.h b/lib/librte_acl/acl_run_neon.h
index b3196cd120..69d1b6d9e1 100644
--- a/lib/librte_acl/acl_run_neon.h
+++ b/lib/librte_acl/acl_run_neon.h
@@ -9,7 +9,7 @@ struct _neon_acl_const {
 	rte_xmm_t xmm_shuffle_input;
 	rte_xmm_t xmm_index_mask;
 	rte_xmm_t range_base;
-} neon_acl_const  __attribute__((aligned(RTE_CACHE_LINE_SIZE))) = {
+} neon_acl_const __rte_cache_aligned = {
 	{
 		.u32 = {0x00000000, 0x04040404, 0x08080808, 0x0c0c0c0c}
 	},
diff --git a/lib/librte_eal/common/include/arch/arm/rte_vect.h b/lib/librte_eal/common/include/arch/arm/rte_vect.h
index 2a18a68546..2696caaf6d 100644
--- a/lib/librte_eal/common/include/arch/arm/rte_vect.h
+++ b/lib/librte_eal/common/include/arch/arm/rte_vect.h
@@ -26,7 +26,7 @@ typedef union rte_xmm {
 	uint32_t u32[XMM_SIZE / sizeof(uint32_t)];
 	uint64_t u64[XMM_SIZE / sizeof(uint64_t)];
 	double   pd[XMM_SIZE / sizeof(double)];
-} __attribute__((aligned(16))) rte_xmm_t;
+} __rte_aligned(16) rte_xmm_t;
 
 #ifdef RTE_ARCH_ARM
 /* NEON intrinsic vqtbl1q_u8() is not supported in ARMv7-A(AArch32) */
diff --git a/lib/librte_eal/common/include/arch/ppc_64/rte_vect.h b/lib/librte_eal/common/include/arch/ppc_64/rte_vect.h
index 068c805b22..a0dabf02eb 100644
--- a/lib/librte_eal/common/include/arch/ppc_64/rte_vect.h
+++ b/lib/librte_eal/common/include/arch/ppc_64/rte_vect.h
@@ -25,7 +25,7 @@ typedef union rte_xmm {
 	uint32_t u32[XMM_SIZE / sizeof(uint32_t)];
 	uint64_t u64[XMM_SIZE / sizeof(uint64_t)];
 	double   pd[XMM_SIZE / sizeof(double)];
-} __attribute__((aligned(16))) rte_xmm_t;
+} __rte_aligned(16) rte_xmm_t;
 
 #ifdef __cplusplus
 }
diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index 4b5f3a31f0..1677a0147a 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -49,9 +49,9 @@ extern "C" {
 #endif
 
 #ifdef RTE_ARCH_STRICT_ALIGN
-typedef uint64_t unaligned_uint64_t __attribute__ ((aligned(1)));
-typedef uint32_t unaligned_uint32_t __attribute__ ((aligned(1)));
-typedef uint16_t unaligned_uint16_t __attribute__ ((aligned(1)));
+typedef uint64_t unaligned_uint64_t __rte_aligned(1);
+typedef uint32_t unaligned_uint32_t __rte_aligned(1);
+typedef uint16_t unaligned_uint16_t __rte_aligned(1);
 #else
 typedef uint64_t unaligned_uint64_t;
 typedef uint32_t unaligned_uint32_t;
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d1a593ad11..e9e3a16995 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -310,7 +310,7 @@ struct rte_eth_link {
 	uint16_t link_duplex  : 1;  /**< ETH_LINK_[HALF/FULL]_DUPLEX */
 	uint16_t link_autoneg : 1;  /**< ETH_LINK_[AUTONEG/FIXED] */
 	uint16_t link_status  : 1;  /**< ETH_LINK_[DOWN/UP] */
-} __attribute__((aligned(8)));      /**< aligned for atomic64 read/write */
+} __rte_aligned(8);      /**< aligned for atomic64 read/write */
 
 /* Utility constants */
 #define ETH_LINK_HALF_DUPLEX 0 /**< Half-duplex connection (see link_duplex). */
diff --git a/lib/librte_hash/rte_thash.h b/lib/librte_hash/rte_thash.h
index b4aaabe3d8..51b5129468 100644
--- a/lib/librte_hash/rte_thash.h
+++ b/lib/librte_hash/rte_thash.h
@@ -107,7 +107,7 @@ union rte_thash_tuple {
 	struct rte_ipv4_tuple	v4;
 	struct rte_ipv6_tuple	v6;
 #ifdef RTE_ARCH_X86
-} __attribute__((aligned(XMM_SIZE)));
+} __rte_aligned(XMM_SIZE);
 #else
 };
 #endif
diff --git a/lib/librte_net/rte_arp.h b/lib/librte_net/rte_arp.h
index fabd686243..79a764fc85 100644
--- a/lib/librte_net/rte_arp.h
+++ b/lib/librte_net/rte_arp.h
@@ -26,7 +26,7 @@ struct rte_arp_ipv4 {
 	uint32_t          arp_sip;  /**< sender IP address */
 	struct rte_ether_addr arp_tha;  /**< target hardware address */
 	uint32_t          arp_tip;  /**< target IP address */
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 /**
  * ARP header.
@@ -47,7 +47,7 @@ struct rte_arp_hdr {
 #define	RTE_ARP_OP_INVREPLY   9 /* response identifying peer */
 
 	struct rte_arp_ipv4 arp_data;
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 /**
  * @warning
diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
index e069dc7fe0..850c0fa387 100644
--- a/lib/librte_net/rte_ether.h
+++ b/lib/librte_net/rte_ether.h
@@ -59,7 +59,7 @@ extern "C" {
  */
 struct rte_ether_addr {
 	uint8_t addr_bytes[RTE_ETHER_ADDR_LEN]; /**< Addr bytes in tx order */
-} __attribute__((aligned(2)));
+} __rte_aligned(2);
 
 #define RTE_ETHER_LOCAL_ADMIN_ADDR 0x02 /**< Locally assigned Eth. address. */
 #define RTE_ETHER_GROUP_ADDR  0x01 /**< Multicast or broadcast Eth. address. */
@@ -273,7 +273,7 @@ struct rte_ether_hdr {
 	struct rte_ether_addr d_addr; /**< Destination address. */
 	struct rte_ether_addr s_addr; /**< Source address. */
 	uint16_t ether_type;      /**< Frame type. */
-} __attribute__((aligned(2)));
+} __rte_aligned(2);
 
 /**
  * Ethernet VLAN Header.
diff --git a/lib/librte_pipeline/rte_table_action.c b/lib/librte_pipeline/rte_table_action.c
index 9ce98f2ceb..e6af23b688 100644
--- a/lib/librte_pipeline/rte_table_action.c
+++ b/lib/librte_pipeline/rte_table_action.c
@@ -471,7 +471,7 @@ struct encap_mpls_data {
 	struct rte_ether_hdr ether;
 	uint32_t mpls[RTE_TABLE_ACTION_MPLS_LABELS_MAX];
 	uint32_t mpls_count;
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 #define PPP_PROTOCOL_IP                                    0x0021
 
@@ -494,7 +494,7 @@ struct encap_vxlan_ipv4_data {
 	struct rte_ipv4_hdr ipv4;
 	struct rte_udp_hdr udp;
 	struct rte_vxlan_hdr vxlan;
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 struct encap_vxlan_ipv4_vlan_data {
 	struct rte_ether_hdr ether;
@@ -502,14 +502,14 @@ struct encap_vxlan_ipv4_vlan_data {
 	struct rte_ipv4_hdr ipv4;
 	struct rte_udp_hdr udp;
 	struct rte_vxlan_hdr vxlan;
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 struct encap_vxlan_ipv6_data {
 	struct rte_ether_hdr ether;
 	struct rte_ipv6_hdr ipv6;
 	struct rte_udp_hdr udp;
 	struct rte_vxlan_hdr vxlan;
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 struct encap_vxlan_ipv6_vlan_data {
 	struct rte_ether_hdr ether;
@@ -517,14 +517,14 @@ struct encap_vxlan_ipv6_vlan_data {
 	struct rte_ipv6_hdr ipv6;
 	struct rte_udp_hdr udp;
 	struct rte_vxlan_hdr vxlan;
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 struct encap_qinq_pppoe_data {
 	struct rte_ether_hdr ether;
 	struct rte_vlan_hdr svlan;
 	struct rte_vlan_hdr cvlan;
 	struct pppoe_ppp_hdr pppoe_ppp;
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 static size_t
 encap_data_size(struct rte_table_action_encap_config *encap)
diff --git a/lib/librte_sched/rte_sched_common.h b/lib/librte_sched/rte_sched_common.h
index b58282de88..96706df7bd 100644
--- a/lib/librte_sched/rte_sched_common.h
+++ b/lib/librte_sched/rte_sched_common.h
@@ -12,7 +12,7 @@ extern "C" {
 #include <stdint.h>
 #include <sys/types.h>
 
-#define __rte_aligned_16 __attribute__((__aligned__(16)))
+#define __rte_aligned_16 __rte_aligned(16)
 
 #if 0
 static inline uint32_t
-- 
2.25.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-dev] [PATCH 20.05 06/15] replace packed attributes
  2020-02-10 16:20 [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon
                   ` (4 preceding siblings ...)
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 05/15] replace alignment attributes Thomas Monjalon
@ 2020-02-10 16:20 ` Thomas Monjalon
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 07/15] replace always-inline attributes Thomas Monjalon
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 20+ messages in thread
From: Thomas Monjalon @ 2020-02-10 16:20 UTC (permalink / raw)
  To: dev
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, Byron Marohn,
	Yipeng Wang, Sameh Gobriel, Bruce Richardson, Konstantin Ananyev,
	John McNamara, Marko Kovacevic, Nicolas Chautru, Hemant Agrawal,
	Sachin Saxena, Rosen Xu, Gagandeep Singh, Harman Kalra,
	Shepard Siegel, Ed Czeck, John Miller, Igor Russkikh,
	Pavel Belous, Steven Webster, Matt Peters, Ajit Khaparde,
	Somnath Kotur, Chas Williams, John Daley, Hyong Youb Kim,
	Beilei Xing, Qi Zhang, Qiming Yang, Heinrich Kuhn, Jan Gutter,
	Jasvinder Singh, Cristian Dumitrescu, Keith Wiles,
	Maxime Coquelin, Tiwei Bie, Zhihong Wang, Nipun Gupta,
	Tianfei zhang, Xiao Wang, Ori Kam, Radu Nicolau, Akhil Goyal,
	Tomasz Kantecki, Sunil Kumar Kori, Pavan Nikhilesh, David Hunt,
	Kirill Rybalchenko, Harry van Haaren, Xiaoyun Li,
	Anatoly Burakov, Vladimir Medvedkin, Olivier Matz

There is a common macro __rte_packed for packing structs,
which is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 app/test-pmd/csumonly.c                       |   2 +-
 app/test/test_efd.c                           |   2 +-
 app/test/test_hash.c                          |   2 +-
 app/test/test_member.c                        |   2 +-
 .../prog_guide/packet_classif_access_ctrl.rst |   2 +-
 drivers/baseband/fpga_lte_fec/fpga_lte_fec.c  |   6 +-
 drivers/bus/dpaa/include/fsl_fman.h           |   2 +-
 drivers/bus/ifpga/rte_bus_ifpga.h             |   6 +-
 drivers/common/iavf/iavf_osdep.h              |   4 +-
 drivers/crypto/caam_jr/caam_jr_desc.h         |   4 +-
 drivers/mempool/octeontx/octeontx_fpavf.c     |   8 +-
 drivers/net/ark/ark_pktchkr.h                 |   4 +-
 drivers/net/ark/ark_pktdir.h                  |   2 +-
 drivers/net/ark/ark_pktgen.h                  |   2 +-
 drivers/net/atlantic/atl_types.h              |   2 +
 drivers/net/atlantic/hw_atl/hw_atl_utils.h    |  60 +-
 .../net/atlantic/hw_atl/hw_atl_utils_fw2x.c   |   4 +-
 drivers/net/avp/rte_avp_common.h              |   6 +-
 drivers/net/bnxt/bnxt.h                       |   4 +-
 drivers/net/bnxt/hsi_struct_def_dpdk.h        | 854 +++++++++---------
 drivers/net/bonding/rte_eth_bond_8023ad.h     |  16 +-
 drivers/net/dpaa/dpaa_rxtx.h                  |  14 +-
 drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h  |   2 +-
 drivers/net/enic/base/vnic_devcmd.h           |  20 +-
 drivers/net/i40e/base/i40e_osdep.h            |   4 +-
 drivers/net/ice/base/ice_osdep.h              |   6 +-
 drivers/net/nfp/nfp_net_pmd.h                 |   6 +-
 drivers/net/softnic/rte_eth_softnic_cli.c     |  10 +-
 drivers/net/tap/tap_bpf_program.c             |   4 +-
 drivers/net/tap/tap_rss.h                     |   2 +-
 drivers/net/virtio/virtio_pci.h               |   2 +-
 drivers/net/virtio/virtio_user/vhost_user.c   |   2 +-
 drivers/net/virtio/virtqueue.h                |   4 +-
 drivers/raw/dpaa2_qdma/dpaa2_qdma.h           |   2 +-
 drivers/raw/ifpga/base/opae_hw_api.h          |   2 +-
 drivers/raw/ioat/rte_ioat_spec.h              |   2 +-
 drivers/vdpa/ifc/base/ifcvf.h                 |   2 +-
 examples/ip_pipeline/cli.c                    |  10 +-
 examples/ipsec-secgw/ipsec.h                  |   2 +-
 examples/l3fwd-power/main.c                   |   4 +-
 examples/l3fwd/l3fwd_em.c                     |   4 +-
 .../performance-thread/l3fwd-thread/main.c    |   4 +-
 examples/ptpclient/ptpclient.c                |  16 +-
 examples/vhost_blk/blk_spec.h                 |   2 +-
 lib/librte_eal/common/eal_private.h           |   2 +-
 lib/librte_eal/common/include/rte_memzone.h   |   2 +-
 lib/librte_efd/rte_efd.c                      |   4 +-
 lib/librte_ip_frag/rte_ip_frag.h              |   2 +-
 lib/librte_ipsec/crypto.h                     |   8 +-
 lib/librte_net/rte_arp.h                      |   4 +-
 lib/librte_net/rte_esp.h                      |   4 +-
 lib/librte_net/rte_ether.h                    |   2 +-
 lib/librte_net/rte_gre.h                      |   2 +-
 lib/librte_net/rte_gtp.h                      |   2 +-
 lib/librte_net/rte_icmp.h                     |   2 +-
 lib/librte_net/rte_ip.h                       |   4 +-
 lib/librte_net/rte_mpls.h                     |   2 +-
 lib/librte_net/rte_sctp.h                     |   2 +-
 lib/librte_net/rte_tcp.h                      |   2 +-
 lib/librte_net/rte_udp.h                      |   2 +-
 lib/librte_net/rte_vxlan.h                    |   4 +-
 lib/librte_pipeline/rte_table_action.c        |  34 +-
 lib/librte_vhost/vhost_user.h                 |   2 +-
 63 files changed, 604 insertions(+), 602 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 25091de881..fe19615b14 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -86,7 +86,7 @@ struct testpmd_offload_info {
 struct simple_gre_hdr {
 	uint16_t flags;
 	uint16_t proto;
-} __attribute__((__packed__));
+} __rte_packed;
 
 static uint16_t
 get_udptcp_checksum(void *l3_hdr, void *l4_hdr, uint16_t ethertype)
diff --git a/app/test/test_efd.c b/app/test/test_efd.c
index a779a71f2d..e3e5e30ea6 100644
--- a/app/test/test_efd.c
+++ b/app/test/test_efd.c
@@ -30,7 +30,7 @@ struct flow_key {
 	uint16_t port_src;
 	uint16_t port_dst;
 	uint8_t proto;
-} __attribute__((packed));
+} __rte_packed;
 
 int efd_logtype_test;
 
diff --git a/app/test/test_hash.c b/app/test/test_hash.c
index fbd5725c68..ade473d5d4 100644
--- a/app/test/test_hash.c
+++ b/app/test/test_hash.c
@@ -67,7 +67,7 @@ struct flow_key {
 	uint16_t port_src;
 	uint16_t port_dst;
 	uint8_t proto;
-} __attribute__((packed));
+} __rte_packed;
 
 int hash_logtype_test;
 
diff --git a/app/test/test_member.c b/app/test/test_member.c
index 748ddcc266..40aa4c8627 100644
--- a/app/test/test_member.c
+++ b/app/test/test_member.c
@@ -25,7 +25,7 @@ struct flow_key {
 	uint16_t port_src;
 	uint16_t port_dst;
 	uint8_t proto;
-} __attribute__((packed));
+} __rte_packed;
 
 /* Set ID Macros for multimatch test usage */
 #define M_MATCH_S 1	/* Not start with 0 since by default 0 means no match */
diff --git a/doc/guides/prog_guide/packet_classif_access_ctrl.rst b/doc/guides/prog_guide/packet_classif_access_ctrl.rst
index 2945eacf55..0345512b9e 100644
--- a/doc/guides/prog_guide/packet_classif_access_ctrl.rst
+++ b/doc/guides/prog_guide/packet_classif_access_ctrl.rst
@@ -161,7 +161,7 @@ To define classification for the IPv6 2-tuple: <protocol, IPv6 source address> o
         uint8_t hop_limits;    /* Hop limits. */
         uint8_t src_addr[16];  /* IP address of source host. */
         uint8_t dst_addr[16];  /* IP address of destination host(s). */
-    } __attribute__((__packed__));
+    } __rte_packed;
 
 The following array of field definitions can be used:
 
diff --git a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c
index 8bd10b401a..abc5a1bf6e 100644
--- a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c
+++ b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c
@@ -114,7 +114,7 @@ enum {
 };
 
 /* FPGA LTE FEC DMA Encoding Request Descriptor */
-struct __attribute__((__packed__)) fpga_dma_enc_desc {
+struct __rte_packed fpga_dma_enc_desc {
 	uint32_t done:1,
 		rsrvd0:11,
 		error:4,
@@ -151,7 +151,7 @@ struct __attribute__((__packed__)) fpga_dma_enc_desc {
 };
 
 /* FPGA LTE FEC DMA Decoding Request Descriptor */
-struct __attribute__((__packed__)) fpga_dma_dec_desc {
+struct __rte_packed fpga_dma_dec_desc {
 	uint32_t done:1,
 		iter:5,
 		rsrvd0:2,
@@ -197,7 +197,7 @@ union fpga_dma_desc {
 };
 
 /* FPGA LTE FEC Ring Control Register */
-struct __attribute__((__packed__)) fpga_ring_ctrl_reg {
+struct __rte_packed fpga_ring_ctrl_reg {
 	uint64_t ring_base_addr;
 	uint64_t ring_head_addr;
 	uint16_t ring_size:11;
diff --git a/drivers/bus/dpaa/include/fsl_fman.h b/drivers/bus/dpaa/include/fsl_fman.h
index 1d1ce86719..5705ebfdce 100644
--- a/drivers/bus/dpaa/include/fsl_fman.h
+++ b/drivers/bus/dpaa/include/fsl_fman.h
@@ -40,7 +40,7 @@ struct fm_status_t {
 	unsigned int phe:1; /* Header Error during parsing */
 	unsigned int frdr:1; /* Frame Dropped by disabled port */
 	unsigned int reserved5:4;
-} __attribute__ ((__packed__));
+} __rte_packed;
 
 /* Set MAC address for a particular interface */
 int fman_if_add_mac_addr(struct fman_if *p, uint8_t *eth, uint8_t addr_num);
diff --git a/drivers/bus/ifpga/rte_bus_ifpga.h b/drivers/bus/ifpga/rte_bus_ifpga.h
index 88a6289642..9d6659ae37 100644
--- a/drivers/bus/ifpga/rte_bus_ifpga.h
+++ b/drivers/bus/ifpga/rte_bus_ifpga.h
@@ -36,7 +36,7 @@ TAILQ_HEAD(ifpga_afu_drv_list, rte_afu_driver);
 struct rte_afu_uuid {
 	uint64_t uuid_low;
 	uint64_t uuid_high;
-} __attribute__ ((packed));
+} __rte_packed;
 
 #define IFPGA_BUS_DEV_PORT_MAX 4
 
@@ -47,7 +47,7 @@ struct rte_afu_uuid {
 struct rte_afu_id {
 	struct rte_afu_uuid uuid;
 	int      port; /**< port number */
-} __attribute__ ((packed));
+} __rte_packed;
 
 /**
  * A structure PR (Partial Reconfiguration) configuration AFU driver.
@@ -81,7 +81,7 @@ struct rte_afu_device {
 	struct rte_intr_handle intr_handle;     /**< Interrupt handle */
 	struct rte_afu_driver *driver;          /**< Associated driver */
 	char path[IFPGA_BUS_BITSTREAM_PATH_MAX_LEN];
-} __attribute__ ((packed));
+} __rte_packed;
 
 /**
  * @internal
diff --git a/drivers/common/iavf/iavf_osdep.h b/drivers/common/iavf/iavf_osdep.h
index 0bf040d639..011b19336e 100644
--- a/drivers/common/iavf/iavf_osdep.h
+++ b/drivers/common/iavf/iavf_osdep.h
@@ -149,12 +149,12 @@ struct iavf_dma_mem {
 	u64 pa;
 	u32 size;
 	const void *zone;
-} __attribute__((packed));
+} __rte_packed;
 
 struct iavf_virt_mem {
 	void *va;
 	u32 size;
-} __attribute__((packed));
+} __rte_packed;
 
 /* SW spinlock */
 struct iavf_spinlock {
diff --git a/drivers/crypto/caam_jr/caam_jr_desc.h b/drivers/crypto/caam_jr/caam_jr_desc.h
index 64e0c00bc8..135d51c392 100644
--- a/drivers/crypto/caam_jr/caam_jr_desc.h
+++ b/drivers/crypto/caam_jr/caam_jr_desc.h
@@ -263,7 +263,7 @@ struct load_command_s {
  */
 struct sec_sd_t {
 	uint32_t rsvd[MAX_DESC_SIZE_WORDS];
-} __attribute__((packed) __rte_aligned(64);
+} __rte_packed __rte_aligned(64);
 
 /* Structure encompassing a job descriptor which processes
  * a single packet from a context. The job descriptor references
@@ -280,6 +280,6 @@ struct sec_job_descriptor_t {
 	uint32_t in_ext_length;
 	struct load_command_s load_dpovrd;
 	uint32_t dpovrd;
-} __attribute__((packed) __rte_aligned(64);
+} __rte_packed __rte_aligned(64);
 
 #endif
diff --git a/drivers/mempool/octeontx/octeontx_fpavf.c b/drivers/mempool/octeontx/octeontx_fpavf.c
index 63f8fb3b50..0ff234913d 100644
--- a/drivers/mempool/octeontx/octeontx_fpavf.c
+++ b/drivers/mempool/octeontx/octeontx_fpavf.c
@@ -46,20 +46,20 @@ struct octeontx_mbox_fpa_cfg {
 	uint64_t	aura_cfg;
 };
 
-struct __attribute__((__packed__)) gen_req {
+struct __rte_packed gen_req {
 	uint32_t	value;
 };
 
-struct __attribute__((__packed__)) idn_req {
+struct __rte_packed idn_req {
 	uint8_t	domain_id;
 };
 
-struct __attribute__((__packed__)) gen_resp {
+struct __rte_packed gen_resp {
 	uint16_t	domain_id;
 	uint16_t	vfid;
 };
 
-struct __attribute__((__packed__)) dcfg_resp {
+struct __rte_packed dcfg_resp {
 	uint8_t	sso_count;
 	uint8_t	ssow_count;
 	uint8_t	fpa_count;
diff --git a/drivers/net/ark/ark_pktchkr.h b/drivers/net/ark/ark_pktchkr.h
index a50f428bf1..b362281776 100644
--- a/drivers/net/ark/ark_pktchkr.h
+++ b/drivers/net/ark/ark_pktchkr.h
@@ -37,7 +37,7 @@ struct ark_pkt_chkr_stat_regs {
 	uint32_t pkts_missing;
 	uint32_t min_latency;
 	uint32_t max_latency;
-} __attribute__ ((packed));
+} __rte_packed;
 
 struct ark_pkt_chkr_ctl_regs {
 	uint32_t pkt_ctrl;
@@ -53,7 +53,7 @@ struct ark_pkt_chkr_ctl_regs {
 	uint32_t dst_mac_addr_h;
 	uint32_t eth_type;
 	uint32_t hdr_dw[7];
-} __attribute__ ((packed));
+} __rte_packed;
 
 struct ark_pkt_chkr_inst {
 	struct rte_eth_dev_info *dev_info;
diff --git a/drivers/net/ark/ark_pktdir.h b/drivers/net/ark/ark_pktdir.h
index 314e6dea9d..4afd128f95 100644
--- a/drivers/net/ark/ark_pktdir.h
+++ b/drivers/net/ark/ark_pktdir.h
@@ -26,7 +26,7 @@ struct ark_pkt_dir_regs {
 	uint32_t ctrl;
 	uint32_t status;
 	uint32_t stall_cnt;
-} __attribute__ ((packed));
+} __rte_packed;
 
 struct ark_pkt_dir_inst {
 	volatile struct ark_pkt_dir_regs *regs;
diff --git a/drivers/net/ark/ark_pktgen.h b/drivers/net/ark/ark_pktgen.h
index 0e5f76aa28..c61dfee6db 100644
--- a/drivers/net/ark/ark_pktgen.h
+++ b/drivers/net/ark/ark_pktgen.h
@@ -41,7 +41,7 @@ struct ark_pkt_gen_regs {
 	uint32_t hdr_dw[7];
 	uint32_t start_offset;
 	uint32_t bytes_per_cycle;
-} __attribute__ ((packed));
+} __rte_packed;
 
 struct ark_pkt_gen_inst {
 	struct rte_eth_dev_info *dev_info;
diff --git a/drivers/net/atlantic/atl_types.h b/drivers/net/atlantic/atl_types.h
index c200a1fadb..e813d9f326 100644
--- a/drivers/net/atlantic/atl_types.h
+++ b/drivers/net/atlantic/atl_types.h
@@ -12,6 +12,8 @@
 #include <netinet/in.h>
 #include <pthread.h>
 
+#include <rte_common.h>
+
 typedef uint8_t		u8;
 typedef int8_t		s8;
 typedef uint16_t	u16;
diff --git a/drivers/net/atlantic/hw_atl/hw_atl_utils.h b/drivers/net/atlantic/hw_atl/hw_atl_utils.h
index 81caffaedf..d8fab010cf 100644
--- a/drivers/net/atlantic/hw_atl/hw_atl_utils.h
+++ b/drivers/net/atlantic/hw_atl/hw_atl_utils.h
@@ -27,10 +27,10 @@ struct hw_atl_txd_s {
 			u32 ct_idx:1;
 			u32 ct_en:1;
 			u32 pay_len:18;
-		} __attribute__((__packed__));
+		} __rte_packed;
 		u64 flags;
 	};
-} __attribute__((__packed__));
+} __rte_packed;
 
 /* Hardware tx context descriptor */
 union hw_atl_txc_s {
@@ -51,8 +51,8 @@ union hw_atl_txc_s {
 		u32 l3_len:9;
 		u32 l4_len:8;
 		u32 mss_len:16;
-	} __attribute__((__packed__));
-} __attribute__((__packed__));
+	} __rte_packed;
+} __rte_packed;
 
 enum aq_tx_desc_type {
 	tx_desc_type_desc = 1,
@@ -73,7 +73,7 @@ enum aq_tx_desc_cmd {
 struct hw_atl_rxd_s {
 	u64 buf_addr;
 	u64 hdr_addr;
-} __attribute__((__packed__));
+} __rte_packed;
 
 /* Hardware rx descriptor writeback */
 struct hw_atl_rxd_wb_s {
@@ -89,7 +89,7 @@ struct hw_atl_rxd_wb_s {
 	u16 pkt_len;
 	u16 next_desc_ptr;
 	u16 vlan;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct hw_atl_stats_s {
 	u32 uprc;
@@ -107,7 +107,7 @@ struct hw_atl_stats_s {
 	u32 ubrc;
 	u32 ubtc;
 	u32 dpc;
-} __attribute__((__packed__));
+} __rte_packed;
 
 union ip_addr {
 	struct {
@@ -117,7 +117,7 @@ union ip_addr {
 		u8 padding[12];
 		u8 addr[4];
 	} v4;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct hw_aq_atl_utils_fw_rpc {
 	u32 msg_id;
@@ -226,13 +226,13 @@ struct hw_aq_atl_utils_fw_rpc {
 		} msg_del_id;
 
 	};
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct hw_aq_atl_utils_mbox_header {
 	u32 version;
 	u32 transaction_id;
 	u32 error;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct hw_aq_info {
 	u8 reserved[6];
@@ -244,13 +244,13 @@ struct hw_aq_info {
 	u8 reserved2[32];
 	u32 caps_lo;
 	u32 caps_hi;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct hw_aq_atl_utils_mbox {
 	struct hw_aq_atl_utils_mbox_header header;
 	struct hw_atl_stats_s stats;
 	struct hw_aq_info info;
-} __attribute__((__packed__));
+} __rte_packed;
 
 /* fw2x */
 typedef u16	in_port_t;
@@ -261,7 +261,7 @@ typedef u32	fw_offset_t;
 
 struct ip6_addr {
 	u32 addr[4];
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct offload_ka_v4 {
 	u32 timeout;
@@ -273,7 +273,7 @@ struct offload_ka_v4 {
 	u32 ack_num;
 	ip4_addr_t local_ip;
 	ip4_addr_t remote_ip;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct offload_ka_v6 {
 	u32 timeout;
@@ -285,7 +285,7 @@ struct offload_ka_v6 {
 	u32 ack_num;
 	struct ip6_addr local_ip;
 	struct ip6_addr remote_ip;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct offload_ip_info {
 	u8 v4_local_addr_count;
@@ -296,14 +296,14 @@ struct offload_ip_info {
 	fw_offset_t v4_prefix;
 	fw_offset_t v6_addr;
 	fw_offset_t v6_prefix;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct offload_port_info {
 	u16 udp_port_count;
 	u16 tcp_port_count;
 	fw_offset_t udp_port;
 	fw_offset_t tcp_port;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct offload_ka_info {
 	u16 v4_ka_count;
@@ -312,14 +312,14 @@ struct offload_ka_info {
 	u32 retry_interval;
 	fw_offset_t v4_ka;
 	fw_offset_t v6_ka;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct offload_rr_info {
 	u32 rr_count;
 	u32 rr_buf_len;
 	fw_offset_t rr_id_x;
 	fw_offset_t rr_buf;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct offload_info {
 	u32 version;		// current version is 0x00000000
@@ -335,14 +335,14 @@ struct offload_info {
 	struct offload_ka_info kas;
 	struct offload_rr_info rrs;
 	u8 buf[0];
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct smbus_request {
 	u32 msg_id; /* not used */
 	u32 device_id;
 	u32 address;
 	u32 length;
-} __attribute__((__packed__));
+} __rte_packed;
 
 enum macsec_msg_type {
 	macsec_cfg_msg = 0,
@@ -358,7 +358,7 @@ struct macsec_cfg {
 	uint32_t egress_threshold;
 	uint32_t ingress_threshold;
 	uint32_t interrupts_enabled;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct add_rx_sc {
 	uint32_t index;
@@ -376,7 +376,7 @@ struct add_rx_sc {
 	uint32_t anti_replay_window; /* default 0 */
 	/* 1: auto_rollover enabled (when SA next_pn is saturated */
 	uint32_t an_rol;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct add_tx_sc {
 	uint32_t index;
@@ -391,26 +391,26 @@ struct add_tx_sc {
 	uint32_t da_mask; /* 0: ignore mac_da */
 	uint32_t protect;
 	uint32_t curr_an; /* SA index which currently used */
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct add_rx_sa {
 	uint32_t index;
 	uint32_t next_pn;
 	uint32_t key[4]; /* 128 bit key */
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct add_tx_sa {
 	uint32_t index;
 	uint32_t next_pn;
 	uint32_t key[4]; /* 128 bit key */
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct get_stats {
 	uint32_t version_only;
 	uint32_t ingress_sa_index;
 	uint32_t egress_sa_index;
 	uint32_t egress_sc_index;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct macsec_stats {
 	uint32_t api_version;
@@ -471,7 +471,7 @@ struct macsec_stats {
 	uint32_t ingress_threshold_expired;
 	uint32_t egress_expired;
 	uint32_t ingress_expired;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct macsec_msg_fw_request {
 	uint32_t offset; /* not used */
@@ -485,12 +485,12 @@ struct macsec_msg_fw_request {
 		struct add_tx_sa txsa;
 		struct get_stats stats;
 	};
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct macsec_msg_fw_response {
 	uint32_t result;
 	struct macsec_stats stats;
-} __attribute__((__packed__));
+} __rte_packed;
 
 #define HAL_ATLANTIC_UTILS_CHIP_MIPS         0x00000001U
 #define HAL_ATLANTIC_UTILS_CHIP_TPO2         0x00000002U
diff --git a/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c b/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c
index 55dc728d32..3a7faf405c 100644
--- a/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c
+++ b/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c
@@ -40,7 +40,7 @@
 struct fw2x_msg_wol_pattern {
 	u8 mask[16];
 	u32 crc;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct fw2x_msg_wol {
 	u32 msg_id;
@@ -53,7 +53,7 @@ struct fw2x_msg_wol {
 	u16 reserved;
 	u32 link_up_timeout;
 	u32 link_down_timeout;
-} __attribute__((__packed__));
+} __rte_packed;
 
 static int aq_fw2x_set_link_speed(struct aq_hw_s *self, u32 speed);
 static int aq_fw2x_set_state(struct aq_hw_s *self,
diff --git a/drivers/net/avp/rte_avp_common.h b/drivers/net/avp/rte_avp_common.h
index ab7d175083..4e82ec0b81 100644
--- a/drivers/net/avp/rte_avp_common.h
+++ b/drivers/net/avp/rte_avp_common.h
@@ -69,7 +69,7 @@ struct rte_avp_device_config {
 	uint16_t num_tx_queues;	/**< Number of active transmit queues */
 	uint16_t num_rx_queues;	/**< Number of active receive queues */
 	uint8_t if_up; /**< 1: interface up, 0: interface down */
-} __attribute__ ((__packed__));
+} __rte_packed;
 
 /*
  * Structure for AVP request.
@@ -83,7 +83,7 @@ struct rte_avp_request {
 	struct rte_avp_device_config config; /**< Queue configuration */
 	};
 	int32_t result;	/**< Result for processing request */
-} __attribute__ ((__packed__));
+} __rte_packed;
 
 /*
  * FIFO struct mapped in a shared memory. It describes a circular buffer FIFO
@@ -116,7 +116,7 @@ struct rte_avp_desc {
 	uint32_t pad3;
 	uint16_t vlan_tci; /**< VLAN Tag Control Identifier (CPU order). */
 	uint32_t pad4;
-} __attribute__ ((__packed__)) __rte_cache_aligned;
+} __rte_packed __rte_cache_aligned;
 
 
 /**{ AVP device features */
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 68786a89bf..dfdf8556b2 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -188,13 +188,13 @@ enum bnxt_hw_context {
 struct bnxt_vlan_table_entry {
 	uint16_t		tpid;
 	uint16_t		vid;
-} __attribute__((packed));
+} __rte_packed;
 
 struct bnxt_vlan_antispoof_table_entry {
 	uint16_t		tpid;
 	uint16_t		vid;
 	uint16_t		mask;
-} __attribute__((packed));
+} __rte_packed;
 
 struct bnxt_child_vf_info {
 	void			*req_buf;
diff --git a/drivers/net/bnxt/hsi_struct_def_dpdk.h b/drivers/net/bnxt/hsi_struct_def_dpdk.h
index c2bae0f675..e5fd5d109d 100644
--- a/drivers/net/bnxt/hsi_struct_def_dpdk.h
+++ b/drivers/net/bnxt/hsi_struct_def_dpdk.h
@@ -39,7 +39,7 @@ struct hwrm_cmd_hdr {
 	 * point to a physically contiguous block of memory.
 	 */
 	uint64_t	resp_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* This is the HWRM response header. */
 /* hwrm_resp_hdr (size:64b/8B) */
@@ -52,7 +52,7 @@ struct hwrm_resp_hdr {
 	uint16_t	seq_id;
 	/* The length of the response data in number of bytes. */
 	uint16_t	resp_len;
-} __attribute__((packed));
+} __rte_packed;
 
 /*
  * TLV encapsulated message. Use the TLV type field of the
@@ -147,7 +147,7 @@ struct tlv {
 	 * and it must be an integer multiple of 8B.
 	 */
 	uint16_t	length;
-} __attribute__((packed));
+} __rte_packed;
 
 /* Input */
 /* input (size:128b/16B) */
@@ -180,7 +180,7 @@ struct input {
 	 * and must be cleared to zero before the request is made.
 	 */
 	uint64_t	resp_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* Output */
 /* output (size:64b/8B) */
@@ -203,7 +203,7 @@ struct output {
 	 * memory.
 	 */
 	uint16_t	resp_len;
-} __attribute__((packed));
+} __rte_packed;
 
 /* Short Command Structure */
 /* hwrm_short_input (size:128b/16B) */
@@ -239,7 +239,7 @@ struct hwrm_short_input {
 	 * This area must be 16B aligned.
 	 */
 	uint64_t	req_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /*
  * Command numbering
@@ -679,7 +679,7 @@ struct cmd_nums {
 	#define HWRM_NVM_RAW_WRITE_BLK                    UINT32_C(0xffff)
 	#define HWRM_LAST                                HWRM_NVM_RAW_WRITE_BLK
 	uint16_t	unused_0[3];
-} __attribute__((packed));
+} __rte_packed;
 
 /* Return Codes */
 /* ret_codes (size:64b/8B) */
@@ -785,7 +785,7 @@ struct ret_codes {
 	#define HWRM_ERR_CODE_LAST \
 		HWRM_ERR_CODE_CMD_NOT_SUPPORTED
 	uint16_t	unused_0[3];
-} __attribute__((packed));
+} __rte_packed;
 
 /* Output */
 /* hwrm_err_output (size:128b/16B) */
@@ -825,7 +825,7 @@ struct hwrm_err_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 /*
  * Following is the signature for HWRM message field that indicates not
  * applicable (All F's). Need to cast it the size of the field if needed.
@@ -923,7 +923,7 @@ struct hwrm_ver_get_input {
 	 */
 	uint8_t	hwrm_intf_upd;
 	uint8_t	unused_0[5];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_ver_get_output (size:1408b/176B) */
 struct hwrm_ver_get_output {
@@ -1398,7 +1398,7 @@ struct hwrm_ver_get_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /* bd_base (size:64b/8B) */
 struct bd_base {
@@ -1444,7 +1444,7 @@ struct bd_base {
 	#define BD_BASE_TYPE_TX_BD_LONG_INLINE  UINT32_C(0x11)
 	#define BD_BASE_TYPE_LAST              BD_BASE_TYPE_TX_BD_LONG_INLINE
 	uint8_t	unused_1[7];
-} __attribute__((packed));
+} __rte_packed;
 
 /* tx_bd_short (size:128b/16B) */
 struct tx_bd_short {
@@ -1553,7 +1553,7 @@ struct tx_bd_short {
 	 * This value must be valid on all BDs of a packet.
 	 */
 	uint64_t	address;
-} __attribute__((packed));
+} __rte_packed;
 
 /* tx_bd_long (size:128b/16B) */
 struct tx_bd_long {
@@ -1660,7 +1660,7 @@ struct tx_bd_long {
 	 * This value must be valid on all BDs of a packet.
 	 */
 	uint64_t	address;
-} __attribute__((packed));
+} __rte_packed;
 
 /* Last 16 bytes of tx_bd_long. */
 /* tx_bd_long_hi (size:128b/16B) */
@@ -1850,7 +1850,7 @@ struct tx_bd_long_hi {
 	#define TX_BD_LONG_CFA_META_KEY_VLAN_TAG        (UINT32_C(0x1) << 28)
 	#define TX_BD_LONG_CFA_META_KEY_LAST \
 		TX_BD_LONG_CFA_META_KEY_VLAN_TAG
-} __attribute__((packed));
+} __rte_packed;
 
 /*
  * This structure is used to inform the NIC of packet data that needs to be
@@ -2063,7 +2063,7 @@ struct tx_bd_long_inline {
 		(UINT32_C(0x1) << 28)
 	#define TX_BD_LONG_INLINE_CFA_META_KEY_LAST \
 		TX_BD_LONG_INLINE_CFA_META_KEY_VLAN_TAG
-} __attribute__((packed));
+} __rte_packed;
 
 /* tx_bd_empty (size:128b/16B) */
 struct tx_bd_empty {
@@ -2081,7 +2081,7 @@ struct tx_bd_empty {
 	uint8_t	unused_2;
 	uint8_t	unused_3[3];
 	uint8_t	unused_4[8];
-} __attribute__((packed));
+} __rte_packed;
 
 /* rx_prod_pkt_bd (size:128b/16B) */
 struct rx_prod_pkt_bd {
@@ -2139,7 +2139,7 @@ struct rx_prod_pkt_bd {
 	 * be placed in host memory.
 	 */
 	uint64_t	address;
-} __attribute__((packed));
+} __rte_packed;
 
 /* rx_prod_bfr_bd (size:128b/16B) */
 struct rx_prod_bfr_bd {
@@ -2168,7 +2168,7 @@ struct rx_prod_bfr_bd {
 	 * be placed in host memory.
 	 */
 	uint64_t	address;
-} __attribute__((packed));
+} __rte_packed;
 
 /* rx_prod_agg_bd (size:128b/16B) */
 struct rx_prod_agg_bd {
@@ -2207,7 +2207,7 @@ struct rx_prod_agg_bd {
 	 * be placed in host memory.
 	 */
 	uint64_t	address;
-} __attribute__((packed));
+} __rte_packed;
 
 /* cmpl_base (size:128b/16B) */
 struct cmpl_base {
@@ -2292,7 +2292,7 @@ struct cmpl_base {
 	#define CMPL_BASE_INFO3_SFT 1
 	/* info4 is 32 b */
 	uint32_t	info4;
-} __attribute__((packed));
+} __rte_packed;
 
 /* tx_cmpl (size:128b/16B) */
 struct tx_cmpl {
@@ -2391,7 +2391,7 @@ struct tx_cmpl {
 	uint16_t	unused_1;
 	/* unused3 is 32 b */
 	uint32_t	unused_2;
-} __attribute__((packed));
+} __rte_packed;
 
 /* rx_pkt_cmpl (size:128b/16B) */
 struct rx_pkt_cmpl {
@@ -2589,7 +2589,7 @@ struct rx_pkt_cmpl {
 	 * based on the mode bits and key value in the VNIC.
 	 */
 	uint32_t	rss_hash;
-} __attribute__((packed));
+} __rte_packed;
 
 /* Last 16 bytes of rx_pkt_cmpl. */
 /* rx_pkt_cmpl_hi (size:128b/16B) */
@@ -2935,7 +2935,7 @@ struct rx_pkt_cmpl_hi {
 	 */
 	#define RX_PKT_CMPL_REORDER_MASK UINT32_C(0xffffff)
 	#define RX_PKT_CMPL_REORDER_SFT 0
-} __attribute__((packed));
+} __rte_packed;
 
 /*
  * This TPA completion structure is used on devices where the
@@ -3100,7 +3100,7 @@ struct rx_tpa_start_cmpl {
 	 * based on the mode bits and key value in the VNIC.
 	 */
 	uint32_t	rss_hash;
-} __attribute__((packed));
+} __rte_packed;
 
 /*
  * Last 16 bytes of rx_tpa_start_cmpl.
@@ -3217,7 +3217,7 @@ struct rx_tpa_start_cmpl_hi {
 	 */
 	#define RX_TPA_START_CMPL_INNER_L4_SIZE_MASK  UINT32_C(0xf8000000)
 	#define RX_TPA_START_CMPL_INNER_L4_SIZE_SFT   27
-} __attribute__((packed));
+} __rte_packed;
 
 /*
  * This TPA completion structure is used on devices where the
@@ -3374,7 +3374,7 @@ struct rx_tpa_end_cmpl {
 	 *     option is present in the packet.
 	 */
 	uint32_t	tsdelta;
-} __attribute__((packed));
+} __rte_packed;
 
 /*
  * Last 16 bytes of rx_tpa_end_cmpl.
@@ -3450,7 +3450,7 @@ struct rx_tpa_end_cmpl_hi {
 	 * completion that corresponds to this TPA end completion.
 	 */
 	uint32_t	start_opaque;
-} __attribute__((packed));
+} __rte_packed;
 
 /*
  * This TPA completion structure is used on devices where the
@@ -3621,7 +3621,7 @@ struct rx_tpa_v2_start_cmpl {
 	 * based on the mode bits and key value in the VNIC.
 	 */
 	uint32_t	rss_hash;
-} __attribute__((packed));
+} __rte_packed;
 
 /*
  * Last 16 bytes of rx_tpa_v2_start_cmpl.
@@ -3836,7 +3836,7 @@ struct rx_tpa_v2_start_cmpl_hi {
 	 */
 	#define RX_TPA_V2_START_CMPL_INNER_L4_SIZE_MASK  UINT32_C(0xf8000000)
 	#define RX_TPA_V2_START_CMPL_INNER_L4_SIZE_SFT   27
-} __attribute__((packed));
+} __rte_packed;
 
 /*
  * This TPA completion structure is used on devices where the
@@ -3967,7 +3967,7 @@ struct rx_tpa_v2_end_cmpl {
 	 *     option is present in the packet.
 	 */
 	uint32_t	tsdelta;
-} __attribute__((packed));
+} __rte_packed;
 
 /*
  * Last 16 bytes of rx_tpa_v2_end_cmpl.
@@ -4077,7 +4077,7 @@ struct rx_tpa_v2_end_cmpl_hi {
 	 * completion that corresponds to this TPA end completion.
 	 */
 	uint32_t	start_opaque;
-} __attribute__((packed));
+} __rte_packed;
 
 /*
  * This TPA completion structure is used on devices where the
@@ -4131,7 +4131,7 @@ struct rx_tpa_v2_abuf_cmpl {
 	 */
 	uint16_t	agg_id;
 	uint32_t	unused_1;
-} __attribute__((packed));
+} __rte_packed;
 
 /* rx_abuf_cmpl (size:128b/16B) */
 struct rx_abuf_cmpl {
@@ -4175,7 +4175,7 @@ struct rx_abuf_cmpl {
 	#define RX_ABUF_CMPL_V     UINT32_C(0x1)
 	/* unused3 is 32 b */
 	uint32_t	unused_2;
-} __attribute__((packed));
+} __rte_packed;
 
 /* eject_cmpl (size:128b/16B) */
 struct eject_cmpl {
@@ -4257,7 +4257,7 @@ struct eject_cmpl {
 	uint16_t	reserved16;
 	/* unused3 is 32 b */
 	uint32_t	unused_2;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cmpl (size:128b/16B) */
 struct hwrm_cmpl {
@@ -4290,7 +4290,7 @@ struct hwrm_cmpl {
 	#define HWRM_CMPL_V     UINT32_C(0x1)
 	/* unused4 is 32 b */
 	uint32_t	unused_3;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_fwd_req_cmpl (size:128b/16B) */
 struct hwrm_fwd_req_cmpl {
@@ -4339,7 +4339,7 @@ struct hwrm_fwd_req_cmpl {
 	/* Address of forwarded request. */
 	#define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_MASK UINT32_C(0xfffffffe)
 	#define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_SFT 1
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_fwd_resp_cmpl (size:128b/16B) */
 struct hwrm_fwd_resp_cmpl {
@@ -4380,7 +4380,7 @@ struct hwrm_fwd_resp_cmpl {
 	/* Address of forwarded request. */
 	#define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_MASK UINT32_C(0xfffffffe)
 	#define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_SFT 1
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl (size:128b/16B) */
 struct hwrm_async_event_cmpl {
@@ -4550,7 +4550,7 @@ struct hwrm_async_event_cmpl {
 	uint16_t	timestamp_hi;
 	/* Event specific data */
 	uint32_t	event_data1;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_link_status_change (size:128b/16B) */
 struct hwrm_async_event_cmpl_link_status_change {
@@ -4629,7 +4629,7 @@ struct hwrm_async_event_cmpl_link_status_change {
 		UINT32_C(0xff00000)
 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PF_ID_SFT \
 		20
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_link_mtu_change (size:128b/16B) */
 struct hwrm_async_event_cmpl_link_mtu_change {
@@ -4679,7 +4679,7 @@ struct hwrm_async_event_cmpl_link_mtu_change {
 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_MASK \
 		UINT32_C(0xffff)
 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_SFT 0
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_link_speed_change (size:128b/16B) */
 struct hwrm_async_event_cmpl_link_speed_change {
@@ -4774,7 +4774,7 @@ struct hwrm_async_event_cmpl_link_speed_change {
 		UINT32_C(0xffff0000)
 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_SFT \
 		16
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_dcb_config_change (size:128b/16B) */
 struct hwrm_async_event_cmpl_dcb_config_change {
@@ -4855,7 +4855,7 @@ struct hwrm_async_event_cmpl_dcb_config_change {
 		(UINT32_C(0xff) << 24)
 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_LAST \
 		HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_NONE
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_port_conn_not_allowed (size:128b/16B) */
 struct hwrm_async_event_cmpl_port_conn_not_allowed {
@@ -4931,7 +4931,7 @@ struct hwrm_async_event_cmpl_port_conn_not_allowed {
 		(UINT32_C(0x3) << 16)
 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_LAST \
 		HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_PWRDOWN
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_link_speed_cfg_not_allowed (size:128b/16B) */
 struct hwrm_async_event_cmpl_link_speed_cfg_not_allowed {
@@ -4984,7 +4984,7 @@ struct hwrm_async_event_cmpl_link_speed_cfg_not_allowed {
 		UINT32_C(0xffff)
 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT \
 		0
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_link_speed_cfg_change (size:128b/16B) */
 struct hwrm_async_event_cmpl_link_speed_cfg_change {
@@ -5053,7 +5053,7 @@ struct hwrm_async_event_cmpl_link_speed_cfg_change {
 	 */
 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_ILLEGAL_LINK_SPEED_CFG \
 		UINT32_C(0x20000)
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_port_phy_cfg_change (size:128b/16B) */
 struct hwrm_async_event_cmpl_port_phy_cfg_change {
@@ -5129,7 +5129,7 @@ struct hwrm_async_event_cmpl_port_phy_cfg_change {
 	 */
 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PAUSE_CFG_CHANGE \
 		UINT32_C(0x40000)
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_reset_notify (size:128b/16B) */
 struct hwrm_async_event_cmpl_reset_notify {
@@ -5229,7 +5229,7 @@ struct hwrm_async_event_cmpl_reset_notify {
 		UINT32_C(0xffff0000)
 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DELAY_IN_100MS_TICKS_SFT \
 		16
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_error_recovery (size:128b/16B) */
 struct hwrm_async_event_cmpl_error_recovery {
@@ -5298,7 +5298,7 @@ struct hwrm_async_event_cmpl_error_recovery {
 	 */
 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_RECOVERY_ENABLED \
 		UINT32_C(0x2)
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_func_drvr_unload (size:128b/16B) */
 struct hwrm_async_event_cmpl_func_drvr_unload {
@@ -5349,7 +5349,7 @@ struct hwrm_async_event_cmpl_func_drvr_unload {
 		UINT32_C(0xffff)
 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT \
 		0
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_func_drvr_load (size:128b/16B) */
 struct hwrm_async_event_cmpl_func_drvr_load {
@@ -5398,7 +5398,7 @@ struct hwrm_async_event_cmpl_func_drvr_load {
 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK \
 		UINT32_C(0xffff)
 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_func_flr_proc_cmplt (size:128b/16B) */
 struct hwrm_async_event_cmpl_func_flr_proc_cmplt {
@@ -5451,7 +5451,7 @@ struct hwrm_async_event_cmpl_func_flr_proc_cmplt {
 		UINT32_C(0xffff)
 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_DATA1_FUNC_ID_SFT \
 		0
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_pf_drvr_unload (size:128b/16B) */
 struct hwrm_async_event_cmpl_pf_drvr_unload {
@@ -5504,7 +5504,7 @@ struct hwrm_async_event_cmpl_pf_drvr_unload {
 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_MASK \
 		UINT32_C(0x70000)
 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_SFT    16
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_pf_drvr_load (size:128b/16B) */
 struct hwrm_async_event_cmpl_pf_drvr_load {
@@ -5557,7 +5557,7 @@ struct hwrm_async_event_cmpl_pf_drvr_load {
 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_MASK \
 		UINT32_C(0x70000)
 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_SFT    16
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_vf_flr (size:128b/16B) */
 struct hwrm_async_event_cmpl_vf_flr {
@@ -5609,7 +5609,7 @@ struct hwrm_async_event_cmpl_vf_flr {
 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_MASK \
 		UINT32_C(0xff0000)
 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_SFT 16
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_vf_mac_addr_change (size:128b/16B) */
 struct hwrm_async_event_cmpl_vf_mac_addr_change {
@@ -5661,7 +5661,7 @@ struct hwrm_async_event_cmpl_vf_mac_addr_change {
 		UINT32_C(0xffff)
 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_SFT \
 		0
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_pf_vf_comm_status_change (size:128b/16B) */
 struct hwrm_async_event_cmpl_pf_vf_comm_status_change {
@@ -5717,7 +5717,7 @@ struct hwrm_async_event_cmpl_pf_vf_comm_status_change {
 	 */
 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_DATA1_COMM_ESTABLISHED \
 		UINT32_C(0x1)
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_vf_cfg_change (size:128b/16B) */
 struct hwrm_async_event_cmpl_vf_cfg_change {
@@ -5802,7 +5802,7 @@ struct hwrm_async_event_cmpl_vf_cfg_change {
 	 */
 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_TRUSTED_VF_CFG_CHANGE \
 		UINT32_C(0x10)
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_llfc_pfc_change (size:128b/16B) */
 struct hwrm_async_event_cmpl_llfc_pfc_change {
@@ -5881,7 +5881,7 @@ struct hwrm_async_event_cmpl_llfc_pfc_change {
 		UINT32_C(0x1fffe0)
 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_SFT \
 		5
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_default_vnic_change (size:128b/16B) */
 struct hwrm_async_event_cmpl_default_vnic_change {
@@ -5963,7 +5963,7 @@ struct hwrm_async_event_cmpl_default_vnic_change {
 		UINT32_C(0x3fffc00)
 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_VF_ID_SFT \
 		10
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_hw_flow_aged (size:128b/16B) */
 struct hwrm_async_event_cmpl_hw_flow_aged {
@@ -6030,7 +6030,7 @@ struct hwrm_async_event_cmpl_hw_flow_aged {
 		(UINT32_C(0x1) << 31)
 	#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_LAST \
 		HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_TX
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_eem_cache_flush_req (size:128b/16B) */
 struct hwrm_async_event_cmpl_eem_cache_flush_req {
@@ -6078,7 +6078,7 @@ struct hwrm_async_event_cmpl_eem_cache_flush_req {
 	uint16_t	timestamp_hi;
 	/* Event specific data */
 	uint32_t	event_data1;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_eem_cache_flush_done (size:128b/16B) */
 struct hwrm_async_event_cmpl_eem_cache_flush_done {
@@ -6134,7 +6134,7 @@ struct hwrm_async_event_cmpl_eem_cache_flush_done {
 		UINT32_C(0xffff)
 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_DATA1_FID_SFT \
 		0
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_tcp_flag_action_change (size:128b/16B) */
 struct hwrm_async_event_cmpl_tcp_flag_action_change {
@@ -6182,7 +6182,7 @@ struct hwrm_async_event_cmpl_tcp_flag_action_change {
 	uint16_t	timestamp_hi;
 	/* Event specific data */
 	uint32_t	event_data1;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_eem_flow_active (size:128b/16B) */
 struct hwrm_async_event_cmpl_eem_flow_active {
@@ -6282,7 +6282,7 @@ struct hwrm_async_event_cmpl_eem_flow_active {
 		(UINT32_C(0x1) << 31)
 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_LAST \
 		HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_1
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_eem_cfg_change (size:128b/16B) */
 struct hwrm_async_event_cmpl_eem_cfg_change {
@@ -6339,7 +6339,7 @@ struct hwrm_async_event_cmpl_eem_cfg_change {
 	 */
 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_DATA1_EEM_RX_ENABLE \
 		UINT32_C(0x2)
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_quiesce_done (size:128b/16B) */
 struct hwrm_async_event_cmpl_quiesce_done {
@@ -6412,7 +6412,7 @@ struct hwrm_async_event_cmpl_quiesce_done {
 	/* Time stamp for error event */
 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA1_TIMESTAMP \
 		UINT32_C(0x1)
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_fw_trace_msg (size:128b/16B) */
 struct hwrm_async_event_cmpl_fw_trace_msg {
@@ -6519,7 +6519,7 @@ struct hwrm_async_event_cmpl_fw_trace_msg {
 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE9_MASK \
 		UINT32_C(0xff000000)
 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE9_SFT 24
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_async_event_cmpl_hwrm_error (size:128b/16B) */
 struct hwrm_async_event_cmpl_hwrm_error {
@@ -6582,7 +6582,7 @@ struct hwrm_async_event_cmpl_hwrm_error {
 	/* Time stamp for error event */
 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA1_TIMESTAMP \
 		UINT32_C(0x1)
-} __attribute__((packed));
+} __rte_packed;
 
 /*******************
  * hwrm_func_reset *
@@ -6665,7 +6665,7 @@ struct hwrm_func_reset_input {
 	#define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_LAST \
 		HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF
 	uint8_t	unused_0;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_reset_output (size:128b/16B) */
 struct hwrm_func_reset_output {
@@ -6686,7 +6686,7 @@ struct hwrm_func_reset_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /********************
  * hwrm_func_getfid *
@@ -6737,7 +6737,7 @@ struct hwrm_func_getfid_input {
 	 */
 	uint16_t	pci_id;
 	uint8_t	unused_0[2];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_getfid_output (size:128b/16B) */
 struct hwrm_func_getfid_output {
@@ -6763,7 +6763,7 @@ struct hwrm_func_getfid_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************
  * hwrm_func_vf_alloc *
@@ -6813,7 +6813,7 @@ struct hwrm_func_vf_alloc_input {
 	uint16_t	first_vf_id;
 	/* The number of virtual functions requested. */
 	uint16_t	num_vfs;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_vf_alloc_output (size:128b/16B) */
 struct hwrm_func_vf_alloc_output {
@@ -6836,7 +6836,7 @@ struct hwrm_func_vf_alloc_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*********************
  * hwrm_func_vf_free *
@@ -6889,7 +6889,7 @@ struct hwrm_func_vf_free_input {
 	 * 0xFFFF - Cleanup all children of this PF.
 	 */
 	uint16_t	num_vfs;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_vf_free_output (size:128b/16B) */
 struct hwrm_func_vf_free_output {
@@ -6910,7 +6910,7 @@ struct hwrm_func_vf_free_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /********************
  * hwrm_func_vf_cfg *
@@ -7153,7 +7153,7 @@ struct hwrm_func_vf_cfg_input {
 	/* The number of HW ring groups requested for the VF. */
 	uint16_t	num_hw_ring_grps;
 	uint8_t	unused_0[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_vf_cfg_output (size:128b/16B) */
 struct hwrm_func_vf_cfg_output {
@@ -7174,7 +7174,7 @@ struct hwrm_func_vf_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*******************
  * hwrm_func_qcaps *
@@ -7218,7 +7218,7 @@ struct hwrm_func_qcaps_input {
 	 */
 	uint16_t	fid;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_qcaps_output (size:640b/80B) */
 struct hwrm_func_qcaps_output {
@@ -7560,7 +7560,7 @@ struct hwrm_func_qcaps_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /******************
  * hwrm_func_qcfg *
@@ -7604,7 +7604,7 @@ struct hwrm_func_qcfg_input {
 	 */
 	uint16_t	fid;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_qcfg_output (size:704b/88B) */
 struct hwrm_func_qcfg_output {
@@ -8025,7 +8025,7 @@ struct hwrm_func_qcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*****************
  * hwrm_func_cfg *
@@ -8655,7 +8655,7 @@ struct hwrm_func_cfg_input {
 	 * be reserved for this function on the RX side.
 	 */
 	uint16_t	num_mcast_filters;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_cfg_output (size:128b/16B) */
 struct hwrm_func_cfg_output {
@@ -8676,7 +8676,7 @@ struct hwrm_func_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /********************
  * hwrm_func_qstats *
@@ -8733,7 +8733,7 @@ struct hwrm_func_qstats_input {
 	#define HWRM_FUNC_QSTATS_INPUT_FLAGS_LAST \
 		HWRM_FUNC_QSTATS_INPUT_FLAGS_ROCE_ONLY
 	uint8_t	unused_0[5];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_qstats_output (size:1408b/176B) */
 struct hwrm_func_qstats_output {
@@ -8815,7 +8815,7 @@ struct hwrm_func_qstats_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***********************
  * hwrm_func_clr_stats *
@@ -8859,7 +8859,7 @@ struct hwrm_func_clr_stats_input {
 	 */
 	uint16_t	fid;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_clr_stats_output (size:128b/16B) */
 struct hwrm_func_clr_stats_output {
@@ -8880,7 +8880,7 @@ struct hwrm_func_clr_stats_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**************************
  * hwrm_func_vf_resc_free *
@@ -8923,7 +8923,7 @@ struct hwrm_func_vf_resc_free_input {
 	 */
 	uint16_t	vf_id;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_vf_resc_free_output (size:128b/16B) */
 struct hwrm_func_vf_resc_free_output {
@@ -8944,7 +8944,7 @@ struct hwrm_func_vf_resc_free_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************
  * hwrm_func_drv_rgtr *
@@ -9168,7 +9168,7 @@ struct hwrm_func_drv_rgtr_input {
 	uint16_t	ver_upd;
 	/* This is the 16bit patch version of the driver. */
 	uint16_t	ver_patch;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_drv_rgtr_output (size:128b/16B) */
 struct hwrm_func_drv_rgtr_output {
@@ -9196,7 +9196,7 @@ struct hwrm_func_drv_rgtr_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /************************
  * hwrm_func_drv_unrgtr *
@@ -9241,7 +9241,7 @@ struct hwrm_func_drv_unrgtr_input {
 	#define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN \
 		UINT32_C(0x1)
 	uint8_t	unused_0[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_drv_unrgtr_output (size:128b/16B) */
 struct hwrm_func_drv_unrgtr_output {
@@ -9262,7 +9262,7 @@ struct hwrm_func_drv_unrgtr_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************
  * hwrm_func_buf_rgtr *
@@ -9376,7 +9376,7 @@ struct hwrm_func_buf_rgtr_input {
 	 * HWRM.
 	 */
 	uint64_t	resp_buf_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_buf_rgtr_output (size:128b/16B) */
 struct hwrm_func_buf_rgtr_output {
@@ -9397,7 +9397,7 @@ struct hwrm_func_buf_rgtr_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /************************
  * hwrm_func_buf_unrgtr *
@@ -9446,7 +9446,7 @@ struct hwrm_func_buf_unrgtr_input {
 	 */
 	uint16_t	vf_id;
 	uint8_t	unused_0[2];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_buf_unrgtr_output (size:128b/16B) */
 struct hwrm_func_buf_unrgtr_output {
@@ -9467,7 +9467,7 @@ struct hwrm_func_buf_unrgtr_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************
  * hwrm_func_drv_qver *
@@ -9513,7 +9513,7 @@ struct hwrm_func_drv_qver_input {
 	 */
 	uint16_t	fid;
 	uint8_t	unused_0[2];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_drv_qver_output (size:256b/32B) */
 struct hwrm_func_drv_qver_output {
@@ -9575,7 +9575,7 @@ struct hwrm_func_drv_qver_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /****************************
  * hwrm_func_resource_qcaps *
@@ -9619,7 +9619,7 @@ struct hwrm_func_resource_qcaps_input {
 	 */
 	uint16_t	fid;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_resource_qcaps_output (size:448b/56B) */
 struct hwrm_func_resource_qcaps_output {
@@ -9705,7 +9705,7 @@ struct hwrm_func_resource_qcaps_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*********************************
  * hwrm_func_backing_store_qcaps *
@@ -9742,7 +9742,7 @@ struct hwrm_func_backing_store_qcaps_input {
 	 * point to a physically contiguous block of memory.
 	 */
 	uint64_t	resp_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_backing_store_qcaps_output (size:640b/80B) */
 struct hwrm_func_backing_store_qcaps_output {
@@ -9872,7 +9872,7 @@ struct hwrm_func_backing_store_qcaps_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*******************************
  * hwrm_func_backing_store_cfg *
@@ -10886,7 +10886,7 @@ struct hwrm_func_backing_store_cfg_input {
 	uint16_t	mrav_entry_size;
 	/* Number of bytes that have been allocated for each context entry. */
 	uint16_t	tim_entry_size;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_backing_store_cfg_output (size:128b/16B) */
 struct hwrm_func_backing_store_cfg_output {
@@ -10907,7 +10907,7 @@ struct hwrm_func_backing_store_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /********************************
  * hwrm_func_backing_store_qcfg *
@@ -10944,7 +10944,7 @@ struct hwrm_func_backing_store_qcfg_input {
 	 * point to a physically contiguous block of memory.
 	 */
 	uint64_t	resp_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_backing_store_qcfg_output (size:1920b/240B) */
 struct hwrm_func_backing_store_qcfg_output {
@@ -11821,7 +11821,7 @@ struct hwrm_func_backing_store_qcfg_output {
 	 * is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /****************************
  * hwrm_error_recovery_qcfg *
@@ -11859,7 +11859,7 @@ struct hwrm_error_recovery_qcfg_input {
 	 */
 	uint64_t	resp_addr;
 	uint8_t	unused_0[8];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_error_recovery_qcfg_output (size:1664b/208B) */
 struct hwrm_error_recovery_qcfg_output {
@@ -12188,7 +12188,7 @@ struct hwrm_error_recovery_qcfg_output {
 	 * is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***********************
  * hwrm_func_vlan_qcfg *
@@ -12233,7 +12233,7 @@ struct hwrm_func_vlan_qcfg_input {
 	 */
 	uint16_t	fid;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_vlan_qcfg_output (size:320b/40B) */
 struct hwrm_func_vlan_qcfg_output {
@@ -12279,7 +12279,7 @@ struct hwrm_func_vlan_qcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************
  * hwrm_func_vlan_cfg *
@@ -12380,7 +12380,7 @@ struct hwrm_func_vlan_cfg_input {
 	/* Future use. */
 	uint32_t	rsvd2;
 	uint8_t	unused_3[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_vlan_cfg_output (size:128b/16B) */
 struct hwrm_func_vlan_cfg_output {
@@ -12401,7 +12401,7 @@ struct hwrm_func_vlan_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*******************************
  * hwrm_func_vf_vnic_ids_query *
@@ -12448,7 +12448,7 @@ struct hwrm_func_vf_vnic_ids_query_input {
 	uint32_t	max_vnic_id_cnt;
 	/* This is the address for VF VNIC ID table */
 	uint64_t	vnic_id_tbl_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_vf_vnic_ids_query_output (size:128b/16B) */
 struct hwrm_func_vf_vnic_ids_query_output {
@@ -12475,7 +12475,7 @@ struct hwrm_func_vf_vnic_ids_query_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***********************
  * hwrm_func_vf_bw_cfg *
@@ -12579,7 +12579,7 @@ struct hwrm_func_vf_bw_cfg_input {
 		(UINT32_C(0xf) << 12)
 	#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_LAST \
 		HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_vf_bw_cfg_output (size:128b/16B) */
 struct hwrm_func_vf_bw_cfg_output {
@@ -12600,7 +12600,7 @@ struct hwrm_func_vf_bw_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /************************
  * hwrm_func_vf_bw_qcfg *
@@ -12649,7 +12649,7 @@ struct hwrm_func_vf_bw_qcfg_input {
 	/* The physical VF id of interest */
 	#define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_MASK UINT32_C(0xfff)
 	#define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_SFT 0
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_vf_bw_qcfg_output (size:960b/120B) */
 struct hwrm_func_vf_bw_qcfg_output {
@@ -12738,7 +12738,7 @@ struct hwrm_func_vf_bw_qcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***************************
  * hwrm_func_drv_if_change *
@@ -12791,7 +12791,7 @@ struct hwrm_func_drv_if_change_input {
 	 */
 	#define HWRM_FUNC_DRV_IF_CHANGE_INPUT_FLAGS_UP     UINT32_C(0x1)
 	uint32_t	unused;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_drv_if_change_output (size:128b/16B) */
 struct hwrm_func_drv_if_change_output {
@@ -12827,7 +12827,7 @@ struct hwrm_func_drv_if_change_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*******************************
  * hwrm_func_host_pf_ids_query *
@@ -12913,7 +12913,7 @@ struct hwrm_func_host_pf_ids_query_input {
 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_LAST \
 		HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ROCE
 	uint8_t	unused_1[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_func_host_pf_ids_query_output (size:128b/16B) */
 struct hwrm_func_host_pf_ids_query_output {
@@ -13033,7 +13033,7 @@ struct hwrm_func_host_pf_ids_query_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*********************
  * hwrm_port_phy_cfg *
@@ -13575,7 +13575,7 @@ struct hwrm_port_phy_cfg_input {
 	#define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK UINT32_C(0xffffff)
 	#define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0
 	uint32_t	unused_3;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_phy_cfg_output (size:128b/16B) */
 struct hwrm_port_phy_cfg_output {
@@ -13596,7 +13596,7 @@ struct hwrm_port_phy_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_phy_cfg_cmd_err (size:64b/8B) */
 struct hwrm_port_phy_cfg_cmd_err {
@@ -13625,7 +13625,7 @@ struct hwrm_port_phy_cfg_cmd_err {
 	#define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_LAST \
 		HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY
 	uint8_t	unused_0[7];
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************
  * hwrm_port_phy_qcfg *
@@ -13665,7 +13665,7 @@ struct hwrm_port_phy_qcfg_input {
 	/* Port ID of port that is to be queried. */
 	uint16_t	port_id;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_phy_qcfg_output (size:768b/96B) */
 struct hwrm_port_phy_qcfg_output {
@@ -14513,7 +14513,7 @@ struct hwrm_port_phy_qcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*********************
  * hwrm_port_mac_cfg *
@@ -14914,7 +14914,7 @@ struct hwrm_port_mac_cfg_input {
 	 */
 	int32_t	ptp_freq_adj_ppb;
 	uint8_t	unused_1[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_mac_cfg_output (size:128b/16B) */
 struct hwrm_port_mac_cfg_output {
@@ -14968,7 +14968,7 @@ struct hwrm_port_mac_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************
  * hwrm_port_mac_qcfg *
@@ -15008,7 +15008,7 @@ struct hwrm_port_mac_qcfg_input {
 	/* Port ID of port that is to be configured. */
 	uint16_t	port_id;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_mac_qcfg_output (size:192b/24B) */
 struct hwrm_port_mac_qcfg_output {
@@ -15258,7 +15258,7 @@ struct hwrm_port_mac_qcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**************************
  * hwrm_port_mac_ptp_qcfg *
@@ -15298,7 +15298,7 @@ struct hwrm_port_mac_ptp_qcfg_input {
 	/* Port ID of port that is being queried. */
 	uint16_t	port_id;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_mac_ptp_qcfg_output (size:640b/80B) */
 struct hwrm_port_mac_ptp_qcfg_output {
@@ -15373,7 +15373,7 @@ struct hwrm_port_mac_ptp_qcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /* Port Tx Statistics Formats */
 /* tx_port_stats (size:3264b/408B) */
@@ -15514,7 +15514,7 @@ struct tx_port_stats {
 	uint64_t	tx_stat_discard;
 	/* Total Tx Error Drops per Port reported by STATS block */
 	uint64_t	tx_stat_error;
-} __attribute__((packed));
+} __rte_packed;
 
 /* Port Rx Statistics Formats */
 /* rx_port_stats (size:4224b/528B) */
@@ -15729,7 +15729,7 @@ struct rx_port_stats {
 	/* Total Rx Discards per Port reported by STATS block */
 	uint64_t	rx_stat_discard;
 	uint64_t	rx_stat_err;
-} __attribute__((packed));
+} __rte_packed;
 
 /********************
  * hwrm_port_qstats *
@@ -15779,7 +15779,7 @@ struct hwrm_port_qstats_input {
 	 * Rx port statistics will be stored
 	 */
 	uint64_t	rx_stat_host_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_qstats_output (size:128b/16B) */
 struct hwrm_port_qstats_output {
@@ -15804,7 +15804,7 @@ struct hwrm_port_qstats_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /* Port Tx Statistics extended Formats */
 /* tx_port_stats_ext (size:2048b/256B) */
@@ -15873,7 +15873,7 @@ struct tx_port_stats_ext {
 	uint64_t	pfc_pri7_tx_duration_us;
 	/* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 7 */
 	uint64_t	pfc_pri7_tx_transitions;
-} __attribute__((packed));
+} __rte_packed;
 
 /* Port Rx Statistics extended Formats */
 /* rx_port_stats_ext (size:3648b/456B) */
@@ -15995,7 +15995,7 @@ struct rx_port_stats_ext {
 	uint64_t	rx_discard_packets_cos6;
 	/* Total number of rx discard packets count on cos queue 7 */
 	uint64_t	rx_discard_packets_cos7;
-} __attribute__((packed));
+} __rte_packed;
 
 /************************
  * hwrm_port_qstats_ext *
@@ -16055,7 +16055,7 @@ struct hwrm_port_qstats_ext_input {
 	 * Rx port statistics will be stored
 	 */
 	uint64_t	rx_stat_host_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_qstats_ext_output (size:128b/16B) */
 struct hwrm_port_qstats_ext_output {
@@ -16088,7 +16088,7 @@ struct hwrm_port_qstats_ext_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*************************
  * hwrm_port_lpbk_qstats *
@@ -16125,7 +16125,7 @@ struct hwrm_port_lpbk_qstats_input {
 	 * point to a physically contiguous block of memory.
 	 */
 	uint64_t	resp_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_lpbk_qstats_output (size:768b/96B) */
 struct hwrm_port_lpbk_qstats_output {
@@ -16166,7 +16166,7 @@ struct hwrm_port_lpbk_qstats_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***********************
  * hwrm_port_clr_stats *
@@ -16217,7 +16217,7 @@ struct hwrm_port_clr_stats_input {
 	 */
 	#define HWRM_PORT_CLR_STATS_INPUT_FLAGS_ROCE_COUNTERS     UINT32_C(0x1)
 	uint8_t	unused_0[5];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_clr_stats_output (size:128b/16B) */
 struct hwrm_port_clr_stats_output {
@@ -16238,7 +16238,7 @@ struct hwrm_port_clr_stats_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***********************
  * hwrm_port_phy_qcaps *
@@ -16278,7 +16278,7 @@ struct hwrm_port_phy_qcaps_input {
 	/* Port ID of port that is being queried. */
 	uint16_t	port_id;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_phy_qcaps_output (size:192b/24B) */
 struct hwrm_port_phy_qcaps_output {
@@ -16508,7 +16508,7 @@ struct hwrm_port_phy_qcaps_output {
 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_VALID_MASK \
 		UINT32_C(0xff000000)
 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_VALID_SFT             24
-} __attribute__((packed));
+} __rte_packed;
 
 /****************************
  * hwrm_port_phy_mdio_write *
@@ -16564,7 +16564,7 @@ struct hwrm_port_phy_mdio_write_input {
 	uint8_t	cl45_mdio;
 	/*  */
 	uint8_t	unused_1[7];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_phy_mdio_write_output (size:128b/16B) */
 struct hwrm_port_phy_mdio_write_output {
@@ -16585,7 +16585,7 @@ struct hwrm_port_phy_mdio_write_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***************************
  * hwrm_port_phy_mdio_read *
@@ -16639,7 +16639,7 @@ struct hwrm_port_phy_mdio_read_input {
 	uint8_t	cl45_mdio;
 	/*  */
 	uint8_t	unused_1;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_phy_mdio_read_output (size:128b/16B) */
 struct hwrm_port_phy_mdio_read_output {
@@ -16662,7 +16662,7 @@ struct hwrm_port_phy_mdio_read_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*********************
  * hwrm_port_led_cfg *
@@ -17065,7 +17065,7 @@ struct hwrm_port_led_cfg_input {
 	uint8_t	led3_group_id;
 	/* Reserved field. */
 	uint8_t	rsvd3;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_led_cfg_output (size:128b/16B) */
 struct hwrm_port_led_cfg_output {
@@ -17086,7 +17086,7 @@ struct hwrm_port_led_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************
  * hwrm_port_led_qcfg *
@@ -17126,7 +17126,7 @@ struct hwrm_port_led_qcfg_input {
 	/* Port ID of port whose LED configuration is being queried. */
 	uint16_t	port_id;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_led_qcfg_output (size:448b/56B) */
 struct hwrm_port_led_qcfg_output {
@@ -17392,7 +17392,7 @@ struct hwrm_port_led_qcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***********************
  * hwrm_port_led_qcaps *
@@ -17432,7 +17432,7 @@ struct hwrm_port_led_qcaps_input {
 	/* Port ID of port whose LED configuration is being queried. */
 	uint16_t	port_id;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_led_qcaps_output (size:384b/48B) */
 struct hwrm_port_led_qcaps_output {
@@ -17744,7 +17744,7 @@ struct hwrm_port_led_qcaps_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***********************
  * hwrm_port_prbs_test *
@@ -17851,7 +17851,7 @@ struct hwrm_port_prbs_test_input {
 	 * bit1 = lane1 ..bit31 = lane31
 	 */
 	uint32_t	rx_lane_map;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_prbs_test_output (size:128b/16B) */
 struct hwrm_port_prbs_test_output {
@@ -17875,7 +17875,7 @@ struct hwrm_port_prbs_test_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************
  * hwrm_port_dsc_dump *
@@ -17983,7 +17983,7 @@ struct hwrm_port_dsc_dump_input {
 	 */
 	#define HWRM_PORT_DSC_DUMP_INPUT_DSC_DUMP_CONFIG_START_RETRIEVE \
 		UINT32_C(0x1)
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_dsc_dump_output (size:128b/16B) */
 struct hwrm_port_dsc_dump_output {
@@ -18007,7 +18007,7 @@ struct hwrm_port_dsc_dump_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /******************************
  * hwrm_port_sfp_sideband_cfg *
@@ -18127,7 +18127,7 @@ struct hwrm_port_sfp_sideband_cfg_input {
 	/* When this bit is set to '1', the module will be powered down. */
 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_PWR_DIS \
 		UINT32_C(0x40)
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_sfp_sideband_cfg_output (size:128b/16B) */
 struct hwrm_port_sfp_sideband_cfg_output {
@@ -18148,7 +18148,7 @@ struct hwrm_port_sfp_sideband_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*******************************
  * hwrm_port_sfp_sideband_qcfg *
@@ -18188,7 +18188,7 @@ struct hwrm_port_sfp_sideband_qcfg_input {
 	/* Port ID of port that is to be queried. */
 	uint16_t	port_id;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_sfp_sideband_qcfg_output (size:192b/24B) */
 struct hwrm_port_sfp_sideband_qcfg_output {
@@ -18271,7 +18271,7 @@ struct hwrm_port_sfp_sideband_qcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************************
  * hwrm_port_phy_mdio_bus_acquire *
@@ -18326,7 +18326,7 @@ struct hwrm_port_phy_mdio_bus_acquire_input {
 	 */
 	uint16_t	mdio_bus_timeout;
 	uint8_t	unused_0[2];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_phy_mdio_bus_acquire_output (size:128b/16B) */
 struct hwrm_port_phy_mdio_bus_acquire_output {
@@ -18353,7 +18353,7 @@ struct hwrm_port_phy_mdio_bus_acquire_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************************
  * hwrm_port_phy_mdio_bus_release *
@@ -18398,7 +18398,7 @@ struct hwrm_port_phy_mdio_bus_release_input {
 	 */
 	uint16_t	client_id;
 	uint8_t	unused_0[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_phy_mdio_bus_release_output (size:128b/16B) */
 struct hwrm_port_phy_mdio_bus_release_output {
@@ -18422,7 +18422,7 @@ struct hwrm_port_phy_mdio_bus_release_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***********************
  * hwrm_queue_qportcfg *
@@ -18489,7 +18489,7 @@ struct hwrm_queue_qportcfg_input {
 	#define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_LAST \
 		HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED
 	uint8_t	unused_0;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_queue_qportcfg_output (size:256b/32B) */
 struct hwrm_queue_qportcfg_output {
@@ -18875,7 +18875,7 @@ struct hwrm_queue_qportcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*******************
  * hwrm_queue_qcfg *
@@ -18927,7 +18927,7 @@ struct hwrm_queue_qcfg_input {
 		HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX
 	/* Queue ID of the queue. */
 	uint32_t	queue_id;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_queue_qcfg_output (size:128b/16B) */
 struct hwrm_queue_qcfg_output {
@@ -18973,7 +18973,7 @@ struct hwrm_queue_qcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /******************
  * hwrm_queue_cfg *
@@ -19056,7 +19056,7 @@ struct hwrm_queue_cfg_input {
 	#define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LAST \
 		HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN
 	uint8_t	unused_0[7];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_queue_cfg_output (size:128b/16B) */
 struct hwrm_queue_cfg_output {
@@ -19077,7 +19077,7 @@ struct hwrm_queue_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*****************************
  * hwrm_queue_pfcenable_qcfg *
@@ -19121,7 +19121,7 @@ struct hwrm_queue_pfcenable_qcfg_input {
 	 */
 	uint16_t	port_id;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_queue_pfcenable_qcfg_output (size:128b/16B) */
 struct hwrm_queue_pfcenable_qcfg_output {
@@ -19167,7 +19167,7 @@ struct hwrm_queue_pfcenable_qcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /****************************
  * hwrm_queue_pfcenable_cfg *
@@ -19236,7 +19236,7 @@ struct hwrm_queue_pfcenable_cfg_input {
 	 */
 	uint16_t	port_id;
 	uint8_t	unused_0[2];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_queue_pfcenable_cfg_output (size:128b/16B) */
 struct hwrm_queue_pfcenable_cfg_output {
@@ -19257,7 +19257,7 @@ struct hwrm_queue_pfcenable_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***************************
  * hwrm_queue_pri2cos_qcfg *
@@ -19321,7 +19321,7 @@ struct hwrm_queue_pri2cos_qcfg_input {
 	 */
 	uint8_t	port_id;
 	uint8_t	unused_0[3];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_queue_pri2cos_qcfg_output (size:192b/24B) */
 struct hwrm_queue_pri2cos_qcfg_output {
@@ -19408,7 +19408,7 @@ struct hwrm_queue_pri2cos_qcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**************************
  * hwrm_queue_pri2cos_cfg *
@@ -19564,7 +19564,7 @@ struct hwrm_queue_pri2cos_cfg_input {
 	 */
 	uint8_t	pri7_cos_queue_id;
 	uint8_t	unused_0[7];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_queue_pri2cos_cfg_output (size:128b/16B) */
 struct hwrm_queue_pri2cos_cfg_output {
@@ -19585,7 +19585,7 @@ struct hwrm_queue_pri2cos_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**************************
  * hwrm_queue_cos2bw_qcfg *
@@ -19629,7 +19629,7 @@ struct hwrm_queue_cos2bw_qcfg_input {
 	 */
 	uint16_t	port_id;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_queue_cos2bw_qcfg_output (size:896b/112B) */
 struct hwrm_queue_cos2bw_qcfg_output {
@@ -20628,7 +20628,7 @@ struct hwrm_queue_cos2bw_qcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*************************
  * hwrm_queue_cos2bw_cfg *
@@ -21699,7 +21699,7 @@ struct hwrm_queue_cos2bw_cfg_input {
 	 */
 	uint8_t	queue_id7_bw_weight;
 	uint8_t	unused_1[5];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_queue_cos2bw_cfg_output (size:128b/16B) */
 struct hwrm_queue_cos2bw_cfg_output {
@@ -21720,7 +21720,7 @@ struct hwrm_queue_cos2bw_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*************************
  * hwrm_queue_dscp_qcaps *
@@ -21764,7 +21764,7 @@ struct hwrm_queue_dscp_qcaps_input {
 	 */
 	uint8_t	port_id;
 	uint8_t	unused_0[7];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_queue_dscp_qcaps_output (size:128b/16B) */
 struct hwrm_queue_dscp_qcaps_output {
@@ -21790,7 +21790,7 @@ struct hwrm_queue_dscp_qcaps_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /****************************
  * hwrm_queue_dscp2pri_qcfg *
@@ -21842,7 +21842,7 @@ struct hwrm_queue_dscp2pri_qcfg_input {
 	/* Size of the buffer pointed to by dest_data_addr. */
 	uint16_t	dest_data_buffer_size;
 	uint8_t	unused_1[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_queue_dscp2pri_qcfg_output (size:128b/16B) */
 struct hwrm_queue_dscp2pri_qcfg_output {
@@ -21873,7 +21873,7 @@ struct hwrm_queue_dscp2pri_qcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***************************
  * hwrm_queue_dscp2pri_cfg *
@@ -21943,7 +21943,7 @@ struct hwrm_queue_dscp2pri_cfg_input {
 	 */
 	uint16_t	entry_cnt;
 	uint8_t	unused_0[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_queue_dscp2pri_cfg_output (size:128b/16B) */
 struct hwrm_queue_dscp2pri_cfg_output {
@@ -21964,7 +21964,7 @@ struct hwrm_queue_dscp2pri_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*************************
  * hwrm_queue_mpls_qcaps *
@@ -22008,7 +22008,7 @@ struct hwrm_queue_mpls_qcaps_input {
 	 */
 	uint8_t	port_id;
 	uint8_t	unused_0[7];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_queue_mpls_qcaps_output (size:128b/16B) */
 struct hwrm_queue_mpls_qcaps_output {
@@ -22047,7 +22047,7 @@ struct hwrm_queue_mpls_qcaps_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /******************************
  * hwrm_queue_mplstc2pri_qcfg *
@@ -22091,7 +22091,7 @@ struct hwrm_queue_mplstc2pri_qcfg_input {
 	 */
 	uint8_t	port_id;
 	uint8_t	unused_0[7];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_queue_mplstc2pri_qcfg_output (size:192b/24B) */
 struct hwrm_queue_mplstc2pri_qcfg_output {
@@ -22168,7 +22168,7 @@ struct hwrm_queue_mplstc2pri_qcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*****************************
  * hwrm_queue_mplstc2pri_cfg *
@@ -22301,7 +22301,7 @@ struct hwrm_queue_mplstc2pri_cfg_input {
 	 * be changed before traffic has started.
 	 */
 	uint8_t	tc7_pri_queue_id;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_queue_mplstc2pri_cfg_output (size:128b/16B) */
 struct hwrm_queue_mplstc2pri_cfg_output {
@@ -22322,7 +22322,7 @@ struct hwrm_queue_mplstc2pri_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*******************
  * hwrm_vnic_alloc *
@@ -22366,7 +22366,7 @@ struct hwrm_vnic_alloc_input {
 	 */
 	#define HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT     UINT32_C(0x1)
 	uint8_t	unused_0[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_vnic_alloc_output (size:128b/16B) */
 struct hwrm_vnic_alloc_output {
@@ -22389,7 +22389,7 @@ struct hwrm_vnic_alloc_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /******************
  * hwrm_vnic_free *
@@ -22429,7 +22429,7 @@ struct hwrm_vnic_free_input {
 	/* Logical vnic ID */
 	uint32_t	vnic_id;
 	uint8_t	unused_0[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_vnic_free_output (size:128b/16B) */
 struct hwrm_vnic_free_output {
@@ -22450,7 +22450,7 @@ struct hwrm_vnic_free_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*****************
  * hwrm_vnic_cfg *
@@ -22661,7 +22661,7 @@ struct hwrm_vnic_cfg_input {
 	 */
 	uint16_t	queue_id;
 	uint8_t	unused0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_vnic_cfg_output (size:128b/16B) */
 struct hwrm_vnic_cfg_output {
@@ -22682,7 +22682,7 @@ struct hwrm_vnic_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /******************
  * hwrm_vnic_qcfg *
@@ -22730,7 +22730,7 @@ struct hwrm_vnic_qcfg_input {
 	/* ID of Virtual Function whose VNIC resource is being queried. */
 	uint16_t	vf_id;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_vnic_qcfg_output (size:256b/32B) */
 struct hwrm_vnic_qcfg_output {
@@ -22844,7 +22844,7 @@ struct hwrm_vnic_qcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*******************
  * hwrm_vnic_qcaps *
@@ -22883,7 +22883,7 @@ struct hwrm_vnic_qcaps_input {
 	uint64_t	resp_addr;
 	uint32_t	enables;
 	uint8_t	unused_0[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_vnic_qcaps_output (size:192b/24B) */
 struct hwrm_vnic_qcaps_output {
@@ -22987,7 +22987,7 @@ struct hwrm_vnic_qcaps_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*********************
  * hwrm_vnic_tpa_cfg *
@@ -23172,7 +23172,7 @@ struct hwrm_vnic_tpa_cfg_input {
 	 * and can be queried using hwrm_vnic_tpa_qcfg.
 	 */
 	uint32_t	min_agg_len;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_vnic_tpa_cfg_output (size:128b/16B) */
 struct hwrm_vnic_tpa_cfg_output {
@@ -23193,7 +23193,7 @@ struct hwrm_vnic_tpa_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*********************
  * hwrm_vnic_rss_cfg *
@@ -23323,7 +23323,7 @@ struct hwrm_vnic_rss_cfg_input {
 	/* Index to the rss indirection table. */
 	uint16_t	rss_ctx_idx;
 	uint8_t	unused_1[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_vnic_rss_cfg_output (size:128b/16B) */
 struct hwrm_vnic_rss_cfg_output {
@@ -23344,7 +23344,7 @@ struct hwrm_vnic_rss_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_vnic_rss_cfg_cmd_err (size:64b/8B) */
 struct hwrm_vnic_rss_cfg_cmd_err {
@@ -23365,7 +23365,7 @@ struct hwrm_vnic_rss_cfg_cmd_err {
 	#define HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_LAST \
 		HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_INTERFACE_NOT_READY
 	uint8_t	unused_0[7];
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************
  * hwrm_vnic_rss_qcfg *
@@ -23405,7 +23405,7 @@ struct hwrm_vnic_rss_qcfg_input {
 	/* Index to the rss indirection table. */
 	uint16_t	rss_ctx_idx;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_vnic_rss_qcfg_output (size:512b/64B) */
 struct hwrm_vnic_rss_qcfg_output {
@@ -23508,7 +23508,7 @@ struct hwrm_vnic_rss_qcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**************************
  * hwrm_vnic_plcmodes_cfg *
@@ -23651,7 +23651,7 @@ struct hwrm_vnic_plcmodes_cfg_input {
 	 */
 	uint16_t	hds_threshold;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_vnic_plcmodes_cfg_output (size:128b/16B) */
 struct hwrm_vnic_plcmodes_cfg_output {
@@ -23672,7 +23672,7 @@ struct hwrm_vnic_plcmodes_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***************************
  * hwrm_vnic_plcmodes_qcfg *
@@ -23712,7 +23712,7 @@ struct hwrm_vnic_plcmodes_qcfg_input {
 	/* Logical vnic ID */
 	uint32_t	vnic_id;
 	uint8_t	unused_0[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_vnic_plcmodes_qcfg_output (size:192b/24B) */
 struct hwrm_vnic_plcmodes_qcfg_output {
@@ -23801,7 +23801,7 @@ struct hwrm_vnic_plcmodes_qcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************************
  * hwrm_vnic_rss_cos_lb_ctx_alloc *
@@ -23838,7 +23838,7 @@ struct hwrm_vnic_rss_cos_lb_ctx_alloc_input {
 	 * point to a physically contiguous block of memory.
 	 */
 	uint64_t	resp_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_vnic_rss_cos_lb_ctx_alloc_output (size:128b/16B) */
 struct hwrm_vnic_rss_cos_lb_ctx_alloc_output {
@@ -23861,7 +23861,7 @@ struct hwrm_vnic_rss_cos_lb_ctx_alloc_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*********************************
  * hwrm_vnic_rss_cos_lb_ctx_free *
@@ -23901,7 +23901,7 @@ struct hwrm_vnic_rss_cos_lb_ctx_free_input {
 	/* rss_cos_lb_ctx_id is 16 b */
 	uint16_t	rss_cos_lb_ctx_id;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_vnic_rss_cos_lb_ctx_free_output (size:128b/16B) */
 struct hwrm_vnic_rss_cos_lb_ctx_free_output {
@@ -23922,7 +23922,7 @@ struct hwrm_vnic_rss_cos_lb_ctx_free_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*******************
  * hwrm_ring_alloc *
@@ -24235,7 +24235,7 @@ struct hwrm_ring_alloc_input {
 	 * record.
 	 */
 	uint64_t	cq_handle;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_ring_alloc_output (size:128b/16B) */
 struct hwrm_ring_alloc_output {
@@ -24263,7 +24263,7 @@ struct hwrm_ring_alloc_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /******************
  * hwrm_ring_free *
@@ -24320,7 +24320,7 @@ struct hwrm_ring_free_input {
 	/* Physical number of ring allocated. */
 	uint16_t	ring_id;
 	uint8_t	unused_1[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_ring_free_output (size:128b/16B) */
 struct hwrm_ring_free_output {
@@ -24341,7 +24341,7 @@ struct hwrm_ring_free_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*******************
  * hwrm_ring_reset *
@@ -24394,7 +24394,7 @@ struct hwrm_ring_reset_input {
 	/* Physical number of the ring. */
 	uint16_t	ring_id;
 	uint8_t	unused_1[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_ring_reset_output (size:128b/16B) */
 struct hwrm_ring_reset_output {
@@ -24417,7 +24417,7 @@ struct hwrm_ring_reset_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**************************
  * hwrm_ring_aggint_qcaps *
@@ -24454,7 +24454,7 @@ struct hwrm_ring_aggint_qcaps_input {
 	 * point to a physically contiguous block of memory.
 	 */
 	uint64_t	resp_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_ring_aggint_qcaps_output (size:384b/48B) */
 struct hwrm_ring_aggint_qcaps_output {
@@ -24567,7 +24567,7 @@ struct hwrm_ring_aggint_qcaps_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**************************************
  * hwrm_ring_cmpl_ring_qaggint_params *
@@ -24607,7 +24607,7 @@ struct hwrm_ring_cmpl_ring_qaggint_params_input {
 	/* Physical number of completion ring. */
 	uint16_t	ring_id;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_ring_cmpl_ring_qaggint_params_output (size:256b/32B) */
 struct hwrm_ring_cmpl_ring_qaggint_params_output {
@@ -24674,7 +24674,7 @@ struct hwrm_ring_cmpl_ring_qaggint_params_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*****************************************
  * hwrm_ring_cmpl_ring_cfg_aggint_params *
@@ -24810,7 +24810,7 @@ struct hwrm_ring_cmpl_ring_cfg_aggint_params_input {
 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_AGGR_INT \
 		UINT32_C(0x20)
 	uint8_t	unused_0[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_ring_cmpl_ring_cfg_aggint_params_output (size:128b/16B) */
 struct hwrm_ring_cmpl_ring_cfg_aggint_params_output {
@@ -24831,7 +24831,7 @@ struct hwrm_ring_cmpl_ring_cfg_aggint_params_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***********************
  * hwrm_ring_grp_alloc *
@@ -24889,7 +24889,7 @@ struct hwrm_ring_grp_alloc_input {
 	 * with the ring group.
 	 */
 	uint16_t	sc;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_ring_grp_alloc_output (size:128b/16B) */
 struct hwrm_ring_grp_alloc_output {
@@ -24916,7 +24916,7 @@ struct hwrm_ring_grp_alloc_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************
  * hwrm_ring_grp_free *
@@ -24956,7 +24956,7 @@ struct hwrm_ring_grp_free_input {
 	/* This is the ring group ID value. */
 	uint32_t	ring_group_id;
 	uint8_t	unused_0[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_ring_grp_free_output (size:128b/16B) */
 struct hwrm_ring_grp_free_output {
@@ -24977,7 +24977,7 @@ struct hwrm_ring_grp_free_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 /*
  * special reserved flow ID to identify per function default
  * flows for vSwitch offload
@@ -25409,7 +25409,7 @@ struct hwrm_cfa_l2_filter_alloc_input {
 	 * 2 - Below the given filter
 	 */
 	uint64_t	l2_filter_id_hint;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_l2_filter_alloc_output (size:192b/24B) */
 struct hwrm_cfa_l2_filter_alloc_output {
@@ -25475,7 +25475,7 @@ struct hwrm_cfa_l2_filter_alloc_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***************************
  * hwrm_cfa_l2_filter_free *
@@ -25517,7 +25517,7 @@ struct hwrm_cfa_l2_filter_free_input {
 	 * context.
 	 */
 	uint64_t	l2_filter_id;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_l2_filter_free_output (size:128b/16B) */
 struct hwrm_cfa_l2_filter_free_output {
@@ -25538,7 +25538,7 @@ struct hwrm_cfa_l2_filter_free_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**************************
  * hwrm_cfa_l2_filter_cfg *
@@ -25645,7 +25645,7 @@ struct hwrm_cfa_l2_filter_cfg_input {
 	 * mirrored.
 	 */
 	uint32_t	new_mirror_vnic_id;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_l2_filter_cfg_output (size:128b/16B) */
 struct hwrm_cfa_l2_filter_cfg_output {
@@ -25666,7 +25666,7 @@ struct hwrm_cfa_l2_filter_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***************************
  * hwrm_cfa_l2_set_rx_mask *
@@ -25827,7 +25827,7 @@ struct hwrm_cfa_l2_set_rx_mask_input {
 	 */
 	uint32_t	num_vlan_tags;
 	uint8_t	unused_1[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_l2_set_rx_mask_output (size:128b/16B) */
 struct hwrm_cfa_l2_set_rx_mask_output {
@@ -25848,7 +25848,7 @@ struct hwrm_cfa_l2_set_rx_mask_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_l2_set_rx_mask_cmd_err (size:64b/8B) */
 struct hwrm_cfa_l2_set_rx_mask_cmd_err {
@@ -25866,7 +25866,7 @@ struct hwrm_cfa_l2_set_rx_mask_cmd_err {
 	#define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_LAST \
 		HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR
 	uint8_t	unused_0[7];
-} __attribute__((packed));
+} __rte_packed;
 
 /*******************************
  * hwrm_cfa_vlan_antispoof_cfg *
@@ -25920,7 +25920,7 @@ struct hwrm_cfa_vlan_antispoof_cfg_input {
 	 * for the 12-bit VLAN ID.
 	 */
 	uint64_t	vlan_tag_mask_tbl_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_vlan_antispoof_cfg_output (size:128b/16B) */
 struct hwrm_cfa_vlan_antispoof_cfg_output {
@@ -25941,7 +25941,7 @@ struct hwrm_cfa_vlan_antispoof_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /********************************
  * hwrm_cfa_vlan_antispoof_qcfg *
@@ -25998,7 +25998,7 @@ struct hwrm_cfa_vlan_antispoof_qcfg_input {
 	 * the mask value should be 0xfff for the 12-bit VLAN ID.
 	 */
 	uint64_t	vlan_tag_mask_tbl_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_vlan_antispoof_qcfg_output (size:128b/16B) */
 struct hwrm_cfa_vlan_antispoof_qcfg_output {
@@ -26021,7 +26021,7 @@ struct hwrm_cfa_vlan_antispoof_qcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /********************************
  * hwrm_cfa_tunnel_filter_alloc *
@@ -26268,7 +26268,7 @@ struct hwrm_cfa_tunnel_filter_alloc_input {
 	 * mirrored.
 	 */
 	uint32_t	mirror_vnic_id;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_tunnel_filter_alloc_output (size:192b/24B) */
 struct hwrm_cfa_tunnel_filter_alloc_output {
@@ -26331,7 +26331,7 @@ struct hwrm_cfa_tunnel_filter_alloc_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*******************************
  * hwrm_cfa_tunnel_filter_free *
@@ -26370,7 +26370,7 @@ struct hwrm_cfa_tunnel_filter_free_input {
 	uint64_t	resp_addr;
 	/* This value is an opaque id into CFA data structures. */
 	uint64_t	tunnel_filter_id;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_tunnel_filter_free_output (size:128b/16B) */
 struct hwrm_cfa_tunnel_filter_free_output {
@@ -26391,7 +26391,7 @@ struct hwrm_cfa_tunnel_filter_free_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***************************************
  * hwrm_cfa_redirect_tunnel_type_alloc *
@@ -26482,7 +26482,7 @@ struct hwrm_cfa_redirect_tunnel_type_alloc_input {
 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_FLAGS_MODIFY_DST \
 		UINT32_C(0x1)
 	uint8_t	unused_0[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_redirect_tunnel_type_alloc_output (size:128b/16B) */
 struct hwrm_cfa_redirect_tunnel_type_alloc_output {
@@ -26503,7 +26503,7 @@ struct hwrm_cfa_redirect_tunnel_type_alloc_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**************************************
  * hwrm_cfa_redirect_tunnel_type_free *
@@ -26589,7 +26589,7 @@ struct hwrm_cfa_redirect_tunnel_type_free_input {
 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_LAST \
 		HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL
 	uint8_t	unused_0[5];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_redirect_tunnel_type_free_output (size:128b/16B) */
 struct hwrm_cfa_redirect_tunnel_type_free_output {
@@ -26610,7 +26610,7 @@ struct hwrm_cfa_redirect_tunnel_type_free_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**************************************
  * hwrm_cfa_redirect_tunnel_type_info *
@@ -26696,7 +26696,7 @@ struct hwrm_cfa_redirect_tunnel_type_info_input {
 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_LAST \
 		HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL
 	uint8_t	unused_0[5];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_redirect_tunnel_type_info_output (size:128b/16B) */
 struct hwrm_cfa_redirect_tunnel_type_info_output {
@@ -26719,7 +26719,7 @@ struct hwrm_cfa_redirect_tunnel_type_info_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_vxlan_ipv4_hdr (size:128b/16B) */
 struct hwrm_vxlan_ipv4_hdr {
@@ -26745,7 +26745,7 @@ struct hwrm_vxlan_ipv4_hdr {
 	uint32_t	src_ip_addr;
 	/* IPv4 destination address. */
 	uint32_t	dest_ip_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_vxlan_ipv6_hdr (size:320b/40B) */
 struct hwrm_vxlan_ipv6_hdr {
@@ -26781,7 +26781,7 @@ struct hwrm_vxlan_ipv6_hdr {
 	uint32_t	src_ip_addr[4];
 	/* IPv6 destination address. */
 	uint32_t	dest_ip_addr[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_encap_data_vxlan (size:640b/80B) */
 struct hwrm_cfa_encap_data_vxlan {
@@ -26826,7 +26826,7 @@ struct hwrm_cfa_encap_data_vxlan {
 	/* VXLAN header flags field. */
 	uint8_t	hdr_flags;
 	uint8_t	unused[3];
-} __attribute__((packed));
+} __rte_packed;
 
 /*******************************
  * hwrm_cfa_encap_record_alloc *
@@ -26917,7 +26917,7 @@ struct hwrm_cfa_encap_record_alloc_input {
 	uint8_t	unused_0[3];
 	/* This value is encap data used for the given encap type. */
 	uint32_t	encap_data[20];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_encap_record_alloc_output (size:128b/16B) */
 struct hwrm_cfa_encap_record_alloc_output {
@@ -26940,7 +26940,7 @@ struct hwrm_cfa_encap_record_alloc_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /******************************
  * hwrm_cfa_encap_record_free *
@@ -26980,7 +26980,7 @@ struct hwrm_cfa_encap_record_free_input {
 	/* This value is an opaque id into CFA data structures. */
 	uint32_t	encap_record_id;
 	uint8_t	unused_0[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_encap_record_free_output (size:128b/16B) */
 struct hwrm_cfa_encap_record_free_output {
@@ -27001,7 +27001,7 @@ struct hwrm_cfa_encap_record_free_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /********************************
  * hwrm_cfa_ntuple_filter_alloc *
@@ -27376,7 +27376,7 @@ struct hwrm_cfa_ntuple_filter_alloc_input {
 	 * the pri_hint.
 	 */
 	uint64_t	ntuple_filter_id_hint;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_ntuple_filter_alloc_output (size:192b/24B) */
 struct hwrm_cfa_ntuple_filter_alloc_output {
@@ -27439,7 +27439,7 @@ struct hwrm_cfa_ntuple_filter_alloc_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_ntuple_filter_alloc_cmd_err (size:64b/8B) */
 struct hwrm_cfa_ntuple_filter_alloc_cmd_err {
@@ -27457,7 +27457,7 @@ struct hwrm_cfa_ntuple_filter_alloc_cmd_err {
 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_LAST \
 		HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR
 	uint8_t	unused_0[7];
-} __attribute__((packed));
+} __rte_packed;
 
 /*******************************
  * hwrm_cfa_ntuple_filter_free *
@@ -27496,7 +27496,7 @@ struct hwrm_cfa_ntuple_filter_free_input {
 	uint64_t	resp_addr;
 	/* This value is an opaque id into CFA data structures. */
 	uint64_t	ntuple_filter_id;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_ntuple_filter_free_output (size:128b/16B) */
 struct hwrm_cfa_ntuple_filter_free_output {
@@ -27517,7 +27517,7 @@ struct hwrm_cfa_ntuple_filter_free_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /******************************
  * hwrm_cfa_ntuple_filter_cfg *
@@ -27617,7 +27617,7 @@ struct hwrm_cfa_ntuple_filter_cfg_input {
 	#define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_LAST \
 		HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID
 	uint8_t	unused_1[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_ntuple_filter_cfg_output (size:128b/16B) */
 struct hwrm_cfa_ntuple_filter_cfg_output {
@@ -27638,7 +27638,7 @@ struct hwrm_cfa_ntuple_filter_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**************************
  * hwrm_cfa_em_flow_alloc *
@@ -27981,7 +27981,7 @@ struct hwrm_cfa_em_flow_alloc_input {
 	/* Logical ID of the encapsulation record. */
 	uint32_t	encap_record_id;
 	uint8_t	unused_2[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_em_flow_alloc_output (size:192b/24B) */
 struct hwrm_cfa_em_flow_alloc_output {
@@ -28044,7 +28044,7 @@ struct hwrm_cfa_em_flow_alloc_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*************************
  * hwrm_cfa_em_flow_free *
@@ -28083,7 +28083,7 @@ struct hwrm_cfa_em_flow_free_input {
 	uint64_t	resp_addr;
 	/* This value is an opaque id into CFA data structures. */
 	uint64_t	em_filter_id;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_em_flow_free_output (size:128b/16B) */
 struct hwrm_cfa_em_flow_free_output {
@@ -28104,7 +28104,7 @@ struct hwrm_cfa_em_flow_free_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /************************
  * hwrm_cfa_meter_qcaps *
@@ -28141,7 +28141,7 @@ struct hwrm_cfa_meter_qcaps_input {
 	 * point to a physically contiguous block of memory.
 	 */
 	uint64_t	resp_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_meter_qcaps_output (size:320b/40B) */
 struct hwrm_cfa_meter_qcaps_output {
@@ -28217,7 +28217,7 @@ struct hwrm_cfa_meter_qcaps_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /********************************
  * hwrm_cfa_meter_profile_alloc *
@@ -28464,7 +28464,7 @@ struct hwrm_cfa_meter_profile_alloc_input {
 		(UINT32_C(0x7) << 29)
 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_LAST \
 		HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_meter_profile_alloc_output (size:128b/16B) */
 struct hwrm_cfa_meter_profile_alloc_output {
@@ -28495,7 +28495,7 @@ struct hwrm_cfa_meter_profile_alloc_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*******************************
  * hwrm_cfa_meter_profile_free *
@@ -28559,7 +28559,7 @@ struct hwrm_cfa_meter_profile_free_input {
 	#define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_LAST \
 		HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID
 	uint8_t	unused_1[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_meter_profile_free_output (size:128b/16B) */
 struct hwrm_cfa_meter_profile_free_output {
@@ -28580,7 +28580,7 @@ struct hwrm_cfa_meter_profile_free_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /******************************
  * hwrm_cfa_meter_profile_cfg *
@@ -28830,7 +28830,7 @@ struct hwrm_cfa_meter_profile_cfg_input {
 		(UINT32_C(0x7) << 29)
 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_LAST \
 		HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_meter_profile_cfg_output (size:128b/16B) */
 struct hwrm_cfa_meter_profile_cfg_output {
@@ -28851,7 +28851,7 @@ struct hwrm_cfa_meter_profile_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*********************************
  * hwrm_cfa_meter_instance_alloc *
@@ -28916,7 +28916,7 @@ struct hwrm_cfa_meter_instance_alloc_input {
 	#define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_LAST \
 		HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID
 	uint8_t	unused_1[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_meter_instance_alloc_output (size:128b/16B) */
 struct hwrm_cfa_meter_instance_alloc_output {
@@ -28947,7 +28947,7 @@ struct hwrm_cfa_meter_instance_alloc_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*******************************
  * hwrm_cfa_meter_instance_cfg *
@@ -29019,7 +29019,7 @@ struct hwrm_cfa_meter_instance_cfg_input {
 	 */
 	uint16_t	meter_instance_id;
 	uint8_t	unused_1[2];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_meter_instance_cfg_output (size:128b/16B) */
 struct hwrm_cfa_meter_instance_cfg_output {
@@ -29040,7 +29040,7 @@ struct hwrm_cfa_meter_instance_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /********************************
  * hwrm_cfa_meter_instance_free *
@@ -29104,7 +29104,7 @@ struct hwrm_cfa_meter_instance_free_input {
 	#define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_LAST \
 		HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID
 	uint8_t	unused_1[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_meter_instance_free_output (size:128b/16B) */
 struct hwrm_cfa_meter_instance_free_output {
@@ -29125,7 +29125,7 @@ struct hwrm_cfa_meter_instance_free_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*******************************
  * hwrm_cfa_decap_filter_alloc *
@@ -29427,7 +29427,7 @@ struct hwrm_cfa_decap_filter_alloc_input {
 	 * information of the decap filter.
 	 */
 	uint16_t	l2_ctxt_ref_id;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_decap_filter_alloc_output (size:128b/16B) */
 struct hwrm_cfa_decap_filter_alloc_output {
@@ -29450,7 +29450,7 @@ struct hwrm_cfa_decap_filter_alloc_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /******************************
  * hwrm_cfa_decap_filter_free *
@@ -29490,7 +29490,7 @@ struct hwrm_cfa_decap_filter_free_input {
 	/* This value is an opaque id into CFA data structures. */
 	uint32_t	decap_filter_id;
 	uint8_t	unused_0[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_decap_filter_free_output (size:128b/16B) */
 struct hwrm_cfa_decap_filter_free_output {
@@ -29511,7 +29511,7 @@ struct hwrm_cfa_decap_filter_free_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***********************
  * hwrm_cfa_flow_alloc *
@@ -29793,7 +29793,7 @@ struct hwrm_cfa_flow_alloc_input {
 		UINT32_C(0xff)
 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST \
 		HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_flow_alloc_output (size:256b/32B) */
 struct hwrm_cfa_flow_alloc_output {
@@ -29860,7 +29860,7 @@ struct hwrm_cfa_flow_alloc_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_flow_alloc_cmd_err (size:64b/8B) */
 struct hwrm_cfa_flow_alloc_cmd_err {
@@ -29888,7 +29888,7 @@ struct hwrm_cfa_flow_alloc_cmd_err {
 	#define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_LAST \
 		HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_CTXT_DB
 	uint8_t	unused_0[7];
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************
  * hwrm_cfa_flow_free *
@@ -29932,7 +29932,7 @@ struct hwrm_cfa_flow_free_input {
 	uint32_t	flow_counter_id;
 	/* This value identifies a set of CFA data structures used for a flow. */
 	uint64_t	ext_flow_handle;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_flow_free_output (size:256b/32B) */
 struct hwrm_cfa_flow_free_output {
@@ -29957,7 +29957,7 @@ struct hwrm_cfa_flow_free_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_flow_action_data (size:960b/120B) */
 struct hwrm_cfa_flow_action_data {
@@ -30038,7 +30038,7 @@ struct hwrm_cfa_flow_action_data {
 	uint8_t	unused[7];
 	/* This value is encap data for the associated encap type. */
 	uint32_t	encap_data[20];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_flow_tunnel_hdr_data (size:64b/8B) */
 struct hwrm_cfa_flow_tunnel_hdr_data {
@@ -30094,7 +30094,7 @@ struct hwrm_cfa_flow_tunnel_hdr_data {
 	 * Virtual Network Identifier (VNI).
 	 */
 	uint32_t	tunnel_id;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_flow_l4_key_data (size:64b/8B) */
 struct hwrm_cfa_flow_l4_key_data {
@@ -30103,7 +30103,7 @@ struct hwrm_cfa_flow_l4_key_data {
 	/* The value of destination port. */
 	uint16_t	l4_dst_port;
 	uint32_t	unused;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_flow_l3_key_data (size:512b/64B) */
 struct hwrm_cfa_flow_l3_key_data {
@@ -30117,7 +30117,7 @@ struct hwrm_cfa_flow_l3_key_data {
 	/* NAT IPv4/IPv6 address. */
 	uint32_t	nat_ip_address[4];
 	uint32_t	unused[2];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_flow_l2_key_data (size:448b/56B) */
 struct hwrm_cfa_flow_l2_key_data {
@@ -30150,7 +30150,7 @@ struct hwrm_cfa_flow_l2_key_data {
 	/* Inner VLAN TCI. */
 	uint16_t	ivlan_tci;
 	uint8_t	unused[8];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_flow_key_data (size:4160b/520B) */
 struct hwrm_cfa_flow_key_data {
@@ -30180,7 +30180,7 @@ struct hwrm_cfa_flow_key_data {
 	uint32_t	l4_key_data[2];
 	/* Flow associated L4 header mask info. */
 	uint32_t	l4_key_mask[2];
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************
  * hwrm_cfa_flow_info *
@@ -30238,7 +30238,7 @@ struct hwrm_cfa_flow_info_input {
 	uint8_t	unused_0[6];
 	/* This value identifies a set of CFA data structures used for a flow. */
 	uint64_t	ext_flow_handle;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_flow_info_output (size:5632b/704B) */
 struct hwrm_cfa_flow_info_output {
@@ -30291,7 +30291,7 @@ struct hwrm_cfa_flow_info_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***********************
  * hwrm_cfa_flow_flush *
@@ -30404,7 +30404,7 @@ struct hwrm_cfa_flow_flush_input {
 	uint16_t	num_flows;
 	/* Pointer to the PBL, or PDL depending on number of levels */
 	uint64_t	page_dir;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_flow_flush_output (size:128b/16B) */
 struct hwrm_cfa_flow_flush_output {
@@ -30425,7 +30425,7 @@ struct hwrm_cfa_flow_flush_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***********************
  * hwrm_cfa_flow_stats *
@@ -30505,7 +30505,7 @@ struct hwrm_cfa_flow_stats_input {
 	uint32_t	flow_id_8;
 	/* Flow ID of a flow. */
 	uint32_t	flow_id_9;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_flow_stats_output (size:1408b/176B) */
 struct hwrm_cfa_flow_stats_output {
@@ -30566,7 +30566,7 @@ struct hwrm_cfa_flow_stats_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***********************************
  * hwrm_cfa_flow_aging_timer_reset *
@@ -30613,7 +30613,7 @@ struct hwrm_cfa_flow_aging_timer_reset_input {
 	uint32_t	flow_timer;
 	/* This value identifies a set of CFA data structures used for a flow. */
 	uint64_t	ext_flow_handle;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_flow_aging_timer_reset_output (size:128b/16B) */
 struct hwrm_cfa_flow_aging_timer_reset_output {
@@ -30634,7 +30634,7 @@ struct hwrm_cfa_flow_aging_timer_reset_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***************************
  * hwrm_cfa_flow_aging_cfg *
@@ -30738,7 +30738,7 @@ struct hwrm_cfa_flow_aging_cfg_input {
 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_LAST \
 		HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_EJECTION_DATA
 	uint8_t	unused_1[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_flow_aging_cfg_output (size:128b/16B) */
 struct hwrm_cfa_flow_aging_cfg_output {
@@ -30759,7 +30759,7 @@ struct hwrm_cfa_flow_aging_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /****************************
  * hwrm_cfa_flow_aging_qcfg *
@@ -30807,7 +30807,7 @@ struct hwrm_cfa_flow_aging_qcfg_input {
 	#define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_LAST \
 		HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_RX
 	uint8_t	unused_0[7];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_flow_aging_qcfg_output (size:320b/40B) */
 struct hwrm_cfa_flow_aging_qcfg_output {
@@ -30844,7 +30844,7 @@ struct hwrm_cfa_flow_aging_qcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*****************************
  * hwrm_cfa_flow_aging_qcaps *
@@ -30892,7 +30892,7 @@ struct hwrm_cfa_flow_aging_qcaps_input {
 	#define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_LAST \
 		HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_RX
 	uint8_t	unused_0[7];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_flow_aging_qcaps_output (size:256b/32B) */
 struct hwrm_cfa_flow_aging_qcaps_output {
@@ -30921,7 +30921,7 @@ struct hwrm_cfa_flow_aging_qcaps_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************************
  * hwrm_cfa_tcp_flag_process_qcfg *
@@ -30958,7 +30958,7 @@ struct hwrm_cfa_tcp_flag_process_qcfg_input {
 	 * point to a physically contiguous block of memory.
 	 */
 	uint64_t	resp_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_tcp_flag_process_qcfg_output (size:192b/24B) */
 struct hwrm_cfa_tcp_flag_process_qcfg_output {
@@ -30987,7 +30987,7 @@ struct hwrm_cfa_tcp_flag_process_qcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************
  * hwrm_cfa_pair_info *
@@ -31037,7 +31037,7 @@ struct hwrm_cfa_pair_info_input {
 	uint8_t	pair_vfid;
 	/* Pair name (32 byte string). */
 	char	pair_name[32];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_pair_info_output (size:576b/72B) */
 struct hwrm_cfa_pair_info_output {
@@ -31108,7 +31108,7 @@ struct hwrm_cfa_pair_info_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***************************************
  * hwrm_cfa_redirect_query_tunnel_type *
@@ -31148,7 +31148,7 @@ struct hwrm_cfa_redirect_query_tunnel_type_input {
 	/* The source function id. */
 	uint16_t	src_fid;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_redirect_query_tunnel_type_output (size:128b/16B) */
 struct hwrm_cfa_redirect_query_tunnel_type_output {
@@ -31213,7 +31213,7 @@ struct hwrm_cfa_redirect_query_tunnel_type_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*************************
  * hwrm_cfa_ctx_mem_rgtr *
@@ -31284,7 +31284,7 @@ struct hwrm_cfa_ctx_mem_rgtr_input {
 	uint32_t	unused_0;
 	/* Pointer to the PBL, or PDL depending on number of levels */
 	uint64_t	page_dir;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_ctx_mem_rgtr_output (size:128b/16B) */
 struct hwrm_cfa_ctx_mem_rgtr_output {
@@ -31310,7 +31310,7 @@ struct hwrm_cfa_ctx_mem_rgtr_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***************************
  * hwrm_cfa_ctx_mem_unrgtr *
@@ -31353,7 +31353,7 @@ struct hwrm_cfa_ctx_mem_unrgtr_input {
 	 */
 	uint16_t	ctx_id;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_ctx_mem_unrgtr_output (size:128b/16B) */
 struct hwrm_cfa_ctx_mem_unrgtr_output {
@@ -31374,7 +31374,7 @@ struct hwrm_cfa_ctx_mem_unrgtr_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*************************
  * hwrm_cfa_ctx_mem_qctx *
@@ -31417,7 +31417,7 @@ struct hwrm_cfa_ctx_mem_qctx_input {
 	 */
 	uint16_t	ctx_id;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_ctx_mem_qctx_output (size:256b/32B) */
 struct hwrm_cfa_ctx_mem_qctx_output {
@@ -31472,7 +31472,7 @@ struct hwrm_cfa_ctx_mem_qctx_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**************************
  * hwrm_cfa_ctx_mem_qcaps *
@@ -31509,7 +31509,7 @@ struct hwrm_cfa_ctx_mem_qcaps_input {
 	 * point to a physically contiguous block of memory.
 	 */
 	uint64_t	resp_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_ctx_mem_qcaps_output (size:128b/16B) */
 struct hwrm_cfa_ctx_mem_qcaps_output {
@@ -31532,7 +31532,7 @@ struct hwrm_cfa_ctx_mem_qcaps_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************
  * hwrm_cfa_eem_qcaps *
@@ -31588,7 +31588,7 @@ struct hwrm_cfa_eem_qcaps_input {
 	#define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PREFERRED_OFFLOAD \
 		UINT32_C(0x4)
 	uint32_t	unused_0;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_eem_qcaps_output (size:320b/40B) */
 struct hwrm_cfa_eem_qcaps_output {
@@ -31689,7 +31689,7 @@ struct hwrm_cfa_eem_qcaps_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /********************
  * hwrm_cfa_eem_cfg *
@@ -31772,7 +31772,7 @@ struct hwrm_cfa_eem_cfg_input {
 	uint16_t	fid_ctx_id;
 	uint16_t	unused_2;
 	uint32_t	unused_3;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_eem_cfg_output (size:128b/16B) */
 struct hwrm_cfa_eem_cfg_output {
@@ -31793,7 +31793,7 @@ struct hwrm_cfa_eem_cfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*********************
  * hwrm_cfa_eem_qcfg *
@@ -31836,7 +31836,7 @@ struct hwrm_cfa_eem_qcfg_input {
 	/* When set to 1, indicates the configuration is the RX flow. */
 	#define HWRM_CFA_EEM_QCFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x2)
 	uint32_t	unused_0;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_eem_qcfg_output (size:256b/32B) */
 struct hwrm_cfa_eem_qcfg_output {
@@ -31879,7 +31879,7 @@ struct hwrm_cfa_eem_qcfg_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*******************
  * hwrm_cfa_eem_op *
@@ -31955,7 +31955,7 @@ struct hwrm_cfa_eem_op_input {
 	#define HWRM_CFA_EEM_OP_INPUT_OP_EEM_CLEANUP UINT32_C(0x3)
 	#define HWRM_CFA_EEM_OP_INPUT_OP_LAST \
 		HWRM_CFA_EEM_OP_INPUT_OP_EEM_CLEANUP
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_eem_op_output (size:128b/16B) */
 struct hwrm_cfa_eem_op_output {
@@ -31976,7 +31976,7 @@ struct hwrm_cfa_eem_op_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /********************************
  * hwrm_cfa_adv_flow_mgnt_qcaps *
@@ -32014,7 +32014,7 @@ struct hwrm_cfa_adv_flow_mgnt_qcaps_input {
 	 */
 	uint64_t	resp_addr;
 	uint32_t	unused_0[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_adv_flow_mgnt_qcaps_output (size:128b/16B) */
 struct hwrm_cfa_adv_flow_mgnt_qcaps_output {
@@ -32142,7 +32142,7 @@ struct hwrm_cfa_adv_flow_mgnt_qcaps_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /******************
  * hwrm_cfa_tflib *
@@ -32187,7 +32187,7 @@ struct hwrm_cfa_tflib_input {
 	uint8_t	unused0[4];
 	/* TFLIB request data. */
 	uint32_t	tf_req[26];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_cfa_tflib_output (size:5632b/704B) */
 struct hwrm_cfa_tflib_output {
@@ -32217,7 +32217,7 @@ struct hwrm_cfa_tflib_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /******************************
  * hwrm_tunnel_dst_port_query *
@@ -32277,7 +32277,7 @@ struct hwrm_tunnel_dst_port_query_input {
 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_LAST \
 		HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
 	uint8_t	unused_0[7];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_tunnel_dst_port_query_output (size:128b/16B) */
 struct hwrm_tunnel_dst_port_query_output {
@@ -32316,7 +32316,7 @@ struct hwrm_tunnel_dst_port_query_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /******************************
  * hwrm_tunnel_dst_port_alloc *
@@ -32388,7 +32388,7 @@ struct hwrm_tunnel_dst_port_alloc_input {
 	 */
 	uint16_t	tunnel_dst_port_val;
 	uint8_t	unused_1[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_tunnel_dst_port_alloc_output (size:128b/16B) */
 struct hwrm_tunnel_dst_port_alloc_output {
@@ -32414,7 +32414,7 @@ struct hwrm_tunnel_dst_port_alloc_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*****************************
  * hwrm_tunnel_dst_port_free *
@@ -32480,7 +32480,7 @@ struct hwrm_tunnel_dst_port_free_input {
 	 */
 	uint16_t	tunnel_dst_port_id;
 	uint8_t	unused_1[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_tunnel_dst_port_free_output (size:128b/16B) */
 struct hwrm_tunnel_dst_port_free_output {
@@ -32501,7 +32501,7 @@ struct hwrm_tunnel_dst_port_free_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /* Periodic statistics context DMA to host. */
 /* ctx_hw_stats (size:1280b/160B) */
@@ -32546,7 +32546,7 @@ struct ctx_hw_stats {
 	uint64_t	tpa_events;
 	/* Number of TPA aborts */
 	uint64_t	tpa_aborts;
-} __attribute__((packed));
+} __rte_packed;
 
 /* Periodic statistics context DMA to host. */
 /* ctx_hw_stats_ext (size:1344b/168B) */
@@ -32593,7 +32593,7 @@ struct ctx_hw_stats_ext {
 	uint64_t	rx_tpa_bytes;
 	/* Number of TPA errors */
 	uint64_t	rx_tpa_errors;
-} __attribute__((packed));
+} __rte_packed;
 
 /* Periodic Engine statistics context DMA to host. */
 /* ctx_eng_stats (size:512b/64B) */
@@ -32639,7 +32639,7 @@ struct ctx_eng_stats {
 	 * the unit is count of clock cycles
 	 */
 	uint64_t	cdd_engine_usage;
-} __attribute__((packed));
+} __rte_packed;
 
 /***********************
  * hwrm_stat_ctx_alloc *
@@ -32717,7 +32717,7 @@ struct hwrm_stat_ctx_alloc_input {
 	 * for the periodic DMA updates.
 	 */
 	uint16_t	stats_dma_length;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_stat_ctx_alloc_output (size:128b/16B) */
 struct hwrm_stat_ctx_alloc_output {
@@ -32740,7 +32740,7 @@ struct hwrm_stat_ctx_alloc_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************
  * hwrm_stat_ctx_free *
@@ -32780,7 +32780,7 @@ struct hwrm_stat_ctx_free_input {
 	/* ID of the statistics context that is being queried. */
 	uint32_t	stat_ctx_id;
 	uint8_t	unused_0[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_stat_ctx_free_output (size:128b/16B) */
 struct hwrm_stat_ctx_free_output {
@@ -32803,7 +32803,7 @@ struct hwrm_stat_ctx_free_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***********************
  * hwrm_stat_ctx_query *
@@ -32843,7 +32843,7 @@ struct hwrm_stat_ctx_query_input {
 	/* ID of the statistics context that is being queried. */
 	uint32_t	stat_ctx_id;
 	uint8_t	unused_0[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_stat_ctx_query_output (size:1408b/176B) */
 struct hwrm_stat_ctx_query_output {
@@ -32904,7 +32904,7 @@ struct hwrm_stat_ctx_query_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***************************
  * hwrm_stat_ctx_eng_query *
@@ -32944,7 +32944,7 @@ struct hwrm_stat_ctx_eng_query_input {
 	/* ID of the statistics context that is being queried. */
 	uint32_t	stat_ctx_id;
 	uint8_t	unused_0[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_stat_ctx_eng_query_output (size:640b/80B) */
 struct hwrm_stat_ctx_eng_query_output {
@@ -33006,7 +33006,7 @@ struct hwrm_stat_ctx_eng_query_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***************************
  * hwrm_stat_ctx_clr_stats *
@@ -33046,7 +33046,7 @@ struct hwrm_stat_ctx_clr_stats_input {
 	/* ID of the statistics context that is being queried. */
 	uint32_t	stat_ctx_id;
 	uint8_t	unused_0[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_stat_ctx_clr_stats_output (size:128b/16B) */
 struct hwrm_stat_ctx_clr_stats_output {
@@ -33067,7 +33067,7 @@ struct hwrm_stat_ctx_clr_stats_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /********************
  * hwrm_pcie_qstats *
@@ -33116,7 +33116,7 @@ struct hwrm_pcie_qstats_input {
 	 * PCIe statistics will be stored
 	 */
 	uint64_t	pcie_stat_host_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_pcie_qstats_output (size:128b/16B) */
 struct hwrm_pcie_qstats_output {
@@ -33139,7 +33139,7 @@ struct hwrm_pcie_qstats_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /* PCIe Statistics Formats */
 /* pcie_ctx_hw_stats (size:768b/96B) */
@@ -33175,7 +33175,7 @@ struct pcie_ctx_hw_stats {
 	 * to Recovery
 	 */
 	uint64_t	pcie_recovery_histogram;
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************
  * hwrm_exec_fwd_resp *
@@ -33228,7 +33228,7 @@ struct hwrm_exec_fwd_resp_input {
 	 */
 	uint16_t	encap_resp_target_id;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_exec_fwd_resp_output (size:128b/16B) */
 struct hwrm_exec_fwd_resp_output {
@@ -33249,7 +33249,7 @@ struct hwrm_exec_fwd_resp_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /************************
  * hwrm_reject_fwd_resp *
@@ -33302,7 +33302,7 @@ struct hwrm_reject_fwd_resp_input {
 	 */
 	uint16_t	encap_resp_target_id;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_reject_fwd_resp_output (size:128b/16B) */
 struct hwrm_reject_fwd_resp_output {
@@ -33323,7 +33323,7 @@ struct hwrm_reject_fwd_resp_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*****************
  * hwrm_fwd_resp *
@@ -33391,7 +33391,7 @@ struct hwrm_fwd_resp_input {
 	uint64_t	encap_resp_addr;
 	/* This is an encapsulated response. */
 	uint32_t	encap_resp[24];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_fwd_resp_output (size:128b/16B) */
 struct hwrm_fwd_resp_output {
@@ -33412,7 +33412,7 @@ struct hwrm_fwd_resp_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*****************************
  * hwrm_fwd_async_event_cmpl *
@@ -33461,7 +33461,7 @@ struct hwrm_fwd_async_event_cmpl_input {
 	uint8_t	unused_0[6];
 	/* This is an encapsulated asynchronous event completion. */
 	uint32_t	encap_async_event_cmpl[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_fwd_async_event_cmpl_output (size:128b/16B) */
 struct hwrm_fwd_async_event_cmpl_output {
@@ -33482,7 +33482,7 @@ struct hwrm_fwd_async_event_cmpl_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**************************
  * hwrm_nvm_raw_write_blk *
@@ -33531,7 +33531,7 @@ struct hwrm_nvm_raw_write_blk_input {
 	uint32_t	dest_addr;
 	/* Length of data to be written, in bytes. */
 	uint32_t	len;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_raw_write_blk_output (size:128b/16B) */
 struct hwrm_nvm_raw_write_blk_output {
@@ -33552,7 +33552,7 @@ struct hwrm_nvm_raw_write_blk_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*****************
  * hwrm_nvm_read *
@@ -33602,7 +33602,7 @@ struct hwrm_nvm_read_input {
 	/* The length of the data to be read, in bytes. */
 	uint32_t	len;
 	uint8_t	unused_1[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_read_output (size:128b/16B) */
 struct hwrm_nvm_read_output {
@@ -33623,7 +33623,7 @@ struct hwrm_nvm_read_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*********************
  * hwrm_nvm_raw_dump *
@@ -33669,7 +33669,7 @@ struct hwrm_nvm_raw_dump_input {
 	uint32_t	offset;
 	/* Total length of NVRAM contents to be read, in bytes. */
 	uint32_t	len;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_raw_dump_output (size:128b/16B) */
 struct hwrm_nvm_raw_dump_output {
@@ -33690,7 +33690,7 @@ struct hwrm_nvm_raw_dump_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /****************************
  * hwrm_nvm_get_dir_entries *
@@ -33732,7 +33732,7 @@ struct hwrm_nvm_get_dir_entries_input {
 	 * This is the host address where the directory will be written.
 	 */
 	uint64_t	host_dest_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_get_dir_entries_output (size:128b/16B) */
 struct hwrm_nvm_get_dir_entries_output {
@@ -33753,7 +33753,7 @@ struct hwrm_nvm_get_dir_entries_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*************************
  * hwrm_nvm_get_dir_info *
@@ -33790,7 +33790,7 @@ struct hwrm_nvm_get_dir_info_input {
 	 * point to a physically contiguous block of memory.
 	 */
 	uint64_t	resp_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_get_dir_info_output (size:192b/24B) */
 struct hwrm_nvm_get_dir_info_output {
@@ -33815,7 +33815,7 @@ struct hwrm_nvm_get_dir_info_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /******************
  * hwrm_nvm_write *
@@ -33891,7 +33891,7 @@ struct hwrm_nvm_write_input {
 	 */
 	uint32_t	dir_item_length;
 	uint32_t	unused_0;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_write_output (size:128b/16B) */
 struct hwrm_nvm_write_output {
@@ -33919,7 +33919,7 @@ struct hwrm_nvm_write_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_write_cmd_err (size:64b/8B) */
 struct hwrm_nvm_write_cmd_err {
@@ -33937,7 +33937,7 @@ struct hwrm_nvm_write_cmd_err {
 	#define HWRM_NVM_WRITE_CMD_ERR_CODE_LAST \
 		HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE
 	uint8_t	unused_0[7];
-} __attribute__((packed));
+} __rte_packed;
 
 /*******************
  * hwrm_nvm_modify *
@@ -33990,7 +33990,7 @@ struct hwrm_nvm_modify_input {
 	 */
 	uint32_t	len;
 	uint8_t	unused_1[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_modify_output (size:128b/16B) */
 struct hwrm_nvm_modify_output {
@@ -34011,7 +34011,7 @@ struct hwrm_nvm_modify_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***************************
  * hwrm_nvm_find_dir_entry *
@@ -34080,7 +34080,7 @@ struct hwrm_nvm_find_dir_entry_input {
 	#define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_LAST \
 		HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT
 	uint8_t	unused_0[3];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_find_dir_entry_output (size:256b/32B) */
 struct hwrm_nvm_find_dir_entry_output {
@@ -34114,7 +34114,7 @@ struct hwrm_nvm_find_dir_entry_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /****************************
  * hwrm_nvm_erase_dir_entry *
@@ -34154,7 +34154,7 @@ struct hwrm_nvm_erase_dir_entry_input {
 	/* Directory Entry Index */
 	uint16_t	dir_idx;
 	uint8_t	unused_0[6];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_erase_dir_entry_output (size:128b/16B) */
 struct hwrm_nvm_erase_dir_entry_output {
@@ -34175,7 +34175,7 @@ struct hwrm_nvm_erase_dir_entry_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /*************************
  * hwrm_nvm_get_dev_info *
@@ -34212,7 +34212,7 @@ struct hwrm_nvm_get_dev_info_input {
 	 * point to a physically contiguous block of memory.
 	 */
 	uint64_t	resp_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_get_dev_info_output (size:256b/32B) */
 struct hwrm_nvm_get_dev_info_output {
@@ -34249,7 +34249,7 @@ struct hwrm_nvm_get_dev_info_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**************************
  * hwrm_nvm_mod_dir_entry *
@@ -34308,7 +34308,7 @@ struct hwrm_nvm_mod_dir_entry_input {
 	 * value of the content in the directory entry.
 	 */
 	uint32_t	checksum;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_mod_dir_entry_output (size:128b/16B) */
 struct hwrm_nvm_mod_dir_entry_output {
@@ -34329,7 +34329,7 @@ struct hwrm_nvm_mod_dir_entry_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**************************
  * hwrm_nvm_verify_update *
@@ -34382,7 +34382,7 @@ struct hwrm_nvm_verify_update_input {
 	 */
 	uint16_t	dir_ext;
 	uint8_t	unused_0[2];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_verify_update_output (size:128b/16B) */
 struct hwrm_nvm_verify_update_output {
@@ -34403,7 +34403,7 @@ struct hwrm_nvm_verify_update_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /***************************
  * hwrm_nvm_install_update *
@@ -34480,7 +34480,7 @@ struct hwrm_nvm_install_update_input {
 	#define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ALLOWED_TO_DEFRAG \
 		UINT32_C(0x4)
 	uint8_t	unused_0[2];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_install_update_output (size:192b/24B) */
 struct hwrm_nvm_install_update_output {
@@ -34549,7 +34549,7 @@ struct hwrm_nvm_install_update_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_install_update_cmd_err (size:64b/8B) */
 struct hwrm_nvm_install_update_cmd_err {
@@ -34567,7 +34567,7 @@ struct hwrm_nvm_install_update_cmd_err {
 	#define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_LAST \
 		HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_SPACE
 	uint8_t	unused_0[7];
-} __attribute__((packed));
+} __rte_packed;
 
 /******************
  * hwrm_nvm_flush *
@@ -34604,7 +34604,7 @@ struct hwrm_nvm_flush_input {
 	 * point to a physically contiguous block of memory.
 	 */
 	uint64_t	resp_addr;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_flush_output (size:128b/16B) */
 struct hwrm_nvm_flush_output {
@@ -34625,7 +34625,7 @@ struct hwrm_nvm_flush_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_flush_cmd_err (size:64b/8B) */
 struct hwrm_nvm_flush_cmd_err {
@@ -34641,7 +34641,7 @@ struct hwrm_nvm_flush_cmd_err {
 	#define HWRM_NVM_FLUSH_CMD_ERR_CODE_LAST \
 		HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL
 	uint8_t	unused_0[7];
-} __attribute__((packed));
+} __rte_packed;
 
 /*************************
  * hwrm_nvm_get_variable *
@@ -34718,7 +34718,7 @@ struct hwrm_nvm_get_variable_input {
 	#define HWRM_NVM_GET_VARIABLE_INPUT_FLAGS_FACTORY_DFLT \
 		UINT32_C(0x1)
 	uint8_t	unused_0;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_get_variable_output (size:128b/16B) */
 struct hwrm_nvm_get_variable_output {
@@ -34757,7 +34757,7 @@ struct hwrm_nvm_get_variable_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_get_variable_cmd_err (size:64b/8B) */
 struct hwrm_nvm_get_variable_cmd_err {
@@ -34777,7 +34777,7 @@ struct hwrm_nvm_get_variable_cmd_err {
 	#define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LAST \
 		HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT
 	uint8_t	unused_0[7];
-} __attribute__((packed));
+} __rte_packed;
 
 /*************************
  * hwrm_nvm_set_variable *
@@ -34875,7 +34875,7 @@ struct hwrm_nvm_set_variable_input {
 	#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FACTORY_DEFAULT \
 		UINT32_C(0x80)
 	uint8_t	unused_0;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_set_variable_output (size:128b/16B) */
 struct hwrm_nvm_set_variable_output {
@@ -34896,7 +34896,7 @@ struct hwrm_nvm_set_variable_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_set_variable_cmd_err (size:64b/8B) */
 struct hwrm_nvm_set_variable_cmd_err {
@@ -34914,7 +34914,7 @@ struct hwrm_nvm_set_variable_cmd_err {
 	#define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_LAST \
 		HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR
 	uint8_t	unused_0[7];
-} __attribute__((packed));
+} __rte_packed;
 
 /****************************
  * hwrm_nvm_validate_option *
@@ -34985,7 +34985,7 @@ struct hwrm_nvm_validate_option_input {
 	/* index for the 4th dimensions */
 	uint16_t	index_3;
 	uint8_t	unused_0[2];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_validate_option_output (size:128b/16B) */
 struct hwrm_nvm_validate_option_output {
@@ -35013,7 +35013,7 @@ struct hwrm_nvm_validate_option_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_nvm_validate_option_cmd_err (size:64b/8B) */
 struct hwrm_nvm_validate_option_cmd_err {
@@ -35027,7 +35027,7 @@ struct hwrm_nvm_validate_option_cmd_err {
 	#define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_LAST \
 		HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN
 	uint8_t	unused_0[7];
-} __attribute__((packed));
+} __rte_packed;
 
 /*****************
  * hwrm_fw_reset *
@@ -35127,7 +35127,7 @@ struct hwrm_fw_reset_input {
 	 */
 	#define HWRM_FW_RESET_INPUT_FLAGS_RESET_GRACEFUL     UINT32_C(0x1)
 	uint8_t unused_0[4];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_fw_reset_output (size:128b/16B) */
 struct hwrm_fw_reset_output {
@@ -35164,7 +35164,7 @@ struct hwrm_fw_reset_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t valid;
-} __attribute__((packed));
+} __rte_packed;
 
 /**********************
  * hwrm_port_ts_query *
@@ -35222,7 +35222,7 @@ struct hwrm_port_ts_query_input {
 	/* Port ID of port that is being queried. */
 	uint16_t	port_id;
 	uint8_t		unused_0[2];
-} __attribute__((packed));
+} __rte_packed;
 
 /* hwrm_port_ts_query_output (size:192b/24B) */
 struct hwrm_port_ts_query_output {
@@ -35250,6 +35250,6 @@ struct hwrm_port_ts_query_output {
 	 * the order of writes has to be such that this field is written last.
 	 */
 	uint8_t		valid;
-} __attribute__((packed));
+} __rte_packed;
 
 #endif /* _HSI_STRUCT_DEF_DPDK_H_ */
diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bonding/rte_eth_bond_8023ad.h
index 0b5d0a4351..11a71a55e5 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.h
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.h
@@ -54,13 +54,13 @@ enum rte_bond_8023ad_agg_selection {
 struct slow_protocol {
 	uint8_t subtype;
 	uint8_t reserved_119[119];
-} __attribute__((__packed__));
+} __rte_packed;
 
 /** Generic slow protocol frame type structure */
 struct slow_protocol_frame {
 	struct rte_ether_hdr eth_hdr;
 	struct slow_protocol slow_protocol;
-} __attribute__((__packed__)) __rte_aligned(2);
+} __rte_packed __rte_aligned(2);
 
 struct port_params {
 	uint16_t system_priority;
@@ -73,7 +73,7 @@ struct port_params {
 	/**< Priority of this (unused in current implementation) */
 	uint16_t port_number;
 	/**< Port number. It corresponds to slave port id. */
-} __attribute__((__packed__)) __rte_aligned(2);
+} __rte_packed __rte_aligned(2);
 
 struct lacpdu_actor_partner_params {
 	uint8_t tlv_type_info;
@@ -81,7 +81,7 @@ struct lacpdu_actor_partner_params {
 	struct port_params port_params;
 	uint8_t state;
 	uint8_t reserved_3[3];
-} __attribute__((__packed__)) __rte_aligned(2);
+} __rte_packed __rte_aligned(2);
 
 /** LACPDU structure (5.4.2 in 802.1AX documentation). */
 struct lacpdu {
@@ -99,13 +99,13 @@ struct lacpdu {
 	uint8_t tlv_type_terminator;
 	uint8_t terminator_length;
 	uint8_t reserved_50[50];
-} __attribute__((__packed__)) __rte_aligned(2);
+} __rte_packed __rte_aligned(2);
 
 /** LACPDU frame: Contains ethernet header and LACPDU. */
 struct lacpdu_header {
 	struct rte_ether_hdr eth_hdr;
 	struct lacpdu lacpdu;
-} __attribute__((__packed__)) __rte_aligned(2);
+} __rte_packed __rte_aligned(2);
 
 struct marker {
 	uint8_t subtype;
@@ -121,12 +121,12 @@ struct marker {
 	uint8_t tlv_type_terminator;
 	uint8_t terminator_length;
 	uint8_t reserved_90[90];
-} __attribute__((__packed__)) __rte_aligned(2);
+} __rte_packed __rte_aligned(2);
 
 struct marker_header {
 	struct rte_ether_hdr eth_hdr;
 	struct marker marker;
-} __attribute__((__packed__)) __rte_aligned(2);
+} __rte_packed __rte_aligned(2);
 
 struct rte_eth_bond_8023ad_conf {
 	uint32_t fast_periodic_ms;
diff --git a/drivers/net/dpaa/dpaa_rxtx.h b/drivers/net/dpaa/dpaa_rxtx.h
index 75b093c1e0..4f896fba11 100644
--- a/drivers/net/dpaa/dpaa_rxtx.h
+++ b/drivers/net/dpaa/dpaa_rxtx.h
@@ -170,8 +170,8 @@ struct dpaa_eth_parse_results_t {
 			uint16_t      vlan:1;
 			uint16_t      ethernet:1;
 #endif
-		} __attribute__((__packed__));
-	 } __attribute__((__packed__));
+		} __rte_packed;
+	 } __rte_packed;
 	 union {
 		uint16_t              l3r;	/**< Layer 3 result */
 		struct {
@@ -198,8 +198,8 @@ struct dpaa_eth_parse_results_t {
 			uint16_t      first_ipv6:1;
 			uint16_t      first_ipv4:1;
 #endif
-		} __attribute__((__packed__));
-	 } __attribute__((__packed__));
+		} __rte_packed;
+	 } __rte_packed;
 	 union {
 		uint8_t               l4r;	/**< Layer 4 result */
 		struct{
@@ -214,8 +214,8 @@ struct dpaa_eth_parse_results_t {
 			uint8_t        l4_info_err:1;
 			uint8_t        l4_type:3;
 #endif
-		} __attribute__((__packed__));
-	 } __attribute__((__packed__));
+		} __rte_packed;
+	 } __rte_packed;
 	 uint8_t     cplan;		 /**< Classification plan id */
 	 uint16_t    nxthdr;		 /**< Next Header  */
 	 uint16_t    cksum;		 /**< Checksum */
@@ -231,7 +231,7 @@ struct dpaa_eth_parse_results_t {
 	 uint8_t     gre_off;		 /**< GRE offset */
 	 uint8_t     l4_off;		 /**< Layer 4 offset */
 	 uint8_t     nxthdr_off;	 /**< Parser end point */
-} __attribute__ ((__packed__));
+} __rte_packed;
 
 /* The structure is the Prepended Data to the Frame which is used by FMAN */
 struct annotations_t {
diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h b/drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h
index 4dd7be1d59..7e5e499b6a 100644
--- a/drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h
+++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h
@@ -37,7 +37,7 @@ struct dpaa2_fas {
 	uint8_t ppid;
 	__le16 ifpid;
 	__le32 status;
-}  __attribute__((__packed__));
+}  __rte_packed;
 
 /**
  * HW Packet Annotation  Register structures
diff --git a/drivers/net/enic/base/vnic_devcmd.h b/drivers/net/enic/base/vnic_devcmd.h
index 09477ab1ce..a2f577f1e3 100644
--- a/drivers/net/enic/base/vnic_devcmd.h
+++ b/drivers/net/enic/base/vnic_devcmd.h
@@ -772,7 +772,7 @@ struct filter_usnic_id {
 	uint16_t ethtype;
 	uint8_t proto_version;
 	uint32_t usnic_id;
-} __attribute__((packed));
+} __rte_packed;
 
 #define FILTER_FIELD_5TUP_PROTO  FILTER_FIELD_VALID(1)
 #define FILTER_FIELD_5TUP_SRC_AD FILTER_FIELD_VALID(2)
@@ -801,7 +801,7 @@ struct filter_ipv4_5tuple {
 	uint32_t dst_addr;
 	uint16_t src_port;
 	uint16_t dst_port;
-} __attribute__((packed));
+} __rte_packed;
 
 #define FILTER_FIELD_VMQ_VLAN   FILTER_FIELD_VALID(1)
 #define FILTER_FIELD_VMQ_MAC    FILTER_FIELD_VALID(2)
@@ -815,7 +815,7 @@ struct filter_mac_vlan {
 	uint32_t flags;
 	uint16_t vlan;
 	uint8_t mac_addr[6];
-} __attribute__((packed));
+} __rte_packed;
 
 #define FILTER_FIELD_VLAN_IP_3TUP_VLAN      FILTER_FIELD_VALID(1)
 #define FILTER_FIELD_VLAN_IP_3TUP_L3_PROTO  FILTER_FIELD_VALID(2)
@@ -839,7 +839,7 @@ struct filter_vlan_ip_3tuple {
 	} u;
 	uint32_t l4_protocol;
 	uint16_t dst_port;
-} __attribute__((packed));
+} __rte_packed;
 
 #define FILTER_GENERIC_1_BYTES 64
 
@@ -877,8 +877,8 @@ struct filter_generic_1 {
 							 * " don't care"
 							 */
 		uint8_t val[FILTER_GENERIC_1_KEY_LEN];
-	} __attribute__((packed)) layer[FILTER_GENERIC_1_NUM_LAYERS];
-} __attribute__((packed));
+	} __rte_packed layer[FILTER_GENERIC_1_NUM_LAYERS];
+} __rte_packed;
 
 /* Specifies the filter_action type. */
 enum {
@@ -892,7 +892,7 @@ struct filter_action {
 	union {
 		uint32_t rq_idx;
 	} u;
-} __attribute__((packed));
+} __rte_packed;
 
 #define FILTER_ACTION_RQ_STEERING_FLAG	(1 << 0)
 #define FILTER_ACTION_FILTER_ID_FLAG	(1 << 1)
@@ -911,7 +911,7 @@ struct filter_action_v2 {
 	uint32_t flags;               /* use FILTER_ACTION_XXX_FLAG defines */
 	uint16_t filter_id;
 	uint8_t reserved[32];         /* for future expansion */
-} __attribute__((packed));
+} __rte_packed;
 
 /* Specifies the filter type. */
 enum filter_type {
@@ -949,7 +949,7 @@ struct filter {
 		struct filter_mac_vlan mac_vlan;
 		struct filter_vlan_ip_3tuple vlan_3tuple;
 	} u;
-} __attribute__((packed));
+} __rte_packed;
 
 /*
  * This is a strict superset of "struct filter" and exists only
@@ -969,7 +969,7 @@ struct filter_v2 {
 		struct filter_vlan_ip_3tuple vlan_3tuple;
 		struct filter_generic_1 generic_1;
 	} u;
-} __attribute__((packed));
+} __rte_packed;
 
 enum {
 	CLSF_TLV_FILTER = 0,
diff --git a/drivers/net/i40e/base/i40e_osdep.h b/drivers/net/i40e/base/i40e_osdep.h
index 8a2d82a8d0..17eee94533 100644
--- a/drivers/net/i40e/base/i40e_osdep.h
+++ b/drivers/net/i40e/base/i40e_osdep.h
@@ -158,7 +158,7 @@ struct i40e_dma_mem {
 	u64 pa;
 	u32 size;
 	const void *zone;
-} __attribute__((packed));
+} __rte_packed;
 
 #define i40e_allocate_dma_mem(h, m, unused, s, a) \
 			i40e_allocate_dma_mem_d(h, m, s, a)
@@ -167,7 +167,7 @@ struct i40e_dma_mem {
 struct i40e_virt_mem {
 	void *va;
 	u32 size;
-} __attribute__((packed));
+} __rte_packed;
 
 #define i40e_allocate_virt_mem(h, m, s) i40e_allocate_virt_mem_d(h, m, s)
 #define i40e_free_virt_mem(h, m) i40e_free_virt_mem_d(h, m)
diff --git a/drivers/net/ice/base/ice_osdep.h b/drivers/net/ice/base/ice_osdep.h
index a4a2994c76..aac8969eb8 100644
--- a/drivers/net/ice/base/ice_osdep.h
+++ b/drivers/net/ice/base/ice_osdep.h
@@ -126,7 +126,7 @@ writeq(uint64_t value, volatile void *addr)
 #define __maybe_unused  __attribute__((unused))
 #endif
 #ifndef __packed
-#define __packed  __attribute__((packed))
+#define __packed  __rte_packed
 #endif
 
 #ifndef BIT_ULL
@@ -180,12 +180,12 @@ struct ice_dma_mem {
 	u64 pa;
 	u32 size;
 	const void *zone;
-} __attribute__((packed));
+} __rte_packed;
 
 struct ice_virt_mem {
 	void *va;
 	u32 size;
-} __attribute__((packed));
+} __rte_packed;
 
 #define ice_malloc(h, s)    rte_zmalloc(NULL, s, 0)
 #define ice_calloc(h, c, s) rte_zmalloc(NULL, (c) * (s), 0)
diff --git a/drivers/net/nfp/nfp_net_pmd.h b/drivers/net/nfp/nfp_net_pmd.h
index f0142e1ff7..cb2d19afe6 100644
--- a/drivers/net/nfp/nfp_net_pmd.h
+++ b/drivers/net/nfp/nfp_net_pmd.h
@@ -182,7 +182,7 @@ struct nfp_net_tx_desc {
 				__le16 vlan; /* VLAN tag to add if indicated */
 			};
 			__le16 data_len;    /* Length of frame + meta data */
-		} __attribute__((__packed__));
+		} __rte_packed;
 		__le32 vals[4];
 	};
 };
@@ -278,7 +278,7 @@ struct nfp_net_rx_desc {
 			uint8_t dd;
 
 			__le32 dma_addr_lo;
-		} __attribute__((__packed__)) fld;
+		} __rte_packed fld;
 
 		/* RX descriptor */
 		struct {
@@ -288,7 +288,7 @@ struct nfp_net_rx_desc {
 
 			__le16 flags;
 			__le16 vlan;
-		} __attribute__((__packed__)) rxd;
+		} __rte_packed rxd;
 
 		__le32 vals[2];
 	};
diff --git a/drivers/net/softnic/rte_eth_softnic_cli.c b/drivers/net/softnic/rte_eth_softnic_cli.c
index bc95f16439..932ec15f49 100644
--- a/drivers/net/softnic/rte_eth_softnic_cli.c
+++ b/drivers/net/softnic/rte_eth_softnic_cli.c
@@ -3358,7 +3358,7 @@ struct pkt_key_qinq {
 	uint16_t svlan;
 	uint16_t ethertype_cvlan;
 	uint16_t cvlan;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct pkt_key_ipv4_5tuple {
 	uint8_t time_to_live;
@@ -3368,7 +3368,7 @@ struct pkt_key_ipv4_5tuple {
 	uint32_t da;
 	uint16_t sp;
 	uint16_t dp;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct pkt_key_ipv6_5tuple {
 	uint16_t payload_length;
@@ -3378,15 +3378,15 @@ struct pkt_key_ipv6_5tuple {
 	uint8_t da[16];
 	uint16_t sp;
 	uint16_t dp;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct pkt_key_ipv4_addr {
 	uint32_t addr;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct pkt_key_ipv6_addr {
 	uint8_t addr[16];
-} __attribute__((__packed__));
+} __rte_packed;
 
 static uint32_t
 parse_match(char **tokens,
diff --git a/drivers/net/tap/tap_bpf_program.c b/drivers/net/tap/tap_bpf_program.c
index 532e8838fe..20c310e5e7 100644
--- a/drivers/net/tap/tap_bpf_program.c
+++ b/drivers/net/tap/tap_bpf_program.c
@@ -75,14 +75,14 @@ struct ipv4_l3_l4_tuple {
 	__u32    dst_addr;
 	__u16    dport;
 	__u16    sport;
-} __attribute__((packed));
+} __rte_packed;
 
 struct ipv6_l3_l4_tuple {
 	__u8        src_addr[16];
 	__u8        dst_addr[16];
 	__u16       dport;
 	__u16       sport;
-} __attribute__((packed));
+} __rte_packed;
 
 static const __u8 def_rss_key[TAP_RSS_HASH_KEY_SIZE] = {
 	0xd1, 0x81, 0xc6, 0x2c,
diff --git a/drivers/net/tap/tap_rss.h b/drivers/net/tap/tap_rss.h
index 17606b2d6e..176e7180bd 100644
--- a/drivers/net/tap/tap_rss.h
+++ b/drivers/net/tap/tap_rss.h
@@ -35,6 +35,6 @@ struct rss_key {
 	__u32 key_size;
 	__u32 queues[TAP_MAX_QUEUES];
 	__u32 nb_queues;
-} __attribute__((packed));
+} __rte_packed;
 
 #endif /* _TAP_RSS_H_ */
diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h
index 7433d2f085..302d6c3e7a 100644
--- a/drivers/net/virtio/virtio_pci.h
+++ b/drivers/net/virtio/virtio_pci.h
@@ -305,7 +305,7 @@ struct virtio_net_config {
 	uint16_t   status;
 	uint16_t   max_virtqueue_pairs;
 	uint16_t   mtu;
-} __attribute__((packed));
+} __rte_packed;
 
 /*
  * How many bits to shift physical queue address written to QUEUE_PFN.
diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c
index d8e083ba8b..74b82e56e4 100644
--- a/drivers/net/virtio/virtio_user/vhost_user.c
+++ b/drivers/net/virtio/virtio_user/vhost_user.c
@@ -43,7 +43,7 @@ struct vhost_user_msg {
 		struct vhost_memory memory;
 	} payload;
 	int fds[VHOST_MEMORY_MAX_NREGIONS];
-} __attribute((packed));
+} __rte_packed;
 
 #define VHOST_USER_HDR_SIZE offsetof(struct vhost_user_msg, payload.u64)
 #define VHOST_USER_PAYLOAD_SIZE \
diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index d8cf5d4e2f..e3d38b5a67 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -182,7 +182,7 @@ enum { VTNET_RQ = 0, VTNET_TQ = 1, VTNET_CQ = 2 };
 struct virtio_net_ctrl_mac {
 	uint32_t entries;
 	uint8_t macs[][RTE_ETHER_ADDR_LEN];
-} __attribute__((__packed__));
+} __rte_packed;
 
 #define VIRTIO_NET_CTRL_MAC    1
 #define VIRTIO_NET_CTRL_MAC_TABLE_SET        0
@@ -215,7 +215,7 @@ struct virtio_net_ctrl_mac {
 struct virtio_net_ctrl_hdr {
 	uint8_t class;
 	uint8_t cmd;
-} __attribute__((packed));
+} __rte_packed;
 
 typedef uint8_t virtio_net_ctrl_ack;
 
diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.h b/drivers/raw/dpaa2_qdma/dpaa2_qdma.h
index 1bce1a4d64..017638075d 100644
--- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.h
+++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.h
@@ -155,7 +155,7 @@ struct qdma_sdd {
 			uint32_t wrttype:4;
 		} write_cmd;
 	};
-} __attribute__ ((__packed__));
+} __rte_packed;
 
 /** Represents a DPDMAI raw device */
 struct dpaa2_dpdmai_dev {
diff --git a/drivers/raw/ifpga/base/opae_hw_api.h b/drivers/raw/ifpga/base/opae_hw_api.h
index cdf369fce5..cf8ff93a69 100644
--- a/drivers/raw/ifpga/base/opae_hw_api.h
+++ b/drivers/raw/ifpga/base/opae_hw_api.h
@@ -309,7 +309,7 @@ static inline void opae_adapter_remove_acc(struct opae_adapter *adapter,
 
 struct opae_ether_addr {
 	unsigned char addr_bytes[OPAE_ETHER_ADDR_LEN];
-} __attribute__((__packed__));
+} __rte_packed;
 
 /* OPAE vBNG network API*/
 int opae_manager_read_mac_rom(struct opae_manager *mgr, int port,
diff --git a/drivers/raw/ioat/rte_ioat_spec.h b/drivers/raw/ioat/rte_ioat_spec.h
index 305e36dedb..c6e7929b2c 100644
--- a/drivers/raw/ioat/rte_ioat_spec.h
+++ b/drivers/raw/ioat/rte_ioat_spec.h
@@ -67,7 +67,7 @@ struct rte_ioat_registers {
 	uint8_t		reserved2[0x8];	/* 0xA0 */
 	uint32_t	chanerr;	/* 0xA8 */
 	uint32_t	chanerrmask;	/* 0xAC */
-} __attribute__((packed));
+} __rte_packed;
 
 #define RTE_IOAT_CHANCMD_RESET			0x20
 #define RTE_IOAT_CHANCMD_SUSPEND		0x04
diff --git a/drivers/vdpa/ifc/base/ifcvf.h b/drivers/vdpa/ifc/base/ifcvf.h
index 9be2770fea..eb04a94067 100644
--- a/drivers/vdpa/ifc/base/ifcvf.h
+++ b/drivers/vdpa/ifc/base/ifcvf.h
@@ -100,7 +100,7 @@ struct ifcvf_net_config {
 	u8    mac[6];
 	u16   status;
 	u16   max_virtqueue_pairs;
-} __attribute__((packed));
+} __rte_packed;
 
 struct ifcvf_pci_mem_resource {
 	u64      phys_addr; /**< Physical address, 0 if not resource. */
diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c
index 3e23f4e7b7..d79699e2ed 100644
--- a/examples/ip_pipeline/cli.c
+++ b/examples/ip_pipeline/cli.c
@@ -2671,7 +2671,7 @@ struct pkt_key_qinq {
 	uint16_t svlan;
 	uint16_t ethertype_cvlan;
 	uint16_t cvlan;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct pkt_key_ipv4_5tuple {
 	uint8_t time_to_live;
@@ -2681,7 +2681,7 @@ struct pkt_key_ipv4_5tuple {
 	uint32_t da;
 	uint16_t sp;
 	uint16_t dp;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct pkt_key_ipv6_5tuple {
 	uint16_t payload_length;
@@ -2691,15 +2691,15 @@ struct pkt_key_ipv6_5tuple {
 	uint8_t da[16];
 	uint16_t sp;
 	uint16_t dp;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct pkt_key_ipv4_addr {
 	uint32_t addr;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct pkt_key_ipv6_addr {
 	uint8_t addr[16];
-} __attribute__((__packed__));
+} __rte_packed;
 
 static uint32_t
 parse_match(char **tokens,
diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h
index 4f2fd61840..a70a4c4f4e 100644
--- a/examples/ipsec-secgw/ipsec.h
+++ b/examples/ipsec-secgw/ipsec.h
@@ -231,7 +231,7 @@ struct cnt_blk {
 	uint32_t salt;
 	uint64_t iv;
 	uint32_t cnt;
-} __attribute__((packed));
+} __rte_packed;
 
 struct traffic_type {
 	const uint8_t *data[MAX_PKT_BURST * 2];
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index e90d18b24f..bb132441d9 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -280,7 +280,7 @@ struct ipv4_5tuple {
 	uint16_t port_dst;
 	uint16_t port_src;
 	uint8_t  proto;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct ipv6_5tuple {
 	uint8_t  ip_dst[IPV6_ADDR_LEN];
@@ -288,7 +288,7 @@ struct ipv6_5tuple {
 	uint16_t port_dst;
 	uint16_t port_src;
 	uint8_t  proto;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct ipv4_l3fwd_route {
 	struct ipv4_5tuple key;
diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c
index 1226709106..7dab299526 100644
--- a/examples/l3fwd/l3fwd_em.c
+++ b/examples/l3fwd/l3fwd_em.c
@@ -48,7 +48,7 @@ struct ipv4_5tuple {
 	uint16_t port_dst;
 	uint16_t port_src;
 	uint8_t  proto;
-} __attribute__((__packed__));
+} __rte_packed;
 
 union ipv4_5tuple_host {
 	struct {
@@ -71,7 +71,7 @@ struct ipv6_5tuple {
 	uint16_t port_dst;
 	uint16_t port_src;
 	uint8_t  proto;
-} __attribute__((__packed__));
+} __rte_packed;
 
 union ipv6_5tuple_host {
 	struct {
diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index ad540fd842..73a811c99e 100644
--- a/examples/performance-thread/l3fwd-thread/main.c
+++ b/examples/performance-thread/l3fwd-thread/main.c
@@ -331,7 +331,7 @@ struct ipv4_5tuple {
 	uint16_t port_dst;
 	uint16_t port_src;
 	uint8_t  proto;
-} __attribute__((__packed__));
+} __rte_packed;
 
 union ipv4_5tuple_host {
 	struct {
@@ -354,7 +354,7 @@ struct ipv6_5tuple {
 	uint16_t port_dst;
 	uint16_t port_src;
 	uint8_t  proto;
-} __attribute__((__packed__));
+} __rte_packed;
 
 union ipv6_5tuple_host {
 	struct {
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index a1a7ae699a..6fcd1aa26e 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -62,7 +62,7 @@ struct tstamp {
 	uint16_t   sec_msb;
 	uint32_t   sec_lsb;
 	uint32_t   ns;
-}  __attribute__((packed));
+}  __rte_packed;
 
 struct clock_id {
 	uint8_t id[8];
@@ -71,7 +71,7 @@ struct clock_id {
 struct port_id {
 	struct clock_id        clock_id;
 	uint16_t               port_number;
-}  __attribute__((packed));
+}  __rte_packed;
 
 struct ptp_header {
 	uint8_t              msg_type;
@@ -86,30 +86,30 @@ struct ptp_header {
 	uint16_t             seq_id;
 	uint8_t              control;
 	int8_t               log_message_interval;
-} __attribute__((packed));
+} __rte_packed;
 
 struct sync_msg {
 	struct ptp_header   hdr;
 	struct tstamp       origin_tstamp;
-} __attribute__((packed));
+} __rte_packed;
 
 struct follow_up_msg {
 	struct ptp_header   hdr;
 	struct tstamp       precise_origin_tstamp;
 	uint8_t             suffix[0];
-} __attribute__((packed));
+} __rte_packed;
 
 struct delay_req_msg {
 	struct ptp_header   hdr;
 	struct tstamp       origin_tstamp;
-} __attribute__((packed));
+} __rte_packed;
 
 struct delay_resp_msg {
 	struct ptp_header    hdr;
 	struct tstamp        rx_tstamp;
 	struct port_id       req_port_id;
 	uint8_t              suffix[0];
-} __attribute__((packed));
+} __rte_packed;
 
 struct ptp_message {
 	union {
@@ -118,7 +118,7 @@ struct ptp_message {
 		struct delay_req_msg       delay_req;
 		struct follow_up_msg       follow_up;
 		struct delay_resp_msg      delay_resp;
-	} __attribute__((packed));
+	} __rte_packed;
 };
 
 struct ptpv2_data_slave_ordinary {
diff --git a/examples/vhost_blk/blk_spec.h b/examples/vhost_blk/blk_spec.h
index 5875e2f869..594bd6a29b 100644
--- a/examples/vhost_blk/blk_spec.h
+++ b/examples/vhost_blk/blk_spec.h
@@ -90,6 +90,6 @@ struct vhost_user_msg {
 		struct vhost_memory_padded memory;
 		struct vhost_user_config cfg;
 	} payload;
-} __attribute((packed));
+} __rte_packed;
 
 #endif
diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h
index ddcfbe2e44..8536ed70bb 100644
--- a/lib/librte_eal/common/eal_private.h
+++ b/lib/librte_eal/common/eal_private.h
@@ -57,7 +57,7 @@ struct rte_config {
 	 * DPDK instances
 	 */
 	struct rte_mem_config *mem_config;
-} __attribute__((__packed__));
+} __rte_packed;
 
 /**
  * Get the global configuration structure.
diff --git a/lib/librte_eal/common/include/rte_memzone.h b/lib/librte_eal/common/include/rte_memzone.h
index f478fa9e67..091c9522f7 100644
--- a/lib/librte_eal/common/include/rte_memzone.h
+++ b/lib/librte_eal/common/include/rte_memzone.h
@@ -68,7 +68,7 @@ struct rte_memzone {
 	int32_t socket_id;                /**< NUMA socket ID. */
 
 	uint32_t flags;                   /**< Characteristics of this memzone. */
-} __attribute__((__packed__));
+} __rte_packed;
 
 /**
  * Reserve a portion of physical memory.
diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c
index 4deeb17924..6a799556d4 100644
--- a/lib/librte_efd/rte_efd.c
+++ b/lib/librte_efd/rte_efd.c
@@ -207,7 +207,7 @@ struct efd_offline_chunk_rules {
 struct efd_online_group_entry {
 	efd_hashfunc_t hash_idx[RTE_EFD_VALUE_NUM_BITS];
 	efd_lookuptbl_t lookup_table[RTE_EFD_VALUE_NUM_BITS];
-} __attribute__((__packed__));
+} __rte_packed;
 
 /**
  * A single chunk record, containing EFD_TARGET_CHUNK_NUM_RULES rules.
@@ -223,7 +223,7 @@ struct efd_online_chunk {
 
 	struct efd_online_group_entry groups[EFD_CHUNK_NUM_GROUPS];
 	/**< Array of all the groups in the chunk. */
-} __attribute__((__packed__));
+} __rte_packed;
 
 /**
  * EFD table structure
diff --git a/lib/librte_ip_frag/rte_ip_frag.h b/lib/librte_ip_frag/rte_ip_frag.h
index 0c0d95f47a..66edd7e33a 100644
--- a/lib/librte_ip_frag/rte_ip_frag.h
+++ b/lib/librte_ip_frag/rte_ip_frag.h
@@ -131,7 +131,7 @@ struct ipv6_extension_fragment {
 	uint8_t reserved;               /**< Reserved */
 	uint16_t frag_data;             /**< All fragmentation data */
 	uint32_t id;                    /**< Packet ID */
-} __attribute__((__packed__));
+} __rte_packed;
 
 
 
diff --git a/lib/librte_ipsec/crypto.h b/lib/librte_ipsec/crypto.h
index f8fbf8d4f3..3d03034590 100644
--- a/lib/librte_ipsec/crypto.h
+++ b/lib/librte_ipsec/crypto.h
@@ -19,7 +19,7 @@ struct aesctr_cnt_blk {
 	uint32_t nonce;
 	uint64_t iv;
 	uint32_t cnt;
-} __attribute__((packed));
+} __rte_packed;
 
  /*
   * AES-GCM devices have some specific requirements for IV and AAD formats.
@@ -30,7 +30,7 @@ struct aead_gcm_iv {
 	uint32_t salt;
 	uint64_t iv;
 	uint32_t cnt;
-} __attribute__((packed));
+} __rte_packed;
 
 struct aead_gcm_aad {
 	uint32_t spi;
@@ -44,12 +44,12 @@ struct aead_gcm_aad {
 		uint64_t u64;
 	} sqn;
 	uint32_t align0; /* align to 16B boundary */
-} __attribute__((packed));
+} __rte_packed;
 
 struct gcm_esph_iv {
 	struct rte_esp_hdr esph;
 	uint64_t iv;
-} __attribute__((packed));
+} __rte_packed;
 
 static inline void
 aes_ctr_cnt_blk_fill(struct aesctr_cnt_blk *ctr, uint64_t iv, uint32_t nonce)
diff --git a/lib/librte_net/rte_arp.h b/lib/librte_net/rte_arp.h
index 79a764fc85..feb0eb3e49 100644
--- a/lib/librte_net/rte_arp.h
+++ b/lib/librte_net/rte_arp.h
@@ -26,7 +26,7 @@ struct rte_arp_ipv4 {
 	uint32_t          arp_sip;  /**< sender IP address */
 	struct rte_ether_addr arp_tha;  /**< target hardware address */
 	uint32_t          arp_tip;  /**< target IP address */
-} __attribute__((__packed__)) __rte_aligned(2);
+} __rte_packed __rte_aligned(2);
 
 /**
  * ARP header.
@@ -47,7 +47,7 @@ struct rte_arp_hdr {
 #define	RTE_ARP_OP_INVREPLY   9 /* response identifying peer */
 
 	struct rte_arp_ipv4 arp_data;
-} __attribute__((__packed__)) __rte_aligned(2);
+} __rte_packed __rte_aligned(2);
 
 /**
  * @warning
diff --git a/lib/librte_net/rte_esp.h b/lib/librte_net/rte_esp.h
index bc7b20a964..464c513e2b 100644
--- a/lib/librte_net/rte_esp.h
+++ b/lib/librte_net/rte_esp.h
@@ -23,7 +23,7 @@ extern "C" {
 struct rte_esp_hdr {
 	rte_be32_t spi;  /**< Security Parameters Index */
 	rte_be32_t seq;  /**< packet sequence number */
-} __attribute__((__packed__));
+} __rte_packed;
 
 /**
  * ESP Trailer
@@ -31,7 +31,7 @@ struct rte_esp_hdr {
 struct rte_esp_tail {
 	uint8_t pad_len;     /**< number of pad bytes (0-255) */
 	uint8_t next_proto;  /**< IPv4 or IPv6 or next layer header */
-} __attribute__((__packed__));
+} __rte_packed;
 
 #ifdef __cplusplus
 }
diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
index 850c0fa387..0ae4e75b6c 100644
--- a/lib/librte_net/rte_ether.h
+++ b/lib/librte_net/rte_ether.h
@@ -283,7 +283,7 @@ struct rte_ether_hdr {
 struct rte_vlan_hdr {
 	uint16_t vlan_tci; /**< Priority (3) + CFI (1) + Identifier Code (12) */
 	uint16_t eth_proto;/**< Ethernet type of encapsulated frame. */
-} __attribute__((__packed__));
+} __rte_packed;
 
 
 
diff --git a/lib/librte_net/rte_gre.h b/lib/librte_net/rte_gre.h
index b5279ede17..ac3ddaada3 100644
--- a/lib/librte_net/rte_gre.h
+++ b/lib/librte_net/rte_gre.h
@@ -35,7 +35,7 @@ struct rte_gre_hdr {
 	uint16_t ver:3;  /**< Version Number */
 #endif
 	uint16_t proto;  /**< Protocol Type */
-} __attribute__((__packed__));
+} __rte_packed;
 
 #ifdef __cplusplus
 }
diff --git a/lib/librte_net/rte_gtp.h b/lib/librte_net/rte_gtp.h
index 59267c07b7..104384cc53 100644
--- a/lib/librte_net/rte_gtp.h
+++ b/lib/librte_net/rte_gtp.h
@@ -32,7 +32,7 @@ struct rte_gtp_hdr {
 	uint8_t msg_type;     /**< GTP message type */
 	uint16_t plen;        /**< Total payload length */
 	uint32_t teid;        /**< Tunnel endpoint ID */
-} __attribute__((__packed__));
+} __rte_packed;
 
 /** GTP header length */
 #define RTE_ETHER_GTP_HLEN \
diff --git a/lib/librte_net/rte_icmp.h b/lib/librte_net/rte_icmp.h
index e0aeed443e..4429e8e29f 100644
--- a/lib/librte_net/rte_icmp.h
+++ b/lib/librte_net/rte_icmp.h
@@ -31,7 +31,7 @@ struct rte_icmp_hdr {
 	rte_be16_t icmp_cksum;  /* ICMP packet checksum. */
 	rte_be16_t icmp_ident;  /* ICMP packet identifier. */
 	rte_be16_t icmp_seq_nb; /* ICMP packet sequence number. */
-} __attribute__((__packed__));
+} __rte_packed;
 
 /* ICMP packet types */
 #define RTE_IP_ICMP_ECHO_REPLY   0
diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h
index 1ceb7b7931..a69430f9b7 100644
--- a/lib/librte_net/rte_ip.h
+++ b/lib/librte_net/rte_ip.h
@@ -41,7 +41,7 @@ struct rte_ipv4_hdr {
 	rte_be16_t hdr_checksum;	/**< header checksum */
 	rte_be32_t src_addr;		/**< source address */
 	rte_be32_t dst_addr;		/**< destination address */
-} __attribute__((__packed__));
+} __rte_packed;
 
 /** Create IPv4 address */
 #define RTE_IPV4(a, b, c, d) ((uint32_t)(((a) & 0xff) << 24) | \
@@ -360,7 +360,7 @@ struct rte_ipv6_hdr {
 	uint8_t  hop_limits;	/**< Hop limits. */
 	uint8_t  src_addr[16];	/**< IP address of source host. */
 	uint8_t  dst_addr[16];	/**< IP address of destination host(s). */
-} __attribute__((__packed__));
+} __rte_packed;
 
 /* IPv6 vtc_flow: IPv / TC / flow_label */
 #define RTE_IPV6_HDR_FL_SHIFT 0
diff --git a/lib/librte_net/rte_mpls.h b/lib/librte_net/rte_mpls.h
index 32b6431219..db91707e67 100644
--- a/lib/librte_net/rte_mpls.h
+++ b/lib/librte_net/rte_mpls.h
@@ -33,7 +33,7 @@ struct rte_mpls_hdr {
 	uint8_t tag_lsb:4;  /**< label(lsb) */
 #endif
 	uint8_t  ttl;       /**< Time to live. */
-} __attribute__((__packed__));
+} __rte_packed;
 
 #ifdef __cplusplus
 }
diff --git a/lib/librte_net/rte_sctp.h b/lib/librte_net/rte_sctp.h
index ab38be7689..965682dc2b 100644
--- a/lib/librte_net/rte_sctp.h
+++ b/lib/librte_net/rte_sctp.h
@@ -30,7 +30,7 @@ struct rte_sctp_hdr {
 	rte_be16_t dst_port; /**< Destin port. */
 	rte_be32_t tag;      /**< Validation tag. */
 	rte_be32_t cksum;    /**< Checksum. */
-} __attribute__((__packed__));
+} __rte_packed;
 
 #ifdef __cplusplus
 }
diff --git a/lib/librte_net/rte_tcp.h b/lib/librte_net/rte_tcp.h
index 06f623da83..506ac4e8ce 100644
--- a/lib/librte_net/rte_tcp.h
+++ b/lib/librte_net/rte_tcp.h
@@ -35,7 +35,7 @@ struct rte_tcp_hdr {
 	rte_be16_t rx_win;   /**< RX flow control window. */
 	rte_be16_t cksum;    /**< TCP checksum. */
 	rte_be16_t tcp_urp;  /**< TCP urgent pointer, if any. */
-} __attribute__((__packed__));
+} __rte_packed;
 
 /**
  * TCP Flags
diff --git a/lib/librte_net/rte_udp.h b/lib/librte_net/rte_udp.h
index 01c26b3de5..6135494c4a 100644
--- a/lib/librte_net/rte_udp.h
+++ b/lib/librte_net/rte_udp.h
@@ -30,7 +30,7 @@ struct rte_udp_hdr {
 	rte_be16_t dst_port;    /**< UDP destination port. */
 	rte_be16_t dgram_len;   /**< UDP datagram length */
 	rte_be16_t dgram_cksum; /**< UDP datagram checksum */
-} __attribute__((__packed__));
+} __rte_packed;
 
 #ifdef __cplusplus
 }
diff --git a/lib/librte_net/rte_vxlan.h b/lib/librte_net/rte_vxlan.h
index 63fc27240f..c23c10c9eb 100644
--- a/lib/librte_net/rte_vxlan.h
+++ b/lib/librte_net/rte_vxlan.h
@@ -31,7 +31,7 @@ extern "C" {
 struct rte_vxlan_hdr {
 	uint32_t vx_flags; /**< flag (8) + Reserved (24). */
 	uint32_t vx_vni;   /**< VNI (24) + Reserved (8). */
-} __attribute__((__packed__));
+} __rte_packed;
 
 /** VXLAN tunnel header length. */
 #define RTE_ETHER_VXLAN_HLEN \
@@ -48,7 +48,7 @@ struct rte_vxlan_gpe_hdr {
 	uint8_t reserved[2]; /**< Reserved (16). */
 	uint8_t proto;       /**< next-protocol (8). */
 	uint32_t vx_vni;     /**< VNI (24) + Reserved (8). */
-} __attribute__((__packed__));
+} __rte_packed;
 
 /** VXLAN-GPE tunnel header length. */
 #define RTE_ETHER_VXLAN_GPE_HLEN (sizeof(struct rte_udp_hdr) + \
diff --git a/lib/librte_pipeline/rte_table_action.c b/lib/librte_pipeline/rte_table_action.c
index e6af23b688..98f3438774 100644
--- a/lib/librte_pipeline/rte_table_action.c
+++ b/lib/librte_pipeline/rte_table_action.c
@@ -64,7 +64,7 @@ lb_cfg_check(struct rte_table_action_lb_config *cfg)
 
 struct lb_data {
 	uint32_t out[RTE_TABLE_ACTION_LB_TABLE_SIZE];
-} __attribute__((__packed__));
+} __rte_packed;
 
 static int
 lb_apply(struct lb_data *data,
@@ -111,7 +111,7 @@ mtr_cfg_check(struct rte_table_action_mtr_config *mtr)
 struct mtr_trtcm_data {
 	struct rte_meter_trtcm trtcm;
 	uint64_t stats[RTE_COLORS];
-} __attribute__((__packed__));
+} __rte_packed;
 
 #define MTR_TRTCM_DATA_METER_PROFILE_ID_GET(data)          \
 	(((data)->stats[RTE_COLOR_GREEN] & 0xF8LLU) >> 3)
@@ -361,7 +361,7 @@ tm_cfg_check(struct rte_table_action_tm_config *tm)
 struct tm_data {
 	uint32_t queue_id;
 	uint32_t reserved;
-} __attribute__((__packed__));
+} __rte_packed;
 
 static int
 tm_apply_check(struct rte_table_action_tm_params *p,
@@ -471,7 +471,7 @@ struct encap_mpls_data {
 	struct rte_ether_hdr ether;
 	uint32_t mpls[RTE_TABLE_ACTION_MPLS_LABELS_MAX];
 	uint32_t mpls_count;
-} __attribute__((__packed__)) __rte_aligned(2);
+} __rte_packed __rte_aligned(2);
 
 #define PPP_PROTOCOL_IP                                    0x0021
 
@@ -494,7 +494,7 @@ struct encap_vxlan_ipv4_data {
 	struct rte_ipv4_hdr ipv4;
 	struct rte_udp_hdr udp;
 	struct rte_vxlan_hdr vxlan;
-} __attribute__((__packed__)) __rte_aligned(2);
+} __rte_packed __rte_aligned(2);
 
 struct encap_vxlan_ipv4_vlan_data {
 	struct rte_ether_hdr ether;
@@ -502,14 +502,14 @@ struct encap_vxlan_ipv4_vlan_data {
 	struct rte_ipv4_hdr ipv4;
 	struct rte_udp_hdr udp;
 	struct rte_vxlan_hdr vxlan;
-} __attribute__((__packed__)) __rte_aligned(2);
+} __rte_packed __rte_aligned(2);
 
 struct encap_vxlan_ipv6_data {
 	struct rte_ether_hdr ether;
 	struct rte_ipv6_hdr ipv6;
 	struct rte_udp_hdr udp;
 	struct rte_vxlan_hdr vxlan;
-} __attribute__((__packed__)) __rte_aligned(2);
+} __rte_packed __rte_aligned(2);
 
 struct encap_vxlan_ipv6_vlan_data {
 	struct rte_ether_hdr ether;
@@ -517,14 +517,14 @@ struct encap_vxlan_ipv6_vlan_data {
 	struct rte_ipv6_hdr ipv6;
 	struct rte_udp_hdr udp;
 	struct rte_vxlan_hdr vxlan;
-} __attribute__((__packed__)) __rte_aligned(2);
+} __rte_packed __rte_aligned(2);
 
 struct encap_qinq_pppoe_data {
 	struct rte_ether_hdr ether;
 	struct rte_vlan_hdr svlan;
 	struct rte_vlan_hdr cvlan;
 	struct pppoe_ppp_hdr pppoe_ppp;
-} __attribute__((__packed__)) __rte_aligned(2);
+} __rte_packed __rte_aligned(2);
 
 static size_t
 encap_data_size(struct rte_table_action_encap_config *encap)
@@ -1209,12 +1209,12 @@ nat_cfg_check(struct rte_table_action_nat_config *nat)
 struct nat_ipv4_data {
 	uint32_t addr;
 	uint16_t port;
-} __attribute__((__packed__));
+} __rte_packed;
 
 struct nat_ipv6_data {
 	uint8_t addr[16];
 	uint16_t port;
-} __attribute__((__packed__));
+} __rte_packed;
 
 static size_t
 nat_data_size(struct rte_table_action_nat_config *nat __rte_unused,
@@ -1505,7 +1505,7 @@ ttl_cfg_check(struct rte_table_action_ttl_config *ttl)
 
 struct ttl_data {
 	uint32_t n_packets;
-} __attribute__((__packed__));
+} __rte_packed;
 
 #define TTL_INIT(data, decrement)                         \
 	((data)->n_packets = (decrement) ? 1 : 0)
@@ -1589,7 +1589,7 @@ stats_cfg_check(struct rte_table_action_stats_config *stats)
 struct stats_data {
 	uint64_t n_packets;
 	uint64_t n_bytes;
-} __attribute__((__packed__));
+} __rte_packed;
 
 static int
 stats_apply(struct stats_data *data,
@@ -1614,7 +1614,7 @@ pkt_work_stats(struct stats_data *data,
  */
 struct time_data {
 	uint64_t time;
-} __attribute__((__packed__));
+} __rte_packed;
 
 static int
 time_apply(struct time_data *data,
@@ -1727,7 +1727,7 @@ struct sym_crypto_data {
 	/** Private data size to store cipher iv / aad. */
 	uint8_t iv_aad_data[32];
 
-} __attribute__((__packed__));
+} __rte_packed;
 
 static int
 sym_crypto_cfg_check(struct rte_table_action_sym_crypto_config *cfg)
@@ -2070,7 +2070,7 @@ pkt_work_sym_crypto(struct rte_mbuf *mbuf, struct sym_crypto_data *data,
  */
 struct tag_data {
 	uint32_t tag;
-} __attribute__((__packed__));
+} __rte_packed;
 
 static int
 tag_apply(struct tag_data *data,
@@ -2114,7 +2114,7 @@ pkt4_work_tag(struct rte_mbuf *mbuf0,
  */
 struct decap_data {
 	uint16_t n;
-} __attribute__((__packed__));
+} __rte_packed;
 
 static int
 decap_apply(struct decap_data *data,
diff --git a/lib/librte_vhost/vhost_user.h b/lib/librte_vhost/vhost_user.h
index 86c364a935..1f65efa4a9 100644
--- a/lib/librte_vhost/vhost_user.h
+++ b/lib/librte_vhost/vhost_user.h
@@ -148,7 +148,7 @@ typedef struct VhostUserMsg {
 	} payload;
 	int fds[VHOST_MEMORY_MAX_NREGIONS];
 	int fd_num;
-} __attribute((packed)) VhostUserMsg;
+} __rte_packed VhostUserMsg;
 
 #define VHOST_USER_HDR_SIZE offsetof(VhostUserMsg, payload.u64)
 
-- 
2.25.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-dev] [PATCH 20.05 07/15] replace always-inline attributes
  2020-02-10 16:20 [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon
                   ` (5 preceding siblings ...)
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 06/15] replace packed attributes Thomas Monjalon
@ 2020-02-10 16:20 ` Thomas Monjalon
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 08/15] replace no-inline attributes Thomas Monjalon
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 20+ messages in thread
From: Thomas Monjalon @ 2020-02-10 16:20 UTC (permalink / raw)
  To: dev
  Cc: Jerin Jacob, Qiming Yang, Wenzhuo Lu, Bruce Richardson,
	Konstantin Ananyev, David Hunt

There is a macro __rte_always_inline, forcing functions to be inlined,
which is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 app/test-eventdev/test_order_atq.c             |  2 +-
 app/test-eventdev/test_order_common.h          |  4 ++--
 app/test-eventdev/test_order_queue.c           |  2 +-
 app/test-eventdev/test_perf_atq.c              |  4 ++--
 app/test-eventdev/test_perf_common.h           |  4 ++--
 app/test-eventdev/test_perf_queue.c            |  4 ++--
 drivers/net/ice/ice_rxtx.c                     |  2 +-
 .../common/include/arch/x86/rte_rtm.h          |  6 +++---
 lib/librte_power/rte_power_empty_poll.c        | 18 +++++++++---------
 9 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/app/test-eventdev/test_order_atq.c b/app/test-eventdev/test_order_atq.c
index abccbccacb..3366cfce9a 100644
--- a/app/test-eventdev/test_order_atq.c
+++ b/app/test-eventdev/test_order_atq.c
@@ -9,7 +9,7 @@
 
 /* See http://doc.dpdk.org/guides/tools/testeventdev.html for test details */
 
-static inline __attribute__((always_inline)) void
+static __rte_always_inline void
 order_atq_process_stage_0(struct rte_event *const ev)
 {
 	ev->sub_event_type = 1; /* move to stage 1 (atomic) on the same queue */
diff --git a/app/test-eventdev/test_order_common.h b/app/test-eventdev/test_order_common.h
index 22a1cc8325..e0fe9c968a 100644
--- a/app/test-eventdev/test_order_common.h
+++ b/app/test-eventdev/test_order_common.h
@@ -62,7 +62,7 @@ order_nb_event_ports(struct evt_options *opt)
 	return evt_nr_active_lcores(opt->wlcores) + 1 /* producer */;
 }
 
-static inline __attribute__((always_inline)) void
+static __rte_always_inline void
 order_process_stage_1(struct test_order *const t,
 		struct rte_event *const ev, const uint32_t nb_flows,
 		uint32_t *const expected_flow_seq,
@@ -87,7 +87,7 @@ order_process_stage_1(struct test_order *const t,
 	rte_atomic64_sub(outstand_pkts, 1);
 }
 
-static inline __attribute__((always_inline)) void
+static __rte_always_inline void
 order_process_stage_invalid(struct test_order *const t,
 			struct rte_event *const ev)
 {
diff --git a/app/test-eventdev/test_order_queue.c b/app/test-eventdev/test_order_queue.c
index 7ac570c730..495efd92f9 100644
--- a/app/test-eventdev/test_order_queue.c
+++ b/app/test-eventdev/test_order_queue.c
@@ -9,7 +9,7 @@
 
 /* See http://doc.dpdk.org/guides/tools/testeventdev.html for test details */
 
-static inline __attribute__((always_inline)) void
+static __rte_always_inline void
 order_queue_process_stage_0(struct rte_event *const ev)
 {
 	ev->queue_id = 1; /* q1 atomic queue */
diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index d0241ec4ae..8fd51004ee 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -14,7 +14,7 @@ atq_nb_event_queues(struct evt_options *opt)
 		rte_eth_dev_count_avail() : evt_nr_active_lcores(opt->plcores);
 }
 
-static inline __attribute__((always_inline)) void
+static __rte_always_inline void
 atq_mark_fwd_latency(struct rte_event *const ev)
 {
 	if (unlikely(ev->sub_event_type == 0)) {
@@ -24,7 +24,7 @@ atq_mark_fwd_latency(struct rte_event *const ev)
 	}
 }
 
-static inline __attribute__((always_inline)) void
+static __rte_always_inline void
 atq_fwd_event(struct rte_event *const ev, uint8_t *const sched_type_list,
 		const uint8_t nb_stages)
 {
diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h
index d8fbee6d89..ff9705df88 100644
--- a/app/test-eventdev/test_perf_common.h
+++ b/app/test-eventdev/test_perf_common.h
@@ -91,7 +91,7 @@ struct perf_elt {
 		printf("%s(): lcore %d dev_id %d port=%d\n", __func__,\
 				rte_lcore_id(), dev, port)
 
-static inline __attribute__((always_inline)) int
+static __rte_always_inline int
 perf_process_last_stage(struct rte_mempool *const pool,
 		struct rte_event *const ev, struct worker_data *const w,
 		void *bufs[], int const buf_sz, uint8_t count)
@@ -107,7 +107,7 @@ perf_process_last_stage(struct rte_mempool *const pool,
 	return count;
 }
 
-static inline __attribute__((always_inline)) uint8_t
+static __rte_always_inline uint8_t
 perf_process_last_stage_latency(struct rte_mempool *const pool,
 		struct rte_event *const ev, struct worker_data *const w,
 		void *bufs[], int const buf_sz, uint8_t count)
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index 29098580e7..f4ea3a795f 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -15,7 +15,7 @@ perf_queue_nb_event_queues(struct evt_options *opt)
 	return nb_prod * opt->nb_stages;
 }
 
-static inline __attribute__((always_inline)) void
+static __rte_always_inline void
 mark_fwd_latency(struct rte_event *const ev,
 		const uint8_t nb_stages)
 {
@@ -26,7 +26,7 @@ mark_fwd_latency(struct rte_event *const ev,
 	}
 }
 
-static inline __attribute__((always_inline)) void
+static __rte_always_inline void
 fwd_event(struct rte_event *const ev, uint8_t *const sched_type_list,
 		const uint8_t nb_stages)
 {
diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index ce5b8e6ca3..045680533f 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -2655,7 +2655,7 @@ ice_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 	return nb_tx;
 }
 
-static inline int __attribute__((always_inline))
+static __rte_always_inline int
 ice_tx_free_bufs(struct ice_tx_queue *txq)
 {
 	struct ice_tx_entry *txep;
diff --git a/lib/librte_eal/common/include/arch/x86/rte_rtm.h b/lib/librte_eal/common/include/arch/x86/rte_rtm.h
index eb0f8e81e1..36bf49846f 100644
--- a/lib/librte_eal/common/include/arch/x86/rte_rtm.h
+++ b/lib/librte_eal/common/include/arch/x86/rte_rtm.h
@@ -25,7 +25,7 @@ extern "C" {
 #define RTE_XABORT_NESTED		(1 << 5)
 #define RTE_XABORT_CODE(x)		(((x) >> 24) & 0xff)
 
-static __attribute__((__always_inline__)) inline
+static __rte_always_inline
 unsigned int rte_xbegin(void)
 {
 	unsigned int ret = RTE_XBEGIN_STARTED;
@@ -34,7 +34,7 @@ unsigned int rte_xbegin(void)
 	return ret;
 }
 
-static __attribute__((__always_inline__)) inline
+static __rte_always_inline
 void rte_xend(void)
 {
 	 asm volatile(".byte 0x0f,0x01,0xd5" ::: "memory");
@@ -45,7 +45,7 @@ void rte_xend(void)
 	asm volatile(".byte 0xc6,0xf8,%P0" :: "i" (status) : "memory"); \
 } while (0)
 
-static __attribute__((__always_inline__)) inline
+static __rte_always_inline
 int rte_xtest(void)
 {
 	unsigned char out;
diff --git a/lib/librte_power/rte_power_empty_poll.c b/lib/librte_power/rte_power_empty_poll.c
index 0a8024ddca..70c07b1533 100644
--- a/lib/librte_power/rte_power_empty_poll.c
+++ b/lib/librte_power/rte_power_empty_poll.c
@@ -52,13 +52,13 @@ set_power_freq(int lcore_id, enum freq_val freq, bool specific_freq)
 }
 
 
-static inline void __attribute__((always_inline))
+static __rte_always_inline void
 exit_training_state(struct priority_worker *poll_stats)
 {
 	RTE_SET_USED(poll_stats);
 }
 
-static inline void __attribute__((always_inline))
+static __rte_always_inline void
 enter_training_state(struct priority_worker *poll_stats)
 {
 	poll_stats->iter_counter = 0;
@@ -66,7 +66,7 @@ enter_training_state(struct priority_worker *poll_stats)
 	poll_stats->queue_state = TRAINING;
 }
 
-static inline void __attribute__((always_inline))
+static __rte_always_inline void
 enter_normal_state(struct priority_worker *poll_stats)
 {
 	/* Clear the averages arrays and strs */
@@ -86,7 +86,7 @@ enter_normal_state(struct priority_worker *poll_stats)
 	poll_stats->thresh[HGH].threshold_percent = high_to_med_threshold;
 }
 
-static inline void __attribute__((always_inline))
+static __rte_always_inline void
 enter_busy_state(struct priority_worker *poll_stats)
 {
 	memset(poll_stats->edpi_av, 0, sizeof(poll_stats->edpi_av));
@@ -101,14 +101,14 @@ enter_busy_state(struct priority_worker *poll_stats)
 	set_power_freq(poll_stats->lcore_id, HGH, false);
 }
 
-static inline void __attribute__((always_inline))
+static __rte_always_inline void
 enter_purge_state(struct priority_worker *poll_stats)
 {
 	poll_stats->iter_counter = 0;
 	poll_stats->queue_state = LOW_PURGE;
 }
 
-static inline void __attribute__((always_inline))
+static __rte_always_inline void
 set_state(struct priority_worker *poll_stats,
 		enum queue_state new_state)
 {
@@ -131,7 +131,7 @@ set_state(struct priority_worker *poll_stats,
 	}
 }
 
-static inline void __attribute__((always_inline))
+static __rte_always_inline void
 set_policy(struct priority_worker *poll_stats,
 		struct ep_policy *policy)
 {
@@ -204,7 +204,7 @@ update_training_stats(struct priority_worker *poll_stats,
 	}
 }
 
-static inline uint32_t __attribute__((always_inline))
+static __rte_always_inline uint32_t
 update_stats(struct priority_worker *poll_stats)
 {
 	uint64_t tot_edpi = 0, tot_ppi = 0;
@@ -249,7 +249,7 @@ update_stats(struct priority_worker *poll_stats)
 }
 
 
-static inline void  __attribute__((always_inline))
+static __rte_always_inline void
 update_stats_normal(struct priority_worker *poll_stats)
 {
 	uint32_t percent;
-- 
2.25.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-dev] [PATCH 20.05 08/15] replace no-inline attributes
  2020-02-10 16:20 [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon
                   ` (6 preceding siblings ...)
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 07/15] replace always-inline attributes Thomas Monjalon
@ 2020-02-10 16:20 ` Thomas Monjalon
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 09/15] replace unused attributes Thomas Monjalon
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 20+ messages in thread
From: Thomas Monjalon @ 2020-02-10 16:20 UTC (permalink / raw)
  To: dev; +Cc: Hemant Agrawal, Sachin Saxena

There is a macro __rte_noinline, preventing function to be inlined,
which is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/common/dpaax/compat.h              | 2 +-
 drivers/net/dpaa2/dpaa2_rxtx.c             | 4 ++--
 lib/librte_eal/common/include/rte_common.h | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/common/dpaax/compat.h b/drivers/common/dpaax/compat.h
index 5b11c2d927..90db68ce76 100644
--- a/drivers/common/dpaax/compat.h
+++ b/drivers/common/dpaax/compat.h
@@ -60,7 +60,7 @@
 #define __packed	__rte_packed
 #endif
 #ifndef noinline
-#define noinline	__attribute__((noinline))
+#define noinline	__rte_noinline
 #endif
 #define L1_CACHE_BYTES 64
 #define ____cacheline_aligned __rte_aligned(L1_CACHE_BYTES)
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index 52d913d9ea..23d48035d5 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -363,7 +363,7 @@ eth_fd_to_mbuf(const struct qbman_fd *fd,
 	return mbuf;
 }
 
-static int __attribute__ ((noinline)) __attribute__((hot))
+static int __rte_noinline __attribute__((hot))
 eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
 		  struct qbman_fd *fd, uint16_t bpid)
 {
@@ -434,7 +434,7 @@ static void
 eth_mbuf_to_fd(struct rte_mbuf *mbuf,
 	       struct qbman_fd *fd, uint16_t bpid) __attribute__((unused));
 
-static void __attribute__ ((noinline)) __attribute__((hot))
+static void __rte_noinline __attribute__((hot))
 eth_mbuf_to_fd(struct rte_mbuf *mbuf,
 	       struct qbman_fd *fd, uint16_t bpid)
 {
diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index 1677a0147a..5145473415 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -155,7 +155,7 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)
 /**
  * Force a function to be noinlined
  */
-#define __rte_noinline  __attribute__((noinline))
+#define __rte_noinline __attribute__((noinline))
 
 /*********** Macros for pointer arithmetic ********/
 
-- 
2.25.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-dev] [PATCH 20.05 09/15] replace unused attributes
  2020-02-10 16:20 [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon
                   ` (7 preceding siblings ...)
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 08/15] replace no-inline attributes Thomas Monjalon
@ 2020-02-10 16:20 ` Thomas Monjalon
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 10/15] replace used attributes Thomas Monjalon
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 20+ messages in thread
From: Thomas Monjalon @ 2020-02-10 16:20 UTC (permalink / raw)
  To: dev
  Cc: Konstantin Ananyev, Olivier Matz, Declan Doherty,
	Cristian Dumitrescu, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger,
	Bruce Richardson, Vladimir Medvedkin, Yipeng Wang, Sameh Gobriel,
	Anatoly Burakov, Andrew Rybchenko, Phil Yang, Joyce Kong,
	Robert Sanford, Erik Gabriel Carrillo, John McNamara,
	Marko Kovacevic, Ori Kam, Radu Nicolau, Akhil Goyal,
	Tomasz Kantecki, Sunil Kumar Kori, Pavan Nikhilesh, David Hunt,
	Hemant Agrawal, Sachin Saxena, Chas Williams, John Daley,
	Hyong Youb Kim, Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou,
	Wei Hu (Xavier), Min Hu (Connor),
	Yisen Zhuang, Beilei Xing, Qi Zhang, Qiming Yang,
	Gagandeep Singh, Rasesh Mody, Shahed Shaikh, Jerin Jacob,
	Maciej Czekaj, Rosen Xu, Tianfei zhang, Xiaoyun Li,
	Kirill Rybalchenko, Harry van Haaren, Jasvinder Singh,
	Byron Marohn, Maxime Coquelin, Tiwei Bie, Zhihong Wang

There is a common macro __rte_unused, avoiding warnings,
which is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 app/test-acl/main.c                           |   2 +-
 app/test-cmdline/cmdline_test.c               |   4 +-
 app/test-cmdline/commands.c                   |  40 +-
 app/test-crypto-perf/cperf_test_common.c      |   2 +-
 app/test-pipeline/main.c                      |   2 +-
 app/test-pipeline/pipeline_hash.c             |  10 +-
 app/test-pmd/bpf_cmd.c                        |   8 +-
 app/test-pmd/cmdline.c                        | 832 +++++++++---------
 app/test-pmd/cmdline_mtr.c                    |  56 +-
 app/test-pmd/cmdline_tm.c                     |  88 +-
 app/test-pmd/txonly.c                         |   2 +-
 app/test/commands.c                           |  20 +-
 app/test/test_atomic.c                        |  14 +-
 app/test/test_cmdline_lib.c                   |  18 +-
 app/test/test_func_reentrancy.c               |  14 +-
 app/test/test_hash.c                          |   6 +-
 app/test/test_hash_readwrite.c                |   2 +-
 app/test/test_hash_readwrite_lf_perf.c        |   8 +-
 app/test/test_malloc.c                        |   6 +-
 app/test/test_mcslock.c                       |   4 +-
 app/test/test_mempool.c                       |   6 +-
 app/test/test_mempool_perf.c                  |   2 +-
 app/test/test_per_lcore.c                     |   6 +-
 app/test/test_rwlock.c                        |   4 +-
 app/test/test_spinlock.c                      |   6 +-
 app/test/test_table.c                         |  10 +-
 app/test/test_table.h                         |  10 +-
 app/test/test_table_pipeline.c                |  22 +-
 app/test/test_ticketlock.c                    |   6 +-
 app/test/test_timer.c                         |  10 +-
 app/test/test_timer_racecond.c                |   2 +-
 doc/guides/sample_app_ug/cmd_line.rst         |   2 +-
 doc/guides/sample_app_ug/hello_world.rst      |   2 +-
 .../sample_app_ug/l3_forward_power_man.rst    |   2 +-
 doc/guides/sample_app_ug/timer.rst            |   4 +-
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h       |   4 +-
 drivers/common/dpaax/caamflib/compat.h        |   4 +-
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c   |   2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c        |   4 +-
 drivers/net/dpaa2/dpaa2_ethdev.h              |   2 +-
 drivers/net/dpaa2/dpaa2_rxtx.c                |   6 +-
 drivers/net/enic/base/vnic_dev.c              |   4 +-
 drivers/net/hinic/hinic_pmd_rx.c              |   2 +-
 drivers/net/hns3/hns3_ethdev.c                |   2 +-
 drivers/net/hns3/hns3_ethdev_vf.c             |   4 +-
 drivers/net/i40e/i40e_ethdev.c                |  10 +-
 drivers/net/ice/base/ice_osdep.h              |  10 +-
 drivers/net/ixgbe/ixgbe_ethdev.c              |   6 +-
 drivers/net/pfe/base/pfe.h                    |   2 +-
 drivers/net/qede/base/bcm_osal.h              |   2 +-
 drivers/net/qede/qede_filter.c                |   6 +-
 drivers/net/thunderx/base/nicvf_mbox.c        |   2 +-
 drivers/raw/ifpga/base/ifpga_compat.h         |   2 +-
 examples/bond/main.c                          |  28 +-
 examples/cmdline/commands.c                   |   8 +-
 examples/cmdline/parse_obj_list.c             |   2 +-
 examples/ethtool/ethtool-app/main.c           |   2 +-
 .../fips_validation/fips_validation_aes.c     |   4 +-
 .../fips_validation/fips_validation_hmac.c    |   4 +-
 .../fips_validation/fips_validation_sha.c     |   4 +-
 .../fips_validation/fips_validation_tdes.c    |   6 +-
 examples/helloworld/main.c                    |   2 +-
 examples/ip_fragmentation/main.c              |   2 +-
 examples/ip_reassembly/main.c                 |   2 +-
 examples/ipsec-secgw/ipsec-secgw.c            |   2 +-
 examples/l2fwd-jobstats/main.c                |   2 +-
 examples/l2fwd-keepalive/main.c               |   6 +-
 examples/l2fwd/main.c                         |   2 +-
 examples/l3fwd-acl/main.c                     |   2 +-
 examples/l3fwd-power/main.c                   |  14 +-
 examples/l3fwd/l3fwd.h                        |  20 +-
 examples/l3fwd/l3fwd_em.c                     |  10 +-
 examples/l3fwd/l3fwd_lpm.c                    |  10 +-
 examples/link_status_interrupt/main.c         |   2 +-
 .../client_server_mp/mp_server/main.c         |   2 +-
 examples/multi_process/hotplug_mp/commands.c  |  16 +-
 examples/multi_process/simple_mp/main.c       |   2 +-
 .../multi_process/simple_mp/mp_commands.c     |  12 +-
 examples/ntb/ntb_fwd.c                        |  34 +-
 .../performance-thread/l3fwd-thread/main.c    |   4 +-
 .../performance-thread/pthread_shim/main.c    |   4 +-
 examples/qos_meter/main.c                     |   2 +-
 examples/qos_sched/cmdline.c                  |  46 +-
 examples/qos_sched/main.c                     |   2 +-
 examples/server_node_efd/server/main.c        |   2 +-
 examples/timer/main.c                         |  10 +-
 examples/vdpa/main.c                          |  14 +-
 .../guest_cli/vm_power_cli_guest.h            |   2 +-
 examples/vm_power_manager/main.c              |   4 +-
 examples/vm_power_manager/oob_monitor_nop.c   |   8 +-
 examples/vm_power_manager/vm_power_cli.c      |  20 +-
 examples/vm_power_manager/vm_power_cli.h      |   2 +-
 examples/vmdq/main.c                          |   2 +-
 lib/librte_cmdline/cmdline.c                  |   2 +-
 lib/librte_cmdline/cmdline_parse_etheraddr.c  |   4 +-
 lib/librte_cmdline/cmdline_parse_portlist.c   |   4 +-
 lib/librte_eal/common/include/rte_common.h    |   2 +-
 lib/librte_eal/freebsd/eal/eal.c              |   2 +-
 lib/librte_eal/freebsd/eal/eal_thread.c       |   2 +-
 lib/librte_eal/linux/eal/eal.c                |   2 +-
 lib/librte_eal/linux/eal/eal_log.c            |   2 +-
 lib/librte_eal/linux/eal/eal_thread.c         |   2 +-
 lib/librte_eal/linux/eal/eal_timer.c          |   2 +-
 lib/librte_mbuf/rte_mbuf.c                    |   6 +-
 lib/librte_power/power_kvm_vm.c               |  14 +-
 105 files changed, 839 insertions(+), 833 deletions(-)

diff --git a/app/test-acl/main.c b/app/test-acl/main.c
index 57f23942eb..4bc00272f4 100644
--- a/app/test-acl/main.c
+++ b/app/test-acl/main.c
@@ -858,7 +858,7 @@ search_ip5tuples_once(uint32_t categories, uint32_t step, const char *alg)
 }
 
 static int
-search_ip5tuples(__attribute__((unused)) void *arg)
+search_ip5tuples(__rte_unused void *arg)
 {
 	uint64_t pkt, start, tm;
 	uint32_t i, lcore;
diff --git a/app/test-cmdline/cmdline_test.c b/app/test-cmdline/cmdline_test.c
index 3e406331a0..89f4260cbf 100644
--- a/app/test-cmdline/cmdline_test.c
+++ b/app/test-cmdline/cmdline_test.c
@@ -12,6 +12,8 @@
 #include <ctype.h>
 #include <sys/queue.h>
 
+#include <rte_common.h>
+
 #include <cmdline_rdline.h>
 #include <cmdline_parse.h>
 #include <cmdline_socket.h>
@@ -20,7 +22,7 @@
 #include "cmdline_test.h"
 
 int
-main(int __attribute__((unused)) argc, char __attribute__((unused)) ** argv)
+main(int __rte_unused argc, char __rte_unused ** argv)
 {
 	struct cmdline *cl;
 
diff --git a/app/test-cmdline/commands.c b/app/test-cmdline/commands.c
index d81da9665a..d67c0ca6ac 100644
--- a/app/test-cmdline/commands.c
+++ b/app/test-cmdline/commands.c
@@ -7,6 +7,8 @@
 #include <termios.h>
 #include <inttypes.h>
 
+#include <rte_common.h>
+
 #include <cmdline_rdline.h>
 #include <cmdline_parse.h>
 #include <cmdline_parse_string.h>
@@ -23,9 +25,9 @@ struct cmd_quit_result {
 };
 
 static void
-cmd_quit_parsed(__attribute__((unused)) void *parsed_result,
+cmd_quit_parsed(__rte_unused void *parsed_result,
 		struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	cmdline_quit(cl);
 }
@@ -54,9 +56,9 @@ struct cmd_single_result {
 };
 
 static void
-cmd_single_parsed(__attribute__((unused)) void *parsed_result,
+cmd_single_parsed(__rte_unused void *parsed_result,
 		struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	cmdline_printf(cl, "Single word command parsed!\n");
 }
@@ -85,9 +87,9 @@ struct cmd_single_long_result {
 };
 
 static void
-cmd_single_long_parsed(__attribute__((unused)) void *parsed_result,
+cmd_single_long_parsed(__rte_unused void *parsed_result,
 		struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	cmdline_printf(cl, "Single long word command parsed!\n");
 }
@@ -118,9 +120,9 @@ struct cmd_autocomplete_1_result {
 };
 
 static void
-cmd_autocomplete_1_parsed(__attribute__((unused)) void *parsed_result,
+cmd_autocomplete_1_parsed(__rte_unused void *parsed_result,
 		struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	cmdline_printf(cl, "Autocomplete command 1 parsed!\n");
 }
@@ -151,9 +153,9 @@ struct cmd_autocomplete_2_result {
 };
 
 static void
-cmd_autocomplete_2_parsed(__attribute__((unused)) void *parsed_result,
+cmd_autocomplete_2_parsed(__rte_unused void *parsed_result,
 		struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	cmdline_printf(cl, "Autocomplete command 2 parsed!\n");
 }
@@ -184,7 +186,7 @@ struct cmd_num_result {
 static void
 cmd_num_parsed(void *parsed_result,
 		struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	unsigned result = ((struct cmd_num_result*)parsed_result)->num;
 	cmdline_printf(cl, "%u\n", result);
@@ -214,9 +216,9 @@ struct cmd_ambig_result_1 {
 };
 
 static void
-cmd_ambig_1_parsed(__attribute__((unused)) void *parsed_result,
+cmd_ambig_1_parsed(__rte_unused void *parsed_result,
 		struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	cmdline_printf(cl, "Command 1 parsed!\n");
 }
@@ -250,9 +252,9 @@ struct cmd_ambig_result_2 {
 };
 
 static void
-cmd_ambig_2_parsed(__attribute__((unused)) void *parsed_result,
+cmd_ambig_2_parsed(__rte_unused void *parsed_result,
 		struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	cmdline_printf(cl, "Command 2 parsed!\n");
 }
@@ -288,9 +290,9 @@ struct cmd_get_history_bufsize_result {
 };
 
 static void
-cmd_get_history_bufsize_parsed(__attribute__((unused)) void *parsed_result,
+cmd_get_history_bufsize_parsed(__rte_unused void *parsed_result,
 		struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	cmdline_printf(cl, "History buffer size: %zu\n",
 			sizeof(cl->rdl.history_buf));
@@ -320,9 +322,9 @@ struct cmd_clear_history_result {
 };
 
 static void
-cmd_clear_history_parsed(__attribute__((unused)) void *parsed_result,
+cmd_clear_history_parsed(__rte_unused void *parsed_result,
 		struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	rdline_clear_history(&cl->rdl);
 }
diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c
index 85603eed5b..058e0ba564 100644
--- a/app/test-crypto-perf/cperf_test_common.c
+++ b/app/test-crypto-perf/cperf_test_common.c
@@ -86,7 +86,7 @@ static void
 mempool_obj_init(struct rte_mempool *mp,
 		 void *opaque_arg,
 		 void *obj,
-		 __attribute__((unused)) unsigned int i)
+		 __rte_unused unsigned int i)
 {
 	struct obj_params *params = opaque_arg;
 	struct rte_crypto_op *op = obj;
diff --git a/app/test-pipeline/main.c b/app/test-pipeline/main.c
index 0be02ac25f..7f0d6d3f18 100644
--- a/app/test-pipeline/main.c
+++ b/app/test-pipeline/main.c
@@ -76,7 +76,7 @@ main(int argc, char **argv)
 }
 
 int
-app_lcore_main_loop(__attribute__((unused)) void *arg)
+app_lcore_main_loop(__rte_unused void *arg)
 {
 	unsigned lcore;
 
diff --git a/app/test-pipeline/pipeline_hash.c b/app/test-pipeline/pipeline_hash.c
index 25fb2e0dab..2dd8928d43 100644
--- a/app/test-pipeline/pipeline_hash.c
+++ b/app/test-pipeline/pipeline_hash.c
@@ -380,9 +380,9 @@ app_main_loop_worker_pipeline_hash(void) {
 
 uint64_t test_hash(
 	void *key,
-	__attribute__((unused)) void *key_mask,
-	__attribute__((unused)) uint32_t key_size,
-	__attribute__((unused)) uint64_t seed)
+	__rte_unused void *key_mask,
+	__rte_unused uint32_t key_size,
+	__rte_unused uint64_t seed)
 {
 	uint32_t *k32 = key;
 	uint32_t ip_dst = rte_be_to_cpu_32(k32[0]);
@@ -393,8 +393,8 @@ uint64_t test_hash(
 
 uint32_t test_hash_cuckoo(
 	const void *key,
-	__attribute__((unused)) uint32_t key_size,
-	__attribute__((unused)) uint32_t seed)
+	__rte_unused uint32_t key_size,
+	__rte_unused uint32_t seed)
 {
 	const uint32_t *k32 = key;
 	uint32_t ip_dst = rte_be_to_cpu_32(k32[0]);
diff --git a/app/test-pmd/bpf_cmd.c b/app/test-pmd/bpf_cmd.c
index 830bfc13a5..0f984ccf4a 100644
--- a/app/test-pmd/bpf_cmd.c
+++ b/app/test-pmd/bpf_cmd.c
@@ -87,8 +87,8 @@ bpf_parse_flags(const char *str, struct rte_bpf_arg *arg, uint32_t *flags)
 }
 
 static void cmd_operate_bpf_ld_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	int32_t rc;
 	uint32_t flags;
@@ -158,8 +158,8 @@ struct cmd_bpf_unld_result {
 };
 
 static void cmd_operate_bpf_unld_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_bpf_unld_result *res;
 
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index de7a695d74..0a38e4ee73 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -80,9 +80,9 @@ struct cmd_help_brief_result {
 	cmdline_fixed_string_t help;
 };
 
-static void cmd_help_brief_parsed(__attribute__((unused)) void *parsed_result,
+static void cmd_help_brief_parsed(__rte_unused void *parsed_result,
                                   struct cmdline *cl,
-                                  __attribute__((unused)) void *data)
+                                  __rte_unused void *data)
 {
 	cmdline_printf(
 		cl,
@@ -123,7 +123,7 @@ struct cmd_help_long_result {
 
 static void cmd_help_long_parsed(void *parsed_result,
                                  struct cmdline *cl,
-                                 __attribute__((unused)) void *data)
+                                 __rte_unused void *data)
 {
 	int show_all = 0;
 	struct cmd_help_long_result *res = parsed_result;
@@ -1304,8 +1304,8 @@ struct cmd_operate_port_result {
 };
 
 static void cmd_operate_port_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_operate_port_result *res = parsed_result;
 
@@ -1350,8 +1350,8 @@ struct cmd_operate_specific_port_result {
 };
 
 static void cmd_operate_specific_port_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_operate_specific_port_result *res = parsed_result;
 
@@ -1399,8 +1399,8 @@ struct cmd_set_port_setup_on_result {
 };
 
 static void cmd_set_port_setup_on_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_set_port_setup_on_result *res = parsed_result;
 
@@ -1450,8 +1450,8 @@ struct cmd_operate_attach_port_result {
 };
 
 static void cmd_operate_attach_port_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_operate_attach_port_result *res = parsed_result;
 
@@ -1492,8 +1492,8 @@ struct cmd_operate_detach_port_result {
 };
 
 static void cmd_operate_detach_port_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_operate_detach_port_result *res = parsed_result;
 
@@ -1533,8 +1533,8 @@ struct cmd_operate_detach_device_result {
 };
 
 static void cmd_operate_detach_device_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_operate_detach_device_result *res = parsed_result;
 
@@ -1630,8 +1630,8 @@ parse_and_check_speed_duplex(char *speedstr, char *duplexstr, uint32_t *speed)
 
 static void
 cmd_config_speed_all_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	struct cmd_config_speed_all *res = parsed_result;
 	uint32_t link_speed;
@@ -1702,8 +1702,8 @@ struct cmd_config_speed_specific {
 
 static void
 cmd_config_speed_specific_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_config_speed_specific *res = parsed_result;
 	uint32_t link_speed;
@@ -1776,8 +1776,8 @@ struct cmd_config_loopback_all {
 
 static void
 cmd_config_loopback_all_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	struct cmd_config_loopback_all *res = parsed_result;
 	portid_t pid;
@@ -1832,8 +1832,8 @@ struct cmd_config_loopback_specific {
 
 static void
 cmd_config_loopback_specific_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_config_loopback_specific *res = parsed_result;
 
@@ -1892,8 +1892,8 @@ struct cmd_config_rx_tx {
 
 static void
 cmd_config_rx_tx_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	struct cmd_config_rx_tx *res = parsed_result;
 
@@ -1982,8 +1982,8 @@ struct cmd_config_max_pkt_len_result {
 
 static void
 cmd_config_max_pkt_len_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_config_max_pkt_len_result *res = parsed_result;
 	portid_t pid;
@@ -2064,8 +2064,8 @@ struct cmd_config_max_lro_pkt_size_result {
 
 static void
 cmd_config_max_lro_pkt_size_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_config_max_lro_pkt_size_result *res = parsed_result;
 	portid_t pid;
@@ -2136,8 +2136,8 @@ struct cmd_config_mtu_result {
 
 static void
 cmd_config_mtu_parsed(void *parsed_result,
-		      __attribute__((unused)) struct cmdline *cl,
-		      __attribute__((unused)) void *data)
+		      __rte_unused struct cmdline *cl,
+		      __rte_unused void *data)
 {
 	struct cmd_config_mtu_result *res = parsed_result;
 
@@ -2187,8 +2187,8 @@ struct cmd_config_rx_mode_flag {
 
 static void
 cmd_config_rx_mode_flag_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_config_rx_mode_flag *res = parsed_result;
 
@@ -2255,8 +2255,8 @@ struct cmd_config_rss {
 
 static void
 cmd_config_rss_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	struct cmd_config_rss *res = parsed_result;
 	struct rte_eth_rss_conf rss_conf = { .rss_key_len = 0, };
@@ -2403,8 +2403,8 @@ parse_and_check_key_hexa_digit(char *key, int idx)
 
 static void
 cmd_config_rss_hash_key_parsed(void *parsed_result,
-			       __attribute__((unused)) struct cmdline *cl,
-			       __attribute__((unused)) void *data)
+			       __rte_unused struct cmdline *cl,
+			       __rte_unused void *data)
 {
 	struct cmd_config_rss_hash_key *res = parsed_result;
 	uint8_t hash_key[RSS_HASH_KEY_LENGTH];
@@ -2502,8 +2502,8 @@ struct cmd_config_rxtx_ring_size {
 
 static void
 cmd_config_rxtx_ring_size_parsed(void *parsed_result,
-				 __attribute__((unused)) struct cmdline *cl,
-				 __attribute__((unused)) void *data)
+				 __rte_unused struct cmdline *cl,
+				 __rte_unused void *data)
 {
 	struct cmd_config_rxtx_ring_size *res = parsed_result;
 	struct rte_port *port;
@@ -2596,8 +2596,8 @@ struct cmd_config_rxtx_queue {
 
 static void
 cmd_config_rxtx_queue_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	struct cmd_config_rxtx_queue *res = parsed_result;
 	uint8_t isrx;
@@ -2691,8 +2691,8 @@ struct cmd_config_deferred_start_rxtx_queue {
 
 static void
 cmd_config_deferred_start_rxtx_queue_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	struct cmd_config_deferred_start_rxtx_queue *res = parsed_result;
 	struct rte_port *port;
@@ -2789,8 +2789,8 @@ cmdline_parse_token_string_t cmd_setup_rxtx_queue_setup =
 static void
 cmd_setup_rxtx_queue_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_setup_rxtx_queue *res = parsed_result;
 	struct rte_port *port;
@@ -2945,8 +2945,8 @@ parse_reta_config(const char *str,
 
 static void
 cmd_set_rss_reta_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	int ret;
 	struct rte_eth_dev_info dev_info;
@@ -3067,8 +3067,8 @@ showport_parse_reta_config(struct rte_eth_rss_reta_entry64 *conf,
 
 static void
 cmd_showport_reta_parsed(void *parsed_result,
-			 __attribute__((unused)) struct cmdline *cl,
-			 __attribute__((unused)) void *data)
+			 __rte_unused struct cmdline *cl,
+			 __rte_unused void *data)
 {
 	struct cmd_showport_reta *res = parsed_result;
 	struct rte_eth_rss_reta_entry64 reta_conf[8];
@@ -3140,7 +3140,7 @@ struct cmd_showport_rss_hash {
 };
 
 static void cmd_showport_rss_hash_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
+				__rte_unused struct cmdline *cl,
 				void *show_rss_key)
 {
 	struct cmd_showport_rss_hash *res = parsed_result;
@@ -3202,8 +3202,8 @@ struct cmd_config_dcb {
 
 static void
 cmd_config_dcb_parsed(void *parsed_result,
-                        __attribute__((unused)) struct cmdline *cl,
-                        __attribute__((unused)) void *data)
+                        __rte_unused struct cmdline *cl,
+                        __rte_unused void *data)
 {
 	struct cmd_config_dcb *res = parsed_result;
 	portid_t port_id = res->port_id;
@@ -3300,8 +3300,8 @@ struct cmd_config_burst {
 
 static void
 cmd_config_burst_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	struct cmd_config_burst *res = parsed_result;
 	struct rte_eth_dev_info dev_info;
@@ -3391,8 +3391,8 @@ struct cmd_config_thresh {
 
 static void
 cmd_config_thresh_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	struct cmd_config_thresh *res = parsed_result;
 
@@ -3460,8 +3460,8 @@ struct cmd_config_threshold {
 
 static void
 cmd_config_threshold_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	struct cmd_config_threshold *res = parsed_result;
 
@@ -3518,9 +3518,9 @@ struct cmd_stop_result {
 	cmdline_fixed_string_t stop;
 };
 
-static void cmd_stop_parsed(__attribute__((unused)) void *parsed_result,
-			    __attribute__((unused)) struct cmdline *cl,
-			    __attribute__((unused)) void *data)
+static void cmd_stop_parsed(__rte_unused void *parsed_result,
+			    __rte_unused struct cmdline *cl,
+			    __rte_unused void *data)
 {
 	stop_packet_forwarding();
 }
@@ -3611,8 +3611,8 @@ struct cmd_set_list_result {
 };
 
 static void cmd_set_list_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_set_list_result *res;
 	union {
@@ -3679,8 +3679,8 @@ struct cmd_setmask_result {
 };
 
 static void cmd_set_mask_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_setmask_result *res = parsed_result;
 
@@ -3727,8 +3727,8 @@ struct cmd_set_result {
 };
 
 static void cmd_set_parsed(void *parsed_result,
-			   __attribute__((unused)) struct cmdline *cl,
-			   __attribute__((unused)) void *data)
+			   __rte_unused struct cmdline *cl,
+			   __rte_unused void *data)
 {
 	struct cmd_set_result *res = parsed_result;
 	if (!strcmp(res->what, "nbport")) {
@@ -3774,8 +3774,8 @@ struct cmd_set_log_result {
 
 static void
 cmd_set_log_parsed(void *parsed_result,
-		   __attribute__((unused)) struct cmdline *cl,
-		   __attribute__((unused)) void *data)
+		   __rte_unused struct cmdline *cl,
+		   __rte_unused void *data)
 {
 	struct cmd_set_log_result *res;
 	int ret;
@@ -3822,8 +3822,8 @@ struct cmd_set_txpkts_result {
 
 static void
 cmd_set_txpkts_parsed(void *parsed_result,
-		      __attribute__((unused)) struct cmdline *cl,
-		      __attribute__((unused)) void *data)
+		      __rte_unused struct cmdline *cl,
+		      __rte_unused void *data)
 {
 	struct cmd_set_txpkts_result *res;
 	unsigned seg_lengths[RTE_MAX_SEGS_PER_PKT];
@@ -3868,8 +3868,8 @@ struct cmd_set_txsplit_result {
 
 static void
 cmd_set_txsplit_parsed(void *parsed_result,
-		      __attribute__((unused)) struct cmdline *cl,
-		      __attribute__((unused)) void *data)
+		      __rte_unused struct cmdline *cl,
+		      __rte_unused void *data)
 {
 	struct cmd_set_txsplit_result *res;
 
@@ -3909,8 +3909,8 @@ struct cmd_rx_vlan_filter_all_result {
 
 static void
 cmd_rx_vlan_filter_all_parsed(void *parsed_result,
-			      __attribute__((unused)) struct cmdline *cl,
-			      __attribute__((unused)) void *data)
+			      __rte_unused struct cmdline *cl,
+			      __rte_unused void *data)
 {
 	struct cmd_rx_vlan_filter_all_result *res = parsed_result;
 
@@ -3960,8 +3960,8 @@ struct cmd_vlan_offload_result {
 
 static void
 cmd_vlan_offload_parsed(void *parsed_result,
-			  __attribute__((unused)) struct cmdline *cl,
-			  __attribute__((unused)) void *data)
+			  __rte_unused struct cmdline *cl,
+			  __rte_unused void *data)
 {
 	int on;
 	struct cmd_vlan_offload_result *res = parsed_result;
@@ -4064,8 +4064,8 @@ struct cmd_vlan_tpid_result {
 
 static void
 cmd_vlan_tpid_parsed(void *parsed_result,
-			  __attribute__((unused)) struct cmdline *cl,
-			  __attribute__((unused)) void *data)
+			  __rte_unused struct cmdline *cl,
+			  __rte_unused void *data)
 {
 	struct cmd_vlan_tpid_result *res = parsed_result;
 	enum rte_vlan_type vlan_type;
@@ -4126,8 +4126,8 @@ struct cmd_rx_vlan_filter_result {
 
 static void
 cmd_rx_vlan_filter_parsed(void *parsed_result,
-			  __attribute__((unused)) struct cmdline *cl,
-			  __attribute__((unused)) void *data)
+			  __rte_unused struct cmdline *cl,
+			  __rte_unused void *data)
 {
 	struct cmd_rx_vlan_filter_result *res = parsed_result;
 
@@ -4175,8 +4175,8 @@ struct cmd_tx_vlan_set_result {
 
 static void
 cmd_tx_vlan_set_parsed(void *parsed_result,
-		       __attribute__((unused)) struct cmdline *cl,
-		       __attribute__((unused)) void *data)
+		       __rte_unused struct cmdline *cl,
+		       __rte_unused void *data)
 {
 	struct cmd_tx_vlan_set_result *res = parsed_result;
 
@@ -4229,8 +4229,8 @@ struct cmd_tx_vlan_set_qinq_result {
 
 static void
 cmd_tx_vlan_set_qinq_parsed(void *parsed_result,
-			    __attribute__((unused)) struct cmdline *cl,
-			    __attribute__((unused)) void *data)
+			    __rte_unused struct cmdline *cl,
+			    __rte_unused void *data)
 {
 	struct cmd_tx_vlan_set_qinq_result *res = parsed_result;
 
@@ -4288,8 +4288,8 @@ struct cmd_tx_vlan_set_pvid_result {
 
 static void
 cmd_tx_vlan_set_pvid_parsed(void *parsed_result,
-			    __attribute__((unused)) struct cmdline *cl,
-			    __attribute__((unused)) void *data)
+			    __rte_unused struct cmdline *cl,
+			    __rte_unused void *data)
 {
 	struct cmd_tx_vlan_set_pvid_result *res = parsed_result;
 
@@ -4342,8 +4342,8 @@ struct cmd_tx_vlan_reset_result {
 
 static void
 cmd_tx_vlan_reset_parsed(void *parsed_result,
-			 __attribute__((unused)) struct cmdline *cl,
-			 __attribute__((unused)) void *data)
+			 __rte_unused struct cmdline *cl,
+			 __rte_unused void *data)
 {
 	struct cmd_tx_vlan_reset_result *res = parsed_result;
 
@@ -4464,8 +4464,8 @@ cmd_config_queue_tx_offloads(struct rte_port *port)
 
 static void
 cmd_csum_parsed(void *parsed_result,
-		       __attribute__((unused)) struct cmdline *cl,
-		       __attribute__((unused)) void *data)
+		       __rte_unused struct cmdline *cl,
+		       __rte_unused void *data)
 {
 	struct cmd_csum_result *res = parsed_result;
 	int hw = 0;
@@ -4615,8 +4615,8 @@ struct cmd_csum_tunnel_result {
 
 static void
 cmd_csum_tunnel_parsed(void *parsed_result,
-		       __attribute__((unused)) struct cmdline *cl,
-		       __attribute__((unused)) void *data)
+		       __rte_unused struct cmdline *cl,
+		       __rte_unused void *data)
 {
 	struct cmd_csum_tunnel_result *res = parsed_result;
 
@@ -4668,8 +4668,8 @@ struct cmd_tso_set_result {
 
 static void
 cmd_tso_set_parsed(void *parsed_result,
-		       __attribute__((unused)) struct cmdline *cl,
-		       __attribute__((unused)) void *data)
+		       __rte_unused struct cmdline *cl,
+		       __rte_unused void *data)
 {
 	struct cmd_tso_set_result *res = parsed_result;
 	struct rte_eth_dev_info dev_info;
@@ -4807,8 +4807,8 @@ check_tunnel_tso_nic_support(portid_t port_id)
 
 static void
 cmd_tunnel_tso_set_parsed(void *parsed_result,
-			  __attribute__((unused)) struct cmdline *cl,
-			  __attribute__((unused)) void *data)
+			  __rte_unused struct cmdline *cl,
+			  __rte_unused void *data)
 {
 	struct cmd_tunnel_tso_set_result *res = parsed_result;
 	struct rte_eth_dev_info dev_info;
@@ -4928,8 +4928,8 @@ struct cmd_gro_enable_result {
 
 static void
 cmd_gro_enable_parsed(void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_gro_enable_result *res;
 
@@ -4978,8 +4978,8 @@ struct cmd_gro_show_result {
 
 static void
 cmd_gro_show_parsed(void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_gro_show_result *res;
 
@@ -5024,8 +5024,8 @@ struct cmd_gro_flush_result {
 
 static void
 cmd_gro_flush_parsed(void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_gro_flush_result *res;
 
@@ -5072,8 +5072,8 @@ struct cmd_gso_enable_result {
 
 static void
 cmd_gso_enable_parsed(void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_gso_enable_result *res;
 
@@ -5122,8 +5122,8 @@ struct cmd_gso_size_result {
 
 static void
 cmd_gso_size_parsed(void *parsed_result,
-		       __attribute__((unused)) struct cmdline *cl,
-		       __attribute__((unused)) void *data)
+		       __rte_unused struct cmdline *cl,
+		       __rte_unused void *data)
 {
 	struct cmd_gso_size_result *res = parsed_result;
 
@@ -5180,8 +5180,8 @@ struct cmd_gso_show_result {
 
 static void
 cmd_gso_show_parsed(void *parsed_result,
-		       __attribute__((unused)) struct cmdline *cl,
-		       __attribute__((unused)) void *data)
+		       __rte_unused struct cmdline *cl,
+		       __rte_unused void *data)
 {
 	struct cmd_gso_show_result *res = parsed_result;
 
@@ -5237,8 +5237,8 @@ struct cmd_set_flush_rx {
 
 static void
 cmd_set_flush_rx_parsed(void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_set_flush_rx *res = parsed_result;
 	no_flush_rx = (uint8_t)((strcmp(res->mode, "on") == 0) ? 0 : 1);
@@ -5276,8 +5276,8 @@ struct cmd_set_link_check {
 
 static void
 cmd_set_link_check_parsed(void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_set_link_check *res = parsed_result;
 	no_link_check = (uint8_t)((strcmp(res->mode, "on") == 0) ? 0 : 1);
@@ -5318,8 +5318,8 @@ struct cmd_set_bypass_mode_result {
 
 static void
 cmd_set_bypass_mode_parsed(void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_set_bypass_mode_result *res = parsed_result;
 	portid_t port_id = res->port_id;
@@ -5386,8 +5386,8 @@ struct cmd_set_bypass_event_result {
 
 static void
 cmd_set_bypass_event_parsed(void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
 {
 	int32_t rc = -EINVAL;
 	struct cmd_set_bypass_event_result *res = parsed_result;
@@ -5493,8 +5493,8 @@ struct cmd_set_bypass_timeout_result {
 
 static void
 cmd_set_bypass_timeout_parsed(void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
 {
 	__rte_unused struct cmd_set_bypass_timeout_result *res = parsed_result;
 
@@ -5555,8 +5555,8 @@ struct cmd_show_bypass_config_result {
 
 static void
 cmd_show_bypass_config_parsed(void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_show_bypass_config_result *res = parsed_result;
 	portid_t port_id = res->port_id;
@@ -5655,8 +5655,8 @@ struct cmd_set_bonding_mode_result {
 };
 
 static void cmd_set_bonding_mode_parsed(void *parsed_result,
-		__attribute__((unused))  struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused  struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_set_bonding_mode_result *res = parsed_result;
 	portid_t port_id = res->port_id;
@@ -5708,8 +5708,8 @@ struct cmd_set_bonding_lacp_dedicated_queues_result {
 };
 
 static void cmd_set_bonding_lacp_dedicated_queues_parsed(void *parsed_result,
-		__attribute__((unused))  struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused  struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_set_bonding_lacp_dedicated_queues_result *res = parsed_result;
 	portid_t port_id = res->port_id;
@@ -5786,8 +5786,8 @@ struct cmd_set_bonding_balance_xmit_policy_result {
 };
 
 static void cmd_set_bonding_balance_xmit_policy_parsed(void *parsed_result,
-		__attribute__((unused))  struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused  struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_set_bonding_balance_xmit_policy_result *res = parsed_result;
 	portid_t port_id = res->port_id;
@@ -5852,8 +5852,8 @@ struct cmd_show_bonding_config_result {
 };
 
 static void cmd_show_bonding_config_parsed(void *parsed_result,
-		__attribute__((unused))  struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused  struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_show_bonding_config_result *res = parsed_result;
 	int bonding_mode, agg_mode;
@@ -5996,8 +5996,8 @@ struct cmd_set_bonding_primary_result {
 };
 
 static void cmd_set_bonding_primary_parsed(void *parsed_result,
-		__attribute__((unused))  struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused  struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_set_bonding_primary_result *res = parsed_result;
 	portid_t master_port_id = res->port_id;
@@ -6053,8 +6053,8 @@ struct cmd_add_bonding_slave_result {
 };
 
 static void cmd_add_bonding_slave_parsed(void *parsed_result,
-		__attribute__((unused))  struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused  struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_add_bonding_slave_result *res = parsed_result;
 	portid_t master_port_id = res->port_id;
@@ -6111,8 +6111,8 @@ struct cmd_remove_bonding_slave_result {
 };
 
 static void cmd_remove_bonding_slave_parsed(void *parsed_result,
-		__attribute__((unused))  struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused  struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_remove_bonding_slave_result *res = parsed_result;
 	portid_t master_port_id = res->port_id;
@@ -6171,8 +6171,8 @@ struct cmd_create_bonded_device_result {
 static int bond_dev_num = 0;
 
 static void cmd_create_bonded_device_parsed(void *parsed_result,
-		__attribute__((unused))  struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused  struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_create_bonded_device_result *res = parsed_result;
 	char ethdev_name[RTE_ETH_NAME_MAX_LEN];
@@ -6251,8 +6251,8 @@ struct cmd_set_bond_mac_addr_result {
 };
 
 static void cmd_set_bond_mac_addr_parsed(void *parsed_result,
-		__attribute__((unused))  struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused  struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_set_bond_mac_addr_result *res = parsed_result;
 	int ret;
@@ -6306,8 +6306,8 @@ struct cmd_set_bond_mon_period_result {
 };
 
 static void cmd_set_bond_mon_period_parsed(void *parsed_result,
-		__attribute__((unused))  struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused  struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_set_bond_mon_period_result *res = parsed_result;
 	int ret;
@@ -6362,8 +6362,8 @@ struct cmd_set_bonding_agg_mode_policy_result {
 
 static void
 cmd_set_bonding_agg_mode(void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_set_bonding_agg_mode_policy_result *res = parsed_result;
 	uint8_t policy = AGG_BANDWIDTH;
@@ -6424,8 +6424,8 @@ struct cmd_set_fwd_mode_result {
 };
 
 static void cmd_set_fwd_mode_parsed(void *parsed_result,
-				    __attribute__((unused)) struct cmdline *cl,
-				    __attribute__((unused)) void *data)
+				    __rte_unused struct cmdline *cl,
+				    __rte_unused void *data)
 {
 	struct cmd_set_fwd_mode_result *res = parsed_result;
 
@@ -6484,8 +6484,8 @@ struct cmd_set_fwd_retry_mode_result {
 };
 
 static void cmd_set_fwd_retry_mode_parsed(void *parsed_result,
-			    __attribute__((unused)) struct cmdline *cl,
-			    __attribute__((unused)) void *data)
+			    __rte_unused struct cmdline *cl,
+			    __rte_unused void *data)
 {
 	struct cmd_set_fwd_retry_mode_result *res = parsed_result;
 
@@ -6555,8 +6555,8 @@ struct cmd_set_burst_tx_retry_result {
 };
 
 static void cmd_set_burst_tx_retry_parsed(void *parsed_result,
-					__attribute__((unused)) struct cmdline *cl,
-					__attribute__((unused)) void *data)
+					__rte_unused struct cmdline *cl,
+					__rte_unused void *data)
 {
 	struct cmd_set_burst_tx_retry_result *res = parsed_result;
 
@@ -6611,7 +6611,7 @@ struct cmd_set_promisc_mode_result {
 };
 
 static void cmd_set_promisc_mode_parsed(void *parsed_result,
-					__attribute__((unused)) struct cmdline *cl,
+					__rte_unused struct cmdline *cl,
 					void *allports)
 {
 	struct cmd_set_promisc_mode_result *res = parsed_result;
@@ -6683,7 +6683,7 @@ struct cmd_set_allmulti_mode_result {
 };
 
 static void cmd_set_allmulti_mode_parsed(void *parsed_result,
-					__attribute__((unused)) struct cmdline *cl,
+					__rte_unused struct cmdline *cl,
 					void *allports)
 {
 	struct cmd_set_allmulti_mode_result *res = parsed_result;
@@ -6982,7 +6982,7 @@ cmdline_parse_inst_t cmd_link_flow_control_set_autoneg = {
 
 static void
 cmd_link_flow_ctrl_set_parsed(void *parsed_result,
-			      __attribute__((unused)) struct cmdline *cl,
+			      __rte_unused struct cmdline *cl,
 			      void *data)
 {
 	struct cmd_link_flow_ctrl_set_result *res = parsed_result;
@@ -7071,8 +7071,8 @@ struct cmd_priority_flow_ctrl_set_result {
 
 static void
 cmd_priority_flow_ctrl_set_parsed(void *parsed_result,
-		       __attribute__((unused)) struct cmdline *cl,
-		       __attribute__((unused)) void *data)
+		       __rte_unused struct cmdline *cl,
+		       __rte_unused void *data)
 {
 	struct cmd_priority_flow_ctrl_set_result *res = parsed_result;
 	struct rte_eth_pfc_conf pfc_conf;
@@ -7165,9 +7165,9 @@ struct cmd_reset_result {
 	cmdline_fixed_string_t def;
 };
 
-static void cmd_reset_parsed(__attribute__((unused)) void *parsed_result,
+static void cmd_reset_parsed(__rte_unused void *parsed_result,
 			     struct cmdline *cl,
-			     __attribute__((unused)) void *data)
+			     __rte_unused void *data)
 {
 	cmdline_printf(cl, "Reset to default forwarding configuration...\n");
 	set_def_fwd_config();
@@ -7198,9 +7198,9 @@ struct cmd_start_result {
 cmdline_parse_token_string_t cmd_start_start =
 	TOKEN_STRING_INITIALIZER(struct cmd_start_result, start, "start");
 
-static void cmd_start_parsed(__attribute__((unused)) void *parsed_result,
-			     __attribute__((unused)) struct cmdline *cl,
-			     __attribute__((unused)) void *data)
+static void cmd_start_parsed(__rte_unused void *parsed_result,
+			     __rte_unused struct cmdline *cl,
+			     __rte_unused void *data)
 {
 	start_packet_forwarding(0);
 }
@@ -7222,9 +7222,9 @@ struct cmd_start_tx_first_result {
 };
 
 static void
-cmd_start_tx_first_parsed(__attribute__((unused)) void *parsed_result,
-			  __attribute__((unused)) struct cmdline *cl,
-			  __attribute__((unused)) void *data)
+cmd_start_tx_first_parsed(__rte_unused void *parsed_result,
+			  __rte_unused struct cmdline *cl,
+			  __rte_unused void *data)
 {
 	start_packet_forwarding(1);
 }
@@ -7257,8 +7257,8 @@ struct cmd_start_tx_first_n_result {
 
 static void
 cmd_start_tx_first_n_parsed(void *parsed_result,
-			  __attribute__((unused)) struct cmdline *cl,
-			  __attribute__((unused)) void *data)
+			  __rte_unused struct cmdline *cl,
+			  __rte_unused void *data)
 {
 	struct cmd_start_tx_first_n_result *res = parsed_result;
 
@@ -7306,9 +7306,9 @@ cmdline_parse_token_string_t cmd_set_link_up_port =
 cmdline_parse_token_num_t cmd_set_link_up_port_id =
 	TOKEN_NUM_INITIALIZER(struct cmd_set_link_up_result, port_id, UINT16);
 
-static void cmd_set_link_up_parsed(__attribute__((unused)) void *parsed_result,
-			     __attribute__((unused)) struct cmdline *cl,
-			     __attribute__((unused)) void *data)
+static void cmd_set_link_up_parsed(__rte_unused void *parsed_result,
+			     __rte_unused struct cmdline *cl,
+			     __rte_unused void *data)
 {
 	struct cmd_set_link_up_result *res = parsed_result;
 	dev_set_link_up(res->port_id);
@@ -7346,9 +7346,9 @@ cmdline_parse_token_num_t cmd_set_link_down_port_id =
 	TOKEN_NUM_INITIALIZER(struct cmd_set_link_down_result, port_id, UINT16);
 
 static void cmd_set_link_down_parsed(
-				__attribute__((unused)) void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused void *parsed_result,
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_set_link_down_result *res = parsed_result;
 	dev_set_link_down(res->port_id);
@@ -7375,8 +7375,8 @@ struct cmd_showcfg_result {
 };
 
 static void cmd_showcfg_parsed(void *parsed_result,
-			       __attribute__((unused)) struct cmdline *cl,
-			       __attribute__((unused)) void *data)
+			       __rte_unused struct cmdline *cl,
+			       __rte_unused void *data)
 {
 	struct cmd_showcfg_result *res = parsed_result;
 	if (!strcmp(res->what, "rxtx"))
@@ -7418,8 +7418,8 @@ struct cmd_showportall_result {
 };
 
 static void cmd_showportall_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	portid_t i;
 
@@ -7492,8 +7492,8 @@ struct cmd_showport_result {
 };
 
 static void cmd_showport_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_showport_result *res = parsed_result;
 	if (!strcmp(res->show, "clear")) {
@@ -7556,8 +7556,8 @@ struct cmd_showdevice_result {
 };
 
 static void cmd_showdevice_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_showdevice_result *res = parsed_result;
 	if (!strcmp(res->what, "info")) {
@@ -7603,8 +7603,8 @@ struct cmd_showqueue_result {
 
 static void
 cmd_showqueue_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_showqueue_result *res = parsed_result;
 
@@ -7692,8 +7692,8 @@ struct cmd_read_reg_result {
 
 static void
 cmd_read_reg_parsed(void *parsed_result,
-		    __attribute__((unused)) struct cmdline *cl,
-		    __attribute__((unused)) void *data)
+		    __rte_unused struct cmdline *cl,
+		    __rte_unused void *data)
 {
 	struct cmd_read_reg_result *res = parsed_result;
 	port_reg_display(res->port_id, res->reg_off);
@@ -7733,8 +7733,8 @@ struct cmd_read_reg_bit_field_result {
 
 static void
 cmd_read_reg_bit_field_parsed(void *parsed_result,
-			      __attribute__((unused)) struct cmdline *cl,
-			      __attribute__((unused)) void *data)
+			      __rte_unused struct cmdline *cl,
+			      __rte_unused void *data)
 {
 	struct cmd_read_reg_bit_field_result *res = parsed_result;
 	port_reg_bit_field_display(res->port_id, res->reg_off,
@@ -7787,8 +7787,8 @@ struct cmd_read_reg_bit_result {
 
 static void
 cmd_read_reg_bit_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	struct cmd_read_reg_bit_result *res = parsed_result;
 	port_reg_bit_display(res->port_id, res->reg_off, res->bit_pos);
@@ -7831,8 +7831,8 @@ struct cmd_write_reg_result {
 
 static void
 cmd_write_reg_parsed(void *parsed_result,
-		     __attribute__((unused)) struct cmdline *cl,
-		     __attribute__((unused)) void *data)
+		     __rte_unused struct cmdline *cl,
+		     __rte_unused void *data)
 {
 	struct cmd_write_reg_result *res = parsed_result;
 	port_reg_set(res->port_id, res->reg_off, res->value);
@@ -7876,8 +7876,8 @@ struct cmd_write_reg_bit_field_result {
 
 static void
 cmd_write_reg_bit_field_parsed(void *parsed_result,
-			       __attribute__((unused)) struct cmdline *cl,
-			       __attribute__((unused)) void *data)
+			       __rte_unused struct cmdline *cl,
+			       __rte_unused void *data)
 {
 	struct cmd_write_reg_bit_field_result *res = parsed_result;
 	port_reg_bit_field_set(res->port_id, res->reg_off,
@@ -7936,8 +7936,8 @@ struct cmd_write_reg_bit_result {
 
 static void
 cmd_write_reg_bit_parsed(void *parsed_result,
-			 __attribute__((unused)) struct cmdline *cl,
-			 __attribute__((unused)) void *data)
+			 __rte_unused struct cmdline *cl,
+			 __rte_unused void *data)
 {
 	struct cmd_write_reg_bit_result *res = parsed_result;
 	port_reg_bit_set(res->port_id, res->reg_off, res->bit_pos, res->value);
@@ -7985,8 +7985,8 @@ struct cmd_read_rxd_txd_result {
 
 static void
 cmd_read_rxd_txd_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	struct cmd_read_rxd_txd_result *res = parsed_result;
 
@@ -8027,9 +8027,9 @@ struct cmd_quit_result {
 	cmdline_fixed_string_t quit;
 };
 
-static void cmd_quit_parsed(__attribute__((unused)) void *parsed_result,
+static void cmd_quit_parsed(__rte_unused void *parsed_result,
 			    struct cmdline *cl,
-			    __attribute__((unused)) void *data)
+			    __rte_unused void *data)
 {
 	cmdline_quit(cl);
 }
@@ -8056,8 +8056,8 @@ struct cmd_mac_addr_result {
 };
 
 static void cmd_mac_addr_parsed(void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_mac_addr_result *res = parsed_result;
 	int ret;
@@ -8111,8 +8111,8 @@ struct cmd_eth_peer_result {
 };
 
 static void cmd_set_eth_peer_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 		struct cmd_eth_peer_result *res = parsed_result;
 
@@ -8159,8 +8159,8 @@ struct cmd_set_qmap_result {
 
 static void
 cmd_set_qmap_parsed(void *parsed_result,
-		       __attribute__((unused)) struct cmdline *cl,
-		       __attribute__((unused)) void *data)
+		       __rte_unused struct cmdline *cl,
+		       __rte_unused void *data)
 {
 	struct cmd_set_qmap_result *res = parsed_result;
 	int is_rx = (strcmp(res->what, "tx") == 0) ? 0 : 1;
@@ -8212,8 +8212,8 @@ struct cmd_set_xstats_hide_zero_result {
 
 static void
 cmd_set_xstats_hide_zero_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	struct cmd_set_xstats_hide_zero_result *res;
 	uint16_t on_off = 0;
@@ -8257,8 +8257,8 @@ struct cmd_set_uc_hash_table {
 
 static void
 cmd_set_uc_hash_parsed(void *parsed_result,
-		       __attribute__((unused)) struct cmdline *cl,
-		       __attribute__((unused)) void *data)
+		       __rte_unused struct cmdline *cl,
+		       __rte_unused void *data)
 {
 	int ret=0;
 	struct cmd_set_uc_hash_table *res = parsed_result;
@@ -8318,8 +8318,8 @@ struct cmd_set_uc_all_hash_table {
 
 static void
 cmd_set_uc_all_hash_parsed(void *parsed_result,
-		       __attribute__((unused)) struct cmdline *cl,
-		       __attribute__((unused)) void *data)
+		       __rte_unused struct cmdline *cl,
+		       __rte_unused void *data)
 {
 	int ret=0;
 	struct cmd_set_uc_all_hash_table *res = parsed_result;
@@ -8382,8 +8382,8 @@ struct cmd_set_vf_macvlan_filter {
 
 static void
 cmd_set_vf_macvlan_parsed(void *parsed_result,
-		       __attribute__((unused)) struct cmdline *cl,
-		       __attribute__((unused)) void *data)
+		       __rte_unused struct cmdline *cl,
+		       __rte_unused void *data)
 {
 	int is_on, ret = 0;
 	struct cmd_set_vf_macvlan_filter *res = parsed_result;
@@ -8485,8 +8485,8 @@ struct cmd_set_vf_traffic {
 
 static void
 cmd_set_vf_traffic_parsed(void *parsed_result,
-		       __attribute__((unused)) struct cmdline *cl,
-		       __attribute__((unused)) void *data)
+		       __rte_unused struct cmdline *cl,
+		       __rte_unused void *data)
 {
 	struct cmd_set_vf_traffic *res = parsed_result;
 	int is_rx = (strcmp(res->what, "rx") == 0) ? 1 : 0;
@@ -8547,8 +8547,8 @@ struct cmd_set_vf_rxmode {
 
 static void
 cmd_set_vf_rxmode_parsed(void *parsed_result,
-		       __attribute__((unused)) struct cmdline *cl,
-		       __attribute__((unused)) void *data)
+		       __rte_unused struct cmdline *cl,
+		       __rte_unused void *data)
 {
 	int ret = -ENOTSUP;
 	uint16_t vf_rxmode = 0;
@@ -8638,8 +8638,8 @@ struct cmd_vf_mac_addr_result {
 };
 
 static void cmd_vf_mac_addr_parsed(void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_vf_mac_addr_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -8715,8 +8715,8 @@ struct cmd_vf_rx_vlan_filter {
 
 static void
 cmd_vf_rx_vlan_filter_parsed(void *parsed_result,
-			  __attribute__((unused)) struct cmdline *cl,
-			  __attribute__((unused)) void *data)
+			  __rte_unused struct cmdline *cl,
+			  __rte_unused void *data)
 {
 	struct cmd_vf_rx_vlan_filter *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -8808,8 +8808,8 @@ struct cmd_queue_rate_limit_result {
 };
 
 static void cmd_queue_rate_limit_parsed(void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_queue_rate_limit_result *res = parsed_result;
 	int ret = 0;
@@ -8877,8 +8877,8 @@ struct cmd_vf_rate_limit_result {
 };
 
 static void cmd_vf_rate_limit_parsed(void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_vf_rate_limit_result *res = parsed_result;
 	int ret = 0;
@@ -8959,8 +8959,8 @@ struct cmd_tunnel_filter_result {
 
 static void
 cmd_tunnel_filter_parsed(void *parsed_result,
-			  __attribute__((unused)) struct cmdline *cl,
-			  __attribute__((unused)) void *data)
+			  __rte_unused struct cmdline *cl,
+			  __rte_unused void *data)
 {
 	struct cmd_tunnel_filter_result *res = parsed_result;
 	struct rte_eth_tunnel_filter_conf tunnel_filter_conf;
@@ -9103,8 +9103,8 @@ struct cmd_tunnel_udp_config {
 
 static void
 cmd_tunnel_udp_config_parsed(void *parsed_result,
-			  __attribute__((unused)) struct cmdline *cl,
-			  __attribute__((unused)) void *data)
+			  __rte_unused struct cmdline *cl,
+			  __rte_unused void *data)
 {
 	struct cmd_tunnel_udp_config *res = parsed_result;
 	struct rte_eth_udp_tunnel tunnel_udp;
@@ -9165,8 +9165,8 @@ struct cmd_config_tunnel_udp_port {
 
 static void
 cmd_cfg_tunnel_udp_port_parsed(void *parsed_result,
-			       __attribute__((unused)) struct cmdline *cl,
-			       __attribute__((unused)) void *data)
+			       __rte_unused struct cmdline *cl,
+			       __rte_unused void *data)
 {
 	struct cmd_config_tunnel_udp_port *res = parsed_result;
 	struct rte_eth_udp_tunnel tunnel_udp;
@@ -9248,8 +9248,8 @@ struct cmd_global_config_result {
 
 static void
 cmd_global_config_parsed(void *parsed_result,
-			 __attribute__((unused)) struct cmdline *cl,
-			 __attribute__((unused)) void *data)
+			 __rte_unused struct cmdline *cl,
+			 __rte_unused void *data)
 {
 	struct cmd_global_config_result *res = parsed_result;
 	struct rte_eth_global_cfg conf;
@@ -9338,8 +9338,8 @@ cmdline_parse_token_string_t cmd_mirror_mask_on =
 
 static void
 cmd_set_mirror_mask_parsed(void *parsed_result,
-		       __attribute__((unused)) struct cmdline *cl,
-		       __attribute__((unused)) void *data)
+		       __rte_unused struct cmdline *cl,
+		       __rte_unused void *data)
 {
 	int ret,nb_item,i;
 	struct cmd_set_mirror_mask_result *res = parsed_result;
@@ -9449,8 +9449,8 @@ cmdline_parse_token_string_t cmd_mirror_link_on =
 
 static void
 cmd_set_mirror_link_parsed(void *parsed_result,
-		       __attribute__((unused)) struct cmdline *cl,
-		       __attribute__((unused)) void *data)
+		       __rte_unused struct cmdline *cl,
+		       __rte_unused void *data)
 {
 	int ret;
 	struct cmd_set_mirror_link_result *res = parsed_result;
@@ -9523,8 +9523,8 @@ cmdline_parse_token_num_t cmd_rm_mirror_rule_ruleid =
 
 static void
 cmd_reset_mirror_rule_parsed(void *parsed_result,
-		       __attribute__((unused)) struct cmdline *cl,
-		       __attribute__((unused)) void *data)
+		       __rte_unused struct cmdline *cl,
+		       __rte_unused void *data)
 {
 	int ret;
 	struct cmd_set_mirror_link_result *res = parsed_result;
@@ -9565,8 +9565,8 @@ dump_struct_sizes(void)
 }
 
 static void cmd_dump_parsed(void *parsed_result,
-			    __attribute__((unused)) struct cmdline *cl,
-			    __attribute__((unused)) void *data)
+			    __rte_unused struct cmdline *cl,
+			    __rte_unused void *data)
 {
 	struct cmd_dump_result *res = parsed_result;
 
@@ -9614,7 +9614,7 @@ struct cmd_dump_one_result {
 };
 
 static void cmd_dump_one_parsed(void *parsed_result, struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused void *data)
 {
 	struct cmd_dump_one_result *res = parsed_result;
 
@@ -9668,8 +9668,8 @@ struct cmd_syn_filter_result {
 
 static void
 cmd_syn_filter_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	struct cmd_syn_filter_result *res = parsed_result;
 	struct rte_eth_syn_filter syn_filter;
@@ -9762,8 +9762,8 @@ struct cmd_queue_region_result {
 
 static void
 cmd_queue_region_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	struct cmd_queue_region_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -9861,8 +9861,8 @@ struct cmd_region_flowtype_result {
 
 static void
 cmd_region_flowtype_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	struct cmd_region_flowtype_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -9952,8 +9952,8 @@ struct cmd_user_priority_region_result {
 
 static void
 cmd_user_priority_region_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	struct cmd_user_priority_region_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -10043,8 +10043,8 @@ struct cmd_flush_queue_region_result {
 
 static void
 cmd_flush_queue_region_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	struct cmd_flush_queue_region_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -10125,8 +10125,8 @@ struct cmd_show_queue_region_info {
 
 static void
 cmd_show_queue_region_info_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	struct cmd_show_queue_region_info *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -10209,8 +10209,8 @@ struct cmd_2tuple_filter_result {
 
 static void
 cmd_2tuple_filter_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	struct rte_eth_ntuple_filter filter;
 	struct cmd_2tuple_filter_result *res = parsed_result;
@@ -10364,8 +10364,8 @@ struct cmd_5tuple_filter_result {
 
 static void
 cmd_5tuple_filter_parsed(void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	struct rte_eth_ntuple_filter filter;
 	struct cmd_5tuple_filter_result *res = parsed_result;
@@ -10572,8 +10572,8 @@ static int xdigit2val(unsigned char c)
 
 static void
 cmd_flex_filter_parsed(void *parsed_result,
-			  __attribute__((unused)) struct cmdline *cl,
-			  __attribute__((unused)) void *data)
+			  __rte_unused struct cmdline *cl,
+			  __rte_unused void *data)
 {
 	int ret = 0;
 	struct rte_eth_flex_filter filter;
@@ -10779,8 +10779,8 @@ cmdline_parse_token_num_t cmd_ethertype_filter_queue_id =
 
 static void
 cmd_ethertype_filter_parsed(void *parsed_result,
-			  __attribute__((unused)) struct cmdline *cl,
-			  __attribute__((unused)) void *data)
+			  __rte_unused struct cmdline *cl,
+			  __rte_unused void *data)
 {
 	struct cmd_ethertype_filter_result *res = parsed_result;
 	struct rte_eth_ethertype_filter filter;
@@ -11003,8 +11003,8 @@ do { \
 
 static void
 cmd_flow_director_filter_parsed(void *parsed_result,
-			  __attribute__((unused)) struct cmdline *cl,
-			  __attribute__((unused)) void *data)
+			  __rte_unused struct cmdline *cl,
+			  __rte_unused void *data)
 {
 	struct cmd_flow_director_result *res = parsed_result;
 	struct rte_eth_fdir_filter entry;
@@ -11623,8 +11623,8 @@ cmdline_parse_token_num_t cmd_flush_flow_director_port_id =
 
 static void
 cmd_flush_flow_director_parsed(void *parsed_result,
-			  __attribute__((unused)) struct cmdline *cl,
-			  __attribute__((unused)) void *data)
+			  __rte_unused struct cmdline *cl,
+			  __rte_unused void *data)
 {
 	struct cmd_flow_director_result *res = parsed_result;
 	int ret = 0;
@@ -11681,8 +11681,8 @@ struct cmd_flow_director_mask_result {
 
 static void
 cmd_flow_director_mask_parsed(void *parsed_result,
-			  __attribute__((unused)) struct cmdline *cl,
-			  __attribute__((unused)) void *data)
+			  __rte_unused struct cmdline *cl,
+			  __rte_unused void *data)
 {
 	struct cmd_flow_director_mask_result *res = parsed_result;
 	struct rte_eth_fdir_masks *mask;
@@ -11873,8 +11873,8 @@ struct cmd_flow_director_flex_mask_result {
 
 static void
 cmd_flow_director_flex_mask_parsed(void *parsed_result,
-			  __attribute__((unused)) struct cmdline *cl,
-			  __attribute__((unused)) void *data)
+			  __rte_unused struct cmdline *cl,
+			  __rte_unused void *data)
 {
 	struct cmd_flow_director_flex_mask_result *res = parsed_result;
 	struct rte_eth_fdir_info fdir_info;
@@ -12027,8 +12027,8 @@ parse_offsets(const char *q_arg, uint16_t *offsets, uint16_t max_num)
 
 static void
 cmd_flow_director_flxpld_parsed(void *parsed_result,
-			  __attribute__((unused)) struct cmdline *cl,
-			  __attribute__((unused)) void *data)
+			  __rte_unused struct cmdline *cl,
+			  __rte_unused void *data)
 {
 	struct cmd_flow_director_flexpayload_result *res = parsed_result;
 	struct rte_eth_flex_payload_cfg flex_cfg;
@@ -12631,8 +12631,8 @@ struct cmd_mcast_addr_result {
 };
 
 static void cmd_mcast_addr_parsed(void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_mcast_addr_result *res = parsed_result;
 
@@ -12746,8 +12746,8 @@ str2fdir_l2_tunnel_type(char *string)
 static void
 cmd_config_l2_tunnel_eth_type_all_parsed
 	(void *parsed_result,
-	 __attribute__((unused)) struct cmdline *cl,
-	 __attribute__((unused)) void *data)
+	 __rte_unused struct cmdline *cl,
+	 __rte_unused void *data)
 {
 	struct cmd_config_l2_tunnel_eth_type_result *res = parsed_result;
 	struct rte_eth_l2_tunnel_conf entry;
@@ -12781,8 +12781,8 @@ cmdline_parse_inst_t cmd_config_l2_tunnel_eth_type_all = {
 static void
 cmd_config_l2_tunnel_eth_type_specific_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_config_l2_tunnel_eth_type_result *res =
 		 parsed_result;
@@ -12857,8 +12857,8 @@ cmdline_parse_token_string_t cmd_config_l2_tunnel_en_dis_en_dis =
 static void
 cmd_config_l2_tunnel_en_dis_all_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_config_l2_tunnel_en_dis_result *res = parsed_result;
 	struct rte_eth_l2_tunnel_conf entry;
@@ -12899,8 +12899,8 @@ cmdline_parse_inst_t cmd_config_l2_tunnel_en_dis_all = {
 static void
 cmd_config_l2_tunnel_en_dis_specific_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_config_l2_tunnel_en_dis_result *res =
 		parsed_result;
@@ -13055,8 +13055,8 @@ cmdline_parse_token_num_t cmd_config_e_tag_vf_id =
 static void
 cmd_config_e_tag_insertion_en_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_config_e_tag_result *res =
 		parsed_result;
@@ -13077,8 +13077,8 @@ cmd_config_e_tag_insertion_en_parsed(
 static void
 cmd_config_e_tag_insertion_dis_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_config_e_tag_result *res =
 		parsed_result;
@@ -13136,8 +13136,8 @@ cmdline_parse_inst_t cmd_config_e_tag_insertion_dis = {
 static void
 cmd_config_e_tag_stripping_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_config_e_tag_result *res =
 		parsed_result;
@@ -13181,8 +13181,8 @@ cmdline_parse_inst_t cmd_config_e_tag_stripping_en_dis = {
 static void
 cmd_config_e_tag_forwarding_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_config_e_tag_result *res = parsed_result;
 	struct rte_eth_l2_tunnel_conf entry;
@@ -13225,8 +13225,8 @@ cmdline_parse_inst_t cmd_config_e_tag_forwarding_en_dis = {
 static void
 cmd_config_e_tag_filter_add_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_config_e_tag_result *res = parsed_result;
 	struct rte_eth_l2_tunnel_conf entry;
@@ -13283,8 +13283,8 @@ cmdline_parse_inst_t cmd_config_e_tag_filter_add = {
 static void
 cmd_config_e_tag_filter_del_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_config_e_tag_result *res = parsed_result;
 	struct rte_eth_l2_tunnel_conf entry;
@@ -13381,8 +13381,8 @@ cmdline_parse_token_string_t cmd_vf_vlan_anti_spoof_on_off =
 static void
 cmd_set_vf_vlan_anti_spoof_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_vf_vlan_anti_spoof_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -13487,8 +13487,8 @@ cmdline_parse_token_string_t cmd_vf_mac_anti_spoof_on_off =
 static void
 cmd_set_vf_mac_anti_spoof_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_vf_mac_anti_spoof_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -13593,8 +13593,8 @@ cmdline_parse_token_string_t cmd_vf_vlan_stripq_on_off =
 static void
 cmd_set_vf_vlan_stripq_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_vf_vlan_stripq_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -13699,8 +13699,8 @@ cmdline_parse_token_num_t cmd_vf_vlan_insert_vlan_id =
 static void
 cmd_set_vf_vlan_insert_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_vf_vlan_insert_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -13793,8 +13793,8 @@ cmdline_parse_token_string_t cmd_tx_loopback_on_off =
 static void
 cmd_set_tx_loopback_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_tx_loopback_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -13893,8 +13893,8 @@ cmdline_parse_token_string_t cmd_all_queues_drop_en_on_off =
 static void
 cmd_set_all_queues_drop_en_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_all_queues_drop_en_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -13989,8 +13989,8 @@ cmdline_parse_token_string_t cmd_vf_split_drop_en_on_off =
 static void
 cmd_set_vf_split_drop_en_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_vf_split_drop_en_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -14082,8 +14082,8 @@ cmdline_parse_token_etheraddr_t cmd_set_vf_mac_addr_mac_addr =
 static void
 cmd_set_vf_mac_addr_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_set_vf_mac_addr_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -14196,8 +14196,8 @@ cmdline_parse_token_string_t cmd_macsec_offload_on_rp_on_off =
 static void
 cmd_set_macsec_offload_on_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_macsec_offload_on_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -14295,8 +14295,8 @@ cmdline_parse_token_string_t cmd_macsec_offload_off_off =
 static void
 cmd_set_macsec_offload_off_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_macsec_offload_off_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -14394,8 +14394,8 @@ cmdline_parse_token_num_t cmd_macsec_sc_pi =
 static void
 cmd_set_macsec_sc_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_macsec_sc_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -14494,8 +14494,8 @@ cmdline_parse_token_string_t cmd_macsec_sa_key =
 static void
 cmd_set_macsec_sa_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_macsec_sa_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -14606,8 +14606,8 @@ cmdline_parse_token_string_t cmd_vf_promisc_on_off =
 static void
 cmd_set_vf_promisc_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_vf_promisc_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -14696,8 +14696,8 @@ cmdline_parse_token_string_t cmd_vf_allmulti_on_off =
 static void
 cmd_set_vf_allmulti_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_vf_allmulti_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -14786,8 +14786,8 @@ cmdline_parse_token_string_t cmd_set_vf_broadcast_on_off =
 static void
 cmd_set_vf_broadcast_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_set_vf_broadcast_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -14880,8 +14880,8 @@ cmdline_parse_token_string_t cmd_set_vf_vlan_tag_on_off =
 static void
 cmd_set_vf_vlan_tag_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_set_vf_vlan_tag_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -15003,8 +15003,8 @@ cmdline_parse_token_num_t cmd_vf_tc_bw_tc_map =
 static void
 cmd_vf_max_bw_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_vf_tc_bw_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -15097,8 +15097,8 @@ vf_tc_min_bw_parse_bw_list(uint8_t *bw_list,
 static void
 cmd_vf_tc_min_bw_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_vf_tc_bw_result *res = parsed_result;
 	uint8_t tc_num;
@@ -15155,8 +15155,8 @@ cmdline_parse_inst_t cmd_vf_tc_min_bw = {
 static void
 cmd_tc_min_bw_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_vf_tc_bw_result *res = parsed_result;
 	struct rte_port *port;
@@ -15218,8 +15218,8 @@ cmdline_parse_inst_t cmd_tc_min_bw = {
 static void
 cmd_vf_tc_max_bw_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_vf_tc_bw_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -15305,8 +15305,8 @@ cmdline_parse_token_num_t cmd_set_port_tm_hierarchy_default_port_id =
 			port_id, UINT16);
 
 static void cmd_set_port_tm_hierarchy_default_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_set_port_tm_hierarchy_default_result *res = parsed_result;
 	struct rte_port *p;
@@ -15430,8 +15430,8 @@ cmdline_parse_token_etheraddr_t cmd_set_vxlan_eth_dst_value =
 	TOKEN_ETHERADDR_INITIALIZER(struct cmd_set_vxlan_result, eth_dst);
 
 static void cmd_set_vxlan_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_set_vxlan_result *res = parsed_result;
 	union {
@@ -15630,8 +15630,8 @@ cmdline_parse_token_etheraddr_t cmd_set_nvgre_eth_dst_value =
 	TOKEN_ETHERADDR_INITIALIZER(struct cmd_set_nvgre_result, eth_dst);
 
 static void cmd_set_nvgre_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_set_nvgre_result *res = parsed_result;
 	union {
@@ -15761,8 +15761,8 @@ cmdline_parse_token_etheraddr_t cmd_set_l2_encap_eth_dst_value =
 	TOKEN_ETHERADDR_INITIALIZER(struct cmd_set_l2_encap_result, eth_dst);
 
 static void cmd_set_l2_encap_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_set_l2_encap_result *res = parsed_result;
 
@@ -15840,8 +15840,8 @@ cmdline_parse_token_string_t cmd_set_l2_decap_l2_decap_with_vlan =
 				 "l2_decap-with-vlan");
 
 static void cmd_set_l2_decap_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_set_l2_decap_result *res = parsed_result;
 
@@ -15939,8 +15939,8 @@ cmdline_parse_token_etheraddr_t cmd_set_mplsogre_encap_eth_dst_value =
 				    eth_dst);
 
 static void cmd_set_mplsogre_encap_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_set_mplsogre_encap_result *res = parsed_result;
 	union {
@@ -16054,8 +16054,8 @@ cmdline_parse_token_string_t cmd_set_mplsogre_decap_ip_version_value =
 				 ip_version, "ipv4#ipv6");
 
 static void cmd_set_mplsogre_decap_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_set_mplsogre_decap_result *res = parsed_result;
 
@@ -16175,8 +16175,8 @@ cmdline_parse_token_etheraddr_t cmd_set_mplsoudp_encap_eth_dst_value =
 				    eth_dst);
 
 static void cmd_set_mplsoudp_encap_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_set_mplsoudp_encap_result *res = parsed_result;
 	union {
@@ -16301,8 +16301,8 @@ cmdline_parse_token_string_t cmd_set_mplsoudp_decap_ip_version_value =
 				 ip_version, "ipv4#ipv6");
 
 static void cmd_set_mplsoudp_decap_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_set_mplsoudp_decap_result *res = parsed_result;
 
@@ -16346,8 +16346,8 @@ cmdline_parse_inst_t cmd_set_mplsoudp_decap_with_vlan = {
 static void
 cmd_strict_link_prio_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_vf_tc_bw_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -16410,8 +16410,8 @@ cmdline_parse_token_string_t cmd_ddp_add_filepath =
 static void
 cmd_ddp_add_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_ddp_add_result *res = parsed_result;
 	uint8_t *buff;
@@ -16490,8 +16490,8 @@ cmdline_parse_token_string_t cmd_ddp_del_filepath =
 static void
 cmd_ddp_del_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_ddp_del_result *res = parsed_result;
 	uint8_t *buff;
@@ -16555,8 +16555,8 @@ cmdline_parse_token_string_t cmd_ddp_info_filepath =
 static void
 cmd_ddp_info_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_ddp_info_result *res = parsed_result;
 	uint8_t *pkg;
@@ -16794,9 +16794,9 @@ cmdline_parse_token_num_t cmd_ddp_get_list_port_id =
 
 static void
 cmd_ddp_get_list_parsed(
-	__attribute__((unused)) void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused void *parsed_result,
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 #ifdef RTE_LIBRTE_I40E_PMD
 	struct cmd_ddp_get_list_result *res = parsed_result;
@@ -16870,9 +16870,9 @@ struct cmd_cfg_input_set_result {
 
 static void
 cmd_cfg_input_set_parsed(
-	__attribute__((unused)) void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused void *parsed_result,
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 #ifdef RTE_LIBRTE_I40E_PMD
 	struct cmd_cfg_input_set_result *res = parsed_result;
@@ -16993,9 +16993,9 @@ struct cmd_clear_input_set_result {
 
 static void
 cmd_clear_input_set_parsed(
-	__attribute__((unused)) void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused void *parsed_result,
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 #ifdef RTE_LIBRTE_I40E_PMD
 	struct cmd_clear_input_set_result *res = parsed_result;
@@ -17112,8 +17112,8 @@ cmdline_parse_token_num_t cmd_show_vf_stats_vf_id =
 static void
 cmd_show_vf_stats_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_show_vf_stats_result *res = parsed_result;
 	struct rte_eth_stats stats;
@@ -17221,8 +17221,8 @@ cmdline_parse_token_num_t cmd_clear_vf_stats_vf_id =
 static void
 cmd_clear_vf_stats_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_clear_vf_stats_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -17313,8 +17313,8 @@ cmdline_parse_token_string_t cmd_pctype_mapping_reset_reset =
 static void
 cmd_pctype_mapping_reset_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_pctype_mapping_reset_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -17391,8 +17391,8 @@ cmdline_parse_token_string_t cmd_pctype_mapping_get_mapping =
 static void
 cmd_pctype_mapping_get_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_pctype_mapping_get_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -17507,8 +17507,8 @@ cmdline_parse_token_num_t cmd_pctype_mapping_update_flow_type =
 static void
 cmd_pctype_mapping_update_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_pctype_mapping_update_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -17605,8 +17605,8 @@ cmdline_parse_token_num_t cmd_ptype_mapping_get_valid_only =
 static void
 cmd_ptype_mapping_get_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_ptype_mapping_get_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -17710,8 +17710,8 @@ cmdline_parse_token_num_t cmd_ptype_mapping_replace_pkt_type =
 static void
 cmd_ptype_mapping_replace_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_ptype_mapping_replace_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -17792,8 +17792,8 @@ cmdline_parse_token_num_t cmd_ptype_mapping_reset_port_id =
 static void
 cmd_ptype_mapping_reset_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_ptype_mapping_reset_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -17873,8 +17873,8 @@ cmdline_parse_token_num_t cmd_ptype_mapping_update_sw_ptype =
 static void
 cmd_ptype_mapping_update_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_ptype_mapping_update_result *res = parsed_result;
 	int ret = -ENOTSUP;
@@ -17940,8 +17940,8 @@ cmdline_parse_token_string_t cmd_load_cmdfile_filename =
 static void
 cmd_load_from_file_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_cmdfile_result *res = parsed_result;
 
@@ -18015,8 +18015,8 @@ print_rx_offloads(uint64_t offloads)
 static void
 cmd_rx_offload_get_capa_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_rx_offload_get_capa_result *res = parsed_result;
 	struct rte_eth_dev_info dev_info;
@@ -18089,8 +18089,8 @@ cmdline_parse_token_string_t cmd_rx_offload_get_configuration_configuration =
 static void
 cmd_rx_offload_get_configuration_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_rx_offload_get_configuration_result *res = parsed_result;
 	struct rte_eth_dev_info dev_info;
@@ -18201,8 +18201,8 @@ search_rx_offload(const char *name)
 
 static void
 cmd_config_per_port_rx_offload_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_config_per_port_rx_offload_result *res = parsed_result;
 	portid_t port_id = res->port_id;
@@ -18307,8 +18307,8 @@ cmdline_parse_token_string_t cmd_config_per_queue_rx_offload_result_on_off =
 
 static void
 cmd_config_per_queue_rx_offload_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_config_per_queue_rx_offload_result *res = parsed_result;
 	struct rte_eth_dev_info dev_info;
@@ -18425,8 +18425,8 @@ print_tx_offloads(uint64_t offloads)
 static void
 cmd_tx_offload_get_capa_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_tx_offload_get_capa_result *res = parsed_result;
 	struct rte_eth_dev_info dev_info;
@@ -18499,8 +18499,8 @@ cmdline_parse_token_string_t cmd_tx_offload_get_configuration_configuration =
 static void
 cmd_tx_offload_get_configuration_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_tx_offload_get_configuration_result *res = parsed_result;
 	struct rte_eth_dev_info dev_info;
@@ -18615,8 +18615,8 @@ search_tx_offload(const char *name)
 
 static void
 cmd_config_per_port_tx_offload_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_config_per_port_tx_offload_result *res = parsed_result;
 	portid_t port_id = res->port_id;
@@ -18723,8 +18723,8 @@ cmdline_parse_token_string_t cmd_config_per_queue_tx_offload_result_on_off =
 
 static void
 cmd_config_per_queue_tx_offload_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_config_per_queue_tx_offload_result *res = parsed_result;
 	struct rte_eth_dev_info dev_info;
@@ -18797,8 +18797,8 @@ struct cmd_config_tx_metadata_specific_result {
 
 static void
 cmd_config_tx_metadata_specific_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_config_tx_metadata_specific_result *res = parsed_result;
 
@@ -18855,8 +18855,8 @@ struct cmd_config_tx_dynf_specific_result {
 
 static void
 cmd_config_dynf_specific_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct cmd_config_tx_dynf_specific_result *res = parsed_result;
 	struct rte_mbuf_dynflag desc_flag;
@@ -18936,8 +18936,8 @@ struct cmd_show_tx_metadata_result {
 
 static void
 cmd_show_tx_metadata_parsed(void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_show_tx_metadata_result *res = parsed_result;
 
@@ -19008,8 +19008,8 @@ cmdline_parse_token_string_t cmd_show_port_supported_ptypes_ptypes =
 static void
 cmd_show_port_supported_ptypes_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 #define RSVD_PTYPE_MASK       0xf0000000
 #define MAX_PTYPES_PER_LAYER  16
@@ -19099,8 +19099,8 @@ struct cmd_show_rx_tx_desc_status_result {
 
 static void
 cmd_show_rx_tx_desc_status_parsed(void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_show_rx_tx_desc_status_result *res = parsed_result;
 	int rc;
@@ -19215,8 +19215,8 @@ cmdline_parse_token_num_t cmd_set_port_ptypes_mask_u32 =
 static void
 cmd_set_port_ptypes_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_set_port_ptypes_result *res = parsed_result;
 #define PTYPE_NAMESIZE        256
@@ -19273,8 +19273,8 @@ struct cmd_showport_macs_result {
 
 static void
 cmd_showport_macs_parsed(void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct cmd_showport_macs_result *res = parsed_result;
 
diff --git a/app/test-pmd/cmdline_mtr.c b/app/test-pmd/cmdline_mtr.c
index ab5c8642db..caa7e98644 100644
--- a/app/test-pmd/cmdline_mtr.c
+++ b/app/test-pmd/cmdline_mtr.c
@@ -256,8 +256,8 @@ cmdline_parse_token_num_t cmd_show_port_meter_cap_port_id =
 		struct cmd_show_port_meter_cap_result, port_id, UINT16);
 
 static void cmd_show_port_meter_cap_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_show_port_meter_cap_result *res = parsed_result;
 	struct rte_mtr_capabilities cap;
@@ -378,8 +378,8 @@ cmdline_parse_token_num_t cmd_add_port_meter_profile_srtcm_ebs =
 			ebs, UINT64);
 
 static void cmd_add_port_meter_profile_srtcm_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_add_port_meter_profile_srtcm_result *res = parsed_result;
 	struct rte_mtr_meter_profile mp;
@@ -484,8 +484,8 @@ cmdline_parse_token_num_t cmd_add_port_meter_profile_trtcm_pbs =
 			pbs, UINT64);
 
 static void cmd_add_port_meter_profile_trtcm_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_add_port_meter_profile_trtcm_result *res = parsed_result;
 	struct rte_mtr_meter_profile mp;
@@ -595,8 +595,8 @@ cmdline_parse_token_num_t cmd_add_port_meter_profile_trtcm_rfc4115_ebs =
 
 static void cmd_add_port_meter_profile_trtcm_rfc4115_parsed(
 	void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_add_port_meter_profile_trtcm_rfc4115_result *res =
 		parsed_result;
@@ -679,8 +679,8 @@ cmdline_parse_token_num_t cmd_del_port_meter_profile_profile_id =
 			profile_id, UINT32);
 
 static void cmd_del_port_meter_profile_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_del_port_meter_profile_result *res = parsed_result;
 	struct rte_mtr_error error;
@@ -772,8 +772,8 @@ cmdline_parse_token_string_t cmd_create_port_meter_input_color =
 		meter_input_color, TOKEN_STRING_MULTI);
 
 static void cmd_create_port_meter_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_create_port_meter_result *res = parsed_result;
 	struct rte_mtr_error error;
@@ -872,8 +872,8 @@ cmdline_parse_token_num_t cmd_enable_port_meter_mtr_id =
 		struct cmd_enable_port_meter_result, mtr_id, UINT32);
 
 static void cmd_enable_port_meter_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_enable_port_meter_result *res = parsed_result;
 	struct rte_mtr_error error;
@@ -933,8 +933,8 @@ cmdline_parse_token_num_t cmd_disable_port_meter_mtr_id =
 		struct cmd_disable_port_meter_result, mtr_id, UINT32);
 
 static void cmd_disable_port_meter_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_disable_port_meter_result *res = parsed_result;
 	struct rte_mtr_error error;
@@ -994,8 +994,8 @@ cmdline_parse_token_num_t cmd_del_port_meter_mtr_id =
 		struct cmd_del_port_meter_result, mtr_id, UINT32);
 
 static void cmd_del_port_meter_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_del_port_meter_result *res = parsed_result;
 	struct rte_mtr_error error;
@@ -1063,8 +1063,8 @@ cmdline_parse_token_num_t cmd_set_port_meter_profile_profile_id =
 		struct cmd_set_port_meter_profile_result, profile_id, UINT32);
 
 static void cmd_set_port_meter_profile_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_set_port_meter_profile_result *res = parsed_result;
 	struct rte_mtr_error error;
@@ -1129,8 +1129,8 @@ cmdline_parse_token_string_t cmd_set_port_meter_dscp_table_token_string =
 		token_string, TOKEN_STRING_MULTI);
 
 static void cmd_set_port_meter_dscp_table_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_set_port_meter_dscp_table_result *res = parsed_result;
 	struct rte_mtr_error error;
@@ -1223,8 +1223,8 @@ cmdline_parse_token_string_t cmd_set_port_meter_policer_action_policer_action =
 		policer_action, TOKEN_STRING_MULTI);
 
 static void cmd_set_port_meter_policer_action_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_set_port_meter_policer_action_result *res = parsed_result;
 	enum rte_mtr_policer_action *actions;
@@ -1326,8 +1326,8 @@ cmdline_parse_token_num_t cmd_set_port_meter_stats_mask_stats_mask =
 		UINT64);
 
 static void cmd_set_port_meter_stats_mask_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_set_port_meter_stats_mask_result *res = parsed_result;
 	struct rte_mtr_error error;
@@ -1397,8 +1397,8 @@ cmdline_parse_token_string_t cmd_show_port_meter_stats_clear =
 		struct cmd_show_port_meter_stats_result, clear, "yes#no");
 
 static void cmd_show_port_meter_stats_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_show_port_meter_stats_result *res = parsed_result;
 	struct rte_mtr_stats stats;
diff --git a/app/test-pmd/cmdline_tm.c b/app/test-pmd/cmdline_tm.c
index d62a4f5443..6951beb58d 100644
--- a/app/test-pmd/cmdline_tm.c
+++ b/app/test-pmd/cmdline_tm.c
@@ -220,8 +220,8 @@ cmdline_parse_token_num_t cmd_show_port_tm_cap_port_id =
 		 port_id, UINT16);
 
 static void cmd_show_port_tm_cap_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_show_port_tm_cap_result *res = parsed_result;
 	struct rte_tm_capabilities cap;
@@ -361,8 +361,8 @@ cmdline_parse_token_num_t cmd_show_port_tm_level_cap_level_id =
 
 
 static void cmd_show_port_tm_level_cap_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_show_port_tm_level_cap_result *res = parsed_result;
 	struct rte_tm_level_capabilities lcap;
@@ -487,8 +487,8 @@ cmdline_parse_token_num_t cmd_show_port_tm_node_cap_node_id =
 		 node_id, UINT32);
 
 static void cmd_show_port_tm_node_cap_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_show_port_tm_node_cap_result *res = parsed_result;
 	struct rte_tm_node_capabilities ncap;
@@ -603,8 +603,8 @@ cmdline_parse_token_num_t cmd_show_port_tm_node_stats_clear =
 		struct cmd_show_port_tm_node_stats_result, clear, UINT32);
 
 static void cmd_show_port_tm_node_stats_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_show_port_tm_node_stats_result *res = parsed_result;
 	struct rte_tm_node_stats stats;
@@ -719,8 +719,8 @@ cmdline_parse_token_num_t cmd_show_port_tm_node_type_node_id =
 			node_id, UINT32);
 
 static void cmd_show_port_tm_node_type_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_show_port_tm_node_type_result *res = parsed_result;
 	struct rte_tm_error error;
@@ -831,8 +831,8 @@ cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_pktlen_adjust =
 			pktlen_adjust, UINT32);
 
 static void cmd_add_port_tm_node_shaper_profile_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_add_port_tm_node_shaper_profile_result *res = parsed_result;
 	struct rte_tm_shaper_params sp;
@@ -927,8 +927,8 @@ cmdline_parse_token_num_t cmd_del_port_tm_node_shaper_profile_shaper_id =
 			shaper_id, UINT32);
 
 static void cmd_del_port_tm_node_shaper_profile_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_del_port_tm_node_shaper_profile_result *res = parsed_result;
 	struct rte_tm_error error;
@@ -1012,8 +1012,8 @@ cmdline_parse_token_num_t cmd_add_port_tm_node_shared_shaper_shaper_profile_id =
 			shaper_profile_id, UINT32);
 
 static void cmd_add_port_tm_node_shared_shaper_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_add_port_tm_node_shared_shaper_result *res = parsed_result;
 	struct rte_tm_error error;
@@ -1108,8 +1108,8 @@ cmdline_parse_token_num_t cmd_del_port_tm_node_shared_shaper_shared_shaper_id =
 			shared_shaper_id, UINT32);
 
 static void cmd_del_port_tm_node_shared_shaper_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_del_port_tm_node_shared_shaper_result *res = parsed_result;
 	struct rte_tm_error error;
@@ -1262,8 +1262,8 @@ cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_wq_log2_r =
 
 
 static void cmd_add_port_tm_node_wred_profile_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_add_port_tm_node_wred_profile_result *res = parsed_result;
 	struct rte_tm_wred_params wp;
@@ -1381,8 +1381,8 @@ cmdline_parse_token_num_t cmd_del_port_tm_node_wred_profile_wred_profile_id =
 			wred_profile_id, UINT32);
 
 static void cmd_del_port_tm_node_wred_profile_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_del_port_tm_node_wred_profile_result *res = parsed_result;
 	struct rte_tm_error error;
@@ -1467,8 +1467,8 @@ cmdline_parse_token_num_t
 			shaper_profile_id, UINT32);
 
 static void cmd_set_port_tm_node_shaper_profile_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_set_port_tm_node_shaper_profile_result *res = parsed_result;
 	struct rte_tm_error error;
@@ -1581,8 +1581,8 @@ cmdline_parse_token_string_t
 		 multi_shared_shaper_id, TOKEN_STRING_MULTI);
 
 static void cmd_add_port_tm_nonleaf_node_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_add_port_tm_nonleaf_node_result *res = parsed_result;
 	struct rte_tm_error error;
@@ -1742,8 +1742,8 @@ cmdline_parse_token_string_t
 		 multi_shared_shaper_id, TOKEN_STRING_MULTI);
 
 static void cmd_add_port_tm_leaf_node_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_add_port_tm_leaf_node_result *res = parsed_result;
 	struct rte_tm_error error;
@@ -1864,8 +1864,8 @@ cmdline_parse_token_num_t cmd_del_port_tm_node_node_id =
 		node_id, UINT32);
 
 static void cmd_del_port_tm_node_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_del_port_tm_node_result *res = parsed_result;
 	struct rte_tm_error error;
@@ -1951,8 +1951,8 @@ cmdline_parse_token_num_t cmd_set_port_tm_node_parent_weight =
 		weight, UINT32);
 
 static void cmd_set_port_tm_node_parent_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_set_port_tm_node_parent_result *res = parsed_result;
 	struct rte_tm_error error;
@@ -2030,8 +2030,8 @@ cmdline_parse_token_num_t cmd_suspend_port_tm_node_node_id =
 		struct cmd_suspend_port_tm_node_result, node_id, UINT32);
 
 static void cmd_suspend_port_tm_node_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_suspend_port_tm_node_result *res = parsed_result;
 	struct rte_tm_error error;
@@ -2095,8 +2095,8 @@ cmdline_parse_token_num_t cmd_resume_port_tm_node_node_id =
 		struct cmd_resume_port_tm_node_result, node_id, UINT32);
 
 static void cmd_resume_port_tm_node_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_resume_port_tm_node_result *res = parsed_result;
 	struct rte_tm_error error;
@@ -2162,8 +2162,8 @@ cmdline_parse_token_string_t cmd_port_tm_hierarchy_commit_clean_on_fail =
 		 clean_on_fail, "yes#no");
 
 static void cmd_port_tm_hierarchy_commit_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_port_tm_hierarchy_commit_result *res = parsed_result;
 	struct rte_tm_error error;
@@ -2249,8 +2249,8 @@ cmdline_parse_token_num_t cmd_port_tm_mark_ip_ecn_red =
 				red, UINT16);
 
 static void cmd_port_tm_mark_ip_ecn_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_port_tm_mark_ip_ecn_result *res = parsed_result;
 	struct rte_tm_error error;
@@ -2336,8 +2336,8 @@ cmdline_parse_token_num_t cmd_port_tm_mark_ip_dscp_red =
 				red, UINT16);
 
 static void cmd_port_tm_mark_ip_dscp_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_port_tm_mark_ip_dscp_result *res = parsed_result;
 	struct rte_tm_error error;
@@ -2423,8 +2423,8 @@ cmdline_parse_token_num_t cmd_port_tm_mark_vlan_dei_red =
 				red, UINT16);
 
 static void cmd_port_tm_mark_vlan_dei_parsed(void *parsed_result,
-	__attribute__((unused)) struct cmdline *cl,
-	__attribute__((unused)) void *data)
+	__rte_unused struct cmdline *cl,
+	__rte_unused void *data)
 {
 	struct cmd_port_tm_mark_vlan_dei_result *res = parsed_result;
 	struct rte_tm_error error;
diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c
index 4b5bec443b..33db9ab521 100644
--- a/app/test-pmd/txonly.c
+++ b/app/test-pmd/txonly.c
@@ -341,7 +341,7 @@ pkt_burst_transmit(struct fwd_stream *fs)
 }
 
 static void
-tx_only_begin(__attribute__((unused)) portid_t pi)
+tx_only_begin(__rte_unused portid_t pi)
 {
 	uint16_t pkt_data_len;
 
diff --git a/app/test/commands.c b/app/test/commands.c
index 3bf767bf7f..d48dd513d7 100644
--- a/app/test/commands.c
+++ b/app/test/commands.c
@@ -59,8 +59,8 @@ struct cmd_autotest_result {
 };
 
 static void cmd_autotest_parsed(void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	struct test_command *t;
 	struct cmd_autotest_result *res = parsed_result;
@@ -112,8 +112,8 @@ dump_struct_sizes(void)
 }
 
 static void cmd_dump_parsed(void *parsed_result,
-			    __attribute__((unused)) struct cmdline *cl,
-			    __attribute__((unused)) void *data)
+			    __rte_unused struct cmdline *cl,
+			    __rte_unused void *data)
 {
 	struct cmd_dump_result *res = parsed_result;
 
@@ -167,7 +167,7 @@ struct cmd_dump_one_result {
 };
 
 static void cmd_dump_one_parsed(void *parsed_result, struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused void *data)
 {
 	struct cmd_dump_one_result *res = parsed_result;
 
@@ -216,9 +216,9 @@ struct cmd_quit_result {
 };
 
 static void
-cmd_quit_parsed(__attribute__((unused)) void *parsed_result,
+cmd_quit_parsed(__rte_unused void *parsed_result,
 		struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	cmdline_quit(cl);
 }
@@ -245,7 +245,7 @@ struct cmd_set_rxtx_result {
 };
 
 static void cmd_set_rxtx_parsed(void *parsed_result, struct cmdline *cl,
-				__attribute__((unused)) void *data)
+				__rte_unused void *data)
 {
 	struct cmd_set_rxtx_result *res = parsed_result;
 	if (test_set_rxtx_conf(res->mode) < 0)
@@ -281,7 +281,7 @@ struct cmd_set_rxtx_anchor {
 static void
 cmd_set_rxtx_anchor_parsed(void *parsed_result,
 			   struct cmdline *cl,
-			   __attribute__((unused)) void *data)
+			   __rte_unused void *data)
 {
 	struct cmd_set_rxtx_anchor *res = parsed_result;
 	if (test_set_rxtx_anchor(res->type) < 0)
@@ -318,7 +318,7 @@ struct cmd_set_rxtx_sc {
 static void
 cmd_set_rxtx_sc_parsed(void *parsed_result,
 			   struct cmdline *cl,
-			   __attribute__((unused)) void *data)
+			   __rte_unused void *data)
 {
 	struct cmd_set_rxtx_sc *res = parsed_result;
 	if (test_set_rxtx_sc(res->type) < 0)
diff --git a/app/test/test_atomic.c b/app/test/test_atomic.c
index de3030d221..214452e543 100644
--- a/app/test/test_atomic.c
+++ b/app/test/test_atomic.c
@@ -108,7 +108,7 @@ static rte_atomic64_t count;
 static rte_atomic32_t synchro;
 
 static int
-test_atomic_usual(__attribute__((unused)) void *arg)
+test_atomic_usual(__rte_unused void *arg)
 {
 	unsigned i;
 
@@ -146,7 +146,7 @@ test_atomic_usual(__attribute__((unused)) void *arg)
 }
 
 static int
-test_atomic_tas(__attribute__((unused)) void *arg)
+test_atomic_tas(__rte_unused void *arg)
 {
 	while (rte_atomic32_read(&synchro) == 0)
 		;
@@ -162,7 +162,7 @@ test_atomic_tas(__attribute__((unused)) void *arg)
 }
 
 static int
-test_atomic_addsub_and_return(__attribute__((unused)) void *arg)
+test_atomic_addsub_and_return(__rte_unused void *arg)
 {
 	uint32_t tmp16;
 	uint32_t tmp32;
@@ -206,7 +206,7 @@ test_atomic_addsub_and_return(__attribute__((unused)) void *arg)
  *
  */
 static int
-test_atomic_inc_and_test(__attribute__((unused)) void *arg)
+test_atomic_inc_and_test(__rte_unused void *arg)
 {
 	while (rte_atomic32_read(&synchro) == 0)
 		;
@@ -233,7 +233,7 @@ test_atomic_inc_and_test(__attribute__((unused)) void *arg)
  * be checked as the result later.
  */
 static int
-test_atomic_dec_and_test(__attribute__((unused)) void *arg)
+test_atomic_dec_and_test(__rte_unused void *arg)
 {
 	while (rte_atomic32_read(&synchro) == 0)
 		;
@@ -261,7 +261,7 @@ static rte_int128_t count128;
  * iteration it runs compare and swap operation with different memory models.
  */
 static int
-test_atomic128_cmp_exchange(__attribute__((unused)) void *arg)
+test_atomic128_cmp_exchange(__rte_unused void *arg)
 {
 	rte_int128_t expected;
 	int success;
@@ -397,7 +397,7 @@ get_crc8(uint8_t *message, int length)
  * +------------+------------+
  */
 static int
-test_atomic_exchange(__attribute__((unused)) void *arg)
+test_atomic_exchange(__rte_unused void *arg)
 {
 	int i;
 	test16_t nt16, ot16; /* new token, old token */
diff --git a/app/test/test_cmdline_lib.c b/app/test/test_cmdline_lib.c
index a856a97132..dec465da5f 100644
--- a/app/test/test_cmdline_lib.c
+++ b/app/test/test_cmdline_lib.c
@@ -12,6 +12,8 @@
 #include <ctype.h>
 #include <sys/queue.h>
 
+#include <rte_common.h>
+
 #include <cmdline_vt100.h>
 #include <cmdline_rdline.h>
 #include <cmdline_parse.h>
@@ -23,18 +25,18 @@
 /****************************************************************/
 /* static functions required for some tests */
 static void
-valid_buffer(__attribute__((unused))struct rdline *rdl,
-			__attribute__((unused))const char *buf,
-			__attribute__((unused)) unsigned int size)
+valid_buffer(__rte_unused struct rdline *rdl,
+			__rte_unused const char *buf,
+			__rte_unused unsigned int size)
 {
 }
 
 static int
-complete_buffer(__attribute__((unused)) struct rdline *rdl,
-			__attribute__((unused)) const char *buf,
-			__attribute__((unused)) char *dstbuf,
-			__attribute__((unused)) unsigned int dstsize,
-			__attribute__((unused)) int *state)
+complete_buffer(__rte_unused struct rdline *rdl,
+			__rte_unused const char *buf,
+			__rte_unused char *dstbuf,
+			__rte_unused unsigned int dstsize,
+			__rte_unused int *state)
 {
 	return 0;
 }
diff --git a/app/test/test_func_reentrancy.c b/app/test/test_func_reentrancy.c
index 596d395eb4..f5ddd03d76 100644
--- a/app/test/test_func_reentrancy.c
+++ b/app/test/test_func_reentrancy.c
@@ -66,7 +66,7 @@ static rte_atomic32_t synchro = RTE_ATOMIC32_INIT(0);
  * rte_eal_init only init once
  */
 static int
-test_eal_init_once(__attribute__((unused)) void *arg)
+test_eal_init_once(__rte_unused void *arg)
 {
 	unsigned lcore_self =  rte_lcore_id();
 
@@ -99,7 +99,7 @@ ring_clean(unsigned int lcore_id)
 }
 
 static int
-ring_create_lookup(__attribute__((unused)) void *arg)
+ring_create_lookup(__rte_unused void *arg)
 {
 	unsigned lcore_self = rte_lcore_id();
 	struct rte_ring * rp;
@@ -133,7 +133,7 @@ ring_create_lookup(__attribute__((unused)) void *arg)
 }
 
 static void
-my_obj_init(struct rte_mempool *mp, __attribute__((unused)) void *arg,
+my_obj_init(struct rte_mempool *mp, __rte_unused void *arg,
 	    void *obj, unsigned i)
 {
 	uint32_t *objnum = obj;
@@ -159,7 +159,7 @@ mempool_clean(unsigned int lcore_id)
 }
 
 static int
-mempool_create_lookup(__attribute__((unused)) void *arg)
+mempool_create_lookup(__rte_unused void *arg)
 {
 	unsigned lcore_self = rte_lcore_id();
 	struct rte_mempool * mp;
@@ -217,7 +217,7 @@ hash_clean(unsigned lcore_id)
 }
 
 static int
-hash_create_free(__attribute__((unused)) void *arg)
+hash_create_free(__rte_unused void *arg)
 {
 	unsigned lcore_self = rte_lcore_id();
 	struct rte_hash *handle;
@@ -281,7 +281,7 @@ fbk_clean(unsigned lcore_id)
 }
 
 static int
-fbk_create_free(__attribute__((unused)) void *arg)
+fbk_create_free(__rte_unused void *arg)
 {
 	unsigned lcore_self = rte_lcore_id();
 	struct rte_fbk_hash_table *handle;
@@ -347,7 +347,7 @@ lpm_clean(unsigned int lcore_id)
 }
 
 static int
-lpm_create_free(__attribute__((unused)) void *arg)
+lpm_create_free(__rte_unused void *arg)
 {
 	unsigned lcore_self = rte_lcore_id();
 	struct rte_lpm *lpm;
diff --git a/app/test/test_hash.c b/app/test/test_hash.c
index ade473d5d4..03c46a7147 100644
--- a/app/test/test_hash.c
+++ b/app/test/test_hash.c
@@ -75,9 +75,9 @@ int hash_logtype_test;
  * Hash function that always returns the same value, to easily test what
  * happens when a bucket is full.
  */
-static uint32_t pseudo_hash(__attribute__((unused)) const void *keys,
-			    __attribute__((unused)) uint32_t key_len,
-			    __attribute__((unused)) uint32_t init_val)
+static uint32_t pseudo_hash(__rte_unused const void *keys,
+			    __rte_unused uint32_t key_len,
+			    __rte_unused uint32_t init_val)
 {
 	return 3;
 }
diff --git a/app/test/test_hash_readwrite.c b/app/test/test_hash_readwrite.c
index a9429091c2..73333dff13 100644
--- a/app/test/test_hash_readwrite.c
+++ b/app/test/test_hash_readwrite.c
@@ -55,7 +55,7 @@ static rte_atomic64_t greads;
 static rte_atomic64_t gwrites;
 
 static int
-test_hash_readwrite_worker(__attribute__((unused)) void *arg)
+test_hash_readwrite_worker(__rte_unused void *arg)
 {
 	uint64_t i, offset;
 	uint32_t lcore_id = rte_lcore_id();
diff --git a/app/test/test_hash_readwrite_lf_perf.c b/app/test/test_hash_readwrite_lf_perf.c
index 7bfc067f4e..889799865c 100644
--- a/app/test/test_hash_readwrite_lf_perf.c
+++ b/app/test/test_hash_readwrite_lf_perf.c
@@ -98,7 +98,7 @@ get_short_sig(const hash_sig_t hash)
 }
 
 static inline uint32_t
-get_prim_bucket_index(__attribute__((unused)) const struct rte_hash *h,
+get_prim_bucket_index(__rte_unused const struct rte_hash *h,
 		      const hash_sig_t hash)
 {
 	uint32_t num_buckets;
@@ -109,7 +109,7 @@ get_prim_bucket_index(__attribute__((unused)) const struct rte_hash *h,
 }
 
 static inline uint32_t
-get_alt_bucket_index(__attribute__((unused)) const struct rte_hash *h,
+get_alt_bucket_index(__rte_unused const struct rte_hash *h,
 			uint32_t cur_bkt_idx, uint16_t sig)
 {
 	uint32_t num_buckets;
@@ -555,7 +555,7 @@ generate_keys(void)
 }
 
 static int
-test_rwc_reader(__attribute__((unused)) void *arg)
+test_rwc_reader(__rte_unused void *arg)
 {
 	uint32_t i, j;
 	int ret;
@@ -678,7 +678,7 @@ write_keys(uint8_t write_type)
 }
 
 static int
-test_rwc_multi_writer(__attribute__((unused)) void *arg)
+test_rwc_multi_writer(__rte_unused void *arg)
 {
 	uint32_t i, offset;
 	uint32_t pos_core = (uint32_t)((uintptr_t)arg);
diff --git a/app/test/test_malloc.c b/app/test/test_malloc.c
index 67a48ba38a..232d3186d0 100644
--- a/app/test/test_malloc.c
+++ b/app/test/test_malloc.c
@@ -67,7 +67,7 @@ is_aligned(void *p, int align)
 }
 
 static int
-test_align_overlap_per_lcore(__attribute__((unused)) void *arg)
+test_align_overlap_per_lcore(__rte_unused void *arg)
 {
 	const unsigned align1 = 8,
 			align2 = 64,
@@ -138,7 +138,7 @@ test_align_overlap_per_lcore(__attribute__((unused)) void *arg)
 }
 
 static int
-test_reordered_free_per_lcore(__attribute__((unused)) void *arg)
+test_reordered_free_per_lcore(__rte_unused void *arg)
 {
 	const unsigned align1 = 8,
 			align2 = 64,
@@ -582,7 +582,7 @@ test_realloc(void)
 }
 
 static int
-test_random_alloc_free(void *_ __attribute__((unused)))
+test_random_alloc_free(void *_ __rte_unused)
 {
 	struct mem_list {
 		struct mem_list *next;
diff --git a/app/test/test_mcslock.c b/app/test/test_mcslock.c
index e9359df2ee..ddccaafa92 100644
--- a/app/test/test_mcslock.c
+++ b/app/test/test_mcslock.c
@@ -50,7 +50,7 @@ static unsigned int count;
 static rte_atomic32_t synchro;
 
 static int
-test_mcslock_per_core(__attribute__((unused)) void *arg)
+test_mcslock_per_core(__rte_unused void *arg)
 {
 	/* Per core me node. */
 	rte_mcslock_t ml_me = RTE_PER_LCORE(_ml_me);
@@ -148,7 +148,7 @@ test_mcslock_perf(void)
  * return immediately.
  */
 static int
-test_mcslock_try(__attribute__((unused)) void *arg)
+test_mcslock_try(__rte_unused void *arg)
 {
 	/**< Per core me node. */
 	rte_mcslock_t ml_me     = RTE_PER_LCORE(_ml_me);
diff --git a/app/test/test_mempool.c b/app/test/test_mempool.c
index c32a5d387d..084842fdaa 100644
--- a/app/test/test_mempool.c
+++ b/app/test/test_mempool.c
@@ -64,7 +64,7 @@ static rte_atomic32_t synchro;
  * other bytes are set to 0.
  */
 static void
-my_obj_init(struct rte_mempool *mp, __attribute__((unused)) void *arg,
+my_obj_init(struct rte_mempool *mp, __rte_unused void *arg,
 	    void *obj, unsigned i)
 {
 	uint32_t *objnum = obj;
@@ -291,13 +291,13 @@ static int test_mempool_single_consumer(void)
  * can run on one lcore only
  */
 static int
-test_mempool_launch_single_consumer(__attribute__((unused)) void *arg)
+test_mempool_launch_single_consumer(__rte_unused void *arg)
 {
 	return test_mempool_single_consumer();
 }
 
 static void
-my_mp_init(struct rte_mempool *mp, __attribute__((unused)) void *arg)
+my_mp_init(struct rte_mempool *mp, __rte_unused void *arg)
 {
 	printf("mempool name is %s\n", mp->name);
 	/* nothing to be implemented here*/
diff --git a/app/test/test_mempool_perf.c b/app/test/test_mempool_perf.c
index 4c877834e7..60bda8aadb 100644
--- a/app/test/test_mempool_perf.c
+++ b/app/test/test_mempool_perf.c
@@ -104,7 +104,7 @@ static struct mempool_test_stats stats[RTE_MAX_LCORE];
  * other bytes are set to 0.
  */
 static void
-my_obj_init(struct rte_mempool *mp, __attribute__((unused)) void *arg,
+my_obj_init(struct rte_mempool *mp, __rte_unused void *arg,
 	    void *obj, unsigned i)
 {
 	uint32_t *objnum = obj;
diff --git a/app/test/test_per_lcore.c b/app/test/test_per_lcore.c
index 19b55f2642..fcd00212f1 100644
--- a/app/test/test_per_lcore.c
+++ b/app/test/test_per_lcore.c
@@ -35,7 +35,7 @@
 static RTE_DEFINE_PER_LCORE(unsigned, test) = 0x12345678;
 
 static int
-assign_vars(__attribute__((unused)) void *arg)
+assign_vars(__rte_unused void *arg)
 {
 	if (RTE_PER_LCORE(test) != 0x12345678)
 		return -1;
@@ -44,7 +44,7 @@ assign_vars(__attribute__((unused)) void *arg)
 }
 
 static int
-display_vars(__attribute__((unused)) void *arg)
+display_vars(__rte_unused void *arg)
 {
 	unsigned lcore_id = rte_lcore_id();
 	unsigned var = RTE_PER_LCORE(test);
@@ -59,7 +59,7 @@ display_vars(__attribute__((unused)) void *arg)
 }
 
 static int
-test_per_lcore_delay(__attribute__((unused)) void *arg)
+test_per_lcore_delay(__rte_unused void *arg)
 {
 	rte_delay_ms(100);
 	printf("wait 100ms on lcore %u\n", rte_lcore_id());
diff --git a/app/test/test_rwlock.c b/app/test/test_rwlock.c
index 40f91759c2..61bee7d7c2 100644
--- a/app/test/test_rwlock.c
+++ b/app/test/test_rwlock.c
@@ -65,7 +65,7 @@ struct try_rwlock_lcore {
 static struct try_rwlock_lcore try_lcore_data[RTE_MAX_LCORE];
 
 static int
-test_rwlock_per_core(__attribute__((unused)) void *arg)
+test_rwlock_per_core(__rte_unused void *arg)
 {
 	rte_rwlock_write_lock(&sl);
 	printf("Global write lock taken on core %u\n", rte_lcore_id());
@@ -92,7 +92,7 @@ static uint64_t time_count[RTE_MAX_LCORE] = {0};
 #define TEST_RWLOCK_DEBUG 0
 
 static int
-load_loop_fn(__attribute__((unused)) void *arg)
+load_loop_fn(__rte_unused void *arg)
 {
 	uint64_t time_diff = 0, begin;
 	uint64_t hz = rte_get_timer_hz();
diff --git a/app/test/test_spinlock.c b/app/test/test_spinlock.c
index 6ac749597a..842990ed3b 100644
--- a/app/test/test_spinlock.c
+++ b/app/test/test_spinlock.c
@@ -52,7 +52,7 @@ static unsigned count = 0;
 static rte_atomic32_t synchro;
 
 static int
-test_spinlock_per_core(__attribute__((unused)) void *arg)
+test_spinlock_per_core(__rte_unused void *arg)
 {
 	rte_spinlock_lock(&sl);
 	printf("Global lock taken on core %u\n", rte_lcore_id());
@@ -66,7 +66,7 @@ test_spinlock_per_core(__attribute__((unused)) void *arg)
 }
 
 static int
-test_spinlock_recursive_per_core(__attribute__((unused)) void *arg)
+test_spinlock_recursive_per_core(__rte_unused void *arg)
 {
 	unsigned id = rte_lcore_id();
 
@@ -178,7 +178,7 @@ test_spinlock_perf(void)
  * checked as the result later.
  */
 static int
-test_spinlock_try(__attribute__((unused)) void *arg)
+test_spinlock_try(__rte_unused void *arg)
 {
 	if (rte_spinlock_trylock(&sl_try) == 0) {
 		rte_spinlock_lock(&sl);
diff --git a/app/test/test_table.c b/app/test/test_table.c
index a4b0ed65f9..bc8d8a2e10 100644
--- a/app/test/test_table.c
+++ b/app/test/test_table.c
@@ -43,9 +43,9 @@ static void app_init_rings(void);
 static void app_init_mbuf_pools(void);
 
 uint64_t pipeline_test_hash(void *key,
-		__attribute__((unused)) void *key_mask,
-		__attribute__((unused)) uint32_t key_size,
-		__attribute__((unused)) uint64_t seed)
+		__rte_unused void *key_mask,
+		__rte_unused uint32_t key_size,
+		__rte_unused uint64_t seed)
 {
 	uint32_t *k32 = key;
 	uint32_t ip_dst = rte_be_to_cpu_32(k32[0]);
@@ -55,8 +55,8 @@ uint64_t pipeline_test_hash(void *key,
 }
 
 uint32_t pipeline_test_hash_cuckoo(const void *key,
-		__attribute__((unused)) uint32_t key_size,
-		__attribute__((unused)) uint32_t seed)
+		__rte_unused uint32_t key_size,
+		__rte_unused uint32_t seed)
 {
 	const uint32_t *k32 = key;
 	uint32_t ip_dst = rte_be_to_cpu_32(k32[0]);
diff --git a/app/test/test_table.h b/app/test/test_table.h
index a66342cb65..43b8855874 100644
--- a/app/test/test_table.h
+++ b/app/test/test_table.h
@@ -103,14 +103,14 @@
 /* Function definitions */
 uint64_t pipeline_test_hash(
 	void *key,
-	__attribute__((unused)) void *key_mask,
-	__attribute__((unused)) uint32_t key_size,
-	__attribute__((unused)) uint64_t seed);
+	__rte_unused void *key_mask,
+	__rte_unused uint32_t key_size,
+	__rte_unused uint64_t seed);
 
 uint32_t pipeline_test_hash_cuckoo(
 	const void *key,
-	__attribute__((unused)) uint32_t key_size,
-	__attribute__((unused)) uint32_t seed);
+	__rte_unused uint32_t key_size,
+	__rte_unused uint32_t seed);
 
 /* Extern variables */
 extern struct rte_pipeline *p;
diff --git a/app/test/test_table_pipeline.c b/app/test/test_table_pipeline.c
index 441338ac01..97788ca042 100644
--- a/app/test/test_table_pipeline.c
+++ b/app/test/test_table_pipeline.c
@@ -74,11 +74,11 @@ table_action_stub_miss(struct rte_pipeline *p, struct rte_mbuf **pkts,
 	uint64_t pkts_mask, struct rte_pipeline_table_entry *entry, void *arg);
 
 rte_pipeline_table_action_handler_hit
-table_action_0x00(__attribute__((unused)) struct rte_pipeline *p,
-	__attribute__((unused)) struct rte_mbuf **pkts,
+table_action_0x00(__rte_unused struct rte_pipeline *p,
+	__rte_unused struct rte_mbuf **pkts,
 	uint64_t pkts_mask,
-	__attribute__((unused)) struct rte_pipeline_table_entry **entry,
-	__attribute__((unused)) void *arg)
+	__rte_unused struct rte_pipeline_table_entry **entry,
+	__rte_unused void *arg)
 {
 	printf("Table Action, setting pkts_mask to 0x00\n");
 	pkts_mask = ~0x00;
@@ -87,11 +87,11 @@ table_action_0x00(__attribute__((unused)) struct rte_pipeline *p,
 }
 
 rte_pipeline_table_action_handler_hit
-table_action_stub_hit(__attribute__((unused)) struct rte_pipeline *p,
-	__attribute__((unused)) struct rte_mbuf **pkts,
+table_action_stub_hit(__rte_unused struct rte_pipeline *p,
+	__rte_unused struct rte_mbuf **pkts,
 	uint64_t pkts_mask,
-	__attribute__((unused)) struct rte_pipeline_table_entry **entry,
-	__attribute__((unused)) void *arg)
+	__rte_unused struct rte_pipeline_table_entry **entry,
+	__rte_unused void *arg)
 {
 	printf("STUB Table Action Hit - doing nothing\n");
 	printf("STUB Table Action Hit - setting mask to 0x%"PRIx64"\n",
@@ -103,10 +103,10 @@ table_action_stub_hit(__attribute__((unused)) struct rte_pipeline *p,
 
 static int
 table_action_stub_miss(struct rte_pipeline *p,
-	__attribute__((unused)) struct rte_mbuf **pkts,
+	__rte_unused struct rte_mbuf **pkts,
 	uint64_t pkts_mask,
-	__attribute__((unused)) struct rte_pipeline_table_entry *entry,
-	__attribute__((unused)) void *arg)
+	__rte_unused struct rte_pipeline_table_entry *entry,
+	__rte_unused void *arg)
 {
 	printf("STUB Table Action Miss - setting mask to 0x%"PRIx64"\n",
 		override_miss_mask);
diff --git a/app/test/test_ticketlock.c b/app/test/test_ticketlock.c
index 13bdadbcb1..66ab3d1a02 100644
--- a/app/test/test_ticketlock.c
+++ b/app/test/test_ticketlock.c
@@ -52,7 +52,7 @@ static unsigned int count;
 static rte_atomic32_t synchro;
 
 static int
-test_ticketlock_per_core(__attribute__((unused)) void *arg)
+test_ticketlock_per_core(__rte_unused void *arg)
 {
 	rte_ticketlock_lock(&tl);
 	printf("Global lock taken on core %u\n", rte_lcore_id());
@@ -66,7 +66,7 @@ test_ticketlock_per_core(__attribute__((unused)) void *arg)
 }
 
 static int
-test_ticketlock_recursive_per_core(__attribute__((unused)) void *arg)
+test_ticketlock_recursive_per_core(__rte_unused void *arg)
 {
 	unsigned int id = rte_lcore_id();
 
@@ -186,7 +186,7 @@ test_ticketlock_perf(void)
  * checked as the result later.
  */
 static int
-test_ticketlock_try(__attribute__((unused)) void *arg)
+test_ticketlock_try(__rte_unused void *arg)
 {
 	if (rte_ticketlock_trylock(&tl_try) == 0) {
 		rte_ticketlock_lock(&tl);
diff --git a/app/test/test_timer.c b/app/test/test_timer.c
index 8e0a589828..5933f56ed5 100644
--- a/app/test/test_timer.c
+++ b/app/test/test_timer.c
@@ -137,8 +137,8 @@ mytimer_reset(struct mytimerinfo *timinfo, uint64_t ticks,
 
 /* timer callback for stress tests */
 static void
-timer_stress_cb(__attribute__((unused)) struct rte_timer *tim,
-		__attribute__((unused)) void *arg)
+timer_stress_cb(__rte_unused struct rte_timer *tim,
+		__rte_unused void *arg)
 {
 	long r;
 	unsigned lcore_id = rte_lcore_id();
@@ -163,7 +163,7 @@ timer_stress_cb(__attribute__((unused)) struct rte_timer *tim,
 }
 
 static int
-timer_stress_main_loop(__attribute__((unused)) void *arg)
+timer_stress_main_loop(__rte_unused void *arg)
 {
 	uint64_t hz = rte_get_timer_hz();
 	unsigned lcore_id = rte_lcore_id();
@@ -272,7 +272,7 @@ timer_stress2_cb(struct rte_timer *tim __rte_unused, void *arg __rte_unused)
 #define NB_STRESS2_TIMERS 8192
 
 static int
-timer_stress2_main_loop(__attribute__((unused)) void *arg)
+timer_stress2_main_loop(__rte_unused void *arg)
 {
 	static struct rte_timer *timers;
 	int i, ret;
@@ -457,7 +457,7 @@ timer_basic_cb(struct rte_timer *tim, void *arg)
 }
 
 static int
-timer_basic_main_loop(__attribute__((unused)) void *arg)
+timer_basic_main_loop(__rte_unused void *arg)
 {
 	uint64_t hz = rte_get_timer_hz();
 	unsigned lcore_id = rte_lcore_id();
diff --git a/app/test/test_timer_racecond.c b/app/test/test_timer_racecond.c
index a9e1daf16b..176f224b0a 100644
--- a/app/test/test_timer_racecond.c
+++ b/app/test/test_timer_racecond.c
@@ -108,7 +108,7 @@ reload_timer(struct rte_timer *tim)
 }
 
 static int
-slave_main_loop(__attribute__((unused)) void *arg)
+slave_main_loop(__rte_unused void *arg)
 {
 	unsigned lcore_id = rte_lcore_id();
 	unsigned i;
diff --git a/doc/guides/sample_app_ug/cmd_line.rst b/doc/guides/sample_app_ug/cmd_line.rst
index 828a607bec..6deb6c8112 100644
--- a/doc/guides/sample_app_ug/cmd_line.rst
+++ b/doc/guides/sample_app_ug/cmd_line.rst
@@ -128,7 +128,7 @@ For example, the cmd_obj_del_show command is defined as shown below:
         struct object *obj;
     };
 
-    static void cmd_obj_del_show_parsed(void *parsed_result, struct cmdline *cl, attribute ((unused)) void *data)
+    static void cmd_obj_del_show_parsed(void *parsed_result, struct cmdline *cl, __rte_unused void *data)
     {
        /* ... */
     }
diff --git a/doc/guides/sample_app_ug/hello_world.rst b/doc/guides/sample_app_ug/hello_world.rst
index c0e0a1549e..46f997a7dc 100644
--- a/doc/guides/sample_app_ug/hello_world.rst
+++ b/doc/guides/sample_app_ug/hello_world.rst
@@ -62,7 +62,7 @@ The following is the definition of the function:
 .. code-block:: c
 
     static int
-    lcore_hello( attribute ((unused)) void *arg)
+    lcore_hello(__rte_unused void *arg)
     {
         unsigned lcore_id;
 
diff --git a/doc/guides/sample_app_ug/l3_forward_power_man.rst b/doc/guides/sample_app_ug/l3_forward_power_man.rst
index 6ec24f4ad8..475a866cfb 100644
--- a/doc/guides/sample_app_ug/l3_forward_power_man.rst
+++ b/doc/guides/sample_app_ug/l3_forward_power_man.rst
@@ -206,7 +206,7 @@ to generate hints based on recent network load trends.
 .. code-block:: c
 
     static
-    attribute ((noreturn)) int main_loop( attribute ((unused)) void *dummy)
+    attribute ((noreturn)) int main_loop(__rte_unused void *dummy)
     {
         // ...
 
diff --git a/doc/guides/sample_app_ug/timer.rst b/doc/guides/sample_app_ug/timer.rst
index 87dfb4c1f4..98d762d238 100644
--- a/doc/guides/sample_app_ug/timer.rst
+++ b/doc/guides/sample_app_ug/timer.rst
@@ -137,7 +137,7 @@ In this case, the timer is stopped using the rte_timer_stop() function.
     /* timer0 callback */
 
     static void
-    timer0_cb( attribute ((unused)) struct rte_timer *tim, __attribute ((unused)) void *arg)
+    timer0_cb(__rte_unused struct rte_timer *tim, __rte_unused void *arg)
     {
         static unsigned counter = 0;
 
@@ -159,7 +159,7 @@ rte_timer_reset() function:
     /* timer1 callback */
 
     static void
-    timer1_cb( attribute ((unused)) struct rte_timer *tim, _attribute ((unused)) void *arg)
+    timer1_cb(__rte_unused struct rte_timer *tim, __rte_unused void *arg)
     {
         unsigned lcore_id = rte_lcore_id();
         uint64_t hz;
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index ab2b213f8d..44d3d49c7a 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -333,7 +333,7 @@ extern struct dpaa2_memseg_list rte_dpaa2_memsegs;
 
 #ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA
 extern uint8_t dpaa2_virt_mode;
-static void *dpaa2_mem_ptov(phys_addr_t paddr) __attribute__((unused));
+static void *dpaa2_mem_ptov(phys_addr_t paddr) __rte_unused;
 
 static void *dpaa2_mem_ptov(phys_addr_t paddr)
 {
@@ -352,7 +352,7 @@ static void *dpaa2_mem_ptov(phys_addr_t paddr)
 	return va;
 }
 
-static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr) __attribute__((unused));
+static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr) __rte_unused;
 
 static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr)
 {
diff --git a/drivers/common/dpaax/caamflib/compat.h b/drivers/common/dpaax/caamflib/compat.h
index ce946ccb5c..36ee4b5335 100644
--- a/drivers/common/dpaax/caamflib/compat.h
+++ b/drivers/common/dpaax/caamflib/compat.h
@@ -33,11 +33,11 @@
 #endif
 
 #ifndef __always_unused
-#define __always_unused __attribute__((unused))
+#define __always_unused __rte_unused
 #endif
 
 #ifndef __maybe_unused
-#define __maybe_unused __attribute__((unused))
+#define __maybe_unused __rte_unused
 #endif
 
 #if defined(__GLIBC__) && !defined(pr_debug)
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 6ed2701ab6..9727378fcf 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -3565,7 +3565,7 @@ dpaa2_sec_process_parallel_event(struct qbman_swp *swp,
 	qbman_swp_dqrr_consume(swp, dq);
 }
 static void
-dpaa2_sec_process_atomic_event(struct qbman_swp *swp __attribute__((unused)),
+dpaa2_sec_process_atomic_event(struct qbman_swp *swp __rte_unused,
 				 const struct qbman_fd *fd,
 				 const struct qbman_result *dq,
 				 struct dpaa2_queue *rxq,
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 707a0f3cdd..612a64599a 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -489,9 +489,9 @@ update_client_stats(uint32_t addr, uint16_t port, uint32_t *TXorRXindicator)
 #endif
 
 static void
-mode6_debug(const char __attribute__((unused)) *info,
+mode6_debug(const char __rte_unused *info,
 	struct rte_ether_hdr *eth_h, uint16_t port,
-	uint32_t __attribute__((unused)) *burstnumber)
+	uint32_t __rte_unused *burstnumber)
 {
 	struct rte_ipv4_hdr *ipv4_h;
 #ifdef RTE_LIBRTE_BOND_DEBUG_ALB
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h
index 95674b26b9..31dca8c7b6 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.h
+++ b/drivers/net/dpaa2/dpaa2_ethdev.h
@@ -198,7 +198,7 @@ uint16_t dpaa2_dev_tx_ordered(void *queue, struct rte_mbuf **bufs,
 uint16_t dummy_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts);
 void dpaa2_dev_free_eqresp_buf(uint16_t eqresp_ci);
 void dpaa2_flow_clean(struct rte_eth_dev *dev);
-uint16_t dpaa2_dev_tx_conf(void *queue)  __attribute__((unused));
+uint16_t dpaa2_dev_tx_conf(void *queue)  __rte_unused;
 
 #if defined(RTE_LIBRTE_IEEE1588)
 int dpaa2_timesync_enable(struct rte_eth_dev *dev);
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index 23d48035d5..4159096155 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -29,7 +29,7 @@ static inline uint32_t __attribute__((hot))
 dpaa2_dev_rx_parse_slow(struct rte_mbuf *mbuf,
 			struct dpaa2_annot_hdr *annotation);
 
-static void enable_tx_tstamp(struct qbman_fd *fd) __attribute__((unused));
+static void enable_tx_tstamp(struct qbman_fd *fd) __rte_unused;
 
 #define DPAA2_MBUF_TO_CONTIG_FD(_mbuf, _fd, _bpid)  do { \
 	DPAA2_SET_FD_ADDR(_fd, DPAA2_MBUF_VADDR_TO_IOVA(_mbuf)); \
@@ -432,7 +432,7 @@ eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
 
 static void
 eth_mbuf_to_fd(struct rte_mbuf *mbuf,
-	       struct qbman_fd *fd, uint16_t bpid) __attribute__((unused));
+	       struct qbman_fd *fd, uint16_t bpid) __rte_unused;
 
 static void __rte_noinline __attribute__((hot))
 eth_mbuf_to_fd(struct rte_mbuf *mbuf,
@@ -688,7 +688,7 @@ dpaa2_dev_process_parallel_event(struct qbman_swp *swp,
 }
 
 void __attribute__((hot))
-dpaa2_dev_process_atomic_event(struct qbman_swp *swp __attribute__((unused)),
+dpaa2_dev_process_atomic_event(struct qbman_swp *swp __rte_unused,
 			       const struct qbman_fd *fd,
 			       const struct qbman_result *dq,
 			       struct dpaa2_queue *rxq,
diff --git a/drivers/net/enic/base/vnic_dev.c b/drivers/net/enic/base/vnic_dev.c
index d6f3ba2b3a..ac03817f40 100644
--- a/drivers/net/enic/base/vnic_dev.c
+++ b/drivers/net/enic/base/vnic_dev.c
@@ -234,7 +234,7 @@ void vnic_dev_clear_desc_ring(struct vnic_dev_ring *ring)
 int vnic_dev_alloc_desc_ring(struct vnic_dev *vdev,
 	struct vnic_dev_ring *ring,
 	unsigned int desc_count, unsigned int desc_size,
-	__attribute__((unused)) unsigned int socket_id,
+	__rte_unused unsigned int socket_id,
 	char *z_name)
 {
 	void *alloc_addr;
@@ -273,7 +273,7 @@ int vnic_dev_alloc_desc_ring(struct vnic_dev *vdev,
 	return 0;
 }
 
-void vnic_dev_free_desc_ring(__attribute__((unused))  struct vnic_dev *vdev,
+void vnic_dev_free_desc_ring(__rte_unused  struct vnic_dev *vdev,
 	struct vnic_dev_ring *ring)
 {
 	if (ring->descs) {
diff --git a/drivers/net/hinic/hinic_pmd_rx.c b/drivers/net/hinic/hinic_pmd_rx.c
index f865f2f470..ade3d5baae 100644
--- a/drivers/net/hinic/hinic_pmd_rx.c
+++ b/drivers/net/hinic/hinic_pmd_rx.c
@@ -533,7 +533,7 @@ static void hinic_fillout_indir_tbl(struct hinic_nic_dev *nic_dev, u32 *indir)
 }
 
 static int hinic_rss_init(struct hinic_nic_dev *nic_dev,
-			  __attribute__((unused)) u8 *rq2iq_map,
+			  __rte_unused u8 *rq2iq_map,
 			  struct rte_eth_rss_conf *rss_conf)
 {
 	u32 indir_tbl[HINIC_RSS_INDIR_SIZE] = {0};
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 918fbe076b..da3d72b0e2 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -1403,7 +1403,7 @@ hns3_add_uc_addr_common(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
 
 static int
 hns3_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
-		  uint32_t idx, __attribute__ ((unused)) uint32_t pool)
+		  uint32_t idx, __rte_unused uint32_t pool)
 {
 	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index 505525eba6..e49ed45b50 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -136,8 +136,8 @@ hns3vf_enable_msix(const struct rte_pci_device *device, bool op)
 
 static int
 hns3vf_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
-		    __attribute__ ((unused)) uint32_t idx,
-		    __attribute__ ((unused)) uint32_t pool)
+		    __rte_unused uint32_t idx,
+		    __rte_unused uint32_t pool)
 {
 	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 9fbda1c34c..af70ed3ee1 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -4489,7 +4489,7 @@ i40e_dev_rss_reta_query(struct rte_eth_dev *dev,
  * @alignment: what to align the allocation to
  **/
 enum i40e_status_code
-i40e_allocate_dma_mem_d(__attribute__((unused)) struct i40e_hw *hw,
+i40e_allocate_dma_mem_d(__rte_unused struct i40e_hw *hw,
 			struct i40e_dma_mem *mem,
 			u64 size,
 			u32 alignment)
@@ -4523,7 +4523,7 @@ i40e_allocate_dma_mem_d(__attribute__((unused)) struct i40e_hw *hw,
  * @mem:  ptr to mem struct to free
  **/
 enum i40e_status_code
-i40e_free_dma_mem_d(__attribute__((unused)) struct i40e_hw *hw,
+i40e_free_dma_mem_d(__rte_unused struct i40e_hw *hw,
 		    struct i40e_dma_mem *mem)
 {
 	if (!mem)
@@ -4547,7 +4547,7 @@ i40e_free_dma_mem_d(__attribute__((unused)) struct i40e_hw *hw,
  * @size: size of memory requested
  **/
 enum i40e_status_code
-i40e_allocate_virt_mem_d(__attribute__((unused)) struct i40e_hw *hw,
+i40e_allocate_virt_mem_d(__rte_unused struct i40e_hw *hw,
 			 struct i40e_virt_mem *mem,
 			 u32 size)
 {
@@ -4569,7 +4569,7 @@ i40e_allocate_virt_mem_d(__attribute__((unused)) struct i40e_hw *hw,
  * @mem:  pointer to mem struct to free
  **/
 enum i40e_status_code
-i40e_free_virt_mem_d(__attribute__((unused)) struct i40e_hw *hw,
+i40e_free_virt_mem_d(__rte_unused struct i40e_hw *hw,
 		     struct i40e_virt_mem *mem)
 {
 	if (!mem)
@@ -4600,7 +4600,7 @@ i40e_release_spinlock_d(struct i40e_spinlock *sp)
 }
 
 void
-i40e_destroy_spinlock_d(__attribute__((unused)) struct i40e_spinlock *sp)
+i40e_destroy_spinlock_d(__rte_unused struct i40e_spinlock *sp)
 {
 	return;
 }
diff --git a/drivers/net/ice/base/ice_osdep.h b/drivers/net/ice/base/ice_osdep.h
index aac8969eb8..0955f565af 100644
--- a/drivers/net/ice/base/ice_osdep.h
+++ b/drivers/net/ice/base/ice_osdep.h
@@ -120,10 +120,10 @@ writeq(uint64_t value, volatile void *addr)
 #endif /* __INTEL_NET_BASE_OSDEP__ */
 
 #ifndef __always_unused
-#define __always_unused  __attribute__((unused))
+#define __always_unused  __rte_unused
 #endif
 #ifndef __maybe_unused
-#define __maybe_unused  __attribute__((unused))
+#define __maybe_unused  __rte_unused
 #endif
 #ifndef __packed
 #define __packed  __rte_packed
@@ -219,14 +219,14 @@ ice_release_lock(struct ice_lock *sp)
 }
 
 static inline void
-ice_destroy_lock(__attribute__((unused)) struct ice_lock *sp)
+ice_destroy_lock(__rte_unused struct ice_lock *sp)
 {
 }
 
 struct ice_hw;
 
 static inline void *
-ice_alloc_dma_mem(__attribute__((unused)) struct ice_hw *hw,
+ice_alloc_dma_mem(__rte_unused struct ice_hw *hw,
 		  struct ice_dma_mem *mem, u64 size)
 {
 	const struct rte_memzone *mz = NULL;
@@ -252,7 +252,7 @@ ice_alloc_dma_mem(__attribute__((unused)) struct ice_hw *hw,
 }
 
 static inline void
-ice_free_dma_mem(__attribute__((unused)) struct ice_hw *hw,
+ice_free_dma_mem(__rte_unused struct ice_hw *hw,
 		 struct ice_dma_mem *mem)
 {
 	PMD_DRV_LOG(DEBUG, "memzone %s to be freed with physical address: "
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 7ea1962f60..94ac24c44c 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -6203,8 +6203,8 @@ ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev,
 
 static int
 ixgbevf_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
-		     __attribute__((unused)) uint32_t index,
-		     __attribute__((unused)) uint32_t pool)
+		     __rte_unused uint32_t index,
+		     __rte_unused uint32_t pool)
 {
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	int diag;
@@ -7006,7 +7006,7 @@ ixgbe_dev_filter_ctrl(struct rte_eth_dev *dev,
 }
 
 static u8 *
-ixgbe_dev_addr_list_itr(__attribute__((unused)) struct ixgbe_hw *hw,
+ixgbe_dev_addr_list_itr(__rte_unused struct ixgbe_hw *hw,
 			u8 **mc_addr_ptr, u32 *vmdq)
 {
 	u8 *mc_addr;
diff --git a/drivers/net/pfe/base/pfe.h b/drivers/net/pfe/base/pfe.h
index ff108067d0..72741ba4a8 100644
--- a/drivers/net/pfe/base/pfe.h
+++ b/drivers/net/pfe/base/pfe.h
@@ -406,7 +406,7 @@ static inline void *pfe_mem_ptov(phys_addr_t paddr)
 	return rte_mem_iova2virt(paddr);
 }
 
-static phys_addr_t pfe_mem_vtop(uint64_t vaddr) __attribute__((unused));
+static phys_addr_t pfe_mem_vtop(uint64_t vaddr) __rte_unused;
 
 static inline phys_addr_t pfe_mem_vtop(uint64_t vaddr)
 {
diff --git a/drivers/net/qede/base/bcm_osal.h b/drivers/net/qede/base/bcm_osal.h
index 513f6a8b42..8b2faec5b6 100644
--- a/drivers/net/qede/base/bcm_osal.h
+++ b/drivers/net/qede/base/bcm_osal.h
@@ -426,7 +426,7 @@ u32 qede_osal_log2(u32);
 #define OSAL_PAGE_SIZE 4096
 #define OSAL_CACHE_LINE_SIZE RTE_CACHE_LINE_SIZE
 #define OSAL_IOMEM volatile
-#define OSAL_UNUSED    __attribute__((unused))
+#define OSAL_UNUSED    __rte_unused
 #define OSAL_UNLIKELY(x)  __builtin_expect(!!(x), 0)
 #define OSAL_MIN_T(type, __min1, __min2)	\
 	((type)(__min1) < (type)(__min2) ? (type)(__min1) : (type)(__min2))
diff --git a/drivers/net/qede/qede_filter.c b/drivers/net/qede/qede_filter.c
index b7ad59ad6d..bad55740a7 100644
--- a/drivers/net/qede/qede_filter.c
+++ b/drivers/net/qede/qede_filter.c
@@ -1030,7 +1030,7 @@ qede_set_ucast_tunn_cmn_param(struct ecore_filter_ucast *ucast,
 static int
 _qede_tunn_filter_config(struct rte_eth_dev *eth_dev,
 			 const struct rte_eth_tunnel_filter_conf *conf,
-			 __attribute__((unused)) enum rte_filter_op filter_op,
+			 __rte_unused enum rte_filter_op filter_op,
 			 enum ecore_tunn_clss *clss,
 			 bool add)
 {
@@ -1168,7 +1168,7 @@ qede_tunn_filter_config(struct rte_eth_dev *eth_dev,
 }
 
 static int
-qede_flow_validate_attr(__attribute__((unused))struct rte_eth_dev *dev,
+qede_flow_validate_attr(__rte_unused struct rte_eth_dev *dev,
 			const struct rte_flow_attr *attr,
 			struct rte_flow_error *error)
 {
@@ -1218,7 +1218,7 @@ qede_flow_validate_attr(__attribute__((unused))struct rte_eth_dev *dev,
 }
 
 static int
-qede_flow_parse_pattern(__attribute__((unused))struct rte_eth_dev *dev,
+qede_flow_parse_pattern(__rte_unused struct rte_eth_dev *dev,
 			const struct rte_flow_item pattern[],
 			struct rte_flow_error *error,
 			struct rte_flow *flow)
diff --git a/drivers/net/thunderx/base/nicvf_mbox.c b/drivers/net/thunderx/base/nicvf_mbox.c
index 8f83d41ddc..ddac635af9 100644
--- a/drivers/net/thunderx/base/nicvf_mbox.c
+++ b/drivers/net/thunderx/base/nicvf_mbox.c
@@ -36,7 +36,7 @@ static const char *mbox_message[NIC_MBOX_MSG_MAX] =  {
 	[NIC_MBOX_MSG_SHUTDOWN]           = "NIC_MBOX_MSG_SHUTDOWN",
 };
 
-static inline const char * __attribute__((unused))
+static inline const char * __rte_unused
 nicvf_mbox_msg_str(int msg)
 {
 	assert(msg >= 0 && msg < NIC_MBOX_MSG_MAX);
diff --git a/drivers/raw/ifpga/base/ifpga_compat.h b/drivers/raw/ifpga/base/ifpga_compat.h
index 931c893854..cdeca70ca5 100644
--- a/drivers/raw/ifpga/base/ifpga_compat.h
+++ b/drivers/raw/ifpga/base/ifpga_compat.h
@@ -51,7 +51,7 @@
 	ret;								     \
 })
 
-#define __maybe_unused __attribute__((__unused__))
+#define __maybe_unused __rte_unused
 
 #define UNUSED(x)	(void)(x)
 
diff --git a/examples/bond/main.c b/examples/bond/main.c
index ee8fa2d271..8608285b68 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -359,7 +359,7 @@ struct global_flag_stru_t *global_flag_stru_p = &global_flag_stru;
  * Main thread that does the work, reading from INPUT_PORT
  * and writing to OUTPUT_PORT
  */
-static int lcore_main(__attribute__((unused)) void *arg1)
+static int lcore_main(__rte_unused void *arg1)
 {
 	struct rte_mbuf *pkts[MAX_PKT_BURST] __rte_cache_aligned;
 	struct rte_ether_addr d_addr;
@@ -481,8 +481,8 @@ static inline void get_string(struct cmd_obj_send_result *res, char *buf, uint8_
 		);
 }
 static void cmd_obj_send_parsed(void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-			       __attribute__((unused)) void *data)
+		__rte_unused struct cmdline *cl,
+			       __rte_unused void *data)
 {
 
 	struct cmd_obj_send_result *res = parsed_result;
@@ -569,9 +569,9 @@ struct cmd_start_result {
 	cmdline_fixed_string_t start;
 };
 
-static void cmd_start_parsed(__attribute__((unused)) void *parsed_result,
+static void cmd_start_parsed(__rte_unused void *parsed_result,
 			       struct cmdline *cl,
-			       __attribute__((unused)) void *data)
+			       __rte_unused void *data)
 {
 	int slave_core_id = rte_lcore_id();
 
@@ -627,9 +627,9 @@ struct cmd_help_result {
 	cmdline_fixed_string_t help;
 };
 
-static void cmd_help_parsed(__attribute__((unused)) void *parsed_result,
+static void cmd_help_parsed(__rte_unused void *parsed_result,
 			    struct cmdline *cl,
-			    __attribute__((unused)) void *data)
+			    __rte_unused void *data)
 {
 	cmdline_printf(cl,
 			"ALB - link bonding mode 6 example\n"
@@ -659,9 +659,9 @@ struct cmd_stop_result {
 	cmdline_fixed_string_t stop;
 };
 
-static void cmd_stop_parsed(__attribute__((unused)) void *parsed_result,
+static void cmd_stop_parsed(__rte_unused void *parsed_result,
 			    struct cmdline *cl,
-			    __attribute__((unused)) void *data)
+			    __rte_unused void *data)
 {
 	rte_spinlock_trylock(&global_flag_stru_p->lock);
 	if (global_flag_stru_p->LcoreMainIsRunning == 0)	{
@@ -700,9 +700,9 @@ struct cmd_quit_result {
 	cmdline_fixed_string_t quit;
 };
 
-static void cmd_quit_parsed(__attribute__((unused)) void *parsed_result,
+static void cmd_quit_parsed(__rte_unused void *parsed_result,
 			    struct cmdline *cl,
-			    __attribute__((unused)) void *data)
+			    __rte_unused void *data)
 {
 	rte_spinlock_trylock(&global_flag_stru_p->lock);
 	if (global_flag_stru_p->LcoreMainIsRunning == 0)	{
@@ -743,9 +743,9 @@ struct cmd_show_result {
 	cmdline_fixed_string_t show;
 };
 
-static void cmd_show_parsed(__attribute__((unused)) void *parsed_result,
+static void cmd_show_parsed(__rte_unused void *parsed_result,
 			    struct cmdline *cl,
-			    __attribute__((unused)) void *data)
+			    __rte_unused void *data)
 {
 	uint16_t slaves[16] = {0};
 	uint8_t len = 16;
@@ -803,7 +803,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 };
 
 /* prompt function, called from main on MASTER lcore */
-static void prompt(__attribute__((unused)) void *arg1)
+static void prompt(__rte_unused void *arg1)
 {
 	struct cmdline *cl;
 
diff --git a/examples/cmdline/commands.c b/examples/cmdline/commands.c
index 4badffc257..0e2232f034 100644
--- a/examples/cmdline/commands.c
+++ b/examples/cmdline/commands.c
@@ -70,7 +70,7 @@ struct cmd_obj_del_show_result {
 
 static void cmd_obj_del_show_parsed(void *parsed_result,
 				    struct cmdline *cl,
-				    __attribute__((unused)) void *data)
+				    __rte_unused void *data)
 {
 	struct cmd_obj_del_show_result *res = parsed_result;
 	char ip_str[INET6_ADDRSTRLEN];
@@ -122,7 +122,7 @@ struct cmd_obj_add_result {
 
 static void cmd_obj_add_parsed(void *parsed_result,
 			       struct cmdline *cl,
-			       __attribute__((unused)) void *data)
+			       __rte_unused void *data)
 {
 	struct cmd_obj_add_result *res = parsed_result;
 	struct object *o;
@@ -181,9 +181,9 @@ struct cmd_help_result {
 	cmdline_fixed_string_t help;
 };
 
-static void cmd_help_parsed(__attribute__((unused)) void *parsed_result,
+static void cmd_help_parsed(__rte_unused void *parsed_result,
 			    struct cmdline *cl,
-			    __attribute__((unused)) void *data)
+			    __rte_unused void *data)
 {
 	cmdline_printf(cl,
 		       "Demo example of command line interface in RTE\n\n"
diff --git a/examples/cmdline/parse_obj_list.c b/examples/cmdline/parse_obj_list.c
index 5d29f9d59b..b04adbea58 100644
--- a/examples/cmdline/parse_obj_list.c
+++ b/examples/cmdline/parse_obj_list.c
@@ -104,7 +104,7 @@ int complete_get_elt_obj_list(cmdline_parse_token_hdr_t *tk,
 }
 
 
-int get_help_obj_list(__attribute__((unused)) cmdline_parse_token_hdr_t *tk,
+int get_help_obj_list(__rte_unused cmdline_parse_token_hdr_t *tk,
 		      char *dstbuf, unsigned int size)
 {
 	snprintf(dstbuf, size, "Obj-List");
diff --git a/examples/ethtool/ethtool-app/main.c b/examples/ethtool/ethtool-app/main.c
index 29891012ac..7383413215 100644
--- a/examples/ethtool/ethtool-app/main.c
+++ b/examples/ethtool/ethtool-app/main.c
@@ -176,7 +176,7 @@ static void process_frame(struct app_port *ptr_port,
 	rte_ether_addr_copy(&ptr_port->mac_addr, &ptr_mac_hdr->s_addr);
 }
 
-static int slave_main(__attribute__((unused)) void *ptr_data)
+static int slave_main(__rte_unused void *ptr_data)
 {
 	struct app_port *ptr_port;
 	struct rte_mbuf *ptr_frame;
diff --git a/examples/fips_validation/fips_validation_aes.c b/examples/fips_validation/fips_validation_aes.c
index 010a82627a..b3c5e31f32 100644
--- a/examples/fips_validation/fips_validation_aes.c
+++ b/examples/fips_validation/fips_validation_aes.c
@@ -49,8 +49,8 @@ struct aes_test_algo {
 
 static int
 parse_interim_enc_dec(const char *key,
-		__attribute__((__unused__)) char *text,
-		__attribute__((__unused__)) struct fips_val *val)
+		__rte_unused char *text,
+		__rte_unused struct fips_val *val)
 {
 	if (strcmp(key, OP_ENC_STR) == 0)
 		info.op = FIPS_TEST_ENC_AUTH_GEN;
diff --git a/examples/fips_validation/fips_validation_hmac.c b/examples/fips_validation/fips_validation_hmac.c
index 97ac7186e5..1285c9d283 100644
--- a/examples/fips_validation/fips_validation_hmac.c
+++ b/examples/fips_validation/fips_validation_hmac.c
@@ -31,9 +31,9 @@ struct hash_size_conversion {
 };
 
 static int
-parse_interim_algo(__attribute__((__unused__)) const char *key,
+parse_interim_algo(__rte_unused const char *key,
 		char *text,
-		__attribute__((__unused__)) struct fips_val *val)
+		__rte_unused struct fips_val *val)
 {
 
 	uint32_t i;
diff --git a/examples/fips_validation/fips_validation_sha.c b/examples/fips_validation/fips_validation_sha.c
index 2cca9cecc5..34c364c75a 100644
--- a/examples/fips_validation/fips_validation_sha.c
+++ b/examples/fips_validation/fips_validation_sha.c
@@ -29,9 +29,9 @@ struct plain_hash_size_conversion {
 };
 
 static int
-parse_interim_algo(__attribute__((__unused__)) const char *key,
+parse_interim_algo(__rte_unused const char *key,
 		char *text,
-		__attribute__((__unused__)) struct fips_val *val)
+		__rte_unused struct fips_val *val)
 {
 	uint32_t i;
 
diff --git a/examples/fips_validation/fips_validation_tdes.c b/examples/fips_validation/fips_validation_tdes.c
index 5b6737643a..84dd288e60 100644
--- a/examples/fips_validation/fips_validation_tdes.c
+++ b/examples/fips_validation/fips_validation_tdes.c
@@ -60,7 +60,7 @@ parse_tdes_uint8_hex_str(const char *key, char *src, struct fips_val *val);
 
 static int
 parse_tdes_interim(const char *key,
-		__attribute__((__unused__)) char *text,
+		__rte_unused char *text,
 		struct fips_val *val);
 
 struct fips_test_callback tdes_tests_vectors[] = {
@@ -95,8 +95,8 @@ struct fips_test_callback tdes_writeback_callbacks[] = {
 
 static int
 parse_tdes_interim(const char *key,
-		__attribute__((__unused__)) char *text,
-		__attribute__((__unused__)) struct fips_val *val)
+		__rte_unused char *text,
+		__rte_unused struct fips_val *val)
 {
 	if (strstr(key, ENC_STR))
 		info.op = FIPS_TEST_ENC_AUTH_GEN;
diff --git a/examples/helloworld/main.c b/examples/helloworld/main.c
index c922cfbad7..968045f1b0 100644
--- a/examples/helloworld/main.c
+++ b/examples/helloworld/main.c
@@ -16,7 +16,7 @@
 #include <rte_debug.h>
 
 static int
-lcore_hello(__attribute__((unused)) void *arg)
+lcore_hello(__rte_unused void *arg)
 {
 	unsigned lcore_id;
 	lcore_id = rte_lcore_id();
diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index 104612339c..2a42122995 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -382,7 +382,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,
 
 /* main processing loop */
 static int
-main_loop(__attribute__((unused)) void *dummy)
+main_loop(__rte_unused void *dummy)
 {
 	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
 	unsigned lcore_id;
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index d59e6d02ff..e34d8f0e12 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -420,7 +420,7 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
 
 /* main processing loop */
 static int
-main_loop(__attribute__((unused)) void *dummy)
+main_loop(__rte_unused void *dummy)
 {
 	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
 	unsigned lcore_id;
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 4799bc90c5..28aa694beb 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -1099,7 +1099,7 @@ drain_outbound_crypto_queues(const struct lcore_conf *qconf,
 
 /* main processing loop */
 static int32_t
-main_loop(__attribute__((unused)) void *dummy)
+main_loop(__rte_unused void *dummy)
 {
 	struct rte_mbuf *pkts[MAX_PKT_BURST];
 	uint32_t lcore_id;
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index f975aa12d0..c1ca100ed0 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -535,7 +535,7 @@ l2fwd_main_loop(void)
 }
 
 static int
-l2fwd_launch_one_lcore(__attribute__((unused)) void *dummy)
+l2fwd_launch_one_lcore(__rte_unused void *dummy)
 {
 	l2fwd_main_loop();
 	return 0;
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index b36834974e..2ae5a3c6a9 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -117,8 +117,8 @@ static void handle_sigterm(__rte_unused int value)
 
 /* Print out statistics on packets dropped */
 static void
-print_stats(__attribute__((unused)) struct rte_timer *ptr_timer,
-	__attribute__((unused)) void *ptr_data)
+print_stats(__rte_unused struct rte_timer *ptr_timer,
+	__rte_unused void *ptr_data)
 {
 	uint64_t total_packets_dropped, total_packets_tx, total_packets_rx;
 	uint16_t portid;
@@ -278,7 +278,7 @@ l2fwd_main_loop(void)
 }
 
 static int
-l2fwd_launch_one_lcore(__attribute__((unused)) void *dummy)
+l2fwd_launch_one_lcore(__rte_unused void *dummy)
 {
 	l2fwd_main_loop();
 	return 0;
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 09257aab1c..88ddfe5897 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -281,7 +281,7 @@ l2fwd_main_loop(void)
 }
 
 static int
-l2fwd_launch_one_lcore(__attribute__((unused)) void *dummy)
+l2fwd_launch_one_lcore(__rte_unused void *dummy)
 {
 	l2fwd_main_loop();
 	return 0;
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index fa92a28297..cccf81929c 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -1326,7 +1326,7 @@ is_valid_ipv4_pkt(struct rte_ipv4_hdr *pkt, uint32_t link_len)
 
 /* main processing loop */
 static int
-main_loop(__attribute__((unused)) void *dummy)
+main_loop(__rte_unused void *dummy)
 {
 	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
 	unsigned lcore_id;
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index bb132441d9..fddc3850dc 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -461,8 +461,8 @@ signal_exit_now(int sigtype)
 
 /*  Freqency scale down timer callback */
 static void
-power_timer_cb(__attribute__((unused)) struct rte_timer *tim,
-			  __attribute__((unused)) void *arg)
+power_timer_cb(__rte_unused struct rte_timer *tim,
+			  __rte_unused void *arg)
 {
 	uint64_t hz;
 	float sleep_time_ratio;
@@ -927,7 +927,7 @@ static int event_register(struct lcore_conf *qconf)
 }
 /* main processing loop */
 static int
-main_telemetry_loop(__attribute__((unused)) void *dummy)
+main_telemetry_loop(__rte_unused void *dummy)
 {
 	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
 	unsigned int lcore_id;
@@ -1047,7 +1047,7 @@ main_telemetry_loop(__attribute__((unused)) void *dummy)
 }
 /* main processing loop */
 static int
-main_empty_poll_loop(__attribute__((unused)) void *dummy)
+main_empty_poll_loop(__rte_unused void *dummy)
 {
 	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
 	unsigned int lcore_id;
@@ -1151,7 +1151,7 @@ main_empty_poll_loop(__attribute__((unused)) void *dummy)
 }
 /* main processing loop */
 static int
-main_loop(__attribute__((unused)) void *dummy)
+main_loop(__rte_unused void *dummy)
 {
 	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
 	unsigned lcore_id;
@@ -2078,8 +2078,8 @@ init_power_library(void)
 	return ret;
 }
 static void
-update_telemetry(__attribute__((unused)) struct rte_timer *tim,
-		__attribute__((unused)) void *arg)
+update_telemetry(__rte_unused struct rte_timer *tim,
+		__rte_unused void *arg)
 {
 	unsigned int lcore_id = rte_lcore_id();
 	struct lcore_conf *qconf;
diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h
index c786f90628..67055431f7 100644
--- a/examples/l3fwd/l3fwd.h
+++ b/examples/l3fwd/l3fwd.h
@@ -202,28 +202,28 @@ lpm_cb_parse_ptype(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[],
 		   uint16_t nb_pkts, uint16_t max_pkts, void *user_param);
 
 int
-em_main_loop(__attribute__((unused)) void *dummy);
+em_main_loop(__rte_unused void *dummy);
 
 int
-lpm_main_loop(__attribute__((unused)) void *dummy);
+lpm_main_loop(__rte_unused void *dummy);
 
 int
-lpm_event_main_loop_tx_d(__attribute__((unused)) void *dummy);
+lpm_event_main_loop_tx_d(__rte_unused void *dummy);
 int
-lpm_event_main_loop_tx_d_burst(__attribute__((unused)) void *dummy);
+lpm_event_main_loop_tx_d_burst(__rte_unused void *dummy);
 int
-lpm_event_main_loop_tx_q(__attribute__((unused)) void *dummy);
+lpm_event_main_loop_tx_q(__rte_unused void *dummy);
 int
-lpm_event_main_loop_tx_q_burst(__attribute__((unused)) void *dummy);
+lpm_event_main_loop_tx_q_burst(__rte_unused void *dummy);
 
 int
-em_event_main_loop_tx_d(__attribute__((unused)) void *dummy);
+em_event_main_loop_tx_d(__rte_unused void *dummy);
 int
-em_event_main_loop_tx_d_burst(__attribute__((unused)) void *dummy);
+em_event_main_loop_tx_d_burst(__rte_unused void *dummy);
 int
-em_event_main_loop_tx_q(__attribute__((unused)) void *dummy);
+em_event_main_loop_tx_q(__rte_unused void *dummy);
 int
-em_event_main_loop_tx_q_burst(__attribute__((unused)) void *dummy);
+em_event_main_loop_tx_q_burst(__rte_unused void *dummy);
 
 
 /* Return ipv4/ipv6 fwd lookup struct for LPM or EM. */
diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c
index 7dab299526..fdbee70b44 100644
--- a/examples/l3fwd/l3fwd_em.c
+++ b/examples/l3fwd/l3fwd_em.c
@@ -618,7 +618,7 @@ em_cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused,
 
 /* main processing loop */
 int
-em_main_loop(__attribute__((unused)) void *dummy)
+em_main_loop(__rte_unused void *dummy)
 {
 	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
 	unsigned lcore_id;
@@ -835,7 +835,7 @@ em_event_loop(struct l3fwd_event_resources *evt_rsrc,
 }
 
 int __rte_noinline
-em_event_main_loop_tx_d(__attribute__((unused)) void *dummy)
+em_event_main_loop_tx_d(__rte_unused void *dummy)
 {
 	struct l3fwd_event_resources *evt_rsrc =
 					l3fwd_get_eventdev_rsrc();
@@ -845,7 +845,7 @@ em_event_main_loop_tx_d(__attribute__((unused)) void *dummy)
 }
 
 int __rte_noinline
-em_event_main_loop_tx_d_burst(__attribute__((unused)) void *dummy)
+em_event_main_loop_tx_d_burst(__rte_unused void *dummy)
 {
 	struct l3fwd_event_resources *evt_rsrc =
 					l3fwd_get_eventdev_rsrc();
@@ -855,7 +855,7 @@ em_event_main_loop_tx_d_burst(__attribute__((unused)) void *dummy)
 }
 
 int __rte_noinline
-em_event_main_loop_tx_q(__attribute__((unused)) void *dummy)
+em_event_main_loop_tx_q(__rte_unused void *dummy)
 {
 	struct l3fwd_event_resources *evt_rsrc =
 					l3fwd_get_eventdev_rsrc();
@@ -865,7 +865,7 @@ em_event_main_loop_tx_q(__attribute__((unused)) void *dummy)
 }
 
 int __rte_noinline
-em_event_main_loop_tx_q_burst(__attribute__((unused)) void *dummy)
+em_event_main_loop_tx_q_burst(__rte_unused void *dummy)
 {
 	struct l3fwd_event_resources *evt_rsrc =
 					l3fwd_get_eventdev_rsrc();
diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c
index 6ad8b30b64..2fe1ecabbc 100644
--- a/examples/l3fwd/l3fwd_lpm.c
+++ b/examples/l3fwd/l3fwd_lpm.c
@@ -169,7 +169,7 @@ lpm_get_dst_port_with_ipv4(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
 
 /* main processing loop */
 int
-lpm_main_loop(__attribute__((unused)) void *dummy)
+lpm_main_loop(__rte_unused void *dummy)
 {
 	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
 	unsigned lcore_id;
@@ -413,7 +413,7 @@ lpm_event_loop(struct l3fwd_event_resources *evt_rsrc,
 }
 
 int __rte_noinline
-lpm_event_main_loop_tx_d(__attribute__((unused)) void *dummy)
+lpm_event_main_loop_tx_d(__rte_unused void *dummy)
 {
 	struct l3fwd_event_resources *evt_rsrc =
 					l3fwd_get_eventdev_rsrc();
@@ -423,7 +423,7 @@ lpm_event_main_loop_tx_d(__attribute__((unused)) void *dummy)
 }
 
 int __rte_noinline
-lpm_event_main_loop_tx_d_burst(__attribute__((unused)) void *dummy)
+lpm_event_main_loop_tx_d_burst(__rte_unused void *dummy)
 {
 	struct l3fwd_event_resources *evt_rsrc =
 					l3fwd_get_eventdev_rsrc();
@@ -433,7 +433,7 @@ lpm_event_main_loop_tx_d_burst(__attribute__((unused)) void *dummy)
 }
 
 int __rte_noinline
-lpm_event_main_loop_tx_q(__attribute__((unused)) void *dummy)
+lpm_event_main_loop_tx_q(__rte_unused void *dummy)
 {
 	struct l3fwd_event_resources *evt_rsrc =
 					l3fwd_get_eventdev_rsrc();
@@ -443,7 +443,7 @@ lpm_event_main_loop_tx_q(__attribute__((unused)) void *dummy)
 }
 
 int __rte_noinline
-lpm_event_main_loop_tx_q_burst(__attribute__((unused)) void *dummy)
+lpm_event_main_loop_tx_q_burst(__rte_unused void *dummy)
 {
 	struct l3fwd_event_resources *evt_rsrc =
 					l3fwd_get_eventdev_rsrc();
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index a924aa2313..38422f6ac5 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -286,7 +286,7 @@ lsi_main_loop(void)
 }
 
 static int
-lsi_launch_one_lcore(__attribute__((unused)) void *dummy)
+lsi_launch_one_lcore(__rte_unused void *dummy)
 {
 	lsi_main_loop();
 	return 0;
diff --git a/examples/multi_process/client_server_mp/mp_server/main.c b/examples/multi_process/client_server_mp/mp_server/main.c
index 802e29d10d..280dab8672 100644
--- a/examples/multi_process/client_server_mp/mp_server/main.c
+++ b/examples/multi_process/client_server_mp/mp_server/main.c
@@ -152,7 +152,7 @@ do_stats_display(void)
  * repeatedly sleeps.
  */
 static int
-sleep_lcore(__attribute__((unused)) void *dummy)
+sleep_lcore(__rte_unused void *dummy)
 {
 	/* Used to pick a display thread - static, so zero-initialised */
 	static rte_atomic32_t display_stats;
diff --git a/examples/multi_process/hotplug_mp/commands.c b/examples/multi_process/hotplug_mp/commands.c
index b068593939..a8a39d07f7 100644
--- a/examples/multi_process/hotplug_mp/commands.c
+++ b/examples/multi_process/hotplug_mp/commands.c
@@ -16,9 +16,9 @@ struct cmd_help_result {
 	cmdline_fixed_string_t help;
 };
 
-static void cmd_help_parsed(__attribute__((unused)) void *parsed_result,
+static void cmd_help_parsed(__rte_unused void *parsed_result,
 			    struct cmdline *cl,
-			    __attribute__((unused)) void *data)
+			    __rte_unused void *data)
 {
 	cmdline_printf(cl,
 		       "commands:\n"
@@ -46,9 +46,9 @@ struct cmd_quit_result {
 	cmdline_fixed_string_t quit;
 };
 
-static void cmd_quit_parsed(__attribute__((unused)) void *parsed_result,
+static void cmd_quit_parsed(__rte_unused void *parsed_result,
 			    struct cmdline *cl,
-			    __attribute__((unused)) void *data)
+			    __rte_unused void *data)
 {
 	cmdline_quit(cl);
 }
@@ -72,9 +72,9 @@ struct cmd_list_result {
 	cmdline_fixed_string_t list;
 };
 
-static void cmd_list_parsed(__attribute__((unused)) void *parsed_result,
+static void cmd_list_parsed(__rte_unused void *parsed_result,
 			    struct cmdline *cl,
-			    __attribute__((unused)) void *data)
+			    __rte_unused void *data)
 {
 	uint16_t port_id;
 	char dev_name[RTE_DEV_NAME_MAX_LEN];
@@ -112,7 +112,7 @@ struct cmd_dev_attach_result {
 
 static void cmd_dev_attach_parsed(void *parsed_result,
 				  struct cmdline *cl,
-				  __attribute__((unused)) void *data)
+				  __rte_unused void *data)
 {
 	struct cmd_dev_attach_result *res = parsed_result;
 	struct rte_devargs da;
@@ -159,7 +159,7 @@ struct cmd_dev_detach_result {
 
 static void cmd_dev_detach_parsed(void *parsed_result,
 				   struct cmdline *cl,
-				   __attribute__((unused)) void *data)
+				   __rte_unused void *data)
 {
 	struct cmd_dev_detach_result *res = parsed_result;
 	struct rte_devargs da;
diff --git a/examples/multi_process/simple_mp/main.c b/examples/multi_process/simple_mp/main.c
index e6c69d6a33..fc79528462 100644
--- a/examples/multi_process/simple_mp/main.c
+++ b/examples/multi_process/simple_mp/main.c
@@ -53,7 +53,7 @@ struct rte_mempool *message_pool;
 volatile int quit = 0;
 
 static int
-lcore_recv(__attribute__((unused)) void *arg)
+lcore_recv(__rte_unused void *arg)
 {
 	unsigned lcore_id = rte_lcore_id();
 
diff --git a/examples/multi_process/simple_mp/mp_commands.c b/examples/multi_process/simple_mp/mp_commands.c
index bdf4947720..311d0fe775 100644
--- a/examples/multi_process/simple_mp/mp_commands.c
+++ b/examples/multi_process/simple_mp/mp_commands.c
@@ -40,8 +40,8 @@ struct cmd_send_result {
 };
 
 static void cmd_send_parsed(void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
 {
 	void *msg = NULL;
 	struct cmd_send_result *res = parsed_result;
@@ -77,9 +77,9 @@ struct cmd_quit_result {
 	cmdline_fixed_string_t quit;
 };
 
-static void cmd_quit_parsed(__attribute__((unused)) void *parsed_result,
+static void cmd_quit_parsed(__rte_unused void *parsed_result,
 			    struct cmdline *cl,
-			    __attribute__((unused)) void *data)
+			    __rte_unused void *data)
 {
 	quit = 1;
 	cmdline_quit(cl);
@@ -104,9 +104,9 @@ struct cmd_help_result {
 	cmdline_fixed_string_t help;
 };
 
-static void cmd_help_parsed(__attribute__((unused)) void *parsed_result,
+static void cmd_help_parsed(__rte_unused void *parsed_result,
 			    struct cmdline *cl,
-			    __attribute__((unused)) void *data)
+			    __rte_unused void *data)
 {
 	cmdline_printf(cl, "Simple demo example of multi-process in RTE\n\n"
 			"This is a readline-like interface that can be used to\n"
diff --git a/examples/ntb/ntb_fwd.c b/examples/ntb/ntb_fwd.c
index 17eedcf0b8..d49189e175 100644
--- a/examples/ntb/ntb_fwd.c
+++ b/examples/ntb/ntb_fwd.c
@@ -109,9 +109,9 @@ struct cmd_help_result {
 };
 
 static void
-cmd_help_parsed(__attribute__((unused)) void *parsed_result,
+cmd_help_parsed(__rte_unused void *parsed_result,
 		struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	cmdline_printf(
 		cl,
@@ -154,9 +154,9 @@ struct cmd_quit_result {
 };
 
 static void
-cmd_quit_parsed(__attribute__((unused)) void *parsed_result,
+cmd_quit_parsed(__rte_unused void *parsed_result,
 		struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	struct ntb_fwd_lcore_conf *conf;
 	uint32_t lcore_id;
@@ -209,8 +209,8 @@ struct cmd_sendfile_result {
 
 static void
 cmd_sendfile_parsed(void *parsed_result,
-		    __attribute__((unused)) struct cmdline *cl,
-		    __attribute__((unused)) void *data)
+		    __rte_unused struct cmdline *cl,
+		    __rte_unused void *data)
 {
 	struct cmd_sendfile_result *res = parsed_result;
 	struct rte_rawdev_buf *pkts_send[NTB_MAX_PKT_BURST];
@@ -793,9 +793,9 @@ struct cmd_start_result {
 };
 
 static void
-cmd_start_parsed(__attribute__((unused)) void *parsed_result,
-			    __attribute__((unused)) struct cmdline *cl,
-			    __attribute__((unused)) void *data)
+cmd_start_parsed(__rte_unused void *parsed_result,
+			    __rte_unused struct cmdline *cl,
+			    __rte_unused void *data)
 {
 	start_pkt_fwd();
 }
@@ -819,9 +819,9 @@ struct cmd_stop_result {
 };
 
 static void
-cmd_stop_parsed(__attribute__((unused)) void *parsed_result,
-		__attribute__((unused)) struct cmdline *cl,
-		__attribute__((unused)) void *data)
+cmd_stop_parsed(__rte_unused void *parsed_result,
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
 {
 	struct ntb_fwd_lcore_conf *conf;
 	uint32_t lcore_id;
@@ -983,8 +983,8 @@ struct cmd_stats_result {
 
 static void
 cmd_stats_parsed(void *parsed_result,
-		 __attribute__((unused)) struct cmdline *cl,
-		 __attribute__((unused)) void *data)
+		 __rte_unused struct cmdline *cl,
+		 __rte_unused void *data)
 {
 	struct cmd_stats_result *res = parsed_result;
 	if (!strcmp(res->show, "clear"))
@@ -1021,9 +1021,9 @@ struct cmd_set_fwd_mode_result {
 };
 
 static void
-cmd_set_fwd_mode_parsed(__attribute__((unused)) void *parsed_result,
-			__attribute__((unused)) struct cmdline *cl,
-			__attribute__((unused)) void *data)
+cmd_set_fwd_mode_parsed(__rte_unused void *parsed_result,
+			__rte_unused struct cmdline *cl,
+			__rte_unused void *data)
 {
 	struct cmd_set_fwd_mode_result *res = parsed_result;
 	int i;
diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index 73a811c99e..8a1560b503 100644
--- a/examples/performance-thread/l3fwd-thread/main.c
+++ b/examples/performance-thread/l3fwd-thread/main.c
@@ -869,7 +869,7 @@ get_ipv6_dst_port(void *ipv6_hdr,  uint16_t portid,
 #endif
 
 static inline void l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid)
-		__attribute__((unused));
+		__rte_unused;
 
 #if ((APP_LOOKUP_METHOD == APP_LOOKUP_EXACT_MATCH) && \
 	(ENABLE_MULTI_BUFFER_OPTIMIZE == 1))
@@ -1120,7 +1120,7 @@ simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid)
 	struct rte_ether_hdr *eth_hdr[8];
 	union ipv6_5tuple_host key[8];
 
-	__attribute__((unused)) struct rte_ipv6_hdr *ipv6_hdr[8];
+	__rte_unused struct rte_ipv6_hdr *ipv6_hdr[8];
 
 	eth_hdr[0] = rte_pktmbuf_mtod(m[0], struct rte_ether_hdr *);
 	eth_hdr[1] = rte_pktmbuf_mtod(m[1], struct rte_ether_hdr *);
diff --git a/examples/performance-thread/pthread_shim/main.c b/examples/performance-thread/pthread_shim/main.c
index 03ff394369..18f83059bc 100644
--- a/examples/performance-thread/pthread_shim/main.c
+++ b/examples/performance-thread/pthread_shim/main.c
@@ -118,7 +118,7 @@ void *helloworld_pthread(void *arg)
  */
 __thread pthread_t tid[HELLOW_WORLD_MAX_LTHREADS];
 
-static void *initial_lthread(void *args __attribute__((unused)))
+static void *initial_lthread(void *args __rte_unused)
 {
 	int lcore = (int) rte_lcore_id();
 	/*
@@ -204,7 +204,7 @@ static void *initial_lthread(void *args __attribute__((unused)))
  * in the core mask
  */
 static int
-lthread_scheduler(void *args __attribute__((unused)))
+lthread_scheduler(void *args __rte_unused)
 {
 	/* create initial thread  */
 	struct lthread *lt;
diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index e8112c83a2..4dade4ca2f 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -167,7 +167,7 @@ app_pkt_handle(struct rte_mbuf *pkt, uint64_t time)
 
 
 static __attribute__((noreturn)) int
-main_loop(__attribute__((unused)) void *dummy)
+main_loop(__rte_unused void *dummy)
 {
 	uint64_t current_time, last_time = rte_rdtsc();
 	uint32_t lcore_id = rte_lcore_id();
diff --git a/examples/qos_sched/cmdline.c b/examples/qos_sched/cmdline.c
index 15f51830c1..ba68e0d026 100644
--- a/examples/qos_sched/cmdline.c
+++ b/examples/qos_sched/cmdline.c
@@ -21,9 +21,9 @@ struct cmd_help_result {
 	cmdline_fixed_string_t help;
 };
 
-static void cmd_help_parsed(__attribute__((unused)) void *parsed_result,
+static void cmd_help_parsed(__rte_unused void *parsed_result,
                                   struct cmdline *cl,
-                                  __attribute__((unused)) void *data)
+                                  __rte_unused void *data)
 {
 	cmdline_printf(
 		cl,
@@ -64,9 +64,9 @@ struct cmd_quit_result {
 	cmdline_fixed_string_t quit;
 };
 
-static void cmd_quit_parsed(__attribute__((unused)) void *parsed_result,
+static void cmd_quit_parsed(__rte_unused void *parsed_result,
 		struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	cmdline_quit(cl);
 }
@@ -92,8 +92,8 @@ struct cmd_setqavg_result {
 };
 
 static void cmd_setqavg_parsed(void *parsed_result,
-                                __attribute__((unused)) struct cmdline *cl,
-                                __attribute__((unused)) void *data)
+                                __rte_unused struct cmdline *cl,
+                                __rte_unused void *data)
 {
         struct cmd_setqavg_result *res = parsed_result;
 
@@ -133,9 +133,9 @@ struct cmd_appstats_result {
 	cmdline_fixed_string_t app_string;
 };
 
-static void cmd_appstats_parsed(__attribute__((unused)) void *parsed_result,
-				__attribute__((unused)) struct cmdline *cl,
-				__attribute__((unused)) void *data)
+static void cmd_appstats_parsed(__rte_unused void *parsed_result,
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
 {
 	app_stat();
 }
@@ -168,8 +168,8 @@ struct cmd_subportstats_result {
 };
 
 static void cmd_subportstats_parsed(void *parsed_result,
-                                __attribute__((unused)) struct cmdline *cl,
-                                __attribute__((unused)) void *data)
+                                __rte_unused struct cmdline *cl,
+                                __rte_unused void *data)
 {
 	struct cmd_subportstats_result *res = parsed_result;
 
@@ -219,8 +219,8 @@ struct cmd_pipestats_result {
 };
 
 static void cmd_pipestats_parsed(void *parsed_result,
-                                __attribute__((unused)) struct cmdline *cl,
-                                __attribute__((unused)) void *data)
+                                __rte_unused struct cmdline *cl,
+                                __rte_unused void *data)
 {
         struct cmd_pipestats_result *res = parsed_result;
 
@@ -282,8 +282,8 @@ struct cmd_avg_q_result {
 };
 
 static void cmd_avg_q_parsed(void *parsed_result,
-                                __attribute__((unused)) struct cmdline *cl,
-                                __attribute__((unused)) void *data)
+                                __rte_unused struct cmdline *cl,
+                                __rte_unused void *data)
 {
         struct cmd_avg_q_result *res = parsed_result;
 
@@ -359,8 +359,8 @@ struct cmd_avg_tcpipe_result {
 };
 
 static void cmd_avg_tcpipe_parsed(void *parsed_result,
-                                __attribute__((unused)) struct cmdline *cl,
-                                __attribute__((unused)) void *data)
+                                __rte_unused struct cmdline *cl,
+                                __rte_unused void *data)
 {
         struct cmd_avg_tcpipe_result *res = parsed_result;
 
@@ -426,8 +426,8 @@ struct cmd_avg_pipe_result {
 };
 
 static void cmd_avg_pipe_parsed(void *parsed_result,
-                                __attribute__((unused)) struct cmdline *cl,
-                                __attribute__((unused)) void *data)
+                                __rte_unused struct cmdline *cl,
+                                __rte_unused void *data)
 {
         struct cmd_avg_pipe_result *res = parsed_result;
 
@@ -485,8 +485,8 @@ struct cmd_avg_tcsubport_result {
 };
 
 static void cmd_avg_tcsubport_parsed(void *parsed_result,
-                                __attribute__((unused)) struct cmdline *cl,
-                                __attribute__((unused)) void *data)
+                                __rte_unused struct cmdline *cl,
+                                __rte_unused void *data)
 {
         struct cmd_avg_tcsubport_result *res = parsed_result;
 
@@ -542,8 +542,8 @@ struct cmd_avg_subport_result {
 };
 
 static void cmd_avg_subport_parsed(void *parsed_result,
-                                __attribute__((unused)) struct cmdline *cl,
-                                __attribute__((unused)) void *data)
+                                __rte_unused struct cmdline *cl,
+                                __rte_unused void *data)
 {
         struct cmd_avg_subport_result *res = parsed_result;
 
diff --git a/examples/qos_sched/main.c b/examples/qos_sched/main.c
index c0ed16b68f..73864d66db 100644
--- a/examples/qos_sched/main.c
+++ b/examples/qos_sched/main.c
@@ -29,7 +29,7 @@ uint32_t qavg_ntimes = APP_QAVG_NTIMES;
 
 /* main processing loop */
 static int
-app_main_loop(__attribute__((unused))void *dummy)
+app_main_loop(__rte_unused void *dummy)
 {
 	uint32_t lcore_id;
 	uint32_t i, mode;
diff --git a/examples/server_node_efd/server/main.c b/examples/server_node_efd/server/main.c
index 21c72acda2..05f961cff5 100644
--- a/examples/server_node_efd/server/main.c
+++ b/examples/server_node_efd/server/main.c
@@ -174,7 +174,7 @@ do_stats_display(void)
  * repeatedly sleeps.
  */
 static int
-sleep_lcore(__attribute__((unused)) void *dummy)
+sleep_lcore(__rte_unused void *dummy)
 {
 	/* Used to pick a display thread - static, so zero-initialised */
 	static rte_atomic32_t display_stats;
diff --git a/examples/timer/main.c b/examples/timer/main.c
index 968a941367..00c251c409 100644
--- a/examples/timer/main.c
+++ b/examples/timer/main.c
@@ -25,8 +25,8 @@ static struct rte_timer timer1;
 
 /* timer0 callback */
 static void
-timer0_cb(__attribute__((unused)) struct rte_timer *tim,
-	  __attribute__((unused)) void *arg)
+timer0_cb(__rte_unused struct rte_timer *tim,
+	  __rte_unused void *arg)
 {
 	static unsigned counter = 0;
 	unsigned lcore_id = rte_lcore_id();
@@ -41,8 +41,8 @@ timer0_cb(__attribute__((unused)) struct rte_timer *tim,
 
 /* timer1 callback */
 static void
-timer1_cb(__attribute__((unused)) struct rte_timer *tim,
-	  __attribute__((unused)) void *arg)
+timer1_cb(__rte_unused struct rte_timer *tim,
+	  __rte_unused void *arg)
 {
 	unsigned lcore_id = rte_lcore_id();
 	uint64_t hz;
@@ -56,7 +56,7 @@ timer1_cb(__attribute__((unused)) struct rte_timer *tim,
 }
 
 static __attribute__((noreturn)) int
-lcore_mainloop(__attribute__((unused)) void *arg)
+lcore_mainloop(__rte_unused void *arg)
 {
 	uint64_t prev_tsc = 0, cur_tsc, diff_tsc;
 	unsigned lcore_id;
diff --git a/examples/vdpa/main.c b/examples/vdpa/main.c
index d2e2cb7cd4..6d6831f349 100644
--- a/examples/vdpa/main.c
+++ b/examples/vdpa/main.c
@@ -228,9 +228,9 @@ struct cmd_help_result {
 	cmdline_fixed_string_t help;
 };
 
-static void cmd_help_parsed(__attribute__((unused)) void *parsed_result,
+static void cmd_help_parsed(__rte_unused void *parsed_result,
 		struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	cmdline_printf(
 		cl,
@@ -263,9 +263,9 @@ struct cmd_list_result {
 };
 
 static void cmd_list_vdpa_devices_parsed(
-		__attribute__((unused)) void *parsed_result,
+		__rte_unused void *parsed_result,
 		struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	int did;
 	uint32_t queue_num;
@@ -320,7 +320,7 @@ struct cmd_create_result {
 
 static void cmd_create_vdpa_port_parsed(void *parsed_result,
 		struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	int did;
 	struct cmd_create_result *res = parsed_result;
@@ -368,9 +368,9 @@ struct cmd_quit_result {
 	cmdline_fixed_string_t quit;
 };
 
-static void cmd_quit_parsed(__attribute__((unused)) void *parsed_result,
+static void cmd_quit_parsed(__rte_unused void *parsed_result,
 		struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	vdpa_sample_quit();
 	cmdline_quit(cl);
diff --git a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.h b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.h
index 0c2cc1374d..6ad14a3dea 100644
--- a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.h
+++ b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.h
@@ -17,7 +17,7 @@ int set_policy_mac(int port, int idx);
 
 int set_policy_defaults(struct channel_packet *pkt);
 
-void run_cli(__attribute__((unused)) void *arg);
+void run_cli(__rte_unused void *arg);
 
 #ifdef __cplusplus
 }
diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index d39f044c1e..dc6afb132c 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -302,7 +302,7 @@ check_all_ports_link_status(uint32_t port_mask)
 	}
 }
 static int
-run_monitor(__attribute__((unused)) void *arg)
+run_monitor(__rte_unused void *arg)
 {
 	if (channel_monitor_init() < 0) {
 		printf("Unable to initialize channel monitor\n");
@@ -313,7 +313,7 @@ run_monitor(__attribute__((unused)) void *arg)
 }
 
 static int
-run_core_monitor(__attribute__((unused)) void *arg)
+run_core_monitor(__rte_unused void *arg)
 {
 	if (branch_monitor_init() < 0) {
 		printf("Unable to initialize core monitor\n");
diff --git a/examples/vm_power_manager/oob_monitor_nop.c b/examples/vm_power_manager/oob_monitor_nop.c
index 7e7b8bc149..fc73ce18ef 100644
--- a/examples/vm_power_manager/oob_monitor_nop.c
+++ b/examples/vm_power_manager/oob_monitor_nop.c
@@ -8,20 +8,20 @@ void branch_monitor_exit(void)
 {
 }
 
-__attribute__((unused)) static float
-apply_policy(__attribute__((unused)) int core)
+__rte_unused static float
+apply_policy(__rte_unused int core)
 {
 	return 0.0;
 }
 
 int
-add_core_to_monitor(__attribute__((unused)) int core)
+add_core_to_monitor(__rte_unused int core)
 {
 	return 0;
 }
 
 int
-remove_core_from_monitor(__attribute__((unused)) int core)
+remove_core_from_monitor(__rte_unused int core)
 {
 	return 0;
 }
diff --git a/examples/vm_power_manager/vm_power_cli.c b/examples/vm_power_manager/vm_power_cli.c
index 5f64b83fb0..7edeaccda5 100644
--- a/examples/vm_power_manager/vm_power_cli.c
+++ b/examples/vm_power_manager/vm_power_cli.c
@@ -27,9 +27,9 @@ struct cmd_quit_result {
 	cmdline_fixed_string_t quit;
 };
 
-static void cmd_quit_parsed(__attribute__((unused)) void *parsed_result,
+static void cmd_quit_parsed(__rte_unused void *parsed_result,
 		struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	channel_monitor_exit();
 	channel_manager_exit();
@@ -58,7 +58,7 @@ struct cmd_show_vm_result {
 
 static void
 cmd_show_vm_parsed(void *parsed_result, struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	struct cmd_show_vm_result *res = parsed_result;
 	struct vm_info info;
@@ -135,7 +135,7 @@ struct cmd_set_pcpu_result {
 
 static void
 cmd_set_pcpu_parsed(void *parsed_result, struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	struct cmd_set_pcpu_result *res = parsed_result;
 
@@ -182,7 +182,7 @@ struct cmd_vm_op_result {
 
 static void
 cmd_vm_op_parsed(void *parsed_result, struct cmdline *cl,
-		__attribute__((unused)) void *data)
+		__rte_unused void *data)
 {
 	struct cmd_vm_op_result *res = parsed_result;
 
@@ -221,7 +221,7 @@ struct cmd_channels_op_result {
 };
 static void
 cmd_channels_op_parsed(void *parsed_result, struct cmdline *cl,
-			__attribute__((unused)) void *data)
+			__rte_unused void *data)
 {
 	unsigned num_channels = 0, channel_num, i;
 	int channels_added;
@@ -349,7 +349,7 @@ struct cmd_channels_status_op_result {
 
 static void
 cmd_channels_status_op_parsed(void *parsed_result, struct cmdline *cl,
-		       __attribute__((unused)) void *data)
+		       __rte_unused void *data)
 {
 	unsigned num_channels = 0, channel_num;
 	int changed;
@@ -435,7 +435,7 @@ struct cmd_show_cpu_freq_result {
 
 static void
 cmd_show_cpu_freq_parsed(void *parsed_result, struct cmdline *cl,
-		       __attribute__((unused)) void *data)
+		       __rte_unused void *data)
 {
 	struct cmd_show_cpu_freq_result *res = parsed_result;
 	uint32_t curr_freq = power_manager_get_current_frequency(res->core_num);
@@ -476,7 +476,7 @@ struct cmd_set_cpu_freq_result {
 
 static void
 cmd_set_cpu_freq_parsed(void *parsed_result, struct cmdline *cl,
-		       __attribute__((unused)) void *data)
+		       __rte_unused void *data)
 {
 	int ret = -1;
 	struct cmd_set_cpu_freq_result *res = parsed_result;
@@ -536,7 +536,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 };
 
 void
-run_cli(__attribute__((unused)) void *arg)
+run_cli(__rte_unused void *arg)
 {
 	struct cmdline *cl;
 
diff --git a/examples/vm_power_manager/vm_power_cli.h b/examples/vm_power_manager/vm_power_cli.h
index 075c255eef..6666cf72c0 100644
--- a/examples/vm_power_manager/vm_power_cli.h
+++ b/examples/vm_power_manager/vm_power_cli.h
@@ -9,7 +9,7 @@
 extern "C" {
 #endif
 
-void run_cli(__attribute__((unused)) void *arg);
+void run_cli(void *arg);
 
 #ifdef __cplusplus
 }
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 0111109203..67aa558887 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -455,7 +455,7 @@ sighup_handler(int signum)
  * and writing to OUTPUT_PORT
  */
 static int
-lcore_main(__attribute__((__unused__)) void *dummy)
+lcore_main(__rte_unused void *dummy)
 {
 	const uint16_t lcore_id = (uint16_t)rte_lcore_id();
 	const uint16_t num_cores = (uint16_t)rte_lcore_count();
diff --git a/lib/librte_cmdline/cmdline.c b/lib/librte_cmdline/cmdline.c
index 53cda84c13..cfd703e5b3 100644
--- a/lib/librte_cmdline/cmdline.c
+++ b/lib/librte_cmdline/cmdline.c
@@ -24,7 +24,7 @@
 
 static void
 cmdline_valid_buffer(struct rdline *rdl, const char *buf,
-		     __attribute__((unused)) unsigned int size)
+		     __rte_unused unsigned int size)
 {
 	struct cmdline *cl = rdl->opaque;
 	int ret;
diff --git a/lib/librte_cmdline/cmdline_parse_etheraddr.c b/lib/librte_cmdline/cmdline_parse_etheraddr.c
index 2cb8dd2a12..5cb10de321 100644
--- a/lib/librte_cmdline/cmdline_parse_etheraddr.c
+++ b/lib/librte_cmdline/cmdline_parse_etheraddr.c
@@ -27,7 +27,7 @@ struct cmdline_token_ops cmdline_token_etheraddr_ops = {
 };
 
 int
-cmdline_parse_etheraddr(__attribute__((unused)) cmdline_parse_token_hdr_t *tk,
+cmdline_parse_etheraddr(__rte_unused cmdline_parse_token_hdr_t *tk,
 	const char *buf, void *res, unsigned ressize)
 {
 	unsigned int token_len = 0;
@@ -58,7 +58,7 @@ cmdline_parse_etheraddr(__attribute__((unused)) cmdline_parse_token_hdr_t *tk,
 }
 
 int
-cmdline_get_help_etheraddr(__attribute__((unused)) cmdline_parse_token_hdr_t *tk,
+cmdline_get_help_etheraddr(__rte_unused cmdline_parse_token_hdr_t *tk,
 			       char *dstbuf, unsigned int size)
 {
 	int ret;
diff --git a/lib/librte_cmdline/cmdline_parse_portlist.c b/lib/librte_cmdline/cmdline_parse_portlist.c
index ad43b522e9..e1aa07be4b 100644
--- a/lib/librte_cmdline/cmdline_parse_portlist.c
+++ b/lib/librte_cmdline/cmdline_parse_portlist.c
@@ -72,7 +72,7 @@ parse_ports(cmdline_portlist_t *pl, const char *str)
 }
 
 int
-cmdline_parse_portlist(__attribute__((unused)) cmdline_parse_token_hdr_t *tk,
+cmdline_parse_portlist(__rte_unused cmdline_parse_token_hdr_t *tk,
 	const char *buf, void *res, unsigned ressize)
 {
 	unsigned int token_len = 0;
@@ -108,7 +108,7 @@ cmdline_parse_portlist(__attribute__((unused)) cmdline_parse_token_hdr_t *tk,
 }
 
 int
-cmdline_get_help_portlist(__attribute__((unused)) cmdline_parse_token_hdr_t *tk,
+cmdline_get_help_portlist(__rte_unused cmdline_parse_token_hdr_t *tk,
 		char *dstbuf, unsigned int size)
 {
 	int ret;
diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index 5145473415..fc66d9236a 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -687,7 +687,7 @@ rte_log2_u64(uint64_t v)
 #ifndef container_of
 #define container_of(ptr, type, member)	__extension__ ({		\
 			const typeof(((type *)0)->member) *_ptr = (ptr); \
-			__attribute__((unused)) type *_target_ptr =	\
+			__rte_unused type *_target_ptr =	\
 				(type *)(ptr);				\
 			(type *)(((uintptr_t)_ptr) - offsetof(type, member)); \
 		})
diff --git a/lib/librte_eal/freebsd/eal/eal.c b/lib/librte_eal/freebsd/eal/eal.c
index 6ae37e7e69..80dc9aa78c 100644
--- a/lib/librte_eal/freebsd/eal/eal.c
+++ b/lib/librte_eal/freebsd/eal/eal.c
@@ -665,7 +665,7 @@ eal_check_mem_on_local_socket(void)
 
 
 static int
-sync_func(__attribute__((unused)) void *arg)
+sync_func(__rte_unused void *arg)
 {
 	return 0;
 }
diff --git a/lib/librte_eal/freebsd/eal/eal_thread.c b/lib/librte_eal/freebsd/eal/eal_thread.c
index 309b587266..925737d34d 100644
--- a/lib/librte_eal/freebsd/eal/eal_thread.c
+++ b/lib/librte_eal/freebsd/eal/eal_thread.c
@@ -90,7 +90,7 @@ void eal_thread_init_master(unsigned lcore_id)
 
 /* main loop of threads */
 __attribute__((noreturn)) void *
-eal_thread_loop(__attribute__((unused)) void *arg)
+eal_thread_loop(__rte_unused void *arg)
 {
 	char c;
 	int n, ret;
diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c
index 9530ee55f8..d1e532fc1b 100644
--- a/lib/librte_eal/linux/eal/eal.c
+++ b/lib/librte_eal/linux/eal/eal.c
@@ -893,7 +893,7 @@ eal_check_mem_on_local_socket(void)
 }
 
 static int
-sync_func(__attribute__((unused)) void *arg)
+sync_func(__rte_unused void *arg)
 {
 	return 0;
 }
diff --git a/lib/librte_eal/linux/eal/eal_log.c b/lib/librte_eal/linux/eal/eal_log.c
index 9d02dddbed..43c8460bfb 100644
--- a/lib/librte_eal/linux/eal/eal_log.c
+++ b/lib/librte_eal/linux/eal/eal_log.c
@@ -23,7 +23,7 @@
  * default log function
  */
 static ssize_t
-console_log_write(__attribute__((unused)) void *c, const char *buf, size_t size)
+console_log_write(__rte_unused void *c, const char *buf, size_t size)
 {
 	ssize_t ret;
 
diff --git a/lib/librte_eal/linux/eal/eal_thread.c b/lib/librte_eal/linux/eal/eal_thread.c
index 379773b683..575c96089b 100644
--- a/lib/librte_eal/linux/eal/eal_thread.c
+++ b/lib/librte_eal/linux/eal/eal_thread.c
@@ -90,7 +90,7 @@ void eal_thread_init_master(unsigned lcore_id)
 
 /* main loop of threads */
 __attribute__((noreturn)) void *
-eal_thread_loop(__attribute__((unused)) void *arg)
+eal_thread_loop(__rte_unused void *arg)
 {
 	char c;
 	int n, ret;
diff --git a/lib/librte_eal/linux/eal/eal_timer.c b/lib/librte_eal/linux/eal/eal_timer.c
index a904a8297c..6dc6b565d7 100644
--- a/lib/librte_eal/linux/eal/eal_timer.c
+++ b/lib/librte_eal/linux/eal/eal_timer.c
@@ -88,7 +88,7 @@ static pthread_t msb_inc_thread_id;
  * this because hpet is 32 bits by default under linux).
  */
 static void *
-hpet_msb_inc(__attribute__((unused)) void *arg)
+hpet_msb_inc(__rte_unused void *arg)
 {
 	uint32_t t;
 
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index cd5794d4a5..220eb2fb0c 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -77,9 +77,9 @@ rte_pktmbuf_pool_init(struct rte_mempool *mp, void *opaque_arg)
  */
 void
 rte_pktmbuf_init(struct rte_mempool *mp,
-		 __attribute__((unused)) void *opaque_arg,
+		 __rte_unused void *opaque_arg,
 		 void *_m,
-		 __attribute__((unused)) unsigned i)
+		 __rte_unused unsigned i)
 {
 	struct rte_mbuf *m = _m;
 	uint32_t mbuf_size, buf_len, priv_size;
@@ -167,7 +167,7 @@ static void
 __rte_pktmbuf_init_extmem(struct rte_mempool *mp,
 			  void *opaque_arg,
 			  void *_m,
-			  __attribute__((unused)) unsigned int i)
+			  __rte_unused unsigned int i)
 {
 	struct rte_mbuf *m = _m;
 	struct rte_pktmbuf_extmem_init_ctx *ctx = opaque_arg;
diff --git a/lib/librte_power/power_kvm_vm.c b/lib/librte_power/power_kvm_vm.c
index 277ebbeaeb..2bb17beb17 100644
--- a/lib/librte_power/power_kvm_vm.c
+++ b/lib/librte_power/power_kvm_vm.c
@@ -37,9 +37,9 @@ power_kvm_vm_exit(unsigned int lcore_id)
 }
 
 uint32_t
-power_kvm_vm_freqs(__attribute__((unused)) unsigned int lcore_id,
-		__attribute__((unused)) uint32_t *freqs,
-		__attribute__((unused)) uint32_t num)
+power_kvm_vm_freqs(__rte_unused unsigned int lcore_id,
+		__rte_unused uint32_t *freqs,
+		__rte_unused uint32_t num)
 {
 	RTE_LOG(ERR, POWER, "rte_power_freqs is not implemented "
 			"for Virtual Machine Power Management\n");
@@ -47,7 +47,7 @@ power_kvm_vm_freqs(__attribute__((unused)) unsigned int lcore_id,
 }
 
 uint32_t
-power_kvm_vm_get_freq(__attribute__((unused)) unsigned int lcore_id)
+power_kvm_vm_get_freq(__rte_unused unsigned int lcore_id)
 {
 	RTE_LOG(ERR, POWER, "rte_power_get_freq is not implemented "
 			"for Virtual Machine Power Management\n");
@@ -55,8 +55,8 @@ power_kvm_vm_get_freq(__attribute__((unused)) unsigned int lcore_id)
 }
 
 int
-power_kvm_vm_set_freq(__attribute__((unused)) unsigned int lcore_id,
-		__attribute__((unused)) uint32_t index)
+power_kvm_vm_set_freq(__rte_unused unsigned int lcore_id,
+		__rte_unused uint32_t index)
 {
 	RTE_LOG(ERR, POWER, "rte_power_set_freq is not implemented "
 			"for Virtual Machine Power Management\n");
@@ -107,7 +107,7 @@ power_kvm_vm_freq_min(unsigned int lcore_id)
 }
 
 int
-power_kvm_vm_turbo_status(__attribute__((unused)) unsigned int lcore_id)
+power_kvm_vm_turbo_status(__rte_unused unsigned int lcore_id)
 {
 	RTE_LOG(ERR, POWER, "rte_power_turbo_status is not implemented for Virtual Machine Power Management\n");
 	return -ENOTSUP;
-- 
2.25.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-dev] [PATCH 20.05 10/15] replace used attributes
  2020-02-10 16:20 [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon
                   ` (8 preceding siblings ...)
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 09/15] replace unused attributes Thomas Monjalon
@ 2020-02-10 16:20 ` Thomas Monjalon
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 11/15] replace hot attributes Thomas Monjalon
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 20+ messages in thread
From: Thomas Monjalon @ 2020-02-10 16:20 UTC (permalink / raw)
  To: dev; +Cc: Neil Horman

The new macro __rte_used, forcing symbol to be generated,
is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 lib/librte_eal/common/eal_common_options.c              | 2 +-
 lib/librte_eal/common/include/rte_common.h              | 5 +++++
 lib/librte_eal/common/include/rte_dev.h                 | 8 ++++----
 lib/librte_eal/common/include/rte_function_versioning.h | 2 +-
 4 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index 5920233bcd..dcea9a3e9c 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -107,7 +107,7 @@ static const char *default_solib_dir = RTE_EAL_PMD_PATH;
  * Note: PLEASE DO NOT ALTER THIS without making a corresponding
  * change to usertools/dpdk-pmdinfo.py
  */
-static const char dpdk_solib_path[] __attribute__((used)) =
+static const char dpdk_solib_path[] __rte_used =
 "DPDK_PLUGIN_PATH=" RTE_EAL_PMD_PATH;
 
 TAILQ_HEAD(device_option_list, device_option);
diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index fc66d9236a..1bd627fa9e 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -76,6 +76,11 @@ typedef uint16_t unaligned_uint16_t;
  */
 #define __rte_weak __attribute__((__weak__))
 
+/**
+ * Force symbol to be generated even if it appears to be unused.
+ */
+#define __rte_used __attribute__((used))
+
 /*********** Macros to eliminate unused variable warnings ********/
 
 /**
diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
index a5c35f00c0..c8d985fb5c 100644
--- a/lib/librte_eal/common/include/rte_dev.h
+++ b/lib/librte_eal/common/include/rte_dev.h
@@ -205,17 +205,17 @@ typedef int (*rte_dev_cmp_t)(const struct rte_device *dev, const void *data);
 
 #define RTE_PMD_EXPORT_NAME(name, idx) \
 static const char RTE_PMD_EXPORT_NAME_ARRAY(this_pmd_name, idx) \
-__attribute__((used)) = RTE_STR(name)
+__rte_used = RTE_STR(name)
 
 #define DRV_EXP_TAG(name, tag) __##name##_##tag
 
 #define RTE_PMD_REGISTER_PCI_TABLE(name, table) \
-static const char DRV_EXP_TAG(name, pci_tbl_export)[] __attribute__((used)) = \
+static const char DRV_EXP_TAG(name, pci_tbl_export)[] __rte_used = \
 RTE_STR(table)
 
 #define RTE_PMD_REGISTER_PARAM_STRING(name, str) \
 static const char DRV_EXP_TAG(name, param_string_export)[] \
-__attribute__((used)) = str
+__rte_used = str
 
 /**
  * Advertise the list of kernel modules required to run this driver
@@ -240,7 +240,7 @@ __attribute__((used)) = str
  */
 #define RTE_PMD_REGISTER_KMOD_DEP(name, str) \
 static const char DRV_EXP_TAG(name, kmod_dep_export)[] \
-__attribute__((used)) = str
+__rte_used = str
 
 /**
  * Iteration context.
diff --git a/lib/librte_eal/common/include/rte_function_versioning.h b/lib/librte_eal/common/include/rte_function_versioning.h
index c924351d5e..b9f862d295 100644
--- a/lib/librte_eal/common/include/rte_function_versioning.h
+++ b/lib/librte_eal/common/include/rte_function_versioning.h
@@ -59,7 +59,7 @@
  * that it is being used as an implementation of a particular version of symbol
  * <b>.
  */
-#define __vsym __attribute__((used))
+#define __vsym __rte_used
 
 /*
  * MAP_STATIC_SYMBOL
-- 
2.25.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-dev] [PATCH 20.05 11/15] replace hot attributes
  2020-02-10 16:20 [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon
                   ` (9 preceding siblings ...)
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 10/15] replace used attributes Thomas Monjalon
@ 2020-02-10 16:20 ` Thomas Monjalon
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 12/15] replace cold attributes Thomas Monjalon
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 20+ messages in thread
From: Thomas Monjalon @ 2020-02-10 16:20 UTC (permalink / raw)
  To: dev
  Cc: Anoob Joseph, Hemant Agrawal, Sachin Saxena, Jerin Jacob,
	Nithin Dabilpuram, Vamsi Attunuru, Akhil Goyal, Ankur Dwivedi,
	Pavan Nikhilesh, Gagandeep Singh, Harman Kalra, Kiran Kumar K,
	Maciej Czekaj

The new macro __rte_hot, for compiler hinting,
is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/common/cpt/cpt_common.h               |  4 --
 drivers/common/cpt/cpt_ucode.h                |  2 +-
 drivers/common/cpt/cpt_ucode_asym.h           |  4 +-
 drivers/common/dpaax/dpaax_iova_table.h       |  2 +-
 drivers/common/octeontx2/otx2_common.h        |  5 --
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c   |  2 +-
 drivers/crypto/octeontx/otx_cryptodev_ops.c   | 18 ++++----
 drivers/crypto/octeontx2/otx2_cryptodev_ops.c |  8 ++--
 drivers/event/octeontx/ssovf_worker.c         | 16 +++----
 drivers/event/octeontx/ssovf_worker.h         |  4 --
 drivers/event/octeontx2/otx2_worker.c         | 28 +++++------
 drivers/event/octeontx2/otx2_worker_dual.c    | 28 +++++------
 drivers/mempool/octeontx2/otx2_mempool_ops.c  |  6 +--
 drivers/net/dpaa2/dpaa2_rxtx.c                | 24 +++++-----
 drivers/net/enetc/enetc_rxtx.c                |  2 +-
 drivers/net/octeontx/octeontx_rxtx.c          |  4 +-
 drivers/net/octeontx/octeontx_rxtx.h          |  4 --
 drivers/net/octeontx2/otx2_rx.c               |  6 +--
 drivers/net/octeontx2/otx2_tx.c               |  6 +--
 drivers/net/thunderx/nicvf_rxtx.c             | 46 +++++++++----------
 drivers/net/thunderx/nicvf_rxtx.h             |  8 +---
 lib/librte_eal/common/include/rte_common.h    |  5 ++
 22 files changed, 108 insertions(+), 124 deletions(-)

diff --git a/drivers/common/cpt/cpt_common.h b/drivers/common/cpt/cpt_common.h
index dff45f0fe9..56bfea4953 100644
--- a/drivers/common/cpt/cpt_common.h
+++ b/drivers/common/cpt/cpt_common.h
@@ -31,10 +31,6 @@
 #define ROUNDUP16(val)	(((val) + 15) & 0xfffffff0)
 #endif
 
-#ifndef __hot
-#define __hot __attribute__((hot))
-#endif
-
 #define MOD_INC(i, l)   ((i) == (l - 1) ? (i) = 0 : (i)++)
 
 struct cpt_qp_meta_info {
diff --git a/drivers/common/cpt/cpt_ucode.h b/drivers/common/cpt/cpt_ucode.h
index c310ea7cb4..0d3a01b37a 100644
--- a/drivers/common/cpt/cpt_ucode.h
+++ b/drivers/common/cpt/cpt_ucode.h
@@ -2455,7 +2455,7 @@ cpt_fc_dec_hmac_prep(uint32_t flags,
 	return prep_req;
 }
 
-static __rte_always_inline void *__hot
+static __rte_always_inline void *__rte_hot
 cpt_fc_enc_hmac_prep(uint32_t flags, uint64_t d_offs, uint64_t d_lens,
 		     fc_params_t *fc_params, void *op)
 {
diff --git a/drivers/common/cpt/cpt_ucode_asym.h b/drivers/common/cpt/cpt_ucode_asym.h
index a67efb361c..5d1c7b5f02 100644
--- a/drivers/common/cpt/cpt_ucode_asym.h
+++ b/drivers/common/cpt/cpt_ucode_asym.h
@@ -464,7 +464,7 @@ cpt_rsa_crt_prep(struct asym_op_params *rsa_params,
 	cpt_fill_req_comp_addr(req, caddr);
 }
 
-static __rte_always_inline int __hot
+static __rte_always_inline int __rte_hot
 cpt_enqueue_rsa_op(struct rte_crypto_op *op,
 	       struct asym_op_params *params,
 	       struct cpt_asym_sess_misc *sess)
@@ -811,7 +811,7 @@ cpt_ecdsa_verify_prep(struct rte_crypto_ecdsa_op_param *ecdsa,
 	cpt_fill_req_comp_addr(req, caddr);
 }
 
-static __rte_always_inline int __hot
+static __rte_always_inline int __rte_hot
 cpt_enqueue_ecdsa_op(struct rte_crypto_op *op,
 		     struct asym_op_params *params,
 		     struct cpt_asym_sess_misc *sess,
diff --git a/drivers/common/dpaax/dpaax_iova_table.h b/drivers/common/dpaax/dpaax_iova_table.h
index fef97f6dde..fc3b9e7a8f 100644
--- a/drivers/common/dpaax/dpaax_iova_table.h
+++ b/drivers/common/dpaax/dpaax_iova_table.h
@@ -66,7 +66,7 @@ void dpaax_iova_table_depopulate(void);
 int dpaax_iova_table_update(phys_addr_t paddr, void *vaddr, size_t length);
 void dpaax_iova_table_dump(void);
 
-static inline void *dpaax_iova_table_get_va(phys_addr_t paddr) __attribute__((hot));
+static inline void *dpaax_iova_table_get_va(phys_addr_t paddr) __rte_hot;
 
 static inline void *
 dpaax_iova_table_get_va(phys_addr_t paddr) {
diff --git a/drivers/common/octeontx2/otx2_common.h b/drivers/common/octeontx2/otx2_common.h
index bf5ea86b3a..e62cdea076 100644
--- a/drivers/common/octeontx2/otx2_common.h
+++ b/drivers/common/octeontx2/otx2_common.h
@@ -49,11 +49,6 @@
 	 (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h))))
 #endif
 
-/* Compiler attributes */
-#ifndef __hot
-#define __hot   __attribute__((hot))
-#endif
-
 /* Intra device related functions */
 struct otx2_npa_lf;
 struct otx2_idev_cfg {
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 9727378fcf..9e1b84dfab 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -3539,7 +3539,7 @@ void dpaa2_sec_stats_reset(struct rte_cryptodev *dev)
 	}
 }
 
-static void __attribute__((hot))
+static void __rte_hot
 dpaa2_sec_process_parallel_event(struct qbman_swp *swp,
 				 const struct qbman_fd *fd,
 				 const struct qbman_result *dq,
diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c b/drivers/crypto/octeontx/otx_cryptodev_ops.c
index d7f3d08272..44c8267388 100644
--- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
+++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
@@ -358,7 +358,7 @@ otx_cpt_asym_session_clear(struct rte_cryptodev *dev,
 	rte_mempool_put(sess_mp, priv);
 }
 
-static __rte_always_inline int32_t __hot
+static __rte_always_inline int32_t __rte_hot
 otx_cpt_request_enqueue(struct cpt_instance *instance,
 			struct pending_queue *pqueue,
 			void *req)
@@ -391,7 +391,7 @@ otx_cpt_request_enqueue(struct cpt_instance *instance,
 	return 0;
 }
 
-static __rte_always_inline int __hot
+static __rte_always_inline int __rte_hot
 otx_cpt_enq_single_asym(struct cpt_instance *instance,
 			struct rte_crypto_op *op,
 			struct pending_queue *pqueue)
@@ -471,7 +471,7 @@ otx_cpt_enq_single_asym(struct cpt_instance *instance,
 	return ret;
 }
 
-static __rte_always_inline int __hot
+static __rte_always_inline int __rte_hot
 otx_cpt_enq_single_sym(struct cpt_instance *instance,
 		       struct rte_crypto_op *op,
 		       struct pending_queue *pqueue)
@@ -513,7 +513,7 @@ otx_cpt_enq_single_sym(struct cpt_instance *instance,
 	return 0;
 }
 
-static __rte_always_inline int __hot
+static __rte_always_inline int __rte_hot
 otx_cpt_enq_single_sym_sessless(struct cpt_instance *instance,
 				struct rte_crypto_op *op,
 				struct pending_queue *pqueue)
@@ -573,7 +573,7 @@ otx_cpt_enq_single_sym_sessless(struct cpt_instance *instance,
 #define OP_TYPE_SYM		0
 #define OP_TYPE_ASYM		1
 
-static __rte_always_inline int __hot
+static __rte_always_inline int __rte_hot
 otx_cpt_enq_single(struct cpt_instance *inst,
 		   struct rte_crypto_op *op,
 		   struct pending_queue *pqueue,
@@ -598,7 +598,7 @@ otx_cpt_enq_single(struct cpt_instance *inst,
 	return -ENOTSUP;
 }
 
-static  __rte_always_inline uint16_t __hot
+static  __rte_always_inline uint16_t __rte_hot
 otx_cpt_pkt_enqueue(void *qptr, struct rte_crypto_op **ops, uint16_t nb_ops,
 		    const uint8_t op_type)
 {
@@ -724,7 +724,7 @@ otx_cpt_asym_dequeue_ecpm_op(struct rte_crypto_ecpm_op_param *ecpm,
 	ecpm->r.y.length = prime_len;
 }
 
-static __rte_always_inline void __hot
+static __rte_always_inline void __rte_hot
 otx_cpt_asym_post_process(struct rte_crypto_op *cop,
 			  struct cpt_request_info *req)
 {
@@ -756,7 +756,7 @@ otx_cpt_asym_post_process(struct rte_crypto_op *cop,
 	}
 }
 
-static __rte_always_inline void __hot
+static __rte_always_inline void __rte_hot
 otx_cpt_dequeue_post_process(struct rte_crypto_op *cop, uintptr_t *rsp,
 			     const uint8_t op_type)
 {
@@ -782,7 +782,7 @@ otx_cpt_dequeue_post_process(struct rte_crypto_op *cop, uintptr_t *rsp,
 	return;
 }
 
-static __rte_always_inline uint16_t __hot
+static __rte_always_inline uint16_t __rte_hot
 otx_cpt_pkt_dequeue(void *qptr, struct rte_crypto_op **ops, uint16_t nb_ops,
 		    const uint8_t op_type)
 {
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
index 7eebb49636..a6f80c1fcc 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
@@ -395,7 +395,7 @@ sym_session_clear(int driver_id, struct rte_cryptodev_sym_session *sess)
 	rte_mempool_put(pool, priv);
 }
 
-static __rte_always_inline int32_t __hot
+static __rte_always_inline int32_t __rte_hot
 otx2_cpt_enqueue_req(const struct otx2_cpt_qp *qp,
 		     struct pending_queue *pend_q,
 		     struct cpt_request_info *req)
@@ -443,7 +443,7 @@ otx2_cpt_enqueue_req(const struct otx2_cpt_qp *qp,
 	return 0;
 }
 
-static __rte_always_inline int32_t __hot
+static __rte_always_inline int32_t __rte_hot
 otx2_cpt_enqueue_asym(struct otx2_cpt_qp *qp,
 		      struct rte_crypto_op *op,
 		      struct pending_queue *pend_q)
@@ -526,7 +526,7 @@ otx2_cpt_enqueue_asym(struct otx2_cpt_qp *qp,
 	return ret;
 }
 
-static __rte_always_inline int __hot
+static __rte_always_inline int __rte_hot
 otx2_cpt_enqueue_sym(struct otx2_cpt_qp *qp, struct rte_crypto_op *op,
 		     struct pending_queue *pend_q)
 {
@@ -569,7 +569,7 @@ otx2_cpt_enqueue_sym(struct otx2_cpt_qp *qp, struct rte_crypto_op *op,
 	return ret;
 }
 
-static __rte_always_inline int __hot
+static __rte_always_inline int __rte_hot
 otx2_cpt_enqueue_sym_sessless(struct otx2_cpt_qp *qp, struct rte_crypto_op *op,
 			      struct pending_queue *pend_q)
 {
diff --git a/drivers/event/octeontx/ssovf_worker.c b/drivers/event/octeontx/ssovf_worker.c
index d940b5dd65..a60c4fc50f 100644
--- a/drivers/event/octeontx/ssovf_worker.c
+++ b/drivers/event/octeontx/ssovf_worker.c
@@ -91,7 +91,7 @@ ssows_release_event(struct ssows *ws)
 		ssows_swtag_untag(ws);
 }
 
-__rte_always_inline uint16_t __hot
+__rte_always_inline uint16_t __rte_hot
 ssows_deq(void *port, struct rte_event *ev, uint64_t timeout_ticks)
 {
 	struct ssows *ws = port;
@@ -107,7 +107,7 @@ ssows_deq(void *port, struct rte_event *ev, uint64_t timeout_ticks)
 	}
 }
 
-__rte_always_inline uint16_t __hot
+__rte_always_inline uint16_t __rte_hot
 ssows_deq_timeout(void *port, struct rte_event *ev, uint64_t timeout_ticks)
 {
 	struct ssows *ws = port;
@@ -125,7 +125,7 @@ ssows_deq_timeout(void *port, struct rte_event *ev, uint64_t timeout_ticks)
 	return ret;
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 ssows_deq_burst(void *port, struct rte_event ev[], uint16_t nb_events,
 		uint64_t timeout_ticks)
 {
@@ -134,7 +134,7 @@ ssows_deq_burst(void *port, struct rte_event ev[], uint16_t nb_events,
 	return ssows_deq(port, ev, timeout_ticks);
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 ssows_deq_timeout_burst(void *port, struct rte_event ev[], uint16_t nb_events,
 			uint64_t timeout_ticks)
 {
@@ -143,7 +143,7 @@ ssows_deq_timeout_burst(void *port, struct rte_event ev[], uint16_t nb_events,
 	return ssows_deq_timeout(port, ev, timeout_ticks);
 }
 
-__rte_always_inline uint16_t __hot
+__rte_always_inline uint16_t __rte_hot
 ssows_enq(void *port, const struct rte_event *ev)
 {
 	struct ssows *ws = port;
@@ -166,14 +166,14 @@ ssows_enq(void *port, const struct rte_event *ev)
 	return ret;
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 ssows_enq_burst(void *port, const struct rte_event ev[], uint16_t nb_events)
 {
 	RTE_SET_USED(nb_events);
 	return ssows_enq(port, ev);
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 ssows_enq_new_burst(void *port, const struct rte_event ev[], uint16_t nb_events)
 {
 	uint16_t i;
@@ -186,7 +186,7 @@ ssows_enq_new_burst(void *port, const struct rte_event ev[], uint16_t nb_events)
 	return nb_events;
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 ssows_enq_fwd_burst(void *port, const struct rte_event ev[], uint16_t nb_events)
 {
 	struct ssows *ws = port;
diff --git a/drivers/event/octeontx/ssovf_worker.h b/drivers/event/octeontx/ssovf_worker.h
index c4f886d63a..009b9c18a5 100644
--- a/drivers/event/octeontx/ssovf_worker.h
+++ b/drivers/event/octeontx/ssovf_worker.h
@@ -17,10 +17,6 @@ enum {
 	SSO_SYNC_EMPTY
 };
 
-#ifndef __hot
-#define __hot	__attribute__((hot))
-#endif
-
 /* SSO Operations */
 
 static __rte_always_inline struct rte_mbuf *
diff --git a/drivers/event/octeontx2/otx2_worker.c b/drivers/event/octeontx2/otx2_worker.c
index 8bec59e066..88bac391c7 100644
--- a/drivers/event/octeontx2/otx2_worker.c
+++ b/drivers/event/octeontx2/otx2_worker.c
@@ -82,7 +82,7 @@ otx2_ssogws_release_event(struct otx2_ssogws *ws)
 }
 
 #define R(name, f6, f5, f4, f3, f2, f1, f0, flags)			\
-uint16_t __hot								\
+uint16_t __rte_hot								\
 otx2_ssogws_deq_ ##name(void *port, struct rte_event *ev,		\
 			uint64_t timeout_ticks)				\
 {									\
@@ -99,7 +99,7 @@ otx2_ssogws_deq_ ##name(void *port, struct rte_event *ev,		\
 	return otx2_ssogws_get_work(ws, ev, flags, ws->lookup_mem);	\
 }									\
 									\
-uint16_t __hot								\
+uint16_t __rte_hot								\
 otx2_ssogws_deq_burst_ ##name(void *port, struct rte_event ev[],	\
 			      uint16_t nb_events,			\
 			      uint64_t timeout_ticks)			\
@@ -109,7 +109,7 @@ otx2_ssogws_deq_burst_ ##name(void *port, struct rte_event ev[],	\
 	return otx2_ssogws_deq_ ##name(port, ev, timeout_ticks);	\
 }									\
 									\
-uint16_t __hot								\
+uint16_t __rte_hot								\
 otx2_ssogws_deq_timeout_ ##name(void *port, struct rte_event *ev,	\
 				uint64_t timeout_ticks)			\
 {									\
@@ -131,7 +131,7 @@ otx2_ssogws_deq_timeout_ ##name(void *port, struct rte_event *ev,	\
 	return ret;							\
 }									\
 									\
-uint16_t __hot								\
+uint16_t __rte_hot								\
 otx2_ssogws_deq_timeout_burst_ ##name(void *port, struct rte_event ev[],\
 				      uint16_t nb_events,		\
 				      uint64_t timeout_ticks)		\
@@ -141,7 +141,7 @@ otx2_ssogws_deq_timeout_burst_ ##name(void *port, struct rte_event ev[],\
 	return otx2_ssogws_deq_timeout_ ##name(port, ev, timeout_ticks);\
 }									\
 									\
-uint16_t __hot								\
+uint16_t __rte_hot								\
 otx2_ssogws_deq_seg_ ##name(void *port, struct rte_event *ev,		\
 			    uint64_t timeout_ticks)			\
 {									\
@@ -159,7 +159,7 @@ otx2_ssogws_deq_seg_ ##name(void *port, struct rte_event *ev,		\
 				    ws->lookup_mem);			\
 }									\
 									\
-uint16_t __hot								\
+uint16_t __rte_hot								\
 otx2_ssogws_deq_seg_burst_ ##name(void *port, struct rte_event ev[],	\
 				  uint16_t nb_events,			\
 				  uint64_t timeout_ticks)		\
@@ -169,7 +169,7 @@ otx2_ssogws_deq_seg_burst_ ##name(void *port, struct rte_event ev[],	\
 	return otx2_ssogws_deq_seg_ ##name(port, ev, timeout_ticks);	\
 }									\
 									\
-uint16_t __hot								\
+uint16_t __rte_hot								\
 otx2_ssogws_deq_seg_timeout_ ##name(void *port, struct rte_event *ev,	\
 				    uint64_t timeout_ticks)		\
 {									\
@@ -193,7 +193,7 @@ otx2_ssogws_deq_seg_timeout_ ##name(void *port, struct rte_event *ev,	\
 	return ret;							\
 }									\
 									\
-uint16_t __hot								\
+uint16_t __rte_hot								\
 otx2_ssogws_deq_seg_timeout_burst_ ##name(void *port,			\
 					  struct rte_event ev[],	\
 					  uint16_t nb_events,		\
@@ -208,7 +208,7 @@ otx2_ssogws_deq_seg_timeout_burst_ ##name(void *port,			\
 SSO_RX_ADPTR_ENQ_FASTPATH_FUNC
 #undef R
 
-uint16_t __hot
+uint16_t __rte_hot
 otx2_ssogws_enq(void *port, const struct rte_event *ev)
 {
 	struct otx2_ssogws *ws = port;
@@ -230,7 +230,7 @@ otx2_ssogws_enq(void *port, const struct rte_event *ev)
 	return 1;
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 otx2_ssogws_enq_burst(void *port, const struct rte_event ev[],
 		      uint16_t nb_events)
 {
@@ -238,7 +238,7 @@ otx2_ssogws_enq_burst(void *port, const struct rte_event ev[],
 	return otx2_ssogws_enq(port, ev);
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 otx2_ssogws_enq_new_burst(void *port, const struct rte_event ev[],
 			  uint16_t nb_events)
 {
@@ -255,7 +255,7 @@ otx2_ssogws_enq_new_burst(void *port, const struct rte_event ev[],
 	return nb_events;
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 otx2_ssogws_enq_fwd_burst(void *port, const struct rte_event ev[],
 			  uint16_t nb_events)
 {
@@ -268,7 +268,7 @@ otx2_ssogws_enq_fwd_burst(void *port, const struct rte_event ev[],
 }
 
 #define T(name, f6, f5, f4, f3, f2, f1, f0, sz, flags)			\
-uint16_t __hot								\
+uint16_t __rte_hot								\
 otx2_ssogws_tx_adptr_enq_ ## name(void *port, struct rte_event ev[],	\
 				  uint16_t nb_events)			\
 {									\
@@ -282,7 +282,7 @@ SSO_TX_ADPTR_ENQ_FASTPATH_FUNC
 #undef T
 
 #define T(name, f6, f5, f4, f3, f2, f1, f0, sz, flags)			\
-uint16_t __hot								\
+uint16_t __rte_hot								\
 otx2_ssogws_tx_adptr_enq_seg_ ## name(void *port, struct rte_event ev[],\
 				      uint16_t nb_events)		\
 {									\
diff --git a/drivers/event/octeontx2/otx2_worker_dual.c b/drivers/event/octeontx2/otx2_worker_dual.c
index 3cba09caff..3d55d921be 100644
--- a/drivers/event/octeontx2/otx2_worker_dual.c
+++ b/drivers/event/octeontx2/otx2_worker_dual.c
@@ -79,7 +79,7 @@ otx2_ssogws_dual_forward_event(struct otx2_ssogws_dual *ws,
 	}
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 otx2_ssogws_dual_enq(void *port, const struct rte_event *ev)
 {
 	struct otx2_ssogws_dual *ws = port;
@@ -102,7 +102,7 @@ otx2_ssogws_dual_enq(void *port, const struct rte_event *ev)
 	return 1;
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 otx2_ssogws_dual_enq_burst(void *port, const struct rte_event ev[],
 			   uint16_t nb_events)
 {
@@ -110,7 +110,7 @@ otx2_ssogws_dual_enq_burst(void *port, const struct rte_event ev[],
 	return otx2_ssogws_dual_enq(port, ev);
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 otx2_ssogws_dual_enq_new_burst(void *port, const struct rte_event ev[],
 			       uint16_t nb_events)
 {
@@ -127,7 +127,7 @@ otx2_ssogws_dual_enq_new_burst(void *port, const struct rte_event ev[],
 	return nb_events;
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 otx2_ssogws_dual_enq_fwd_burst(void *port, const struct rte_event ev[],
 			       uint16_t nb_events)
 {
@@ -141,7 +141,7 @@ otx2_ssogws_dual_enq_fwd_burst(void *port, const struct rte_event ev[],
 }
 
 #define R(name, f6, f5, f4, f3, f2, f1, f0, flags)			\
-uint16_t __hot								\
+uint16_t __rte_hot								\
 otx2_ssogws_dual_deq_ ##name(void *port, struct rte_event *ev,		\
 			     uint64_t timeout_ticks)			\
 {									\
@@ -166,7 +166,7 @@ otx2_ssogws_dual_deq_ ##name(void *port, struct rte_event *ev,		\
 	return gw;							\
 }									\
 									\
-uint16_t __hot								\
+uint16_t __rte_hot								\
 otx2_ssogws_dual_deq_burst_ ##name(void *port, struct rte_event ev[],	\
 				   uint16_t nb_events,			\
 				   uint64_t timeout_ticks)		\
@@ -176,7 +176,7 @@ otx2_ssogws_dual_deq_burst_ ##name(void *port, struct rte_event ev[],	\
 	return otx2_ssogws_dual_deq_ ##name(port, ev, timeout_ticks);	\
 }									\
 									\
-uint16_t __hot								\
+uint16_t __rte_hot								\
 otx2_ssogws_dual_deq_timeout_ ##name(void *port, struct rte_event *ev,	\
 				     uint64_t timeout_ticks)		\
 {									\
@@ -208,7 +208,7 @@ otx2_ssogws_dual_deq_timeout_ ##name(void *port, struct rte_event *ev,	\
 	return gw;							\
 }									\
 									\
-uint16_t __hot								\
+uint16_t __rte_hot								\
 otx2_ssogws_dual_deq_timeout_burst_ ##name(void *port,			\
 					   struct rte_event ev[],	\
 					   uint16_t nb_events,		\
@@ -220,7 +220,7 @@ otx2_ssogws_dual_deq_timeout_burst_ ##name(void *port,			\
 						    timeout_ticks);	\
 }									\
 									\
-uint16_t __hot								\
+uint16_t __rte_hot								\
 otx2_ssogws_dual_deq_seg_ ##name(void *port, struct rte_event *ev,	\
 				 uint64_t timeout_ticks)		\
 {									\
@@ -245,7 +245,7 @@ otx2_ssogws_dual_deq_seg_ ##name(void *port, struct rte_event *ev,	\
 	return gw;							\
 }									\
 									\
-uint16_t __hot								\
+uint16_t __rte_hot								\
 otx2_ssogws_dual_deq_seg_burst_ ##name(void *port,			\
 				       struct rte_event ev[],		\
 				       uint16_t nb_events,		\
@@ -257,7 +257,7 @@ otx2_ssogws_dual_deq_seg_burst_ ##name(void *port,			\
 						timeout_ticks);		\
 }									\
 									\
-uint16_t __hot								\
+uint16_t __rte_hot								\
 otx2_ssogws_dual_deq_seg_timeout_ ##name(void *port,			\
 					 struct rte_event *ev,		\
 					 uint64_t timeout_ticks)	\
@@ -292,7 +292,7 @@ otx2_ssogws_dual_deq_seg_timeout_ ##name(void *port,			\
 	return gw;							\
 }									\
 									\
-uint16_t __hot								\
+uint16_t __rte_hot								\
 otx2_ssogws_dual_deq_seg_timeout_burst_ ##name(void *port,		\
 					       struct rte_event ev[],	\
 					       uint16_t nb_events,	\
@@ -308,7 +308,7 @@ SSO_RX_ADPTR_ENQ_FASTPATH_FUNC
 #undef R
 
 #define T(name, f6, f5, f4, f3, f2, f1, f0, sz, flags)			\
-uint16_t __hot								\
+uint16_t __rte_hot								\
 otx2_ssogws_dual_tx_adptr_enq_ ## name(void *port,			\
 				       struct rte_event ev[],		\
 				       uint16_t nb_events)		\
@@ -325,7 +325,7 @@ SSO_TX_ADPTR_ENQ_FASTPATH_FUNC
 #undef T
 
 #define T(name, f6, f5, f4, f3, f2, f1, f0, sz, flags)			\
-uint16_t __hot								\
+uint16_t __rte_hot								\
 otx2_ssogws_dual_tx_adptr_enq_seg_ ## name(void *port,			\
 					   struct rte_event ev[],	\
 					   uint16_t nb_events)		\
diff --git a/drivers/mempool/octeontx2/otx2_mempool_ops.c b/drivers/mempool/octeontx2/otx2_mempool_ops.c
index ea4b1c45d2..5f7814df8b 100644
--- a/drivers/mempool/octeontx2/otx2_mempool_ops.c
+++ b/drivers/mempool/octeontx2/otx2_mempool_ops.c
@@ -7,7 +7,7 @@
 
 #include "otx2_mempool.h"
 
-static int __hot
+static int __rte_hot
 otx2_npa_enq(struct rte_mempool *mp, void * const *obj_table, unsigned int n)
 {
 	unsigned int index; const uint64_t aura_handle = mp->pool_id;
@@ -281,7 +281,7 @@ otx2_npa_clear_alloc(struct rte_mempool *mp, void **obj_table, unsigned int n)
 	}
 }
 
-static __rte_noinline int __hot
+static __rte_noinline int __rte_hot
 otx2_npa_deq_arm64(struct rte_mempool *mp, void **obj_table, unsigned int n)
 {
 	const int64_t wdata = npa_lf_aura_handle_to_aura(mp->pool_id);
@@ -308,7 +308,7 @@ otx2_npa_deq_arm64(struct rte_mempool *mp, void **obj_table, unsigned int n)
 
 #else
 
-static inline int __hot
+static inline int __rte_hot
 otx2_npa_deq(struct rte_mempool *mp, void **obj_table, unsigned int n)
 {
 	const int64_t wdata = npa_lf_aura_handle_to_aura(mp->pool_id);
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index 4159096155..703f0549ad 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -25,7 +25,7 @@
 #include "dpaa2_ethdev.h"
 #include "base/dpaa2_hw_dpni_annot.h"
 
-static inline uint32_t __attribute__((hot))
+static inline uint32_t __rte_hot
 dpaa2_dev_rx_parse_slow(struct rte_mbuf *mbuf,
 			struct dpaa2_annot_hdr *annotation);
 
@@ -41,7 +41,7 @@ static void enable_tx_tstamp(struct qbman_fd *fd) __rte_unused;
 	DPAA2_RESET_FD_FLC(_fd);		\
 } while (0)
 
-static inline void __attribute__((hot))
+static inline void __rte_hot
 dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd)
 {
 	struct dpaa2_annot_hdr *annotation;
@@ -122,7 +122,7 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd)
 		frc, m->packet_type, m->ol_flags);
 }
 
-static inline uint32_t __attribute__((hot))
+static inline uint32_t __rte_hot
 dpaa2_dev_rx_parse_slow(struct rte_mbuf *mbuf,
 			struct dpaa2_annot_hdr *annotation)
 {
@@ -212,7 +212,7 @@ dpaa2_dev_rx_parse_slow(struct rte_mbuf *mbuf,
 	return pkt_type;
 }
 
-static inline uint32_t __attribute__((hot))
+static inline uint32_t __rte_hot
 dpaa2_dev_rx_parse(struct rte_mbuf *mbuf, void *hw_annot_addr)
 {
 	struct dpaa2_annot_hdr *annotation =
@@ -259,7 +259,7 @@ dpaa2_dev_rx_parse(struct rte_mbuf *mbuf, void *hw_annot_addr)
 	return dpaa2_dev_rx_parse_slow(mbuf, annotation);
 }
 
-static inline struct rte_mbuf *__attribute__((hot))
+static inline struct rte_mbuf *__rte_hot
 eth_sg_fd_to_mbuf(const struct qbman_fd *fd,
 		  int port_id)
 {
@@ -320,7 +320,7 @@ eth_sg_fd_to_mbuf(const struct qbman_fd *fd,
 	return (void *)first_seg;
 }
 
-static inline struct rte_mbuf *__attribute__((hot))
+static inline struct rte_mbuf *__rte_hot
 eth_fd_to_mbuf(const struct qbman_fd *fd,
 	       int port_id)
 {
@@ -363,7 +363,7 @@ eth_fd_to_mbuf(const struct qbman_fd *fd,
 	return mbuf;
 }
 
-static int __rte_noinline __attribute__((hot))
+static int __rte_noinline __rte_hot
 eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
 		  struct qbman_fd *fd, uint16_t bpid)
 {
@@ -434,7 +434,7 @@ static void
 eth_mbuf_to_fd(struct rte_mbuf *mbuf,
 	       struct qbman_fd *fd, uint16_t bpid) __rte_unused;
 
-static void __rte_noinline __attribute__((hot))
+static void __rte_noinline __rte_hot
 eth_mbuf_to_fd(struct rte_mbuf *mbuf,
 	       struct qbman_fd *fd, uint16_t bpid)
 {
@@ -463,7 +463,7 @@ eth_mbuf_to_fd(struct rte_mbuf *mbuf,
 	}
 }
 
-static inline int __attribute__((hot))
+static inline int __rte_hot
 eth_copy_mbuf_to_fd(struct rte_mbuf *mbuf,
 		    struct qbman_fd *fd, uint16_t bpid)
 {
@@ -664,7 +664,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	return num_rx;
 }
 
-void __attribute__((hot))
+void __rte_hot
 dpaa2_dev_process_parallel_event(struct qbman_swp *swp,
 				 const struct qbman_fd *fd,
 				 const struct qbman_result *dq,
@@ -687,7 +687,7 @@ dpaa2_dev_process_parallel_event(struct qbman_swp *swp,
 	qbman_swp_dqrr_consume(swp, dq);
 }
 
-void __attribute__((hot))
+void __rte_hot
 dpaa2_dev_process_atomic_event(struct qbman_swp *swp __rte_unused,
 			       const struct qbman_fd *fd,
 			       const struct qbman_result *dq,
@@ -716,7 +716,7 @@ dpaa2_dev_process_atomic_event(struct qbman_swp *swp __rte_unused,
 	DPAA2_PER_LCORE_DQRR_MBUF(dqrr_index) = ev->mbuf;
 }
 
-void __attribute__((hot))
+void __rte_hot
 dpaa2_dev_process_ordered_event(struct qbman_swp *swp,
 				const struct qbman_fd *fd,
 				const struct qbman_result *dq,
diff --git a/drivers/net/enetc/enetc_rxtx.c b/drivers/net/enetc/enetc_rxtx.c
index 81b0ef3b14..e8f0cd8cc8 100644
--- a/drivers/net/enetc/enetc_rxtx.c
+++ b/drivers/net/enetc/enetc_rxtx.c
@@ -201,7 +201,7 @@ static inline void enetc_slow_parsing(struct rte_mbuf *m,
 }
 
 
-static inline void __attribute__((hot))
+static inline void __rte_hot
 enetc_dev_rx_parse(struct rte_mbuf *m, uint16_t parse_results)
 {
 	ENETC_PMD_DP_DEBUG("parse summary = 0x%x   ", parse_results);
diff --git a/drivers/net/octeontx/octeontx_rxtx.c b/drivers/net/octeontx/octeontx_rxtx.c
index 1e201f3228..4a65b340b0 100644
--- a/drivers/net/octeontx/octeontx_rxtx.c
+++ b/drivers/net/octeontx/octeontx_rxtx.c
@@ -19,7 +19,7 @@
 #include "octeontx_rxtx.h"
 #include "octeontx_logs.h"
 
-uint16_t __hot
+uint16_t __rte_hot
 octeontx_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 {
 	int count;
@@ -43,7 +43,7 @@ octeontx_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 	return count; /* return number of pkts transmitted */
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 octeontx_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 {
 	struct octeontx_rxq *rxq;
diff --git a/drivers/net/octeontx/octeontx_rxtx.h b/drivers/net/octeontx/octeontx_rxtx.h
index d0d73b3046..062c991506 100644
--- a/drivers/net/octeontx/octeontx_rxtx.h
+++ b/drivers/net/octeontx/octeontx_rxtx.h
@@ -7,10 +7,6 @@
 
 #include <rte_ethdev_driver.h>
 
-#ifndef __hot
-#define __hot	__attribute__((hot))
-#endif
-
 /* Packet type table */
 #define PTYPE_SIZE	OCCTX_PKI_LTYPE_LAST
 
diff --git a/drivers/net/octeontx2/otx2_rx.c b/drivers/net/octeontx2/otx2_rx.c
index 47641c7572..ac40704b6e 100644
--- a/drivers/net/octeontx2/otx2_rx.c
+++ b/drivers/net/octeontx2/otx2_rx.c
@@ -331,14 +331,14 @@ nix_recv_pkts_vector(void *rx_queue, struct rte_mbuf **rx_pkts,
 #endif
 
 #define R(name, f6, f5, f4, f3, f2, f1, f0, flags)			       \
-static uint16_t __rte_noinline	__hot					       \
+static uint16_t __rte_noinline	__rte_hot					       \
 otx2_nix_recv_pkts_ ## name(void *rx_queue,				       \
 			struct rte_mbuf **rx_pkts, uint16_t pkts)	       \
 {									       \
 	return nix_recv_pkts(rx_queue, rx_pkts, pkts, (flags));		       \
 }									       \
 									       \
-static uint16_t __rte_noinline	__hot					       \
+static uint16_t __rte_noinline	__rte_hot					       \
 otx2_nix_recv_pkts_mseg_ ## name(void *rx_queue,			       \
 			struct rte_mbuf **rx_pkts, uint16_t pkts)	       \
 {									       \
@@ -346,7 +346,7 @@ otx2_nix_recv_pkts_mseg_ ## name(void *rx_queue,			       \
 			     (flags) | NIX_RX_MULTI_SEG_F);		       \
 }									       \
 									       \
-static uint16_t __rte_noinline	__hot					       \
+static uint16_t __rte_noinline	__rte_hot					       \
 otx2_nix_recv_pkts_vec_ ## name(void *rx_queue,				       \
 			struct rte_mbuf **rx_pkts, uint16_t pkts)	       \
 {									       \
diff --git a/drivers/net/octeontx2/otx2_tx.c b/drivers/net/octeontx2/otx2_tx.c
index 4f2036cb45..1af6fa649a 100644
--- a/drivers/net/octeontx2/otx2_tx.c
+++ b/drivers/net/octeontx2/otx2_tx.c
@@ -947,7 +947,7 @@ nix_xmit_pkts_vector(void *tx_queue, struct rte_mbuf **tx_pkts,
 #endif
 
 #define T(name, f6, f5, f4, f3, f2, f1, f0, sz, flags)			\
-static uint16_t __rte_noinline	__hot					\
+static uint16_t __rte_noinline	__rte_hot					\
 otx2_nix_xmit_pkts_ ## name(void *tx_queue,				\
 			struct rte_mbuf **tx_pkts, uint16_t pkts)	\
 {									\
@@ -964,7 +964,7 @@ NIX_TX_FASTPATH_MODES
 #undef T
 
 #define T(name, f6, f5, f4, f3, f2, f1, f0, sz, flags)			\
-static uint16_t __rte_noinline	__hot					\
+static uint16_t __rte_noinline	__rte_hot					\
 otx2_nix_xmit_pkts_mseg_ ## name(void *tx_queue,			\
 			struct rte_mbuf **tx_pkts, uint16_t pkts)	\
 {									\
@@ -982,7 +982,7 @@ NIX_TX_FASTPATH_MODES
 #undef T
 
 #define T(name, f6, f5, f4, f3, f2, f1, f0, sz, flags)			\
-static uint16_t __rte_noinline	__hot					\
+static uint16_t __rte_noinline	__rte_hot					\
 otx2_nix_xmit_pkts_vec_ ## name(void *tx_queue,				\
 			struct rte_mbuf **tx_pkts, uint16_t pkts)	\
 {									\
diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf_rxtx.c
index 90a6098675..d0ea95f1d1 100644
--- a/drivers/net/thunderx/nicvf_rxtx.c
+++ b/drivers/net/thunderx/nicvf_rxtx.c
@@ -25,7 +25,7 @@
 #include "nicvf_rxtx.h"
 #include "nicvf_logs.h"
 
-static inline void __hot
+static inline void __rte_hot
 fill_sq_desc_header(union sq_entry_t *entry, struct rte_mbuf *pkt)
 {
 	/* Local variable sqe to avoid read from sq desc memory*/
@@ -61,7 +61,7 @@ fill_sq_desc_header(union sq_entry_t *entry, struct rte_mbuf *pkt)
 	entry->buff[0] = sqe.buff[0];
 }
 
-static inline void __hot
+static inline void __rte_hot
 fill_sq_desc_header_zero_w1(union sq_entry_t *entry,
 				struct rte_mbuf *pkt)
 {
@@ -69,7 +69,7 @@ fill_sq_desc_header_zero_w1(union sq_entry_t *entry,
 	entry->buff[1] = 0ULL;
 }
 
-void __hot
+void __rte_hot
 nicvf_single_pool_free_xmited_buffers(struct nicvf_txq *sq)
 {
 	int j = 0;
@@ -92,7 +92,7 @@ nicvf_single_pool_free_xmited_buffers(struct nicvf_txq *sq)
 	NICVF_TX_ASSERT(sq->xmit_bufs >= 0);
 }
 
-void __hot
+void __rte_hot
 nicvf_multi_pool_free_xmited_buffers(struct nicvf_txq *sq)
 {
 	uint32_t n = 0;
@@ -115,7 +115,7 @@ nicvf_multi_pool_free_xmited_buffers(struct nicvf_txq *sq)
 	NICVF_TX_ASSERT(sq->xmit_bufs >= 0);
 }
 
-static inline uint32_t __hot
+static inline uint32_t __rte_hot
 nicvf_free_tx_desc(struct nicvf_txq *sq)
 {
 	return ((sq->head - sq->tail - 1) & sq->qlen_mask);
@@ -124,7 +124,7 @@ nicvf_free_tx_desc(struct nicvf_txq *sq)
 /* Send Header + Packet */
 #define TX_DESC_PER_PKT 2
 
-static inline uint32_t __hot
+static inline uint32_t __rte_hot
 nicvf_free_xmitted_buffers(struct nicvf_txq *sq, struct rte_mbuf **tx_pkts,
 			    uint16_t nb_pkts)
 {
@@ -142,7 +142,7 @@ nicvf_free_xmitted_buffers(struct nicvf_txq *sq, struct rte_mbuf **tx_pkts,
 	return free_desc;
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 nicvf_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 {
 	int i;
@@ -181,7 +181,7 @@ nicvf_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 	return i;
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 nicvf_xmit_pkts_multiseg(void *tx_queue, struct rte_mbuf **tx_pkts,
 			 uint16_t nb_pkts)
 {
@@ -333,13 +333,13 @@ static const uint32_t ptype_table[16][16] __rte_cache_aligned = {
 	[L3_OTHER][L4_NVGRE] = RTE_PTYPE_TUNNEL_NVGRE,
 };
 
-static inline uint32_t __hot
+static inline uint32_t __rte_hot
 nicvf_rx_classify_pkt(cqe_rx_word0_t cqe_rx_w0)
 {
 	return ptype_table[cqe_rx_w0.l3_type][cqe_rx_w0.l4_type];
 }
 
-static inline uint64_t __hot
+static inline uint64_t __rte_hot
 nicvf_set_olflags(const cqe_rx_word0_t cqe_rx_w0)
 {
 	static const uint64_t flag_table[3] __rte_cache_aligned = {
@@ -353,7 +353,7 @@ nicvf_set_olflags(const cqe_rx_word0_t cqe_rx_w0)
 	return flag_table[idx];
 }
 
-static inline int __hot
+static inline int __rte_hot
 nicvf_fill_rbdr(struct nicvf_rxq *rxq, int to_fill)
 {
 	int i;
@@ -392,7 +392,7 @@ nicvf_fill_rbdr(struct nicvf_rxq *rxq, int to_fill)
 	return to_fill;
 }
 
-static inline int32_t __hot
+static inline int32_t __rte_hot
 nicvf_rx_pkts_to_process(struct nicvf_rxq *rxq, uint16_t nb_pkts,
 			 int32_t available_space)
 {
@@ -403,7 +403,7 @@ nicvf_rx_pkts_to_process(struct nicvf_rxq *rxq, uint16_t nb_pkts,
 	return RTE_MIN(nb_pkts, available_space);
 }
 
-static inline void __hot
+static inline void __rte_hot
 nicvf_rx_offload(cqe_rx_word0_t cqe_rx_w0, cqe_rx_word2_t cqe_rx_w2,
 		 struct rte_mbuf *pkt)
 {
@@ -484,7 +484,7 @@ nicvf_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts,
 	return to_process;
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 nicvf_recv_pkts_no_offload(void *rx_queue, struct rte_mbuf **rx_pkts,
 		uint16_t nb_pkts)
 {
@@ -492,7 +492,7 @@ nicvf_recv_pkts_no_offload(void *rx_queue, struct rte_mbuf **rx_pkts,
 			NICVF_RX_OFFLOAD_NONE);
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 nicvf_recv_pkts_cksum(void *rx_queue, struct rte_mbuf **rx_pkts,
 		uint16_t nb_pkts)
 {
@@ -500,7 +500,7 @@ nicvf_recv_pkts_cksum(void *rx_queue, struct rte_mbuf **rx_pkts,
 			NICVF_RX_OFFLOAD_CKSUM);
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 nicvf_recv_pkts_vlan_strip(void *rx_queue, struct rte_mbuf **rx_pkts,
 		uint16_t nb_pkts)
 {
@@ -508,7 +508,7 @@ nicvf_recv_pkts_vlan_strip(void *rx_queue, struct rte_mbuf **rx_pkts,
 			NICVF_RX_OFFLOAD_NONE | NICVF_RX_OFFLOAD_VLAN_STRIP);
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 nicvf_recv_pkts_cksum_vlan_strip(void *rx_queue, struct rte_mbuf **rx_pkts,
 		uint16_t nb_pkts)
 {
@@ -516,7 +516,7 @@ nicvf_recv_pkts_cksum_vlan_strip(void *rx_queue, struct rte_mbuf **rx_pkts,
 			NICVF_RX_OFFLOAD_CKSUM | NICVF_RX_OFFLOAD_VLAN_STRIP);
 }
 
-static __rte_always_inline uint16_t __hot
+static __rte_always_inline uint16_t __rte_hot
 nicvf_process_cq_mseg_entry(struct cqe_rx_t *cqe_rx,
 			uint64_t mbuf_phys_off,
 			struct rte_mbuf **rx_pkt, uint8_t rbptr_offset,
@@ -572,7 +572,7 @@ nicvf_process_cq_mseg_entry(struct cqe_rx_t *cqe_rx,
 	return nb_segs;
 }
 
-static __rte_always_inline uint16_t __hot
+static __rte_always_inline uint16_t __rte_hot
 nicvf_recv_pkts_multiseg(void *rx_queue, struct rte_mbuf **rx_pkts,
 			 uint16_t nb_pkts, const uint32_t flag)
 {
@@ -616,7 +616,7 @@ nicvf_recv_pkts_multiseg(void *rx_queue, struct rte_mbuf **rx_pkts,
 	return to_process;
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 nicvf_recv_pkts_multiseg_no_offload(void *rx_queue, struct rte_mbuf **rx_pkts,
 		uint16_t nb_pkts)
 {
@@ -624,7 +624,7 @@ nicvf_recv_pkts_multiseg_no_offload(void *rx_queue, struct rte_mbuf **rx_pkts,
 			NICVF_RX_OFFLOAD_NONE);
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 nicvf_recv_pkts_multiseg_cksum(void *rx_queue, struct rte_mbuf **rx_pkts,
 		uint16_t nb_pkts)
 {
@@ -632,7 +632,7 @@ nicvf_recv_pkts_multiseg_cksum(void *rx_queue, struct rte_mbuf **rx_pkts,
 			NICVF_RX_OFFLOAD_CKSUM);
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 nicvf_recv_pkts_multiseg_vlan_strip(void *rx_queue, struct rte_mbuf **rx_pkts,
 		uint16_t nb_pkts)
 {
@@ -640,7 +640,7 @@ nicvf_recv_pkts_multiseg_vlan_strip(void *rx_queue, struct rte_mbuf **rx_pkts,
 			NICVF_RX_OFFLOAD_NONE | NICVF_RX_OFFLOAD_VLAN_STRIP);
 }
 
-uint16_t __hot
+uint16_t __rte_hot
 nicvf_recv_pkts_multiseg_cksum_vlan_strip(void *rx_queue,
 		struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 {
diff --git a/drivers/net/thunderx/nicvf_rxtx.h b/drivers/net/thunderx/nicvf_rxtx.h
index a39808cb6b..1f274b2954 100644
--- a/drivers/net/thunderx/nicvf_rxtx.h
+++ b/drivers/net/thunderx/nicvf_rxtx.h
@@ -14,10 +14,6 @@
 
 #define NICVF_TX_OFFLOAD_MASK (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK)
 
-#ifndef __hot
-#define __hot	__attribute__((hot))
-#endif
-
 #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
 static inline uint16_t __attribute__((const))
 nicvf_frag_num(uint16_t i)
@@ -25,7 +21,7 @@ nicvf_frag_num(uint16_t i)
 	return (i & ~3) + 3 - (i & 3);
 }
 
-static inline void __hot
+static inline void __rte_hot
 fill_sq_desc_gather(union sq_entry_t *entry, struct rte_mbuf *pkt)
 {
 	/* Local variable sqe to avoid read from sq desc memory*/
@@ -50,7 +46,7 @@ nicvf_frag_num(uint16_t i)
 	return i;
 }
 
-static inline void __hot
+static inline void __rte_hot
 fill_sq_desc_gather(union sq_entry_t *entry, struct rte_mbuf *pkt)
 {
 	entry->buff[0] = (uint64_t)SQ_DESC_TYPE_GATHER << 60 |
diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index 1bd627fa9e..ea526d408b 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -162,6 +162,11 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)
  */
 #define __rte_noinline __attribute__((noinline))
 
+/**
+ * Hint function in the hot path
+ */
+#define __rte_hot __attribute__((hot))
+
 /*********** Macros for pointer arithmetic ********/
 
 /**
-- 
2.25.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-dev] [PATCH 20.05 12/15] replace cold attributes
  2020-02-10 16:20 [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon
                   ` (10 preceding siblings ...)
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 11/15] replace hot attributes Thomas Monjalon
@ 2020-02-10 16:20 ` Thomas Monjalon
  2020-02-10 19:14   ` David Christensen
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 13/15] replace no-return attributes Thomas Monjalon
                   ` (3 subsequent siblings)
  15 siblings, 1 reply; 20+ messages in thread
From: Thomas Monjalon @ 2020-02-10 16:20 UTC (permalink / raw)
  To: dev
  Cc: Ajit Khaparde, Somnath Kotur, Qi Zhang, Xiao Wang, Beilei Xing,
	David Christensen, Jerin Jacob, Gavin Hu, Jingjing Wu,
	Wenzhuo Lu, Qiming Yang, Alfredo Cardigliano, Konstantin Ananyev,
	Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko,
	Maxime Coquelin, Tiwei Bie, Zhihong Wang

The new macro __rte_cold, for compiler hinting,
is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/net/bnxt/bnxt_rxtx_vec_sse.c       |  2 +-
 drivers/net/fm10k/fm10k_ethdev.c           |  4 +-
 drivers/net/fm10k/fm10k_rxtx_vec.c         | 12 ++---
 drivers/net/i40e/i40e_rxtx.c               | 10 ++--
 drivers/net/i40e/i40e_rxtx_vec_altivec.c   |  8 +--
 drivers/net/i40e/i40e_rxtx_vec_neon.c      |  8 +--
 drivers/net/i40e/i40e_rxtx_vec_sse.c       |  8 +--
 drivers/net/iavf/iavf_rxtx_vec_sse.c       | 12 ++---
 drivers/net/ice/ice_rxtx.c                 |  8 +--
 drivers/net/ice/ice_rxtx_vec_sse.c         |  8 +--
 drivers/net/ionic/ionic_rxtx.c             | 24 ++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c             | 58 +++++++++++-----------
 drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c    | 14 +++---
 drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c     | 14 +++---
 drivers/net/mlx5/mlx5_rxtx_vec.c           |  4 +-
 drivers/net/virtio/virtio_rxtx_simple.c    |  2 +-
 lib/librte_eal/common/include/rte_common.h |  5 ++
 lib/librte_eal/common/include/rte_debug.h  |  2 +-
 lib/librte_eal/common/include/rte_log.h    |  2 +-
 19 files changed, 105 insertions(+), 100 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
index 31457300a7..d0e7910e77 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
@@ -490,7 +490,7 @@ bnxt_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
 	return nb_sent;
 }
 
-int __attribute__((cold))
+int __rte_cold
 bnxt_rxq_vec_setup(struct bnxt_rx_queue *rxq)
 {
 	uintptr_t p;
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 581c690b18..f537ab2862 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -2958,7 +2958,7 @@ fm10k_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
 	return nb_tx;
 }
 
-static void __attribute__((cold))
+static void __rte_cold
 fm10k_set_tx_function(struct rte_eth_dev *dev)
 {
 	struct fm10k_tx_queue *txq;
@@ -3007,7 +3007,7 @@ fm10k_set_tx_function(struct rte_eth_dev *dev)
 	}
 }
 
-static void __attribute__((cold))
+static void __rte_cold
 fm10k_set_rx_function(struct rte_eth_dev *dev)
 {
 	struct fm10k_dev_info *dev_info =
diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c b/drivers/net/fm10k/fm10k_rxtx_vec.c
index d76dfd16fd..eff3933b5c 100644
--- a/drivers/net/fm10k/fm10k_rxtx_vec.c
+++ b/drivers/net/fm10k/fm10k_rxtx_vec.c
@@ -203,7 +203,7 @@ fm10k_desc_to_pktype_v(__m128i descs[4], struct rte_mbuf **rx_pkts)
 #define fm10k_desc_to_pktype_v(desc, rx_pkts) do {} while (0)
 #endif
 
-int __attribute__((cold))
+int __rte_cold
 fm10k_rx_vec_condition_check(struct rte_eth_dev *dev)
 {
 #ifndef RTE_LIBRTE_IEEE1588
@@ -231,7 +231,7 @@ fm10k_rx_vec_condition_check(struct rte_eth_dev *dev)
 #endif
 }
 
-int __attribute__((cold))
+int __rte_cold
 fm10k_rxq_vec_setup(struct fm10k_rx_queue *rxq)
 {
 	uintptr_t p;
@@ -349,7 +349,7 @@ fm10k_rxq_rearm(struct fm10k_rx_queue *rxq)
 	FM10K_PCI_REG_WRITE(rxq->tail_ptr, rx_id);
 }
 
-void __attribute__((cold))
+void __rte_cold
 fm10k_rx_queue_release_mbufs_vec(struct fm10k_rx_queue *rxq)
 {
 	const unsigned mask = rxq->nb_desc - 1;
@@ -695,13 +695,13 @@ static const struct fm10k_txq_ops vec_txq_ops = {
 	.reset = fm10k_reset_tx_queue,
 };
 
-void __attribute__((cold))
+void __rte_cold
 fm10k_txq_vec_setup(struct fm10k_tx_queue *txq)
 {
 	txq->ops = &vec_txq_ops;
 }
 
-int __attribute__((cold))
+int __rte_cold
 fm10k_tx_vec_condition_check(struct fm10k_tx_queue *txq)
 {
 	/* Vector TX can't offload any features yet */
@@ -864,7 +864,7 @@ fm10k_xmit_fixed_burst_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
 	return nb_pkts;
 }
 
-static void __attribute__((cold))
+static void __rte_cold
 fm10k_reset_tx_queue(struct fm10k_tx_queue *txq)
 {
 	static const struct fm10k_tx_desc zeroed_desc = {0};
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index fd1ae80da8..b85758e079 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -3093,7 +3093,7 @@ i40e_get_recommend_rx_vec(bool scatter)
 			 i40e_recv_pkts_vec;
 }
 
-void __attribute__((cold))
+void __rte_cold
 i40e_set_rx_function(struct rte_eth_dev *dev)
 {
 	struct i40e_adapter *ad =
@@ -3208,7 +3208,7 @@ i40e_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
 	return ret;
 }
 
-void __attribute__((cold))
+void __rte_cold
 i40e_set_tx_function_flag(struct rte_eth_dev *dev, struct i40e_tx_queue *txq)
 {
 	struct i40e_adapter *ad =
@@ -3259,7 +3259,7 @@ i40e_get_recommend_tx_vec(void)
 	return i40e_xmit_pkts_vec;
 }
 
-void __attribute__((cold))
+void __rte_cold
 i40e_set_tx_function(struct rte_eth_dev *dev)
 {
 	struct i40e_adapter *ad =
@@ -3337,7 +3337,7 @@ i40e_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
 	return ret;
 }
 
-void __attribute__((cold))
+void __rte_cold
 i40e_set_default_ptype_table(struct rte_eth_dev *dev)
 {
 	struct i40e_adapter *ad =
@@ -3348,7 +3348,7 @@ i40e_set_default_ptype_table(struct rte_eth_dev *dev)
 		ad->ptype_tbl[i] = i40e_get_default_pkt_type(i);
 }
 
-void __attribute__((cold))
+void __rte_cold
 i40e_set_default_pctype_table(struct rte_eth_dev *dev)
 {
 	struct i40e_adapter *ad =
diff --git a/drivers/net/i40e/i40e_rxtx_vec_altivec.c b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
index 310ce1ee2d..5fa92bf924 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_altivec.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
@@ -591,25 +591,25 @@ i40e_xmit_fixed_burst_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
 	return nb_pkts;
 }
 
-void __attribute__((cold))
+void __rte_cold
 i40e_rx_queue_release_mbufs_vec(struct i40e_rx_queue *rxq)
 {
 	_i40e_rx_queue_release_mbufs_vec(rxq);
 }
 
-int __attribute__((cold))
+int __rte_cold
 i40e_rxq_vec_setup(struct i40e_rx_queue *rxq)
 {
 	return i40e_rxq_vec_setup_default(rxq);
 }
 
-int __attribute__((cold))
+int __rte_cold
 i40e_txq_vec_setup(struct i40e_tx_queue __rte_unused * txq)
 {
 	return 0;
 }
 
-int __attribute__((cold))
+int __rte_cold
 i40e_rx_vec_dev_conf_condition_check(struct rte_eth_dev *dev)
 {
 	return i40e_rx_vec_dev_conf_condition_check_default(dev);
diff --git a/drivers/net/i40e/i40e_rxtx_vec_neon.c b/drivers/net/i40e/i40e_rxtx_vec_neon.c
index deb185fe2f..d7d6decafd 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_neon.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_neon.c
@@ -569,25 +569,25 @@ i40e_xmit_fixed_burst_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
 	return nb_pkts;
 }
 
-void __attribute__((cold))
+void __rte_cold
 i40e_rx_queue_release_mbufs_vec(struct i40e_rx_queue *rxq)
 {
 	_i40e_rx_queue_release_mbufs_vec(rxq);
 }
 
-int __attribute__((cold))
+int __rte_cold
 i40e_rxq_vec_setup(struct i40e_rx_queue *rxq)
 {
 	return i40e_rxq_vec_setup_default(rxq);
 }
 
-int __attribute__((cold))
+int __rte_cold
 i40e_txq_vec_setup(struct i40e_tx_queue __rte_unused *txq)
 {
 	return 0;
 }
 
-int __attribute__((cold))
+int __rte_cold
 i40e_rx_vec_dev_conf_condition_check(struct rte_eth_dev *dev)
 {
 	return i40e_rx_vec_dev_conf_condition_check_default(dev);
diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e_rxtx_vec_sse.c
index 6ab0bb0d32..698518349f 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
@@ -738,25 +738,25 @@ i40e_xmit_fixed_burst_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
 	return nb_pkts;
 }
 
-void __attribute__((cold))
+void __rte_cold
 i40e_rx_queue_release_mbufs_vec(struct i40e_rx_queue *rxq)
 {
 	_i40e_rx_queue_release_mbufs_vec(rxq);
 }
 
-int __attribute__((cold))
+int __rte_cold
 i40e_rxq_vec_setup(struct i40e_rx_queue *rxq)
 {
 	return i40e_rxq_vec_setup_default(rxq);
 }
 
-int __attribute__((cold))
+int __rte_cold
 i40e_txq_vec_setup(struct i40e_tx_queue __rte_unused *txq)
 {
 	return 0;
 }
 
-int __attribute__((cold))
+int __rte_cold
 i40e_rx_vec_dev_conf_condition_check(struct rte_eth_dev *dev)
 {
 	return i40e_rx_vec_dev_conf_condition_check_default(dev);
diff --git a/drivers/net/iavf/iavf_rxtx_vec_sse.c b/drivers/net/iavf/iavf_rxtx_vec_sse.c
index b978cc6e05..a08e0e497f 100644
--- a/drivers/net/iavf/iavf_rxtx_vec_sse.c
+++ b/drivers/net/iavf/iavf_rxtx_vec_sse.c
@@ -641,13 +641,13 @@ iavf_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
 	return nb_tx;
 }
 
-static void __attribute__((cold))
+static void __rte_cold
 iavf_rx_queue_release_mbufs_sse(struct iavf_rx_queue *rxq)
 {
 	_iavf_rx_queue_release_mbufs_vec(rxq);
 }
 
-static void __attribute__((cold))
+static void __rte_cold
 iavf_tx_queue_release_mbufs_sse(struct iavf_tx_queue *txq)
 {
 	_iavf_tx_queue_release_mbufs_vec(txq);
@@ -661,27 +661,27 @@ static const struct iavf_txq_ops sse_vec_txq_ops = {
 	.release_mbufs = iavf_tx_queue_release_mbufs_sse,
 };
 
-int __attribute__((cold))
+int __rte_cold
 iavf_txq_vec_setup(struct iavf_tx_queue *txq)
 {
 	txq->ops = &sse_vec_txq_ops;
 	return 0;
 }
 
-int __attribute__((cold))
+int __rte_cold
 iavf_rxq_vec_setup(struct iavf_rx_queue *rxq)
 {
 	rxq->ops = &sse_vec_rxq_ops;
 	return iavf_rxq_vec_setup_default(rxq);
 }
 
-int __attribute__((cold))
+int __rte_cold
 iavf_rx_vec_dev_check(struct rte_eth_dev *dev)
 {
 	return iavf_rx_vec_dev_check_default(dev);
 }
 
-int __attribute__((cold))
+int __rte_cold
 iavf_tx_vec_dev_check(struct rte_eth_dev *dev)
 {
 	return iavf_tx_vec_dev_check_default(dev);
diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 045680533f..56da27f996 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -2944,7 +2944,7 @@ ice_xmit_pkts_simple(void *tx_queue,
 	return nb_tx;
 }
 
-void __attribute__((cold))
+void __rte_cold
 ice_set_rx_function(struct rte_eth_dev *dev)
 {
 	PMD_INIT_FUNC_TRACE();
@@ -3054,7 +3054,7 @@ ice_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
 	return ret;
 }
 
-void __attribute__((cold))
+void __rte_cold
 ice_set_tx_function_flag(struct rte_eth_dev *dev, struct ice_tx_queue *txq)
 {
 	struct ice_adapter *ad =
@@ -3123,7 +3123,7 @@ ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 	return i;
 }
 
-void __attribute__((cold))
+void __rte_cold
 ice_set_tx_function(struct rte_eth_dev *dev)
 {
 	struct ice_adapter *ad =
@@ -3752,7 +3752,7 @@ ice_get_default_pkt_type(uint16_t ptype)
 	return type_table[ptype];
 }
 
-void __attribute__((cold))
+void __rte_cold
 ice_set_default_ptype_table(struct rte_eth_dev *dev)
 {
 	struct ice_adapter *ad =
diff --git a/drivers/net/ice/ice_rxtx_vec_sse.c b/drivers/net/ice/ice_rxtx_vec_sse.c
index 9d5f1f194f..382ef31f3a 100644
--- a/drivers/net/ice/ice_rxtx_vec_sse.c
+++ b/drivers/net/ice/ice_rxtx_vec_sse.c
@@ -609,7 +609,7 @@ ice_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
 	return nb_tx;
 }
 
-int __attribute__((cold))
+int __rte_cold
 ice_rxq_vec_setup(struct ice_rx_queue *rxq)
 {
 	if (!rxq)
@@ -619,7 +619,7 @@ ice_rxq_vec_setup(struct ice_rx_queue *rxq)
 	return ice_rxq_vec_setup_default(rxq);
 }
 
-int __attribute__((cold))
+int __rte_cold
 ice_txq_vec_setup(struct ice_tx_queue __rte_unused *txq)
 {
 	if (!txq)
@@ -629,13 +629,13 @@ ice_txq_vec_setup(struct ice_tx_queue __rte_unused *txq)
 	return 0;
 }
 
-int __attribute__((cold))
+int __rte_cold
 ice_rx_vec_dev_check(struct rte_eth_dev *dev)
 {
 	return ice_rx_vec_dev_check_default(dev);
 }
 
-int __attribute__((cold))
+int __rte_cold
 ice_tx_vec_dev_check(struct rte_eth_dev *dev)
 {
 	return ice_tx_vec_dev_check_default(dev);
diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c
index a721d8c521..2592f5cab6 100644
--- a/drivers/net/ionic/ionic_rxtx.c
+++ b/drivers/net/ionic/ionic_rxtx.c
@@ -67,7 +67,7 @@ ionic_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	qinfo->conf.tx_deferred_start = txq->deferred_start;
 }
 
-static inline void __attribute__((cold))
+static inline void __rte_cold
 ionic_tx_flush(struct ionic_cq *cq)
 {
 	struct ionic_queue *q = cq->bound_q;
@@ -118,7 +118,7 @@ ionic_tx_flush(struct ionic_cq *cq)
 	}
 }
 
-void __attribute__((cold))
+void __rte_cold
 ionic_dev_tx_queue_release(void *tx_queue)
 {
 	struct ionic_qcq *txq = (struct ionic_qcq *)tx_queue;
@@ -128,7 +128,7 @@ ionic_dev_tx_queue_release(void *tx_queue)
 	ionic_qcq_free(txq);
 }
 
-int __attribute__((cold))
+int __rte_cold
 ionic_dev_tx_queue_stop(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id)
 {
 	struct ionic_qcq *txq;
@@ -154,7 +154,7 @@ ionic_dev_tx_queue_stop(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id)
 	return 0;
 }
 
-int __attribute__((cold))
+int __rte_cold
 ionic_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id,
 		uint16_t nb_desc, uint32_t socket_id __rte_unused,
 		const struct rte_eth_txconf *tx_conf)
@@ -208,7 +208,7 @@ ionic_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id,
 /*
  * Start Transmit Units for specified queue.
  */
-int __attribute__((cold))
+int __rte_cold
 ionic_dev_tx_queue_start(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id)
 {
 	struct ionic_qcq *txq;
@@ -609,7 +609,7 @@ ionic_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	qinfo->conf.offloads = rxq->offloads;
 }
 
-static void __attribute__((cold))
+static void __rte_cold
 ionic_rx_empty(struct ionic_queue *q)
 {
 	struct ionic_qcq *rxq = IONIC_Q_TO_QCQ(q);
@@ -625,7 +625,7 @@ ionic_rx_empty(struct ionic_queue *q)
 	}
 }
 
-void __attribute__((cold))
+void __rte_cold
 ionic_dev_rx_queue_release(void *rx_queue)
 {
 	struct ionic_qcq *rxq = (struct ionic_qcq *)rx_queue;
@@ -637,7 +637,7 @@ ionic_dev_rx_queue_release(void *rx_queue)
 	ionic_qcq_free(rxq);
 }
 
-int __attribute__((cold))
+int __rte_cold
 ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
 		uint16_t rx_queue_id,
 		uint16_t nb_desc,
@@ -873,7 +873,7 @@ ionic_rx_recycle(struct ionic_queue *q, uint32_t q_desc_index,
 	ionic_q_post(q, true, ionic_rx_clean, mbuf);
 }
 
-static int __attribute__((cold))
+static int __rte_cold
 ionic_rx_fill(struct ionic_qcq *rxq, uint32_t len)
 {
 	struct ionic_queue *q = &rxq->q;
@@ -950,7 +950,7 @@ ionic_rx_fill(struct ionic_qcq *rxq, uint32_t len)
 /*
  * Start Receive Units for specified queue.
  */
-int __attribute__((cold))
+int __rte_cold
 ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id)
 {
 	uint32_t frame_size = eth_dev->data->dev_conf.rxmode.max_rx_pkt_len;
@@ -983,7 +983,7 @@ ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id)
 	return 0;
 }
 
-static inline void __attribute__((cold))
+static inline void __rte_cold
 ionic_rxq_service(struct ionic_cq *cq, uint32_t work_to_do,
 		void *service_cb_arg)
 {
@@ -1038,7 +1038,7 @@ ionic_rxq_service(struct ionic_cq *cq, uint32_t work_to_do,
 /*
  * Stop Receive Units for specified queue.
  */
-int __attribute__((cold))
+int __rte_cold
 ionic_dev_rx_queue_stop(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id)
 {
 	struct ionic_qcq *rxq;
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 7b398f1a1b..d76d8c9b8d 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -2284,7 +2284,7 @@ ixgbe_recv_pkts_lro_bulk_alloc(void *rx_queue, struct rte_mbuf **rx_pkts,
  *
  **********************************************************************/
 
-static void __attribute__((cold))
+static void __rte_cold
 ixgbe_tx_queue_release_mbufs(struct ixgbe_tx_queue *txq)
 {
 	unsigned i;
@@ -2409,7 +2409,7 @@ ixgbe_dev_tx_done_cleanup(void *tx_queue, uint32_t free_cnt)
 	return ixgbe_tx_done_cleanup_full(txq, free_cnt);
 }
 
-static void __attribute__((cold))
+static void __rte_cold
 ixgbe_tx_free_swring(struct ixgbe_tx_queue *txq)
 {
 	if (txq != NULL &&
@@ -2417,7 +2417,7 @@ ixgbe_tx_free_swring(struct ixgbe_tx_queue *txq)
 		rte_free(txq->sw_ring);
 }
 
-static void __attribute__((cold))
+static void __rte_cold
 ixgbe_tx_queue_release(struct ixgbe_tx_queue *txq)
 {
 	if (txq != NULL && txq->ops != NULL) {
@@ -2427,14 +2427,14 @@ ixgbe_tx_queue_release(struct ixgbe_tx_queue *txq)
 	}
 }
 
-void __attribute__((cold))
+void __rte_cold
 ixgbe_dev_tx_queue_release(void *txq)
 {
 	ixgbe_tx_queue_release(txq);
 }
 
 /* (Re)set dynamic ixgbe_tx_queue fields to defaults */
-static void __attribute__((cold))
+static void __rte_cold
 ixgbe_reset_tx_queue(struct ixgbe_tx_queue *txq)
 {
 	static const union ixgbe_adv_tx_desc zeroed_desc = {{0}};
@@ -2484,7 +2484,7 @@ static const struct ixgbe_txq_ops def_txq_ops = {
  * the queue parameters. Used in tx_queue_setup by primary process and then
  * in dev_init by secondary process when attaching to an existing ethdev.
  */
-void __attribute__((cold))
+void __rte_cold
 ixgbe_set_tx_function(struct rte_eth_dev *dev, struct ixgbe_tx_queue *txq)
 {
 	/* Use a simple Tx queue (no offloads, no multi segs) if possible */
@@ -2555,7 +2555,7 @@ ixgbe_get_tx_port_offloads(struct rte_eth_dev *dev)
 	return tx_offload_capa;
 }
 
-int __attribute__((cold))
+int __rte_cold
 ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
 			 uint16_t queue_idx,
 			 uint16_t nb_desc,
@@ -2770,7 +2770,7 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
  *
  * @m scattered cluster head
  */
-static void __attribute__((cold))
+static void __rte_cold
 ixgbe_free_sc_cluster(struct rte_mbuf *m)
 {
 	uint16_t i, nb_segs = m->nb_segs;
@@ -2783,7 +2783,7 @@ ixgbe_free_sc_cluster(struct rte_mbuf *m)
 	}
 }
 
-static void __attribute__((cold))
+static void __rte_cold
 ixgbe_rx_queue_release_mbufs(struct ixgbe_rx_queue *rxq)
 {
 	unsigned i;
@@ -2820,7 +2820,7 @@ ixgbe_rx_queue_release_mbufs(struct ixgbe_rx_queue *rxq)
 			}
 }
 
-static void __attribute__((cold))
+static void __rte_cold
 ixgbe_rx_queue_release(struct ixgbe_rx_queue *rxq)
 {
 	if (rxq != NULL) {
@@ -2831,7 +2831,7 @@ ixgbe_rx_queue_release(struct ixgbe_rx_queue *rxq)
 	}
 }
 
-void __attribute__((cold))
+void __rte_cold
 ixgbe_dev_rx_queue_release(void *rxq)
 {
 	ixgbe_rx_queue_release(rxq);
@@ -2845,7 +2845,7 @@ ixgbe_dev_rx_queue_release(void *rxq)
  *  -EINVAL: the preconditions are NOT satisfied and the default Rx burst
  *           function must be used.
  */
-static inline int __attribute__((cold))
+static inline int __rte_cold
 check_rx_burst_bulk_alloc_preconditions(struct ixgbe_rx_queue *rxq)
 {
 	int ret = 0;
@@ -2882,7 +2882,7 @@ check_rx_burst_bulk_alloc_preconditions(struct ixgbe_rx_queue *rxq)
 }
 
 /* Reset dynamic ixgbe_rx_queue fields back to defaults */
-static void __attribute__((cold))
+static void __rte_cold
 ixgbe_reset_rx_queue(struct ixgbe_adapter *adapter, struct ixgbe_rx_queue *rxq)
 {
 	static const union ixgbe_adv_rx_desc zeroed_desc = {{0}};
@@ -3007,7 +3007,7 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev)
 	return offloads;
 }
 
-int __attribute__((cold))
+int __rte_cold
 ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
 			 uint16_t queue_idx,
 			 uint16_t nb_desc,
@@ -3288,7 +3288,7 @@ ixgbe_dev_tx_descriptor_status(void *tx_queue, uint16_t offset)
 /*
  * Set up link loopback for X540/X550 mode Tx->Rx.
  */
-static inline void __attribute__((cold))
+static inline void __rte_cold
 ixgbe_setup_loopback_link_x540_x550(struct ixgbe_hw *hw, bool enable)
 {
 	uint32_t macc;
@@ -3316,7 +3316,7 @@ ixgbe_setup_loopback_link_x540_x550(struct ixgbe_hw *hw, bool enable)
 	IXGBE_WRITE_REG(hw, IXGBE_MACC, macc);
 }
 
-void __attribute__((cold))
+void __rte_cold
 ixgbe_dev_clear_queues(struct rte_eth_dev *dev)
 {
 	unsigned i;
@@ -4424,7 +4424,7 @@ ixgbe_vmdq_tx_hw_configure(struct ixgbe_hw *hw)
 	IXGBE_WRITE_FLUSH(hw);
 }
 
-static int __attribute__((cold))
+static int __rte_cold
 ixgbe_alloc_rx_queue_mbufs(struct ixgbe_rx_queue *rxq)
 {
 	struct ixgbe_rx_entry *rxe = rxq->sw_ring;
@@ -4724,7 +4724,7 @@ ixgbe_set_ivar(struct rte_eth_dev *dev, u8 entry, u8 vector, s8 type)
 	}
 }
 
-void __attribute__((cold))
+void __rte_cold
 ixgbe_set_rx_function(struct rte_eth_dev *dev)
 {
 	uint16_t i, rx_using_sse;
@@ -4977,7 +4977,7 @@ ixgbe_set_rsc(struct rte_eth_dev *dev)
 /*
  * Initializes Receive Unit.
  */
-int __attribute__((cold))
+int __rte_cold
 ixgbe_dev_rx_init(struct rte_eth_dev *dev)
 {
 	struct ixgbe_hw     *hw;
@@ -5154,7 +5154,7 @@ ixgbe_dev_rx_init(struct rte_eth_dev *dev)
 /*
  * Initializes Transmit Unit.
  */
-void __attribute__((cold))
+void __rte_cold
 ixgbe_dev_tx_init(struct rte_eth_dev *dev)
 {
 	struct ixgbe_hw     *hw;
@@ -5243,7 +5243,7 @@ ixgbe_check_supported_loopback_mode(struct rte_eth_dev *dev)
 /*
  * Set up link for 82599 loopback mode Tx->Rx.
  */
-static inline void __attribute__((cold))
+static inline void __rte_cold
 ixgbe_setup_loopback_link_82599(struct ixgbe_hw *hw)
 {
 	PMD_INIT_FUNC_TRACE();
@@ -5271,7 +5271,7 @@ ixgbe_setup_loopback_link_82599(struct ixgbe_hw *hw)
 /*
  * Start Transmit and Receive Units.
  */
-int __attribute__((cold))
+int __rte_cold
 ixgbe_dev_rxtx_start(struct rte_eth_dev *dev)
 {
 	struct ixgbe_hw     *hw;
@@ -5359,7 +5359,7 @@ ixgbe_dev_rxtx_start(struct rte_eth_dev *dev)
 /*
  * Start Receive Units for specified queue.
  */
-int __attribute__((cold))
+int __rte_cold
 ixgbe_dev_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 {
 	struct ixgbe_hw     *hw;
@@ -5401,7 +5401,7 @@ ixgbe_dev_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 /*
  * Stop Receive Units for specified queue.
  */
-int __attribute__((cold))
+int __rte_cold
 ixgbe_dev_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 {
 	struct ixgbe_hw     *hw;
@@ -5441,7 +5441,7 @@ ixgbe_dev_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 /*
  * Start Transmit Units for specified queue.
  */
-int __attribute__((cold))
+int __rte_cold
 ixgbe_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)
 {
 	struct ixgbe_hw     *hw;
@@ -5480,7 +5480,7 @@ ixgbe_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)
 /*
  * Stop Transmit Units for specified queue.
  */
-int __attribute__((cold))
+int __rte_cold
 ixgbe_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)
 {
 	struct ixgbe_hw     *hw;
@@ -5577,7 +5577,7 @@ ixgbe_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 /*
  * [VF] Initializes Receive Unit.
  */
-int __attribute__((cold))
+int __rte_cold
 ixgbevf_dev_rx_init(struct rte_eth_dev *dev)
 {
 	struct ixgbe_hw     *hw;
@@ -5701,7 +5701,7 @@ ixgbevf_dev_rx_init(struct rte_eth_dev *dev)
 /*
  * [VF] Initializes Transmit Unit.
  */
-void __attribute__((cold))
+void __rte_cold
 ixgbevf_dev_tx_init(struct rte_eth_dev *dev)
 {
 	struct ixgbe_hw     *hw;
@@ -5742,7 +5742,7 @@ ixgbevf_dev_tx_init(struct rte_eth_dev *dev)
 /*
  * [VF] Start Transmit and Receive Units.
  */
-void __attribute__((cold))
+void __rte_cold
 ixgbevf_dev_rxtx_start(struct rte_eth_dev *dev)
 {
 	struct ixgbe_hw     *hw;
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
index feb86c61ee..293b7c8bd1 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
@@ -531,25 +531,25 @@ ixgbe_xmit_fixed_burst_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
 	return nb_pkts;
 }
 
-static void __attribute__((cold))
+static void __rte_cold
 ixgbe_tx_queue_release_mbufs_vec(struct ixgbe_tx_queue *txq)
 {
 	_ixgbe_tx_queue_release_mbufs_vec(txq);
 }
 
-void __attribute__((cold))
+void __rte_cold
 ixgbe_rx_queue_release_mbufs_vec(struct ixgbe_rx_queue *rxq)
 {
 	_ixgbe_rx_queue_release_mbufs_vec(rxq);
 }
 
-static void __attribute__((cold))
+static void __rte_cold
 ixgbe_tx_free_swring(struct ixgbe_tx_queue *txq)
 {
 	_ixgbe_tx_free_swring_vec(txq);
 }
 
-static void __attribute__((cold))
+static void __rte_cold
 ixgbe_reset_tx_queue(struct ixgbe_tx_queue *txq)
 {
 	_ixgbe_reset_tx_queue_vec(txq);
@@ -561,19 +561,19 @@ static const struct ixgbe_txq_ops vec_txq_ops = {
 	.reset = ixgbe_reset_tx_queue,
 };
 
-int __attribute__((cold))
+int __rte_cold
 ixgbe_rxq_vec_setup(struct ixgbe_rx_queue *rxq)
 {
 	return ixgbe_rxq_vec_setup_default(rxq);
 }
 
-int __attribute__((cold))
+int __rte_cold
 ixgbe_txq_vec_setup(struct ixgbe_tx_queue *txq)
 {
 	return ixgbe_txq_vec_setup_default(txq, &vec_txq_ops);
 }
 
-int __attribute__((cold))
+int __rte_cold
 ixgbe_rx_vec_dev_conf_condition_check(struct rte_eth_dev *dev)
 {
 	struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
index 599ba30e51..517ca31669 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
@@ -702,25 +702,25 @@ ixgbe_xmit_fixed_burst_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
 	return nb_pkts;
 }
 
-static void __attribute__((cold))
+static void __rte_cold
 ixgbe_tx_queue_release_mbufs_vec(struct ixgbe_tx_queue *txq)
 {
 	_ixgbe_tx_queue_release_mbufs_vec(txq);
 }
 
-void __attribute__((cold))
+void __rte_cold
 ixgbe_rx_queue_release_mbufs_vec(struct ixgbe_rx_queue *rxq)
 {
 	_ixgbe_rx_queue_release_mbufs_vec(rxq);
 }
 
-static void __attribute__((cold))
+static void __rte_cold
 ixgbe_tx_free_swring(struct ixgbe_tx_queue *txq)
 {
 	_ixgbe_tx_free_swring_vec(txq);
 }
 
-static void __attribute__((cold))
+static void __rte_cold
 ixgbe_reset_tx_queue(struct ixgbe_tx_queue *txq)
 {
 	_ixgbe_reset_tx_queue_vec(txq);
@@ -732,19 +732,19 @@ static const struct ixgbe_txq_ops vec_txq_ops = {
 	.reset = ixgbe_reset_tx_queue,
 };
 
-int __attribute__((cold))
+int __rte_cold
 ixgbe_rxq_vec_setup(struct ixgbe_rx_queue *rxq)
 {
 	return ixgbe_rxq_vec_setup_default(rxq);
 }
 
-int __attribute__((cold))
+int __rte_cold
 ixgbe_txq_vec_setup(struct ixgbe_tx_queue *txq)
 {
 	return ixgbe_txq_vec_setup_default(txq, &vec_txq_ops);
 }
 
-int __attribute__((cold))
+int __rte_cold
 ixgbe_rx_vec_dev_conf_condition_check(struct rte_eth_dev *dev)
 {
 	return ixgbe_rx_vec_dev_conf_condition_check_default(dev);
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec.c b/drivers/net/mlx5/mlx5_rxtx_vec.c
index 9d7a4ceb7e..1518bdd5b4 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec.c
+++ b/drivers/net/mlx5/mlx5_rxtx_vec.c
@@ -121,7 +121,7 @@ mlx5_rx_burst_vec(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
  * @return
  *   1 if supported, negative errno value if not.
  */
-int __attribute__((cold))
+int __rte_cold
 mlx5_rxq_check_vec_support(struct mlx5_rxq_data *rxq)
 {
 	struct mlx5_rxq_ctrl *ctrl =
@@ -145,7 +145,7 @@ mlx5_rxq_check_vec_support(struct mlx5_rxq_data *rxq)
  * @return
  *   1 if supported, negative errno value if not.
  */
-int __attribute__((cold))
+int __rte_cold
 mlx5_check_vec_rx_support(struct rte_eth_dev *dev)
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
diff --git a/drivers/net/virtio/virtio_rxtx_simple.c b/drivers/net/virtio/virtio_rxtx_simple.c
index f8bcbaa1c7..a26182bb46 100644
--- a/drivers/net/virtio/virtio_rxtx_simple.c
+++ b/drivers/net/virtio/virtio_rxtx_simple.c
@@ -27,7 +27,7 @@
 #pragma GCC diagnostic ignored "-Wcast-qual"
 #endif
 
-int __attribute__((cold))
+int __rte_cold
 virtio_rxq_vec_setup(struct virtnet_rx *rxq)
 {
 	uintptr_t p;
diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index ea526d408b..5a451e4ca2 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -167,6 +167,11 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)
  */
 #define __rte_hot __attribute__((hot))
 
+/**
+ * Hint function in the cold path
+ */
+#define __rte_cold __attribute__((cold))
+
 /*********** Macros for pointer arithmetic ********/
 
 /**
diff --git a/lib/librte_eal/common/include/rte_debug.h b/lib/librte_eal/common/include/rte_debug.h
index 748d32c80f..3ae467211d 100644
--- a/lib/librte_eal/common/include/rte_debug.h
+++ b/lib/librte_eal/common/include/rte_debug.h
@@ -69,7 +69,7 @@ void rte_dump_registers(void);
 void __rte_panic(const char *funcname , const char *format, ...)
 #ifdef __GNUC__
 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2))
-	__attribute__((cold))
+	__rte_cold
 #endif
 #endif
 	__attribute__((noreturn))
diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h
index 1bb0e66944..f2a5bc18ea 100644
--- a/lib/librte_eal/common/include/rte_log.h
+++ b/lib/librte_eal/common/include/rte_log.h
@@ -279,7 +279,7 @@ void rte_log_dump(FILE *f);
 int rte_log(uint32_t level, uint32_t logtype, const char *format, ...)
 #ifdef __GNUC__
 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2))
-	__attribute__((cold))
+	__rte_cold
 #endif
 #endif
 	__attribute__((format(printf, 3, 4)));
-- 
2.25.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-dev] [PATCH 20.05 13/15] replace no-return attributes
  2020-02-10 16:20 [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon
                   ` (11 preceding siblings ...)
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 12/15] replace cold attributes Thomas Monjalon
@ 2020-02-10 16:20 ` Thomas Monjalon
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 14/15] replace printf format attributes Thomas Monjalon
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 20+ messages in thread
From: Thomas Monjalon @ 2020-02-10 16:20 UTC (permalink / raw)
  To: dev
  Cc: Bernard Iremonger, John McNamara, Marko Kovacevic, David Hunt,
	Kirill Rybalchenko, Bruce Richardson, Harry van Haaren,
	Xiaoyun Li, Ori Kam, Radu Nicolau, Akhil Goyal, Tomasz Kantecki,
	Sunil Kumar Kori, Pavan Nikhilesh, Cristian Dumitrescu,
	Robert Sanford, Erik Gabriel Carrillo

The new macro __rte_noreturn, for compiler hinting,
is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 doc/guides/sample_app_ug/flow_classify.rst              | 2 +-
 doc/guides/sample_app_ug/l3_forward_power_man.rst       | 2 +-
 doc/guides/sample_app_ug/performance_thread.rst         | 2 +-
 doc/guides/sample_app_ug/skeleton.rst                   | 2 +-
 examples/flow_classify/flow_classify.c                  | 2 +-
 examples/l2fwd-cat/l2fwd-cat.c                          | 2 +-
 examples/performance-thread/l3fwd-thread/main.c         | 4 ++--
 examples/performance-thread/pthread_shim/pthread_shim.h | 2 +-
 examples/ptpclient/ptpclient.c                          | 2 +-
 examples/qos_meter/main.c                               | 2 +-
 examples/rxtx_callbacks/main.c                          | 2 +-
 examples/skeleton/basicfwd.c                            | 2 +-
 examples/timer/main.c                                   | 2 +-
 lib/librte_eal/common/eal_thread.h                      | 2 +-
 lib/librte_eal/common/include/rte_common.h              | 8 ++++++--
 lib/librte_eal/common/include/rte_debug.h               | 2 +-
 lib/librte_eal/freebsd/eal/eal_thread.c                 | 2 +-
 lib/librte_eal/linux/eal/eal_interrupts.c               | 2 +-
 lib/librte_eal/linux/eal/eal_thread.c                   | 2 +-
 19 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/doc/guides/sample_app_ug/flow_classify.rst b/doc/guides/sample_app_ug/flow_classify.rst
index bc234b50a7..dc40b4d6f9 100644
--- a/doc/guides/sample_app_ug/flow_classify.rst
+++ b/doc/guides/sample_app_ug/flow_classify.rst
@@ -422,7 +422,7 @@ following:
             .stats = (void *)&ntuple_stats
     };
 
-    static __attribute__((noreturn)) void
+    static __rte_noreturn void
     lcore_main(cls_app)
     {
         uint16_t port;
diff --git a/doc/guides/sample_app_ug/l3_forward_power_man.rst b/doc/guides/sample_app_ug/l3_forward_power_man.rst
index 475a866cfb..0cc6f2e62e 100644
--- a/doc/guides/sample_app_ug/l3_forward_power_man.rst
+++ b/doc/guides/sample_app_ug/l3_forward_power_man.rst
@@ -206,7 +206,7 @@ to generate hints based on recent network load trends.
 .. code-block:: c
 
     static
-    attribute ((noreturn)) int main_loop(__rte_unused void *dummy)
+    __rte_noreturn int main_loop(__rte_unused void *dummy)
     {
         // ...
 
diff --git a/doc/guides/sample_app_ug/performance_thread.rst b/doc/guides/sample_app_ug/performance_thread.rst
index 5fed46465f..b04d0ba444 100644
--- a/doc/guides/sample_app_ug/performance_thread.rst
+++ b/doc/guides/sample_app_ug/performance_thread.rst
@@ -1097,7 +1097,7 @@ invokes the genuine pthread function.
 
 The function ``pthread_exit()`` has additional special handling. The standard
 system header file pthread.h declares ``pthread_exit()`` with
-``__attribute__((noreturn))`` this is an optimization that is possible because
+``__rte_noreturn`` this is an optimization that is possible because
 the pthread is terminating and this enables the compiler to omit the normal
 handling of stack and protection of registers since the function is not
 expected to return, and in fact the thread is being destroyed. These
diff --git a/doc/guides/sample_app_ug/skeleton.rst b/doc/guides/sample_app_ug/skeleton.rst
index 1d0a2760d4..34f6f9aea7 100644
--- a/doc/guides/sample_app_ug/skeleton.rst
+++ b/doc/guides/sample_app_ug/skeleton.rst
@@ -191,7 +191,7 @@ looks like the following:
 
 .. code-block:: c
 
-    static __attribute__((noreturn)) void
+    static __rte_noreturn void
     lcore_main(void)
     {
         uint16_t port;
diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index 1c12bbb2fd..433e64d3f9 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -265,7 +265,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
  * The lcore main. This is the main thread that does the work, reading from
  * an input port classifying the packets and writing to an output port.
  */
-static __attribute__((noreturn)) void
+static __rte_noreturn void
 lcore_main(struct flow_classifier *cls_app)
 {
 	uint16_t port;
diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
index 6838f288c6..45a497c082 100644
--- a/examples/l2fwd-cat/l2fwd-cat.c
+++ b/examples/l2fwd-cat/l2fwd-cat.c
@@ -97,7 +97,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
  * The lcore main. This is the main thread that does the work, reading from
  * an input port and writing to an output port.
  */
-static __attribute__((noreturn)) void
+static __rte_noreturn void
 lcore_main(void)
 {
 	uint16_t port;
diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index 8a1560b503..43a5b9248d 100644
--- a/examples/performance-thread/l3fwd-thread/main.c
+++ b/examples/performance-thread/l3fwd-thread/main.c
@@ -1877,7 +1877,7 @@ process_burst(struct rte_mbuf *pkts_burst[MAX_PKT_BURST], int nb_rx,
 /*
  * CPU-load stats collector
  */
-static int __attribute__((noreturn))
+static int __rte_noreturn
 cpu_load_collector(__rte_unused void *arg) {
 	unsigned i, j, k;
 	uint64_t hits;
@@ -2299,7 +2299,7 @@ sched_spawner(__rte_unused void *arg) {
 }
 
 /* main processing loop */
-static int __attribute__((noreturn))
+static int __rte_noreturn
 pthread_tx(void *dummy)
 {
 	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
diff --git a/examples/performance-thread/pthread_shim/pthread_shim.h b/examples/performance-thread/pthread_shim/pthread_shim.h
index bba8ed00e4..e90fb15fc1 100644
--- a/examples/performance-thread/pthread_shim/pthread_shim.h
+++ b/examples/performance-thread/pthread_shim/pthread_shim.h
@@ -55,7 +55,7 @@
  * An exiting lthread must not terminate the pthread it is running in
  * since this would mean terminating the lthread scheduler.
  * We override pthread_exit() with a macro because it is typically declared with
- * __attribute__((noreturn))
+ * __rte_noreturn
  */
 void pthread_exit_override(void *v);
 
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 6fcd1aa26e..bfa86eec5a 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -596,7 +596,7 @@ parse_ptp_frames(uint16_t portid, struct rte_mbuf *m) {
  * The lcore main. This is the main thread that does the work, reading from an
  * input port and writing to an output port.
  */
-static __attribute__((noreturn)) void
+static __rte_noreturn void
 lcore_main(void)
 {
 	uint16_t portid;
diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index 4dade4ca2f..6d057abfe3 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -166,7 +166,7 @@ app_pkt_handle(struct rte_mbuf *pkt, uint64_t time)
 }
 
 
-static __attribute__((noreturn)) int
+static __rte_noreturn int
 main_loop(__rte_unused void *dummy)
 {
 	uint64_t current_time, last_time = rte_rdtsc();
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index 07e95e8d1a..54d124b00b 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -215,7 +215,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
  * Main thread that does the work, reading from INPUT_PORT
  * and writing to OUTPUT_PORT
  */
-static  __attribute__((noreturn)) void
+static  __rte_noreturn void
 lcore_main(void)
 {
 	uint16_t port;
diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index 73d313b84e..72ba85fa1f 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -112,7 +112,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
  * The lcore main. This is the main thread that does the work, reading from
  * an input port and writing to an output port.
  */
-static __attribute__((noreturn)) void
+static __rte_noreturn void
 lcore_main(void)
 {
 	uint16_t port;
diff --git a/examples/timer/main.c b/examples/timer/main.c
index 00c251c409..0259022f10 100644
--- a/examples/timer/main.c
+++ b/examples/timer/main.c
@@ -55,7 +55,7 @@ timer1_cb(__rte_unused struct rte_timer *tim,
 	rte_timer_reset(tim, hz/3, SINGLE, lcore_id, timer1_cb, NULL);
 }
 
-static __attribute__((noreturn)) int
+static __rte_noreturn int
 lcore_mainloop(__rte_unused void *arg)
 {
 	uint64_t prev_tsc = 0, cur_tsc, diff_tsc;
diff --git a/lib/librte_eal/common/eal_thread.h b/lib/librte_eal/common/eal_thread.h
index 0d0bad06bd..b40ed249ed 100644
--- a/lib/librte_eal/common/eal_thread.h
+++ b/lib/librte_eal/common/eal_thread.h
@@ -13,7 +13,7 @@
  * @param arg
  *   opaque pointer
  */
-__attribute__((noreturn)) void *eal_thread_loop(void *arg);
+__rte_noreturn void *eal_thread_loop(void *arg);
 
 /**
  * Init per-lcore info for master thread
diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index 5a451e4ca2..575183e944 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -152,6 +152,11 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)
 #define RTE_FINI(func) \
 	RTE_FINI_PRIO(func, LAST)
 
+/**
+ * Hint never returning function
+ */
+#define __rte_noreturn __attribute__((noreturn))
+
 /**
  * Force a function to be inlined
  */
@@ -796,9 +801,8 @@ rte_str_to_size(const char *str)
  *     printf format characters which will be expanded using any further parameters
  *     to the function.
  */
-void
+__rte_noreturn void
 rte_exit(int exit_code, const char *format, ...)
-	__attribute__((noreturn))
 	__attribute__((format(printf, 2, 3)));
 
 #ifdef __cplusplus
diff --git a/lib/librte_eal/common/include/rte_debug.h b/lib/librte_eal/common/include/rte_debug.h
index 3ae467211d..eb06c835f7 100644
--- a/lib/librte_eal/common/include/rte_debug.h
+++ b/lib/librte_eal/common/include/rte_debug.h
@@ -72,7 +72,7 @@ void __rte_panic(const char *funcname , const char *format, ...)
 	__rte_cold
 #endif
 #endif
-	__attribute__((noreturn))
+	__rte_noreturn
 	__attribute__((format(printf, 2, 3)));
 
 #ifdef __cplusplus
diff --git a/lib/librte_eal/freebsd/eal/eal_thread.c b/lib/librte_eal/freebsd/eal/eal_thread.c
index 925737d34d..f21eddd93c 100644
--- a/lib/librte_eal/freebsd/eal/eal_thread.c
+++ b/lib/librte_eal/freebsd/eal/eal_thread.c
@@ -89,7 +89,7 @@ void eal_thread_init_master(unsigned lcore_id)
 }
 
 /* main loop of threads */
-__attribute__((noreturn)) void *
+__rte_noreturn void *
 eal_thread_loop(__rte_unused void *arg)
 {
 	char c;
diff --git a/lib/librte_eal/linux/eal/eal_interrupts.c b/lib/librte_eal/linux/eal/eal_interrupts.c
index cb8e107098..3893e4065e 100644
--- a/lib/librte_eal/linux/eal/eal_interrupts.c
+++ b/lib/librte_eal/linux/eal/eal_interrupts.c
@@ -1042,7 +1042,7 @@ eal_intr_handle_interrupts(int pfd, unsigned totalfds)
  * @return
  *  never return;
  */
-static __attribute__((noreturn)) void *
+static __rte_noreturn void *
 eal_intr_thread_main(__rte_unused void *arg)
 {
 	/* host thread, never break out */
diff --git a/lib/librte_eal/linux/eal/eal_thread.c b/lib/librte_eal/linux/eal/eal_thread.c
index 575c96089b..2fa5806b88 100644
--- a/lib/librte_eal/linux/eal/eal_thread.c
+++ b/lib/librte_eal/linux/eal/eal_thread.c
@@ -89,7 +89,7 @@ void eal_thread_init_master(unsigned lcore_id)
 }
 
 /* main loop of threads */
-__attribute__((noreturn)) void *
+__rte_noreturn void *
 eal_thread_loop(__rte_unused void *arg)
 {
 	char c;
-- 
2.25.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-dev] [PATCH 20.05 14/15] replace printf format attributes
  2020-02-10 16:20 [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon
                   ` (12 preceding siblings ...)
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 13/15] replace no-return attributes Thomas Monjalon
@ 2020-02-10 16:20 ` Thomas Monjalon
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 15/15] devtools: check use of compiler attributes Thomas Monjalon
  2020-04-16 16:34 ` [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon
  15 siblings, 0 replies; 20+ messages in thread
From: Thomas Monjalon @ 2020-02-10 16:20 UTC (permalink / raw)
  To: dev; +Cc: Olivier Matz

The new macro __rte_format_printf, for compiler hinting,
is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 lib/librte_cmdline/cmdline.h                | 3 ++-
 lib/librte_eal/common/include/rte_common.h  | 8 +++++++-
 lib/librte_eal/common/include/rte_debug.h   | 2 +-
 lib/librte_eal/common/include/rte_devargs.h | 2 +-
 lib/librte_eal/common/include/rte_log.h     | 4 ++--
 5 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/lib/librte_cmdline/cmdline.h b/lib/librte_cmdline/cmdline.h
index 27d2effdf7..190fc3d165 100644
--- a/lib/librte_cmdline/cmdline.h
+++ b/lib/librte_cmdline/cmdline.h
@@ -8,6 +8,7 @@
 #define _CMDLINE_H_
 
 #include <termios.h>
+#include <rte_common.h>
 #include <cmdline_rdline.h>
 #include <cmdline_parse.h>
 
@@ -34,7 +35,7 @@ struct cmdline *cmdline_new(cmdline_parse_ctx_t *ctx, const char *prompt, int s_
 void cmdline_set_prompt(struct cmdline *cl, const char *prompt);
 void cmdline_free(struct cmdline *cl);
 void cmdline_printf(const struct cmdline *cl, const char *fmt, ...)
-	__attribute__((format(printf,2,3)));
+	__rte_format_printf(2, 3);
 int cmdline_in(struct cmdline *cl, const char *buf, int size);
 int cmdline_write_char(struct rdline *rdl, char c);
 
diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index 575183e944..3e14ffc136 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -94,6 +94,12 @@ typedef uint16_t unaligned_uint16_t;
  */
 #define RTE_SET_USED(x) (void)(x)
 
+/**
+ * Hint type checking for printf-style arguments.
+ */
+#define __rte_format_printf(fmt_idx, args_idx) \
+	__attribute__((format(printf, fmt_idx, args_idx)))
+
 #define RTE_PRIORITY_LOG 101
 #define RTE_PRIORITY_BUS 110
 #define RTE_PRIORITY_CLASS 120
@@ -803,7 +809,7 @@ rte_str_to_size(const char *str)
  */
 __rte_noreturn void
 rte_exit(int exit_code, const char *format, ...)
-	__attribute__((format(printf, 2, 3)));
+	__rte_format_printf(2, 3);
 
 #ifdef __cplusplus
 }
diff --git a/lib/librte_eal/common/include/rte_debug.h b/lib/librte_eal/common/include/rte_debug.h
index eb06c835f7..50052c5a90 100644
--- a/lib/librte_eal/common/include/rte_debug.h
+++ b/lib/librte_eal/common/include/rte_debug.h
@@ -73,7 +73,7 @@ void __rte_panic(const char *funcname , const char *format, ...)
 #endif
 #endif
 	__rte_noreturn
-	__attribute__((format(printf, 2, 3)));
+	__rte_format_printf(2, 3);
 
 #ifdef __cplusplus
 }
diff --git a/lib/librte_eal/common/include/rte_devargs.h b/lib/librte_eal/common/include/rte_devargs.h
index 882dfa0abd..898efa0d66 100644
--- a/lib/librte_eal/common/include/rte_devargs.h
+++ b/lib/librte_eal/common/include/rte_devargs.h
@@ -137,7 +137,7 @@ rte_devargs_parse(struct rte_devargs *da, const char *dev);
 int
 rte_devargs_parsef(struct rte_devargs *da,
 		   const char *format, ...)
-__attribute__((format(printf, 2, 0)));
+__rte_format_printf(2, 0);
 
 /**
  * Insert an rte_devargs in the global list.
diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h
index f2a5bc18ea..f292444966 100644
--- a/lib/librte_eal/common/include/rte_log.h
+++ b/lib/librte_eal/common/include/rte_log.h
@@ -282,7 +282,7 @@ int rte_log(uint32_t level, uint32_t logtype, const char *format, ...)
 	__rte_cold
 #endif
 #endif
-	__attribute__((format(printf, 3, 4)));
+	__rte_format_printf(3, 4);
 
 /**
  * Generates a log message.
@@ -311,7 +311,7 @@ int rte_log(uint32_t level, uint32_t logtype, const char *format, ...)
  *   - Negative on error.
  */
 int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)
-	__attribute__((format(printf,3,0)));
+	__rte_format_printf(3, 0);
 
 /**
  * Generates a log message.
-- 
2.25.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-dev] [PATCH 20.05 15/15] devtools: check use of compiler attributes
  2020-02-10 16:20 [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon
                   ` (13 preceding siblings ...)
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 14/15] replace printf format attributes Thomas Monjalon
@ 2020-02-10 16:20 ` Thomas Monjalon
  2020-04-16 16:34 ` [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon
  15 siblings, 0 replies; 20+ messages in thread
From: Thomas Monjalon @ 2020-02-10 16:20 UTC (permalink / raw)
  To: dev

The keyword __attribute__ will emit a warning,
because it is preferred to use or define a common __rte macro.
The centralized macros may help to control or workaround some compilers.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 devtools/checkpatches.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index b16bace927..bbde89bc99 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -61,6 +61,14 @@ check_forbidden_additions() { # <patch>
 		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
 		"$1" || res=1
 
+	# refrain from using compiler attribute without defining a common macro
+	awk -v FOLDERS="lib drivers app examples" \
+		-v EXPRESSIONS="__attribute__" \
+		-v RET_ON_FAIL=1 \
+		-v MESSAGE='Using compiler attribute directly' \
+		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
+		"$1" || res=1
+
 	# svg figures must be included with wildcard extension
 	# because of png conversion for pdf docs
 	awk -v FOLDERS='doc' \
-- 
2.25.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [dpdk-dev] [PATCH 20.05 05/15] replace alignment attributes
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 05/15] replace alignment attributes Thomas Monjalon
@ 2020-02-10 19:11   ` David Christensen
  0 siblings, 0 replies; 20+ messages in thread
From: David Christensen @ 2020-02-10 19:11 UTC (permalink / raw)
  To: Thomas Monjalon, dev
  Cc: Hemant Agrawal, Sachin Saxena, Gagandeep Singh, John Griffin,
	Fiona Trahe, Deepak Kumar Jain, Steven Webster, Matt Peters,
	Chas Williams, Wei Hu (Xavier), Min Hu (Connor),
	Yisen Zhuang, Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko,
	Heinrich Kuhn, Jan Gutter, Keith Wiles, Maxime Coquelin,
	Tiwei Bie, Zhihong Wang, Anatoly Burakov, Konstantin Ananyev,
	Jerin Jacob, Gavin Hu, Jan Viktorin, Ferruh Yigit,
	Andrew Rybchenko, Yipeng Wang, Sameh Gobriel, Bruce Richardson,
	Olivier Matz, Cristian Dumitrescu, Jasvinder Singh



On 2/10/20 8:20 AM, Thomas Monjalon wrote:
> There is a common macro __rte_aligned for alignment,
> which is now used where appropriate for consistency.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Reviewed-by: David Christensen <drc@linux.vnet.ibm.com>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [dpdk-dev] [PATCH 20.05 12/15] replace cold attributes
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 12/15] replace cold attributes Thomas Monjalon
@ 2020-02-10 19:14   ` David Christensen
  0 siblings, 0 replies; 20+ messages in thread
From: David Christensen @ 2020-02-10 19:14 UTC (permalink / raw)
  To: Thomas Monjalon, dev
  Cc: Ajit Khaparde, Somnath Kotur, Qi Zhang, Xiao Wang, Beilei Xing,
	Jerin Jacob, Gavin Hu, Jingjing Wu, Wenzhuo Lu, Qiming Yang,
	Alfredo Cardigliano, Konstantin Ananyev, Matan Azrad,
	Shahaf Shuler, Viacheslav Ovsiienko, Maxime Coquelin, Tiwei Bie,
	Zhihong Wang



On 2/10/20 8:20 AM, Thomas Monjalon wrote:
> The new macro __rte_cold, for compiler hinting,
> is now used where appropriate for consistency.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Reviewed-by: David Christensen <drc@linux.vnet.ibm.com>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [dpdk-dev] [PATCH 20.05 01/15] app/bbdev: replace constructor syntax with common macro
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 01/15] app/bbdev: replace constructor syntax with common macro Thomas Monjalon
@ 2020-02-10 21:06   ` Chautru, Nicolas
  0 siblings, 0 replies; 20+ messages in thread
From: Chautru, Nicolas @ 2020-02-10 21:06 UTC (permalink / raw)
  To: Thomas Monjalon, dev

On 2/10/20 8:20 AM, Thomas Monjalon wrote:
> There is a macro RTE_INIT for constructors, which is now used where
> appropriate for consistency.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Acked-by: Nic Chautru <nicolas.chautru@intel.com>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__
  2020-02-10 16:20 [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon
                   ` (14 preceding siblings ...)
  2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 15/15] devtools: check use of compiler attributes Thomas Monjalon
@ 2020-04-16 16:34 ` Thomas Monjalon
  15 siblings, 0 replies; 20+ messages in thread
From: Thomas Monjalon @ 2020-04-16 16:34 UTC (permalink / raw)
  To: dev

10/02/2020 17:20, Thomas Monjalon:
> Almost all usages of __attribute__ keyword are replaced
> by a macro (existing or new) with prefix __rte_.
> It makes code more consistent and will help changing
> compiler behaviour, or adapting to new compilers,
> in a central place.
> 
> Kernel and BPF files cannot use macros from rte_common.h.
> Some rare attributes are also kept unchanged.
> 
> 
> Thomas Monjalon (15):
>   app/bbdev: replace constructor syntax with common macro
>   net/mlx5: replace destructor syntax with common macro
>   net/memif: use common macros for cache line marker
>   common/mlx5: replace alignas keyword
>   replace alignment attributes
>   replace packed attributes
>   replace always-inline attributes
>   replace no-inline attributes
>   replace unused attributes
>   replace used attributes
>   replace hot attributes
>   replace cold attributes
>   replace no-return attributes
>   replace printf format attributes
>   devtools: check use of compiler attributes

Rebased and applied.

Some commits are dropped because already fixed by others in the meantime:
	app/bbdev: replace constructor syntax with common macro
	replace printf format attributes



^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2020-04-16 16:34 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-10 16:20 [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 01/15] app/bbdev: replace constructor syntax with common macro Thomas Monjalon
2020-02-10 21:06   ` Chautru, Nicolas
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 02/15] net/mlx5: replace destructor " Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 03/15] net/memif: use common macros for cache line marker Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 04/15] common/mlx5: replace alignas keyword Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 05/15] replace alignment attributes Thomas Monjalon
2020-02-10 19:11   ` David Christensen
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 06/15] replace packed attributes Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 07/15] replace always-inline attributes Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 08/15] replace no-inline attributes Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 09/15] replace unused attributes Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 10/15] replace used attributes Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 11/15] replace hot attributes Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 12/15] replace cold attributes Thomas Monjalon
2020-02-10 19:14   ` David Christensen
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 13/15] replace no-return attributes Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 14/15] replace printf format attributes Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 15/15] devtools: check use of compiler attributes Thomas Monjalon
2020-04-16 16:34 ` [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).