Skip to contentSkip to conversation

clean-up use of __attribute__

PATCH In review Thomas Monjalon 3 participants 20 messages Feb 10, 2020 – Apr 16, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover clean-up use of __attribute__

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(-)
Signature · 1 line
2.25.0
#1 lore raw

PATCH 1/15 app/bbdev: replace constructor syntax with common macro

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

---
 app/test-bbdev/main.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
app/test-bbdev/main.h +1 -2
index 23b4d58a53..836f6d6efd 100644
@@ -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); \
 	}
Signature · 1 line
2.25.0
#3 lore raw

PATCH 2/15 net/mlx5: replace destructor syntax with common macro

In reply to Thomas Monjalon

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.

---
 drivers/net/mlx5/mlx5.h        | 1 -
 drivers/net/mlx5/mlx5_socket.c | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/net/mlx5/mlx5.h +0 -1
index d7c519bae0..2affcd2ba3 100644
@@ -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 */
 
drivers/net/mlx5/mlx5_socket.c +1 -2
index cf2b433c00..a79896cb33 100644
@@ -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;
Signature · 1 line
2.25.0
#4 lore raw

PATCH 3/15 net/memif: use common macros for cache line marker

In reply to Thomas Monjalon

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

---
 drivers/net/memif/memif.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/memif/memif.h +1 -1
index a4d88c044b..b912308904 100644
@@ -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);
Signature · 1 line
2.25.0
#5 lore raw

PATCH 4/15 common/mlx5: replace alignas keyword

In reply to Thomas Monjalon

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.

---
 drivers/common/mlx5/mlx5_glue.c | 4 ++--
 drivers/common/mlx5/mlx5_nl.c   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/common/mlx5/mlx5_glue.c +2 -2
index 0af0b86677..428de0ffd9 100644
@@ -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,
drivers/common/mlx5/mlx5_nl.c +1 -1
index 549e787b04..d9f0d4129e 100644
@@ -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 +
Signature · 1 line
2.25.0
#6 lore raw

PATCH 5/15 replace alignment attributes

In reply to Thomas Monjalon

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

---
 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(-)
drivers/bus/dpaa/base/qbman/qman.c +1 -1
index b53eb9e5ee..b596e79c2f 100644
@@ -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
 };
 
drivers/bus/dpaa/include/fsl_bman.h +1 -1
index 0c74aba449..f9cd972153 100644
@@ -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;
drivers/bus/dpaa/include/fsl_qman.h +1 -1
index 4deea5e75e..1b3342e7e6 100644
@@ -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)
drivers/common/dpaax/compat.h +1 -1
index 12c9d99179..5b11c2d927 100644
@@ -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)
 
drivers/crypto/caam_jr/caam_jr_desc.h +2 -2
index 6683ea8350..64e0c00bc8 100644
@@ -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
drivers/crypto/qat/qat_asym.h +1 -1
index 551edc3034..2838aee76f 100644
@@ -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
drivers/net/avp/rte_avp_common.h +1 -1
index 478c01a169..ab7d175083 100644
@@ -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 */
drivers/net/bonding/rte_eth_bond_8023ad.h +7 -7
index 62265f449f..0b5d0a4351 100644
@@ -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;
drivers/net/hns3/hns3_fdir.c +2 -2
index ca3c78e1ce..a395eb1f83 100644
@@ -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;
drivers/net/mlx5/mlx5_rxtx_vec_altivec.h +8 -8
index aa43cab084..8e8d59ae83 100644
@@ -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],
drivers/net/nfp/nfp_net_pmd.h +2 -2
index cc1055c49a..f0142e1ff7 100644
@@ -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 */
drivers/net/tap/tap_bpf.h +1 -1
index 9192686a6a..f0b9fc7a2c 100644
@@ -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__)
drivers/net/virtio/virtqueue.h +1 -1
index 58ad7309ae..d8cf5d4e2f 100644
@@ -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
examples/multi_process/symmetric_mp/main.c +1 -1
index 7f491452a7..522f211c0f 100644
@@ -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;
lib/librte_acl/acl_run.h +1 -1
index bf7842d879..7d215de9d6 100644
@@ -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.
lib/librte_acl/acl_run_altivec.h +1 -1
index b57f08ac92..2de6f27b1f 100644
@@ -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}
 	},
lib/librte_acl/acl_run_neon.h +1 -1
index b3196cd120..69d1b6d9e1 100644
@@ -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}
 	},
lib/librte_eal/common/include/arch/arm/rte_vect.h +1 -1
index 2a18a68546..2696caaf6d 100644
@@ -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) */
lib/librte_eal/common/include/arch/ppc_64/rte_vect.h +1 -1
index 068c805b22..a0dabf02eb 100644
@@ -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
 }
lib/librte_eal/common/include/rte_common.h +3 -3
index 4b5f3a31f0..1677a0147a 100644
@@ -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;
lib/librte_ethdev/rte_ethdev.h +1 -1
index d1a593ad11..e9e3a16995 100644
@@ -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). */
lib/librte_hash/rte_thash.h +1 -1
index b4aaabe3d8..51b5129468 100644
@@ -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
lib/librte_net/rte_arp.h +2 -2
index fabd686243..79a764fc85 100644
@@ -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
lib/librte_net/rte_ether.h +2 -2
index e069dc7fe0..850c0fa387 100644
@@ -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.
lib/librte_pipeline/rte_table_action.c +6 -6
index 9ce98f2ceb..e6af23b688 100644
@@ -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)
lib/librte_sched/rte_sched_common.h +1 -1
index b58282de88..96706df7bd 100644
@@ -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
Signature · 1 line
2.25.0
#8 lore raw

PATCH 6/15 replace packed attributes

In reply to Thomas Monjalon

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

---
 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(-)
app/test-pmd/csumonly.c +1 -1
index 25091de881..fe19615b14 100644
@@ -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)
app/test/test_efd.c +1 -1
index a779a71f2d..e3e5e30ea6 100644
@@ -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;
 
app/test/test_hash.c +1 -1
index fbd5725c68..ade473d5d4 100644
@@ -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;
 
app/test/test_member.c +1 -1
index 748ddcc266..40aa4c8627 100644
@@ -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 */
doc/guides/prog_guide/packet_classif_access_ctrl.rst +1 -1
index 2945eacf55..0345512b9e 100644
@@ -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:
 
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +3 -3
index 8bd10b401a..abc5a1bf6e 100644
@@ -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;
drivers/bus/dpaa/include/fsl_fman.h +1 -1
index 1d1ce86719..5705ebfdce 100644
@@ -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);
drivers/bus/ifpga/rte_bus_ifpga.h +3 -3
index 88a6289642..9d6659ae37 100644
@@ -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
drivers/common/iavf/iavf_osdep.h +2 -2
index 0bf040d639..011b19336e 100644
@@ -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 {
drivers/crypto/caam_jr/caam_jr_desc.h +2 -2
index 64e0c00bc8..135d51c392 100644
@@ -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
drivers/mempool/octeontx/octeontx_fpavf.c +4 -4
index 63f8fb3b50..0ff234913d 100644
@@ -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;
drivers/net/ark/ark_pktchkr.h +2 -2
index a50f428bf1..b362281776 100644
@@ -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;
drivers/net/ark/ark_pktdir.h +1 -1
index 314e6dea9d..4afd128f95 100644
@@ -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;
drivers/net/ark/ark_pktgen.h +1 -1
index 0e5f76aa28..c61dfee6db 100644
@@ -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;
drivers/net/atlantic/atl_types.h +2 -0
index c200a1fadb..e813d9f326 100644
@@ -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;
drivers/net/atlantic/hw_atl/hw_atl_utils.h +30 -30

224 lines not on this page · raw message

drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c +2 -2
index 55dc728d32..3a7faf405c 100644
@@ -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,
drivers/net/avp/rte_avp_common.h +3 -3
index ab7d175083..4e82ec0b81 100644
@@ -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 */
drivers/net/bnxt/bnxt.h +2 -2
index 68786a89bf..dfdf8556b2 100644
@@ -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;
drivers/net/bnxt/hsi_struct_def_dpdk.h +427 -427

2,532 lines not on this page · raw message

drivers/net/bonding/rte_eth_bond_8023ad.h +8 -8
index 0b5d0a4351..11a71a55e5 100644

Lines of this file are not shown. View the raw message.

drivers/net/dpaa/dpaa_rxtx.h +7 -7
index 75b093c1e0..4f896fba11 100644

Lines of this file are not shown. View the raw message.

drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h +1 -1
index 4dd7be1d59..7e5e499b6a 100644

Lines of this file are not shown. View the raw message.

drivers/net/enic/base/vnic_devcmd.h +10 -10
index 09477ab1ce..a2f577f1e3 100644

Lines of this file are not shown. View the raw message.

drivers/net/i40e/base/i40e_osdep.h +2 -2
index 8a2d82a8d0..17eee94533 100644

Lines of this file are not shown. View the raw message.

drivers/net/ice/base/ice_osdep.h +3 -3
index a4a2994c76..aac8969eb8 100644

Lines of this file are not shown. View the raw message.

drivers/net/nfp/nfp_net_pmd.h +3 -3
index f0142e1ff7..cb2d19afe6 100644

Lines of this file are not shown. View the raw message.

drivers/net/softnic/rte_eth_softnic_cli.c +5 -5
index bc95f16439..932ec15f49 100644

Lines of this file are not shown. View the raw message.

drivers/net/tap/tap_bpf_program.c +2 -2
index 532e8838fe..20c310e5e7 100644

Lines of this file are not shown. View the raw message.

drivers/net/tap/tap_rss.h +1 -1
index 17606b2d6e..176e7180bd 100644

Lines of this file are not shown. View the raw message.

drivers/net/virtio/virtio_pci.h +1 -1
index 7433d2f085..302d6c3e7a 100644

Lines of this file are not shown. View the raw message.

drivers/net/virtio/virtio_user/vhost_user.c +1 -1
index d8e083ba8b..74b82e56e4 100644

Lines of this file are not shown. View the raw message.

drivers/net/virtio/virtqueue.h +2 -2
index d8cf5d4e2f..e3d38b5a67 100644

Lines of this file are not shown. View the raw message.

drivers/raw/dpaa2_qdma/dpaa2_qdma.h +1 -1
index 1bce1a4d64..017638075d 100644

Lines of this file are not shown. View the raw message.

drivers/raw/ifpga/base/opae_hw_api.h +1 -1
index cdf369fce5..cf8ff93a69 100644

Lines of this file are not shown. View the raw message.

drivers/raw/ioat/rte_ioat_spec.h +1 -1
index 305e36dedb..c6e7929b2c 100644

Lines of this file are not shown. View the raw message.

drivers/vdpa/ifc/base/ifcvf.h +1 -1
index 9be2770fea..eb04a94067 100644

Lines of this file are not shown. View the raw message.

examples/ip_pipeline/cli.c +5 -5
index 3e23f4e7b7..d79699e2ed 100644

Lines of this file are not shown. View the raw message.

examples/ipsec-secgw/ipsec.h +1 -1
index 4f2fd61840..a70a4c4f4e 100644

Lines of this file are not shown. View the raw message.

examples/l3fwd-power/main.c +2 -2
index e90d18b24f..bb132441d9 100644

Lines of this file are not shown. View the raw message.

examples/l3fwd/l3fwd_em.c +2 -2
index 1226709106..7dab299526 100644

Lines of this file are not shown. View the raw message.

examples/performance-thread/l3fwd-thread/main.c +2 -2
index ad540fd842..73a811c99e 100644

Lines of this file are not shown. View the raw message.

examples/ptpclient/ptpclient.c +8 -8
index a1a7ae699a..6fcd1aa26e 100644

Lines of this file are not shown. View the raw message.

examples/vhost_blk/blk_spec.h +1 -1
index 5875e2f869..594bd6a29b 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/common/eal_private.h +1 -1
index ddcfbe2e44..8536ed70bb 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/common/include/rte_memzone.h +1 -1
index f478fa9e67..091c9522f7 100644

Lines of this file are not shown. View the raw message.

lib/librte_efd/rte_efd.c +2 -2
index 4deeb17924..6a799556d4 100644

Lines of this file are not shown. View the raw message.

lib/librte_ip_frag/rte_ip_frag.h +1 -1
index 0c0d95f47a..66edd7e33a 100644

Lines of this file are not shown. View the raw message.

lib/librte_ipsec/crypto.h +4 -4
index f8fbf8d4f3..3d03034590 100644

Lines of this file are not shown. View the raw message.

lib/librte_net/rte_arp.h +2 -2
index 79a764fc85..feb0eb3e49 100644

Lines of this file are not shown. View the raw message.

lib/librte_net/rte_esp.h +2 -2
index bc7b20a964..464c513e2b 100644

Lines of this file are not shown. View the raw message.

lib/librte_net/rte_ether.h +1 -1
index 850c0fa387..0ae4e75b6c 100644

Lines of this file are not shown. View the raw message.

lib/librte_net/rte_gre.h +1 -1
index b5279ede17..ac3ddaada3 100644

Lines of this file are not shown. View the raw message.

lib/librte_net/rte_gtp.h +1 -1
index 59267c07b7..104384cc53 100644

Lines of this file are not shown. View the raw message.

lib/librte_net/rte_icmp.h +1 -1
index e0aeed443e..4429e8e29f 100644

Lines of this file are not shown. View the raw message.

lib/librte_net/rte_ip.h +2 -2
index 1ceb7b7931..a69430f9b7 100644

Lines of this file are not shown. View the raw message.

lib/librte_net/rte_mpls.h +1 -1
index 32b6431219..db91707e67 100644

Lines of this file are not shown. View the raw message.

lib/librte_net/rte_sctp.h +1 -1
index ab38be7689..965682dc2b 100644

Lines of this file are not shown. View the raw message.

lib/librte_net/rte_tcp.h +1 -1
index 06f623da83..506ac4e8ce 100644

Lines of this file are not shown. View the raw message.

lib/librte_net/rte_udp.h +1 -1
index 01c26b3de5..6135494c4a 100644

Lines of this file are not shown. View the raw message.

lib/librte_net/rte_vxlan.h +2 -2
index 63fc27240f..c23c10c9eb 100644

Lines of this file are not shown. View the raw message.

lib/librte_pipeline/rte_table_action.c +17 -17
index e6af23b688..98f3438774 100644

Lines of this file are not shown. View the raw message.

lib/librte_vhost/vhost_user.h +1 -1
index 86c364a935..1f65efa4a9 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.25.0

Part of the diff is not shown here. View the raw message.

#9 lore raw

PATCH 7/15 replace always-inline attributes

In reply to Thomas Monjalon

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

---
 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(-)
app/test-eventdev/test_order_atq.c +1 -1
index abccbccacb..3366cfce9a 100644
@@ -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 */
app/test-eventdev/test_order_common.h +2 -2
index 22a1cc8325..e0fe9c968a 100644
@@ -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)
 {
app/test-eventdev/test_order_queue.c +1 -1
index 7ac570c730..495efd92f9 100644
@@ -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 */
app/test-eventdev/test_perf_atq.c +2 -2
index d0241ec4ae..8fd51004ee 100644
@@ -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)
 {
app/test-eventdev/test_perf_common.h +2 -2
index d8fbee6d89..ff9705df88 100644
@@ -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)
app/test-eventdev/test_perf_queue.c +2 -2
index 29098580e7..f4ea3a795f 100644
@@ -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)
 {
drivers/net/ice/ice_rxtx.c +1 -1
index ce5b8e6ca3..045680533f 100644
@@ -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;
lib/librte_eal/common/include/arch/x86/rte_rtm.h +3 -3
index eb0f8e81e1..36bf49846f 100644
@@ -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;
lib/librte_power/rte_power_empty_poll.c +9 -9
index 0a8024ddca..70c07b1533 100644
@@ -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;
Signature · 1 line
2.25.0
#10 lore raw

PATCH 8/15 replace no-inline attributes

In reply to Thomas Monjalon

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

---
 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(-)
drivers/common/dpaax/compat.h +1 -1
index 5b11c2d927..90db68ce76 100644
@@ -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)
drivers/net/dpaa2/dpaa2_rxtx.c +2 -2
index 52d913d9ea..23d48035d5 100644
@@ -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)
 {
lib/librte_eal/common/include/rte_common.h +1 -1
index 1677a0147a..5145473415 100644
@@ -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 ********/
 
Signature · 1 line
2.25.0
#11 lore raw

PATCH 9/15 replace unused attributes

In reply to Thomas Monjalon

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

---
 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(-)
app/test-acl/main.c +1 -1
index 57f23942eb..4bc00272f4 100644
@@ -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;
app/test-cmdline/cmdline_test.c +3 -1
index 3e406331a0..89f4260cbf 100644
@@ -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;
 
app/test-cmdline/commands.c +21 -19
index d81da9665a..d67c0ca6ac 100644
@@ -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);
 }
app/test-crypto-perf/cperf_test_common.c +1 -1
index 85603eed5b..058e0ba564 100644
@@ -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;
app/test-pipeline/main.c +1 -1
index 0be02ac25f..7f0d6d3f18 100644
@@ -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;
 
app/test-pipeline/pipeline_hash.c +5 -5
index 25fb2e0dab..2dd8928d43 100644
@@ -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]);
app/test-pmd/bpf_cmd.c +4 -4
index 830bfc13a5..0f984ccf4a 100644
@@ -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;
 
app/test-pmd/cmdline.c +416 -416

2,077 lines not on this page · raw message

app/test-pmd/cmdline_mtr.c +28 -28

140 lines not on this page · raw message

app/test-pmd/cmdline_tm.c +44 -44

220 lines not on this page · raw message

app/test-pmd/txonly.c +1 -1
index 4b5bec443b..33db9ab521 100644
@@ -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;
 
app/test/commands.c +10 -10
index 3bf767bf7f..d48dd513d7 100644
@@ -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)
app/test/test_atomic.c +7 -7
index de3030d221..214452e543 100644
@@ -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 */
app/test/test_cmdline_lib.c +10 -8
index a856a97132..dec465da5f 100644
@@ -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;
 }
app/test/test_func_reentrancy.c +7 -7
index 596d395eb4..f5ddd03d76 100644
@@ -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;
app/test/test_hash.c +3 -3
index ade473d5d4..03c46a7147 100644
@@ -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;
 }
app/test/test_hash_readwrite.c +1 -1
index a9429091c2..73333dff13 100644
@@ -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();
app/test/test_hash_readwrite_lf_perf.c +4 -4
index 7bfc067f4e..889799865c 100644
@@ -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);
app/test/test_malloc.c +3 -3
index 67a48ba38a..232d3186d0 100644
@@ -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;
app/test/test_mcslock.c +2 -2
index e9359df2ee..ddccaafa92 100644
@@ -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);
app/test/test_mempool.c +3 -3
index c32a5d387d..084842fdaa 100644
@@ -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*/
app/test/test_mempool_perf.c +1 -1
index 4c877834e7..60bda8aadb 100644
@@ -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;
app/test/test_per_lcore.c +3 -3
index 19b55f2642..fcd00212f1 100644
@@ -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());
app/test/test_rwlock.c +2 -2
index 40f91759c2..61bee7d7c2 100644
@@ -65,7 +65,7 @@ struct try_rwlock_lcore {
 static struct try_rwlock_lcore try_lcore_data[RTE_MAX_LCORE];
 
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

app/test/test_spinlock.c +3 -3
index 6ac749597a..842990ed3b 100644

Lines of this file are not shown. View the raw message.

app/test/test_table.c +5 -5
index a4b0ed65f9..bc8d8a2e10 100644

Lines of this file are not shown. View the raw message.

app/test/test_table.h +5 -5
index a66342cb65..43b8855874 100644

Lines of this file are not shown. View the raw message.

app/test/test_table_pipeline.c +11 -11
index 441338ac01..97788ca042 100644

Lines of this file are not shown. View the raw message.

app/test/test_ticketlock.c +3 -3
index 13bdadbcb1..66ab3d1a02 100644

Lines of this file are not shown. View the raw message.

app/test/test_timer.c +5 -5
index 8e0a589828..5933f56ed5 100644

Lines of this file are not shown. View the raw message.

app/test/test_timer_racecond.c +1 -1
index a9e1daf16b..176f224b0a 100644

Lines of this file are not shown. View the raw message.

doc/guides/sample_app_ug/cmd_line.rst +1 -1
index 828a607bec..6deb6c8112 100644

Lines of this file are not shown. View the raw message.

doc/guides/sample_app_ug/hello_world.rst +1 -1
index c0e0a1549e..46f997a7dc 100644

Lines of this file are not shown. View the raw message.

doc/guides/sample_app_ug/l3_forward_power_man.rst +1 -1
index 6ec24f4ad8..475a866cfb 100644

Lines of this file are not shown. View the raw message.

doc/guides/sample_app_ug/timer.rst +2 -2
index 87dfb4c1f4..98d762d238 100644

Lines of this file are not shown. View the raw message.

drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +2 -2
index ab2b213f8d..44d3d49c7a 100644

Lines of this file are not shown. View the raw message.

drivers/common/dpaax/caamflib/compat.h +2 -2
index ce946ccb5c..36ee4b5335 100644

Lines of this file are not shown. View the raw message.

drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +1 -1
index 6ed2701ab6..9727378fcf 100644

Lines of this file are not shown. View the raw message.

drivers/net/bonding/rte_eth_bond_pmd.c +2 -2
index 707a0f3cdd..612a64599a 100644

Lines of this file are not shown. View the raw message.

drivers/net/dpaa2/dpaa2_ethdev.h +1 -1
index 95674b26b9..31dca8c7b6 100644

Lines of this file are not shown. View the raw message.

drivers/net/dpaa2/dpaa2_rxtx.c +3 -3
index 23d48035d5..4159096155 100644

Lines of this file are not shown. View the raw message.

drivers/net/enic/base/vnic_dev.c +2 -2
index d6f3ba2b3a..ac03817f40 100644

Lines of this file are not shown. View the raw message.

drivers/net/hinic/hinic_pmd_rx.c +1 -1
index f865f2f470..ade3d5baae 100644

Lines of this file are not shown. View the raw message.

drivers/net/hns3/hns3_ethdev.c +1 -1
index 918fbe076b..da3d72b0e2 100644

Lines of this file are not shown. View the raw message.

drivers/net/hns3/hns3_ethdev_vf.c +2 -2
index 505525eba6..e49ed45b50 100644

Lines of this file are not shown. View the raw message.

drivers/net/i40e/i40e_ethdev.c +5 -5
index 9fbda1c34c..af70ed3ee1 100644

Lines of this file are not shown. View the raw message.

drivers/net/ice/base/ice_osdep.h +5 -5
index aac8969eb8..0955f565af 100644

Lines of this file are not shown. View the raw message.

drivers/net/ixgbe/ixgbe_ethdev.c +3 -3
index 7ea1962f60..94ac24c44c 100644

Lines of this file are not shown. View the raw message.

drivers/net/pfe/base/pfe.h +1 -1
index ff108067d0..72741ba4a8 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/base/bcm_osal.h +1 -1
index 513f6a8b42..8b2faec5b6 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/qede_filter.c +3 -3
index b7ad59ad6d..bad55740a7 100644

Lines of this file are not shown. View the raw message.

drivers/net/thunderx/base/nicvf_mbox.c +1 -1
index 8f83d41ddc..ddac635af9 100644

Lines of this file are not shown. View the raw message.

drivers/raw/ifpga/base/ifpga_compat.h +1 -1
index 931c893854..cdeca70ca5 100644

Lines of this file are not shown. View the raw message.

examples/bond/main.c +14 -14
index ee8fa2d271..8608285b68 100644

Lines of this file are not shown. View the raw message.

examples/cmdline/commands.c +4 -4
index 4badffc257..0e2232f034 100644

Lines of this file are not shown. View the raw message.

examples/cmdline/parse_obj_list.c +1 -1
index 5d29f9d59b..b04adbea58 100644

Lines of this file are not shown. View the raw message.

examples/ethtool/ethtool-app/main.c +1 -1
index 29891012ac..7383413215 100644

Lines of this file are not shown. View the raw message.

examples/fips_validation/fips_validation_aes.c +2 -2
index 010a82627a..b3c5e31f32 100644

Lines of this file are not shown. View the raw message.

examples/fips_validation/fips_validation_hmac.c +2 -2
index 97ac7186e5..1285c9d283 100644

Lines of this file are not shown. View the raw message.

examples/fips_validation/fips_validation_sha.c +2 -2
index 2cca9cecc5..34c364c75a 100644

Lines of this file are not shown. View the raw message.

examples/fips_validation/fips_validation_tdes.c +3 -3
index 5b6737643a..84dd288e60 100644

Lines of this file are not shown. View the raw message.

examples/helloworld/main.c +1 -1
index c922cfbad7..968045f1b0 100644

Lines of this file are not shown. View the raw message.

examples/ip_fragmentation/main.c +1 -1
index 104612339c..2a42122995 100644

Lines of this file are not shown. View the raw message.

examples/ip_reassembly/main.c +1 -1
index d59e6d02ff..e34d8f0e12 100644

Lines of this file are not shown. View the raw message.

examples/ipsec-secgw/ipsec-secgw.c +1 -1
index 4799bc90c5..28aa694beb 100644

Lines of this file are not shown. View the raw message.

examples/l2fwd-jobstats/main.c +1 -1
index f975aa12d0..c1ca100ed0 100644

Lines of this file are not shown. View the raw message.

examples/l2fwd-keepalive/main.c +3 -3
index b36834974e..2ae5a3c6a9 100644

Lines of this file are not shown. View the raw message.

examples/l2fwd/main.c +1 -1
index 09257aab1c..88ddfe5897 100644

Lines of this file are not shown. View the raw message.

examples/l3fwd-acl/main.c +1 -1
index fa92a28297..cccf81929c 100644

Lines of this file are not shown. View the raw message.

examples/l3fwd-power/main.c +7 -7
index bb132441d9..fddc3850dc 100644

Lines of this file are not shown. View the raw message.

examples/l3fwd/l3fwd.h +10 -10
index c786f90628..67055431f7 100644

Lines of this file are not shown. View the raw message.

examples/l3fwd/l3fwd_em.c +5 -5
index 7dab299526..fdbee70b44 100644

Lines of this file are not shown. View the raw message.

examples/l3fwd/l3fwd_lpm.c +5 -5
index 6ad8b30b64..2fe1ecabbc 100644

Lines of this file are not shown. View the raw message.

examples/link_status_interrupt/main.c +1 -1
index a924aa2313..38422f6ac5 100644

Lines of this file are not shown. View the raw message.

examples/multi_process/client_server_mp/mp_server/main.c +1 -1
index 802e29d10d..280dab8672 100644

Lines of this file are not shown. View the raw message.

examples/multi_process/hotplug_mp/commands.c +8 -8
index b068593939..a8a39d07f7 100644

Lines of this file are not shown. View the raw message.

examples/multi_process/simple_mp/main.c +1 -1
index e6c69d6a33..fc79528462 100644

Lines of this file are not shown. View the raw message.

examples/multi_process/simple_mp/mp_commands.c +6 -6
index bdf4947720..311d0fe775 100644

Lines of this file are not shown. View the raw message.

examples/ntb/ntb_fwd.c +17 -17
index 17eedcf0b8..d49189e175 100644

Lines of this file are not shown. View the raw message.

examples/performance-thread/l3fwd-thread/main.c +2 -2
index 73a811c99e..8a1560b503 100644

Lines of this file are not shown. View the raw message.

examples/performance-thread/pthread_shim/main.c +2 -2
index 03ff394369..18f83059bc 100644

Lines of this file are not shown. View the raw message.

examples/qos_meter/main.c +1 -1
index e8112c83a2..4dade4ca2f 100644

Lines of this file are not shown. View the raw message.

examples/qos_sched/cmdline.c +23 -23

46 lines not on this page · raw message

examples/qos_sched/main.c +1 -1
index c0ed16b68f..73864d66db 100644

Lines of this file are not shown. View the raw message.

examples/server_node_efd/server/main.c +1 -1
index 21c72acda2..05f961cff5 100644

Lines of this file are not shown. View the raw message.

examples/timer/main.c +5 -5
index 968a941367..00c251c409 100644

Lines of this file are not shown. View the raw message.

examples/vdpa/main.c +7 -7
index d2e2cb7cd4..6d6831f349 100644

Lines of this file are not shown. View the raw message.

examples/vm_power_manager/guest_cli/vm_power_cli_guest.h +1 -1
index 0c2cc1374d..6ad14a3dea 100644

Lines of this file are not shown. View the raw message.

examples/vm_power_manager/main.c +2 -2
index d39f044c1e..dc6afb132c 100644

Lines of this file are not shown. View the raw message.

examples/vm_power_manager/oob_monitor_nop.c +4 -4
index 7e7b8bc149..fc73ce18ef 100644

Lines of this file are not shown. View the raw message.

examples/vm_power_manager/vm_power_cli.c +10 -10
index 5f64b83fb0..7edeaccda5 100644

Lines of this file are not shown. View the raw message.

examples/vm_power_manager/vm_power_cli.h +1 -1
index 075c255eef..6666cf72c0 100644

Lines of this file are not shown. View the raw message.

examples/vmdq/main.c +1 -1
index 0111109203..67aa558887 100644

Lines of this file are not shown. View the raw message.

lib/librte_cmdline/cmdline.c +1 -1
index 53cda84c13..cfd703e5b3 100644

Lines of this file are not shown. View the raw message.

lib/librte_cmdline/cmdline_parse_etheraddr.c +2 -2
index 2cb8dd2a12..5cb10de321 100644

Lines of this file are not shown. View the raw message.

lib/librte_cmdline/cmdline_parse_portlist.c +2 -2
index ad43b522e9..e1aa07be4b 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/common/include/rte_common.h +1 -1
index 5145473415..fc66d9236a 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/freebsd/eal/eal.c +1 -1
index 6ae37e7e69..80dc9aa78c 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/freebsd/eal/eal_thread.c +1 -1
index 309b587266..925737d34d 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/linux/eal/eal.c +1 -1
index 9530ee55f8..d1e532fc1b 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/linux/eal/eal_log.c +1 -1
index 9d02dddbed..43c8460bfb 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/linux/eal/eal_thread.c +1 -1
index 379773b683..575c96089b 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/linux/eal/eal_timer.c +1 -1
index a904a8297c..6dc6b565d7 100644

Lines of this file are not shown. View the raw message.

lib/librte_mbuf/rte_mbuf.c +3 -3
index cd5794d4a5..220eb2fb0c 100644

Lines of this file are not shown. View the raw message.

lib/librte_power/power_kvm_vm.c +7 -7
index 277ebbeaeb..2bb17beb17 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.25.0

Part of the diff is not shown here. View the raw message.

#12 lore raw

PATCH 10/15 replace used attributes

In reply to Thomas Monjalon

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

---
 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(-)
lib/librte_eal/common/eal_common_options.c +1 -1
index 5920233bcd..dcea9a3e9c 100644
@@ -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);
lib/librte_eal/common/include/rte_common.h +5 -0
index fc66d9236a..1bd627fa9e 100644
@@ -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 ********/
 
 /**
lib/librte_eal/common/include/rte_dev.h +4 -4
index a5c35f00c0..c8d985fb5c 100644
@@ -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.
lib/librte_eal/common/include/rte_function_versioning.h +1 -1
index c924351d5e..b9f862d295 100644
@@ -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
Signature · 1 line
2.25.0
#13 lore raw

PATCH 11/15 replace hot attributes

In reply to Thomas Monjalon

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

---
 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(-)
drivers/common/cpt/cpt_common.h +0 -4
index dff45f0fe9..56bfea4953 100644
@@ -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 {
drivers/common/cpt/cpt_ucode.h +1 -1
index c310ea7cb4..0d3a01b37a 100644
@@ -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)
 {
drivers/common/cpt/cpt_ucode_asym.h +2 -2
index a67efb361c..5d1c7b5f02 100644
@@ -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,
drivers/common/dpaax/dpaax_iova_table.h +1 -1
index fef97f6dde..fc3b9e7a8f 100644
@@ -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) {
drivers/common/octeontx2/otx2_common.h +0 -5
index bf5ea86b3a..e62cdea076 100644
@@ -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 {
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +1 -1
index 9727378fcf..9e1b84dfab 100644
@@ -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,
drivers/crypto/octeontx/otx_cryptodev_ops.c +9 -9
index d7f3d08272..44c8267388 100644
@@ -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)
 {
drivers/crypto/octeontx2/otx2_cryptodev_ops.c +4 -4
index 7eebb49636..a6f80c1fcc 100644
@@ -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)
 {
drivers/event/octeontx/ssovf_worker.c +8 -8
index d940b5dd65..a60c4fc50f 100644
@@ -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;
drivers/event/octeontx/ssovf_worker.h +0 -4
index c4f886d63a..009b9c18a5 100644
@@ -17,10 +17,6 @@ enum {
 	SSO_SYNC_EMPTY
 };
 
-#ifndef __hot
-#define __hot	__attribute__((hot))
-#endif
-
 /* SSO Operations */
 
 static __rte_always_inline struct rte_mbuf *
drivers/event/octeontx2/otx2_worker.c +14 -14
index 8bec59e066..88bac391c7 100644
@@ -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)		\
 {									\
drivers/event/octeontx2/otx2_worker_dual.c +14 -14
index 3cba09caff..3d55d921be 100644
@@ -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)		\
drivers/mempool/octeontx2/otx2_mempool_ops.c +3 -3
index ea4b1c45d2..5f7814df8b 100644
@@ -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);
drivers/net/dpaa2/dpaa2_rxtx.c +12 -12
index 4159096155..703f0549ad 100644
@@ -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,
drivers/net/enetc/enetc_rxtx.c +1 -1
index 81b0ef3b14..e8f0cd8cc8 100644
@@ -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);
drivers/net/octeontx/octeontx_rxtx.c +2 -2
index 1e201f3228..4a65b340b0 100644
@@ -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;
drivers/net/octeontx/octeontx_rxtx.h +0 -4
index d0d73b3046..062c991506 100644
@@ -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
 
drivers/net/octeontx2/otx2_rx.c +3 -3
index 47641c7572..ac40704b6e 100644
@@ -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)	       \
 {									       \
drivers/net/octeontx2/otx2_tx.c +3 -3
index 4f2036cb45..1af6fa649a 100644
@@ -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)	\
 {									\
drivers/net/thunderx/nicvf_rxtx.c +23 -23

183 lines not on this page · raw message

drivers/net/thunderx/nicvf_rxtx.h +2 -6
index a39808cb6b..1f274b2954 100644
@@ -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 |
lib/librte_eal/common/include/rte_common.h +5 -0
index 1bd627fa9e..ea526d408b 100644
@@ -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 ********/
 
 /**
Signature · 1 line
2.25.0
#14 lore raw

PATCH 12/15 replace cold attributes

In reply to Thomas Monjalon

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

---
 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(-)
drivers/net/bnxt/bnxt_rxtx_vec_sse.c +1 -1
index 31457300a7..d0e7910e77 100644
@@ -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;
drivers/net/fm10k/fm10k_ethdev.c +2 -2
index 581c690b18..f537ab2862 100644
@@ -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 =
drivers/net/fm10k/fm10k_rxtx_vec.c +6 -6
index d76dfd16fd..eff3933b5c 100644
@@ -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};
drivers/net/i40e/i40e_rxtx.c +5 -5
index fd1ae80da8..b85758e079 100644
@@ -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 =
drivers/net/i40e/i40e_rxtx_vec_altivec.c +4 -4
index 310ce1ee2d..5fa92bf924 100644
@@ -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);
drivers/net/i40e/i40e_rxtx_vec_neon.c +4 -4
index deb185fe2f..d7d6decafd 100644
@@ -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);
drivers/net/i40e/i40e_rxtx_vec_sse.c +4 -4
index 6ab0bb0d32..698518349f 100644
@@ -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);
drivers/net/iavf/iavf_rxtx_vec_sse.c +6 -6
index b978cc6e05..a08e0e497f 100644
@@ -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);
drivers/net/ice/ice_rxtx.c +4 -4
index 045680533f..56da27f996 100644
@@ -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 =
drivers/net/ice/ice_rxtx_vec_sse.c +4 -4
index 9d5f1f194f..382ef31f3a 100644
@@ -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);
drivers/net/ionic/ionic_rxtx.c +12 -12
index a721d8c521..2592f5cab6 100644
@@ -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;
drivers/net/ixgbe/ixgbe_rxtx.c +29 -29

232 lines not on this page · raw message

drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c +7 -7
index feb86c61ee..293b7c8bd1 100644
@@ -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;
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c +7 -7
index 599ba30e51..517ca31669 100644
@@ -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);
drivers/net/mlx5/mlx5_rxtx_vec.c +2 -2
index 9d7a4ceb7e..1518bdd5b4 100644
@@ -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;
drivers/net/virtio/virtio_rxtx_simple.c +1 -1
index f8bcbaa1c7..a26182bb46 100644
@@ -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;
lib/librte_eal/common/include/rte_common.h +5 -0
index ea526d408b..5a451e4ca2 100644
@@ -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 ********/
 
 /**
lib/librte_eal/common/include/rte_debug.h +1 -1
index 748d32c80f..3ae467211d 100644
@@ -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))
lib/librte_eal/common/include/rte_log.h +1 -1
index 1bb0e66944..f2a5bc18ea 100644
@@ -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)));
Signature · 1 line
2.25.0
#16 lore raw

PATCH 13/15 replace no-return attributes

In reply to Thomas Monjalon

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

---
 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(-)
doc/guides/sample_app_ug/flow_classify.rst +1 -1
index bc234b50a7..dc40b4d6f9 100644
@@ -422,7 +422,7 @@ following:
             .stats = (void *)&ntuple_stats
     };
 
-    static __attribute__((noreturn)) void
+    static __rte_noreturn void
     lcore_main(cls_app)
     {
         uint16_t port;
doc/guides/sample_app_ug/l3_forward_power_man.rst +1 -1
index 475a866cfb..0cc6f2e62e 100644
@@ -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)
     {
         // ...
 
doc/guides/sample_app_ug/performance_thread.rst +1 -1
index 5fed46465f..b04d0ba444 100644
@@ -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
doc/guides/sample_app_ug/skeleton.rst +1 -1
index 1d0a2760d4..34f6f9aea7 100644
@@ -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;
examples/flow_classify/flow_classify.c +1 -1
index 1c12bbb2fd..433e64d3f9 100644
@@ -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;
examples/l2fwd-cat/l2fwd-cat.c +1 -1
index 6838f288c6..45a497c082 100644
@@ -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;
examples/performance-thread/l3fwd-thread/main.c +2 -2
index 8a1560b503..43a5b9248d 100644
@@ -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];
examples/performance-thread/pthread_shim/pthread_shim.h +1 -1
index bba8ed00e4..e90fb15fc1 100644
@@ -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);
 
examples/ptpclient/ptpclient.c +1 -1
index 6fcd1aa26e..bfa86eec5a 100644
@@ -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;
examples/qos_meter/main.c +1 -1
index 4dade4ca2f..6d057abfe3 100644
@@ -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();
examples/rxtx_callbacks/main.c +1 -1
index 07e95e8d1a..54d124b00b 100644
@@ -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;
examples/skeleton/basicfwd.c +1 -1
index 73d313b84e..72ba85fa1f 100644
@@ -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;
examples/timer/main.c +1 -1
index 00c251c409..0259022f10 100644
@@ -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;
lib/librte_eal/common/eal_thread.h +1 -1
index 0d0bad06bd..b40ed249ed 100644
@@ -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
lib/librte_eal/common/include/rte_common.h +6 -2
index 5a451e4ca2..575183e944 100644
@@ -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
lib/librte_eal/common/include/rte_debug.h +1 -1
index 3ae467211d..eb06c835f7 100644
@@ -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
lib/librte_eal/freebsd/eal/eal_thread.c +1 -1
index 925737d34d..f21eddd93c 100644
@@ -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;
lib/librte_eal/linux/eal/eal_interrupts.c +1 -1
index cb8e107098..3893e4065e 100644
@@ -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 */
lib/librte_eal/linux/eal/eal_thread.c +1 -1
index 575c96089b..2fa5806b88 100644
@@ -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;
Signature · 1 line
2.25.0
#17 lore raw

PATCH 14/15 replace printf format attributes

In reply to Thomas Monjalon

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

---
 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(-)
lib/librte_cmdline/cmdline.h +2 -1
index 27d2effdf7..190fc3d165 100644
@@ -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);
 
lib/librte_eal/common/include/rte_common.h +7 -1
index 575183e944..3e14ffc136 100644
@@ -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
 }
lib/librte_eal/common/include/rte_debug.h +1 -1
index eb06c835f7..50052c5a90 100644
@@ -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
 }
lib/librte_eal/common/include/rte_devargs.h +1 -1
index 882dfa0abd..898efa0d66 100644
@@ -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.
lib/librte_eal/common/include/rte_log.h +2 -2
index f2a5bc18ea..f292444966 100644
@@ -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.
Signature · 1 line
2.25.0
#18 lore raw

PATCH 15/15 devtools: check use of compiler attributes

In reply to Thomas Monjalon

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.

---
 devtools/checkpatches.sh | 8 ++++++++
 1 file changed, 8 insertions(+)
devtools/checkpatches.sh +8 -0
index b16bace927..bbde89bc99 100755
@@ -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' \
Signature · 1 line
2.25.0
#19 lore raw
In reply to Thomas Monjalon

10/02/2020 17:20, Thomas Monjalon:

Quoted 10 lines

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.

Quoted 16 lines

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