aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2023-11-06 10:15:55 +0200
committerGitHub <noreply@github.com>2023-11-06 10:15:55 +0200
commit8c8f3e247c2f6dd122be963f832cdb9043a71de5 (patch)
tree1c81ad73c45b1e9ad9fe4f628da4c4f9f24b47f0
parent77d57e69ea968b465dca27aa8f6d9b423d757565 (diff)
parentb99536f95356223e3470ccf2d0039b4b8456b02c (diff)
Merge ODP v1.42.1.0v1.42.1.0_DPDK_22.11
Merge ODP linux-generic v1.42.1.0 into linux-dpdk.
-rw-r--r--.checkpatch.conf1
-rw-r--r--.github/actions/build-failure-log/action.yml7
-rw-r--r--.github/actions/dump-log/action.yml7
-rw-r--r--.github/actions/run-failure-log/action.yml7
-rw-r--r--.github/workflows/ci-pipeline-arm64.yml85
-rw-r--r--.github/workflows/ci-pipeline.yml239
-rw-r--r--CHANGELOG138
-rw-r--r--config/odp-linux-dpdk.conf4
-rw-r--r--configure.ac13
-rw-r--r--doc/users-guide/users-guide-cls.adoc2
-rw-r--r--doc/users-guide/users-guide-pktio.adoc2
-rw-r--r--doc/users-guide/users-guide-timer.adoc2
-rw-r--r--doc/users-guide/users-guide.adoc2
-rw-r--r--example/classifier/odp_classifier.c2
-rw-r--r--example/generator/odp_generator.c11
-rw-r--r--example/ipsec_api/odp_ipsec.c2
-rw-r--r--example/ipsec_crypto/odp_ipsec.c6
-rw-r--r--example/ipsec_crypto/odp_ipsec_fwd_db.h2
-rw-r--r--example/ipsec_crypto/odp_ipsec_misc.h2
-rw-r--r--example/ipsec_crypto/odp_ipsec_sa_db.h2
-rw-r--r--example/ipsec_crypto/odp_ipsec_stream.c4
-rw-r--r--example/packet/odp_pktio.c2
-rw-r--r--example/ping/odp_ping.c20
-rw-r--r--example/switch/odp_switch.c4
-rw-r--r--example/sysinfo/odp_sysinfo.c673
-rw-r--r--example/timer/odp_timer_accuracy.c816
-rw-r--r--example/timer/odp_timer_simple.c6
-rw-r--r--example/timer/odp_timer_test.c5
-rw-r--r--example/traffic_mgmt/odp_traffic_mgmt.c10
-rw-r--r--helper/Makefile.am1
-rw-r--r--helper/chksum.c6
-rw-r--r--helper/cli.c6
-rw-r--r--helper/cuckootable.c8
-rw-r--r--helper/eth.c6
-rw-r--r--helper/hashtable.c8
-rw-r--r--helper/include/odp/helper/chksum.h12
-rw-r--r--helper/include/odp/helper/cli.h21
-rw-r--r--helper/include/odp/helper/deprecated.h8
-rw-r--r--helper/include/odp/helper/eth.h32
-rw-r--r--helper/include/odp/helper/gtp.h14
-rw-r--r--helper/include/odp/helper/icmp.h61
-rw-r--r--helper/include/odp/helper/igmp.h21
-rw-r--r--helper/include/odp/helper/ip.h23
-rw-r--r--helper/include/odp/helper/ipsec.h30
-rw-r--r--helper/include/odp/helper/linux.h6
-rw-r--r--helper/include/odp/helper/linux/process.h13
-rw-r--r--helper/include/odp/helper/linux/pthread.h13
-rw-r--r--helper/include/odp/helper/macros.h67
-rw-r--r--helper/include/odp/helper/odph_api.h7
-rw-r--r--helper/include/odp/helper/odph_cuckootable.h10
-rw-r--r--helper/include/odp/helper/odph_debug.h16
-rw-r--r--helper/include/odp/helper/odph_hashtable.h10
-rw-r--r--helper/include/odp/helper/odph_iplookuptable.h20
-rw-r--r--helper/include/odp/helper/odph_lineartable.h10
-rw-r--r--helper/include/odp/helper/sctp.h14
-rw-r--r--helper/include/odp/helper/strong_types.h22
-rw-r--r--helper/include/odp/helper/table.h34
-rw-r--r--helper/include/odp/helper/tcp.h11
-rw-r--r--helper/include/odp/helper/threads.h17
-rw-r--r--helper/include/odp/helper/udp.h14
-rw-r--r--helper/include/odp/helper/version.h.in10
-rw-r--r--helper/include/odph_list_internal.h6
-rw-r--r--helper/ip.c6
-rw-r--r--helper/iplookuptable.c8
-rw-r--r--helper/ipsec.c6
-rw-r--r--helper/lineartable.c12
-rw-r--r--helper/linux/thread.c6
-rw-r--r--helper/test/.gitignore1
-rw-r--r--helper/test/Makefile.am12
-rw-r--r--helper/test/chksum.c6
-rw-r--r--helper/test/cli.c6
-rw-r--r--helper/test/cuckootable.c8
-rw-r--r--helper/test/debug.c6
-rw-r--r--helper/test/iplookuptable.c6
-rw-r--r--helper/test/linux/process.c6
-rw-r--r--helper/test/linux/pthread.c6
-rw-r--r--helper/test/macros.c71
-rw-r--r--helper/test/odpthreads.c8
-rwxr-xr-xhelper/test/odpthreads_as_processes6
-rwxr-xr-xhelper/test/odpthreads_as_pthreads6
-rw-r--r--helper/test/parse.c6
-rw-r--r--helper/test/table.c6
-rw-r--r--helper/test/version.c6
-rw-r--r--helper/threads.c8
-rw-r--r--helper/version.c6
-rw-r--r--include/README8
-rw-r--r--include/odp/api/abi-default/align.h6
-rw-r--r--include/odp/api/abi-default/atomic.h8
-rw-r--r--include/odp/api/abi-default/barrier.h6
-rw-r--r--include/odp/api/abi-default/buffer.h6
-rw-r--r--include/odp/api/abi-default/buffer_types.h8
-rw-r--r--include/odp/api/abi-default/byteorder.h6
-rw-r--r--include/odp/api/abi-default/classification.h6
-rw-r--r--include/odp/api/abi-default/comp.h6
-rw-r--r--include/odp/api/abi-default/cpu.h6
-rw-r--r--include/odp/api/abi-default/cpumask.h6
-rw-r--r--include/odp/api/abi-default/crypto.h8
-rw-r--r--include/odp/api/abi-default/crypto_types.h8
-rw-r--r--include/odp/api/abi-default/debug.h6
-rw-r--r--include/odp/api/abi-default/dma.h6
-rw-r--r--include/odp/api/abi-default/dma_types.h6
-rw-r--r--include/odp/api/abi-default/errno.h6
-rw-r--r--include/odp/api/abi-default/event.h6
-rw-r--r--include/odp/api/abi-default/event_types.h8
-rw-r--r--include/odp/api/abi-default/hash.h6
-rw-r--r--include/odp/api/abi-default/init.h6
-rw-r--r--include/odp/api/abi-default/ipsec.h8
-rw-r--r--include/odp/api/abi-default/ipsec_types.h8
-rw-r--r--include/odp/api/abi-default/packet.h6
-rw-r--r--include/odp/api/abi-default/packet_flags.h6
-rw-r--r--include/odp/api/abi-default/packet_io.h6
-rw-r--r--include/odp/api/abi-default/packet_io_types.h10
-rw-r--r--include/odp/api/abi-default/packet_types.h8
-rw-r--r--include/odp/api/abi-default/pool.h6
-rw-r--r--include/odp/api/abi-default/pool_types.h8
-rw-r--r--include/odp/api/abi-default/proto_stats.h6
-rw-r--r--include/odp/api/abi-default/proto_stats_types.h8
-rw-r--r--include/odp/api/abi-default/queue.h6
-rw-r--r--include/odp/api/abi-default/queue_types.h8
-rw-r--r--include/odp/api/abi-default/random.h6
-rw-r--r--include/odp/api/abi-default/rwlock.h6
-rw-r--r--include/odp/api/abi-default/rwlock_recursive.h6
-rw-r--r--include/odp/api/abi-default/schedule.h6
-rw-r--r--include/odp/api/abi-default/schedule_types.h6
-rw-r--r--include/odp/api/abi-default/shared_memory.h6
-rw-r--r--include/odp/api/abi-default/spinlock.h6
-rw-r--r--include/odp/api/abi-default/spinlock_recursive.h6
-rw-r--r--include/odp/api/abi-default/stash.h6
-rw-r--r--include/odp/api/abi-default/stash_types.h6
-rw-r--r--include/odp/api/abi-default/std.h6
-rw-r--r--include/odp/api/abi-default/std_types.h6
-rw-r--r--include/odp/api/abi-default/sync.h6
-rw-r--r--include/odp/api/abi-default/thread.h6
-rw-r--r--include/odp/api/abi-default/thrmask.h6
-rw-r--r--include/odp/api/abi-default/ticketlock.h6
-rw-r--r--include/odp/api/abi-default/time.h6
-rw-r--r--include/odp/api/abi-default/time_types.h6
-rw-r--r--include/odp/api/abi-default/timer.h6
-rw-r--r--include/odp/api/abi-default/timer_types.h6
-rw-r--r--include/odp/api/abi-default/traffic_mngr.h8
-rw-r--r--include/odp/api/abi-default/version.h6
-rw-r--r--include/odp/api/align.h6
-rw-r--r--include/odp/api/atomic.h6
-rw-r--r--include/odp/api/barrier.h6
-rw-r--r--include/odp/api/buffer.h6
-rw-r--r--include/odp/api/buffer_types.h6
-rw-r--r--include/odp/api/byteorder.h6
-rw-r--r--include/odp/api/chksum.h6
-rw-r--r--include/odp/api/classification.h6
-rw-r--r--include/odp/api/comp.h6
-rw-r--r--include/odp/api/cpu.h6
-rw-r--r--include/odp/api/cpumask.h6
-rw-r--r--include/odp/api/crypto.h6
-rw-r--r--include/odp/api/crypto_types.h6
-rw-r--r--include/odp/api/debug.h6
-rw-r--r--include/odp/api/deprecated.h6
-rw-r--r--include/odp/api/dma.h6
-rw-r--r--include/odp/api/dma_types.h6
-rw-r--r--include/odp/api/errno.h6
-rw-r--r--include/odp/api/event.h6
-rw-r--r--include/odp/api/event_types.h6
-rw-r--r--include/odp/api/hash.h6
-rw-r--r--include/odp/api/hints.h6
-rw-r--r--include/odp/api/init.h6
-rw-r--r--include/odp/api/ipsec.h6
-rw-r--r--include/odp/api/ipsec_types.h6
-rw-r--r--include/odp/api/packet.h8
-rw-r--r--include/odp/api/packet_flags.h6
-rw-r--r--include/odp/api/packet_io.h6
-rw-r--r--include/odp/api/packet_io_stats.h6
-rw-r--r--include/odp/api/packet_io_types.h6
-rw-r--r--include/odp/api/packet_types.h6
-rw-r--r--include/odp/api/pool.h6
-rw-r--r--include/odp/api/pool_types.h6
-rw-r--r--include/odp/api/proto_stats.h6
-rw-r--r--include/odp/api/proto_stats_types.h6
-rw-r--r--include/odp/api/protocols.h6
-rw-r--r--include/odp/api/queue.h8
-rw-r--r--include/odp/api/queue_types.h6
-rw-r--r--include/odp/api/random.h6
-rw-r--r--include/odp/api/random_types.h6
-rw-r--r--include/odp/api/reassembly.h6
-rw-r--r--include/odp/api/rwlock.h6
-rw-r--r--include/odp/api/rwlock_recursive.h8
-rw-r--r--include/odp/api/schedule.h6
-rw-r--r--include/odp/api/schedule_types.h6
-rw-r--r--include/odp/api/shared_memory.h6
-rw-r--r--include/odp/api/spec/align.h6
-rw-r--r--include/odp/api/spec/atomic.h8
-rw-r--r--include/odp/api/spec/barrier.h6
-rw-r--r--include/odp/api/spec/buffer.h8
-rw-r--r--include/odp/api/spec/buffer_types.h8
-rw-r--r--include/odp/api/spec/byteorder.h6
-rw-r--r--include/odp/api/spec/chksum.h6
-rw-r--r--include/odp/api/spec/classification.h86
-rw-r--r--include/odp/api/spec/comp.h8
-rw-r--r--include/odp/api/spec/cpu.h6
-rw-r--r--include/odp/api/spec/cpumask.h8
-rw-r--r--include/odp/api/spec/crypto.h27
-rw-r--r--include/odp/api/spec/crypto_types.h47
-rw-r--r--include/odp/api/spec/debug.h6
-rw-r--r--include/odp/api/spec/deprecated.h.in6
-rw-r--r--include/odp/api/spec/dma.h6
-rw-r--r--include/odp/api/spec/dma_types.h6
-rw-r--r--include/odp/api/spec/errno.h6
-rw-r--r--include/odp/api/spec/event.h8
-rw-r--r--include/odp/api/spec/event_types.h8
-rw-r--r--include/odp/api/spec/hash.h6
-rw-r--r--include/odp/api/spec/hints.h6
-rw-r--r--include/odp/api/spec/init.h8
-rw-r--r--include/odp/api/spec/ipsec.h8
-rw-r--r--include/odp/api/spec/ipsec_types.h10
-rw-r--r--include/odp/api/spec/packet.h8
-rw-r--r--include/odp/api/spec/packet_flags.h8
-rw-r--r--include/odp/api/spec/packet_io.h9
-rw-r--r--include/odp/api/spec/packet_io_stats.h8
-rw-r--r--include/odp/api/spec/packet_io_types.h14
-rw-r--r--include/odp/api/spec/packet_types.h8
-rw-r--r--include/odp/api/spec/pool.h8
-rw-r--r--include/odp/api/spec/pool_types.h6
-rw-r--r--include/odp/api/spec/proto_stats.h6
-rw-r--r--include/odp/api/spec/proto_stats_types.h8
-rw-r--r--include/odp/api/spec/protocols.h6
-rw-r--r--include/odp/api/spec/queue.h60
-rw-r--r--include/odp/api/spec/queue_types.h10
-rw-r--r--include/odp/api/spec/random.h6
-rw-r--r--include/odp/api/spec/random_types.h8
-rw-r--r--include/odp/api/spec/reassembly.h6
-rw-r--r--include/odp/api/spec/rwlock.h6
-rw-r--r--include/odp/api/spec/rwlock_recursive.h6
-rw-r--r--include/odp/api/spec/schedule.h6
-rw-r--r--include/odp/api/spec/schedule_types.h6
-rw-r--r--include/odp/api/spec/shared_memory.h8
-rw-r--r--include/odp/api/spec/spinlock.h6
-rw-r--r--include/odp/api/spec/spinlock_recursive.h6
-rw-r--r--include/odp/api/spec/stash.h6
-rw-r--r--include/odp/api/spec/stash_types.h6
-rw-r--r--include/odp/api/spec/std.h8
-rw-r--r--include/odp/api/spec/std_types.h10
-rw-r--r--include/odp/api/spec/system_info.h17
-rw-r--r--include/odp/api/spec/thread.h8
-rw-r--r--include/odp/api/spec/thread_types.h6
-rw-r--r--include/odp/api/spec/threshold.h6
-rw-r--r--include/odp/api/spec/thrmask.h6
-rw-r--r--include/odp/api/spec/ticketlock.h6
-rw-r--r--include/odp/api/spec/time.h8
-rw-r--r--include/odp/api/spec/time_types.h8
-rw-r--r--include/odp/api/spec/timer.h33
-rw-r--r--include/odp/api/spec/timer_types.h12
-rw-r--r--include/odp/api/spec/traffic_mngr.h10
-rw-r--r--include/odp/api/spec/version.h.in8
-rw-r--r--include/odp/api/spinlock.h6
-rw-r--r--include/odp/api/spinlock_recursive.h8
-rw-r--r--include/odp/api/stash.h6
-rw-r--r--include/odp/api/stash_types.h6
-rw-r--r--include/odp/api/std.h6
-rw-r--r--include/odp/api/std_types.h6
-rw-r--r--include/odp/api/sync.h6
-rw-r--r--include/odp/api/system_info.h6
-rw-r--r--include/odp/api/thread.h6
-rw-r--r--include/odp/api/threshold.h6
-rw-r--r--include/odp/api/thrmask.h6
-rw-r--r--include/odp/api/ticketlock.h6
-rw-r--r--include/odp/api/time.h6
-rw-r--r--include/odp/api/time_types.h6
-rw-r--r--include/odp/api/timer.h6
-rw-r--r--include/odp/api/timer_types.h6
-rw-r--r--include/odp/api/traffic_mngr.h6
-rw-r--r--include/odp/api/version.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/align.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/atomic.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/barrier.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/buffer.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/buffer_types.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/byteorder.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/classification.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/comp.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/cpu.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/cpumask.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/crypto.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/crypto_types.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/debug.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/dma.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/dma_types.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/errno.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/event.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/event_types.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/hash.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/init.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/ipsec.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/ipsec_types.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/packet.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/packet_flags.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/packet_io.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/packet_io_types.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/packet_types.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/pool.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/pool_types.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/proto_stats_types.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/queue.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/queue_types.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/random.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/rwlock.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/rwlock_recursive.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/schedule.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/schedule_types.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/shared_memory.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/spinlock.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/spinlock_recursive.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/stash.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/stash_types.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/std.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/std_types.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/sync.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/thread.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/thrmask.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/ticketlock.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/time.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/time_types.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/timer.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/timer_types.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/traffic_mngr.h6
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/version.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/align.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/atomic.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/barrier.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/buffer.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/buffer_types.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/byteorder.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/classification.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/comp.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/cpu.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/cpumask.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/crypto.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/crypto_types.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/debug.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/dma.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/dma_types.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/errno.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/event.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/event_types.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/hash.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/init.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/ipsec.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/ipsec_types.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/packet.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/packet_flags.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/packet_io.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/packet_io_types.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/packet_types.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/pool.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/pool_types.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/proto_stats_types.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/queue.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/queue_types.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/random.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/rwlock.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/rwlock_recursive.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/schedule.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/schedule_types.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/shared_memory.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/spinlock.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/spinlock_recursive.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/stash.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/stash_types.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/std.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/std_types.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/sync.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/thread.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/thrmask.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/ticketlock.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/time.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/time_types.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/timer.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/timer_types.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/traffic_mngr.h6
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/version.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/align.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/atomic.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/barrier.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/buffer.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/buffer_types.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/byteorder.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/classification.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/comp.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/cpu.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/cpumask.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/crypto.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/crypto_types.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/debug.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/dma.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/dma_types.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/errno.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/event.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/event_types.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/hash.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/init.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/ipsec.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/ipsec_types.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/packet.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/packet_flags.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/packet_io.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/packet_io_types.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/packet_types.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/pool.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/pool_types.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/proto_stats_types.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/queue.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/queue_types.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/random.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/rwlock.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/rwlock_recursive.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/schedule.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/schedule_types.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/shared_memory.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/spinlock.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/spinlock_recursive.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/stash.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/stash_types.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/std.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/std_types.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/sync.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/thread.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/thrmask.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/ticketlock.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/time.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/time_types.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/timer.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/timer_types.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/traffic_mngr.h6
-rw-r--r--include/odp/arch/default-linux/odp/api/abi/version.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/align.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/atomic.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/barrier.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/buffer.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/buffer_types.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/byteorder.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/classification.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/comp.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/cpu.h8
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/cpumask.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/crypto.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/crypto_types.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/debug.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/dma.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/dma_types.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/errno.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/event.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/event_types.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/hash.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/init.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/ipsec.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/ipsec_types.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/packet.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/packet_flags.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/packet_io.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/packet_io_types.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/packet_types.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/pool.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/pool_types.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/proto_stats_types.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/queue.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/queue_types.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/random.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/rwlock.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/rwlock_recursive.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/schedule.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/schedule_types.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/shared_memory.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/spinlock.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/spinlock_recursive.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/stash.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/stash_types.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/std.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/std_types.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/sync.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/thread.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/thrmask.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/ticketlock.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/time.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/time_types.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/timer.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/timer_types.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/traffic_mngr.h6
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/version.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/align.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/atomic.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/barrier.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/buffer.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/buffer_types.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/byteorder.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/classification.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/comp.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/cpu.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/cpumask.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/crypto.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/crypto_types.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/debug.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/dma.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/dma_types.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/errno.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/event.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/event_types.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/hash.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/init.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/ipsec.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/ipsec_types.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/packet.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/packet_flags.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/packet_io.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/packet_io_types.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/packet_types.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/pool.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/pool_types.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/proto_stats_types.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/queue.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/queue_types.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/random.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/rwlock.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/rwlock_recursive.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/schedule.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/schedule_types.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/shared_memory.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/spinlock.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/spinlock_recursive.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/stash.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/stash_types.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/std.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/std_types.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/sync.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/thread.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/thrmask.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/ticketlock.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/time.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/time_types.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/timer.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/timer_types.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/traffic_mngr.h6
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/version.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/align.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/atomic.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/barrier.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/buffer.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/buffer_types.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/byteorder.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/classification.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/comp.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/cpu.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/cpumask.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/crypto.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/crypto_types.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/debug.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/dma.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/dma_types.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/errno.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/event.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/event_types.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/hash.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/init.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/ipsec.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/ipsec_types.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/packet.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/packet_flags.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/packet_io.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/packet_io_types.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/packet_types.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/pool.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/pool_types.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/proto_stats_types.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/queue.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/queue_types.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/random.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/rwlock.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/rwlock_recursive.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/schedule.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/schedule_types.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/shared_memory.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/spinlock.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/spinlock_recursive.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/stash.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/stash_types.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/std.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/std_types.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/sync.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/thread.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/thrmask.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/ticketlock.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/time.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/time_types.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/timer.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/timer_types.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/traffic_mngr.h6
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/version.h6
-rw-r--r--include/odp/visibility_begin.h6
-rw-r--r--include/odp/visibility_end.h6
-rw-r--r--include/odp_api.h6
-rw-r--r--m4/odp_dpdk.m47
-rw-r--r--platform/linux-dpdk/Makefile.am5
l---------platform/linux-dpdk/arch/aarch64/odp/api/abi/time_cpu.h1
l---------platform/linux-dpdk/arch/aarch64/odp_cpu_cycles.c1
-rw-r--r--platform/linux-dpdk/include/odp/api/plat/packet_inline_types.h9
-rw-r--r--platform/linux-dpdk/include/odp_config_internal.h7
-rw-r--r--platform/linux-dpdk/include/odp_packet_internal.h3
-rw-r--r--platform/linux-dpdk/include/odp_packet_io_internal.h8
-rw-r--r--platform/linux-dpdk/m4/configure.m44
-rw-r--r--platform/linux-dpdk/odp_crypto.c4
-rw-r--r--platform/linux-dpdk/odp_init.c17
-rw-r--r--platform/linux-dpdk/odp_packet.c29
-rw-r--r--platform/linux-dpdk/odp_pool.c15
-rw-r--r--platform/linux-dpdk/odp_queue_basic.c42
-rw-r--r--platform/linux-dpdk/odp_queue_if.c13
-rw-r--r--platform/linux-dpdk/odp_shared_memory.c5
-rw-r--r--platform/linux-dpdk/odp_timer.c37
-rw-r--r--platform/linux-dpdk/test/Makefile.am6
-rw-r--r--platform/linux-dpdk/test/default-timer.conf (renamed from platform/linux-dpdk/test/alternate-timer.conf)4
-rw-r--r--platform/linux-dpdk/test/performance/Makefile.am1
-rw-r--r--platform/linux-dpdk/test/performance/dmafwd/Makefile.am18
-rw-r--r--platform/linux-dpdk/test/performance/dmafwd/pktio_env59
-rw-r--r--platform/linux-generic/Makefile.am2
-rw-r--r--platform/linux-generic/arch/aarch64/cpu_flags.c585
-rw-r--r--platform/linux-generic/arch/aarch64/odp/api/abi/cpu_inlines.h34
-rw-r--r--platform/linux-generic/arch/aarch64/odp_cpu_cycles.c48
-rw-r--r--platform/linux-generic/arch/aarch64/odp_crypto_armv8.c18
-rw-r--r--platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c37
-rw-r--r--platform/linux-generic/include-abi/odp/api/abi/packet_io_types.h4
-rw-r--r--platform/linux-generic/include/odp/api/plat/cpu_inlines.h4
-rw-r--r--platform/linux-generic/include/odp/api/plat/packet_inline_types.h9
-rw-r--r--platform/linux-generic/include/odp/api/plat/queue_inline_types.h6
-rw-r--r--platform/linux-generic/include/odp_classification_datamodel.h2
-rw-r--r--platform/linux-generic/include/odp_config_internal.h10
-rw-r--r--platform/linux-generic/include/odp_fdserver_internal.h2
-rw-r--r--platform/linux-generic/include/odp_global_data.h2
-rw-r--r--platform/linux-generic/include/odp_packet_internal.h3
-rw-r--r--platform/linux-generic/include/odp_packet_io_internal.h8
-rw-r--r--platform/linux-generic/include/odp_ring_mpmc_internal.h59
-rw-r--r--platform/linux-generic/m4/configure.m44
-rw-r--r--platform/linux-generic/m4/odp_dpdk.m42
-rw-r--r--platform/linux-generic/odp_classification.c87
-rw-r--r--platform/linux-generic/odp_crypto_ipsecmb.c22
-rw-r--r--platform/linux-generic/odp_crypto_null.c16
-rw-r--r--platform/linux-generic/odp_crypto_openssl.c43
-rw-r--r--platform/linux-generic/odp_dma.c4
-rw-r--r--platform/linux-generic/odp_fdserver.c6
-rw-r--r--platform/linux-generic/odp_init.c17
-rw-r--r--platform/linux-generic/odp_ipsec.c2
-rw-r--r--platform/linux-generic/odp_ipsec_sad.c2
-rw-r--r--platform/linux-generic/odp_ishmpool.c4
-rw-r--r--platform/linux-generic/odp_packet.c29
-rw-r--r--platform/linux-generic/odp_packet_io.c304
-rw-r--r--platform/linux-generic/odp_pool.c15
-rw-r--r--platform/linux-generic/odp_queue_basic.c42
-rw-r--r--platform/linux-generic/odp_queue_if.c13
-rw-r--r--platform/linux-generic/odp_queue_scalable.c42
-rw-r--r--platform/linux-generic/odp_schedule_scalable.c2
-rw-r--r--platform/linux-generic/odp_system_info.c3
-rw-r--r--platform/linux-generic/odp_timer.c57
-rw-r--r--platform/linux-generic/odp_traffic_mngr.c3
-rw-r--r--platform/linux-generic/pktio/dpdk.c39
-rw-r--r--platform/linux-generic/pktio/ipc.c6
-rw-r--r--platform/linux-generic/pktio/loop.c4
-rw-r--r--platform/linux-generic/pktio/null.c4
-rw-r--r--platform/linux-generic/pktio/pcap.c4
-rw-r--r--platform/linux-generic/pktio/socket.c4
-rw-r--r--platform/linux-generic/pktio/socket_mmap.c4
-rw-r--r--platform/linux-generic/pktio/tap.c4
-rw-r--r--platform/linux-generic/test/Makefile.am12
-rw-r--r--platform/linux-generic/test/performance/Makefile.am1
-rw-r--r--platform/linux-generic/test/performance/dmafwd/Makefile.am18
-rw-r--r--platform/linux-generic/test/performance/dmafwd/pktio_env57
-rw-r--r--platform/linux-generic/test/pktio_ipc/ipc_common.c2
-rw-r--r--platform/linux-generic/test/validation/api/shmem/shmem_linux.c36
-rw-r--r--platform/linux-generic/test/validation/api/shmem/shmem_odp2.c4
-rw-r--r--test/common/mask_common.c3
-rw-r--r--test/common/odp_cunit_common.c4
-rw-r--r--test/performance/.gitignore3
-rw-r--r--test/performance/Makefile.am20
-rw-r--r--test/performance/bench_common.c256
-rw-r--r--test/performance/bench_common.h237
-rw-r--r--test/performance/odp_atomic_perf.c2
-rw-r--r--test/performance/odp_bench_buffer.c233
-rw-r--r--test/performance/odp_bench_misc.c229
-rw-r--r--test/performance/odp_bench_packet.c261
-rw-r--r--test/performance/odp_bench_pktio_sp.c1132
-rw-r--r--test/performance/odp_bench_timer.c179
-rw-r--r--test/performance/odp_cpu_bench.c2
-rw-r--r--test/performance/odp_crypto.c13
-rw-r--r--test/performance/odp_dma_perf.c172
-rw-r--r--test/performance/odp_dmafwd.c1468
-rwxr-xr-xtest/performance/odp_dmafwd_run.sh72
-rw-r--r--test/performance/odp_ipsec.c15
-rw-r--r--test/performance/odp_ipsecfwd.c209
-rw-r--r--test/performance/odp_l2fwd.c28
-rwxr-xr-xtest/performance/odp_l2fwd_run.sh2
-rw-r--r--test/performance/odp_lock_perf.c2
-rw-r--r--test/performance/odp_packet_gen.c542
-rwxr-xr-xtest/performance/odp_packet_gen_run.sh5
-rw-r--r--test/performance/odp_pktio_ordered.c2
-rw-r--r--test/performance/odp_queue_perf.c49
-rw-r--r--test/performance/odp_sched_perf.c2
-rw-r--r--test/performance/odp_sched_pktio.c15
-rw-r--r--test/performance/odp_stash_perf.c515
-rw-r--r--test/performance/odp_timer_perf.c158
-rwxr-xr-xtest/performance/odp_timer_perf_run.sh4
-rw-r--r--test/validation/api/atomic/atomic.c9
-rw-r--r--test/validation/api/buffer/buffer.c2
-rw-r--r--test/validation/api/classification/odp_classification_basic.c386
-rw-r--r--test/validation/api/classification/odp_classification_common.c6
-rw-r--r--test/validation/api/classification/odp_classification_test_pmr.c223
-rw-r--r--test/validation/api/classification/odp_classification_tests.c61
-rw-r--r--test/validation/api/crypto/crypto_op_test.c45
-rw-r--r--test/validation/api/crypto/crypto_op_test.h4
-rw-r--r--test/validation/api/crypto/odp_crypto_test_inp.c348
-rw-r--r--test/validation/api/crypto/util.h3
-rw-r--r--test/validation/api/dma/dma.c28
-rw-r--r--test/validation/api/hash/hash.c10
-rw-r--r--test/validation/api/init/init_main.c2
-rw-r--r--test/validation/api/ipsec/ipsec.c2
-rw-r--r--test/validation/api/ipsec/ipsec.h2
-rw-r--r--test/validation/api/ipsec/ipsec_test_in.c20
-rw-r--r--test/validation/api/ipsec/ipsec_test_out.c10
-rw-r--r--test/validation/api/lock/lock.c4
-rw-r--r--test/validation/api/packet/packet.c2
-rw-r--r--test/validation/api/pktio/pktio.c104
-rw-r--r--test/validation/api/pool/pool.c43
-rw-r--r--test/validation/api/queue/queue.c80
-rw-r--r--test/validation/api/scheduler/scheduler.c4
-rw-r--r--test/validation/api/system/system.c12
-rw-r--r--test/validation/api/timer/timer.c176
-rw-r--r--test/validation/api/traffic_mngr/traffic_mngr.c35
729 files changed, 10440 insertions, 5329 deletions
diff --git a/.checkpatch.conf b/.checkpatch.conf
index 3a0190deb..16235c39b 100644
--- a/.checkpatch.conf
+++ b/.checkpatch.conf
@@ -9,7 +9,6 @@
--ignore=VOLATILE
--ignore=AVOID_EXTERNS
--ignore=CONST_STRUCT
---ignore=ARRAY_SIZE
--ignore=PREFER_KERNEL_TYPES
--ignore=CONSTANT_COMPARISON
--ignore=BLOCK_COMMENT_STYLE
diff --git a/.github/actions/build-failure-log/action.yml b/.github/actions/build-failure-log/action.yml
new file mode 100644
index 000000000..571274c41
--- /dev/null
+++ b/.github/actions/build-failure-log/action.yml
@@ -0,0 +1,7 @@
+name: 'Build Failure Logger'
+description: 'Log output of failing build'
+runs:
+ using: 'composite'
+ steps:
+ - run: find . -name config.log -exec cat {} \;
+ shell: bash
diff --git a/.github/actions/dump-log/action.yml b/.github/actions/dump-log/action.yml
new file mode 100644
index 000000000..039583686
--- /dev/null
+++ b/.github/actions/dump-log/action.yml
@@ -0,0 +1,7 @@
+name: 'Dump Logs'
+description: 'Dump logs of successful run'
+runs:
+ using: 'composite'
+ steps:
+ - run: find . -name "*.log" -exec echo -e "\n\n @@@@@ {} @@@@@\n\n" \; -exec cat {} \;
+ shell: bash
diff --git a/.github/actions/run-failure-log/action.yml b/.github/actions/run-failure-log/action.yml
new file mode 100644
index 000000000..520d178c8
--- /dev/null
+++ b/.github/actions/run-failure-log/action.yml
@@ -0,0 +1,7 @@
+name: 'Run Failure Logger'
+description: 'Log output of failing run'
+runs:
+ using: 'composite'
+ steps:
+ - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ shell: bash
diff --git a/.github/workflows/ci-pipeline-arm64.yml b/.github/workflows/ci-pipeline-arm64.yml
index 84f52c1da..9e85a7881 100644
--- a/.github/workflows/ci-pipeline-arm64.yml
+++ b/.github/workflows/ci-pipeline-arm64.yml
@@ -3,7 +3,7 @@ name: CI arm64
# github.repository has been used to ensure CI is only run on the repo where
# self-hosted runners are installed. This will prevent [self-hosted, ARM64] CI failing on forks
-on: [push, pull_request]
+on: [push, pull_request, merge_group]
env:
ARCH: arm64
CC: gcc
@@ -11,7 +11,6 @@ env:
OS: ubuntu_20.04
jobs:
-
Build:
if: ${{ github.repository == 'OpenDataPlane/odp-dpdk' }}
runs-on: [self-hosted, ARM64]
@@ -31,9 +30,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}"
-e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/build_${ARCH}.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name config.log -exec cat {} \;
+ - if: ${{ failure() }}
+ uses: ./.github/actions/build-failure-log
Build_static_u22:
if: ${{ github.repository == 'OpenDataPlane/odp-dpdk' }}
@@ -51,9 +49,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="gcc-${{matrix.cc_ver}}" -e CXX="g++-${{matrix.cc_ver}}"
-e CONF="${CONF} ${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/build_static.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name config.log -exec cat {} \;
+ - if: ${{ failure() }}
+ uses: ./.github/actions/build-failure-log
Build_OS:
if: ${{ github.repository == 'OpenDataPlane/odp-dpdk' }}
@@ -68,9 +65,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}"
-e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${{matrix.os}}-${ARCH}-native /odp/scripts/ci/build_${ARCH}.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name config.log -exec cat {} \;
+ - if: ${{ failure() }}
+ uses: ./.github/actions/build-failure-log
Build_gcc_u22:
if: ${{ github.repository == 'OpenDataPlane/odp-dpdk' }}
@@ -87,9 +83,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="gcc-${{matrix.cc_ver}}" -e CXX="g++-${{matrix.cc_ver}}"
-e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/build_${ARCH}.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name config.log -exec cat {} \;
+ - if: ${{ failure() }}
+ uses: ./.github/actions/build-failure-log
Build_out-of-tree:
if: ${{ github.repository == 'OpenDataPlane/odp-dpdk' }}
@@ -99,9 +94,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}"
-e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/out_of_tree.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name config.log -exec cat {} \;
+ - if: ${{ failure() }}
+ uses: ./.github/actions/build-failure-log
Run_distcheck:
if: ${{ github.repository == 'OpenDataPlane/odp-dpdk' }}
@@ -116,9 +110,8 @@ jobs:
# Ignore distcheck failure (caused by the first 'make check' run unmounting huge pages)
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}"
-e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/distcheck.sh || true
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
Run:
if: ${{ github.repository == 'OpenDataPlane/odp-dpdk' }}
@@ -137,9 +130,10 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e ARCH="${ARCH}"
-e CXX=g++-10 -e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/check.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
+ - if: ${{ success() }}
+ uses: ./.github/actions/dump-log
Run_CFLAGS:
if: ${{ github.repository == 'OpenDataPlane/odp-dpdk' }}
@@ -154,9 +148,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e ARCH="${ARCH}"
-e CXX=g++-10 -e CFLAGS="${{matrix.cflags}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/check.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
Run_OS:
if: ${{ github.repository == 'OpenDataPlane/odp-dpdk' }}
@@ -170,9 +163,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}"
-e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${{matrix.os}}-${ARCH}-native /odp/scripts/ci/check.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
Run_sched_config:
if: ${{ github.repository == 'OpenDataPlane/odp-dpdk' }}
@@ -182,9 +174,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}"
-e CONF="${CONF}" -e ODP_CONFIG_FILE=/odp/platform/linux-dpdk/test/sched-basic.conf $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/check.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
Run_stash_config:
if: ${{ github.repository == 'OpenDataPlane/odp-dpdk' }}
@@ -194,9 +185,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}"
-e CONF="${CONF}" -e ODP_CONFIG_FILE=/odp/platform/linux-dpdk/test/stash-custom.conf $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/check.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
Run_scheduler_sp:
if: ${{ github.repository == 'OpenDataPlane/odp-dpdk' }}
@@ -206,9 +196,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}"
-e CONF="${CONF}" -e ODP_SCHEDULER=sp $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/check.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
Run_process_mode:
if: ${{ github.repository == 'OpenDataPlane/odp-dpdk' }}
@@ -219,9 +208,8 @@ jobs:
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}"
-e CONF="${CONF}" -e ODP_CONFIG_FILE=/odp/platform/linux-dpdk/test/process-mode.conf
-e ODPH_PROC_MODE=1 $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/check.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
Run_dpdk-19_11:
if: ${{ github.repository == 'OpenDataPlane/odp-dpdk' }}
@@ -231,9 +219,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}"
-e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native-dpdk_19.11 /odp/scripts/ci/check.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
Run_dpdk-20_11:
if: ${{ github.repository == 'OpenDataPlane/odp-dpdk' }}
@@ -243,9 +230,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}"
-e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native-dpdk_20.11 /odp/scripts/ci/check.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
Run_dpdk-21_11:
if: ${{ github.repository == 'OpenDataPlane/odp-dpdk' }}
@@ -255,6 +241,5 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}"
-e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native-dpdk_21.11 /odp/scripts/ci/check.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml
index 280e9653e..13108c1bf 100644
--- a/.github/workflows/ci-pipeline.yml
+++ b/.github/workflows/ci-pipeline.yml
@@ -1,6 +1,6 @@
name: CI x86_64
-on: [push, pull_request]
+on: [push, pull_request, merge_group]
env:
ARCH: x86_64
CC: gcc
@@ -11,55 +11,51 @@ jobs:
Checkpatch:
runs-on: ubuntu-20.04
steps:
- - uses: actions/checkout@v3
- with:
- fetch-depth: 0
-
- - name: Install dependencies
- run: |
- sudo apt update
- sudo apt install codespell
-
- - name: Check pull request
- if: github.event_name == 'pull_request'
- env:
- CHECKPATCH_COMMAND: ./scripts/checkpatch.pl
- uses: webispy/checkpatch-action@v8
-
- - name: Check push
- if: github.event_name == 'push' && github.ref != 'refs/heads/master'
- run: |
- AFTER=${{ github.event.after }}
- BEFORE=${{ github.event.before }}
- if [ -z "${BEFORE//0}" ] || [ -z "${AFTER//0}" ]; then
- COMMIT_RANGE=""
- else
- COMMIT_RANGE="${BEFORE}..${AFTER}"
- fi
- ./scripts/ci-checkpatches.sh ${COMMIT_RANGE}
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ - name: Install dependencies
+ run: |
+ sudo apt update
+ sudo apt install codespell
+ - name: Check pull request
+ if: github.event_name == 'pull_request'
+ env:
+ CHECKPATCH_COMMAND: ./scripts/checkpatch.pl
+ uses: webispy/checkpatch-action@v8
+ - name: Check push
+ if: github.event_name == 'push' && github.ref != 'refs/heads/master'
+ run: |
+ AFTER=${{ github.event.after }}
+ BEFORE=${{ github.event.before }}
+ if [ -z "${BEFORE//0}" ] || [ -z "${AFTER//0}" ]; then
+ COMMIT_RANGE=""
+ else
+ COMMIT_RANGE="${BEFORE}..${AFTER}"
+ fi
+ ./scripts/ci-checkpatches.sh ${COMMIT_RANGE}
Documentation:
runs-on: ubuntu-20.04
steps:
- - uses: actions/checkout@v3
-
- - name: Install dependencies
- run: |
- sudo apt update
- sudo apt install doxygen asciidoctor libconfig-dev libssl-dev mscgen cmake graphviz libdpdk-dev
- sudo gem install asciidoctor
- - name: Build
- shell: bash
- run: |
- ./bootstrap
- ./configure --enable-user-guides
- pushd doc
- make
- popd
- touch ./doxygen.log
- # Doxygen does not trap on warnings, check for them here.
- make doxygen-doc 2>&1 | tee ./doxygen.log
- ! fgrep -rq warning ./doxygen.log
+ - uses: actions/checkout@v3
+ - name: Install dependencies
+ run: |
+ sudo apt update
+ sudo apt install doxygen asciidoctor libconfig-dev libssl-dev mscgen cmake graphviz libdpdk-dev
+ sudo gem install asciidoctor
+ - name: Build
+ shell: bash
+ run: |
+ ./bootstrap
+ ./configure --enable-user-guides
+ pushd doc
+ make
+ popd
+ touch ./doxygen.log
+ # Doxygen does not trap on warnings, check for them here.
+ make doxygen-doc 2>&1 | tee ./doxygen.log
+ ! fgrep -rq warning ./doxygen.log
Build:
runs-on: ubuntu-20.04
@@ -78,9 +74,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}"
-e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name config.log -exec cat {} \;
+ - if: ${{ failure() }}
+ uses: ./.github/actions/build-failure-log
Build_static_u22:
runs-on: ubuntu-20.04
@@ -96,9 +91,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="gcc-${{matrix.cc_ver}}" -e CXX="g++-${{matrix.cc_ver}}"
-e CONF="${CONF} ${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-static /odp/scripts/ci/build_static.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name config.log -exec cat {} \;
+ - if: ${{ failure() }}
+ uses: ./.github/actions/build-failure-log
Build_arm64:
runs-on: ubuntu-20.04
@@ -114,9 +108,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}"
-e CONF="${CONF} ${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name config.log -exec cat {} \;
+ - if: ${{ failure() }}
+ uses: ./.github/actions/build-failure-log
Build_arm64_u18:
runs-on: ubuntu-20.04
@@ -131,9 +124,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}"
-e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name config.log -exec cat {} \;
+ - if: ${{ failure() }}
+ uses: ./.github/actions/build-failure-log
Build_ppc64el:
runs-on: ubuntu-20.04
@@ -148,9 +140,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}"
-e CONF="${CONF} ${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name config.log -exec cat {} \;
+ - if: ${{ failure() }}
+ uses: ./.github/actions/build-failure-log
Build_i386:
runs-on: ubuntu-20.04
@@ -166,9 +157,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}"
-e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name config.log -exec cat {} \;
+ - if: ${{ failure() }}
+ uses: ./.github/actions/build-failure-log
Build_OS:
runs-on: ubuntu-20.04
@@ -182,9 +172,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}"
-e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${{matrix.os}}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name config.log -exec cat {} \;
+ - if: ${{ failure() }}
+ uses: ./.github/actions/build-failure-log
Build_gcc_u18:
runs-on: ubuntu-20.04
@@ -199,9 +188,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="gcc-${{matrix.cc_ver}}" -e CXX="g++-${{matrix.cc_ver}}"
-e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name config.log -exec cat {} \;
+ - if: ${{ failure() }}
+ uses: ./.github/actions/build-failure-log
Build_gcc_u22:
runs-on: ubuntu-20.04
@@ -216,43 +204,28 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="gcc-${{matrix.cc_ver}}" -e CXX="g++-${{matrix.cc_ver}}"
-e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name config.log -exec cat {} \;
+ - if: ${{ failure() }}
+ uses: ./.github/actions/build-failure-log
Build_out-of-tree:
runs-on: ubuntu-20.04
steps:
- - uses: actions/checkout@v3
- - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}"
- -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/out_of_tree.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name config.log -exec cat {} \;
+ - uses: actions/checkout@v3
+ - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}"
+ -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/out_of_tree.sh
+ - if: ${{ failure() }}
+ uses: ./.github/actions/build-failure-log
Build_linux-generic:
runs-on: ubuntu-20.04
env:
CONF: "--with-platform=linux-generic"
steps:
- - uses: actions/checkout@v3
- - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ODP_LIB_NAME="libodp-linux"
- -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name config.log -exec cat {} \;
-
- Run_coverage:
- runs-on: ubuntu-20.04
- steps:
- uses: actions/checkout@v3
- - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}"
- -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/coverage.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
- - name: Upload to Codecov
- uses: codecov/codecov-action@v3
+ - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ODP_LIB_NAME="libodp-linux"
+ -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh
+ - if: ${{ failure() }}
+ uses: ./.github/actions/build-failure-log
Run_distcheck:
runs-on: ubuntu-20.04
@@ -261,13 +234,12 @@ jobs:
matrix:
conf: ['--enable-user-guides', '--enable-user-guides --enable-abi-compat']
steps:
- - uses: actions/checkout@v3
- # Ignore distcheck failure (caused by the first 'make check' run unmounting huge pages)
- - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}"
+ - uses: actions/checkout@v3
+ # Ignore distcheck failure (caused by the first 'make check' run unmounting huge pages)
+ - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}"
-e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/distcheck.sh || true
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
Run:
runs-on: ubuntu-20.04
@@ -284,9 +256,10 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e ARCH="${ARCH}"
-e CXX=g++-10 -e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/check.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
+ - if: ${{ success() }}
+ uses: ./.github/actions/dump-log
Run_OS:
runs-on: ubuntu-20.04
@@ -299,9 +272,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e ARCH="${ARCH}"
-e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${{matrix.os}}-${ARCH} /odp/scripts/ci/check.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
Run_sched_config:
runs-on: ubuntu-20.04
@@ -309,9 +281,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}"
-e CONF="${CONF}" -e ODP_CONFIG_FILE=/odp/platform/linux-dpdk/test/sched-basic.conf $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/check.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
Run_stash_config:
runs-on: ubuntu-20.04
@@ -319,9 +290,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}"
-e CONF="${CONF}" -e ODP_CONFIG_FILE=/odp/platform/linux-dpdk/test/stash-custom.conf $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/check.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
Run_scheduler_sp:
runs-on: ubuntu-20.04
@@ -329,9 +299,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}"
-e CONF="${CONF}" -e ODP_SCHEDULER=sp $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/check.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
Run_process_mode:
runs-on: ubuntu-20.04
@@ -340,20 +309,18 @@ jobs:
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}"
-e CONF="${CONF}" -e ODP_CONFIG_FILE=/odp/platform/linux-dpdk/test/process-mode.conf
-e ODPH_PROC_MODE=1 $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/check.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
- Run_alternate_timer:
+ Run_default_timer:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}"
- -e ODP_CONFIG_FILE=/odp/platform/linux-dpdk/test/alternate-timer.conf
- -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/check.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ -e ODP_CONFIG_FILE=/odp/platform/linux-dpdk/test/default-timer.conf
+ -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/check_validation.sh
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
Run_dpdk-19_11:
runs-on: ubuntu-20.04
@@ -361,9 +328,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}"
-e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-dpdk_19.11 /odp/scripts/ci/check.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
Run_dpdk-20_11:
runs-on: ubuntu-20.04
@@ -371,9 +337,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}"
-e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-dpdk_20.11 /odp/scripts/ci/check.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
Run_dpdk-21_11:
runs-on: ubuntu-20.04
@@ -381,9 +346,8 @@ jobs:
- uses: actions/checkout@v3
- run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}"
-e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-dpdk_21.11 /odp/scripts/ci/check.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
Run_crypto:
runs-on: ubuntu-20.04
@@ -397,6 +361,5 @@ jobs:
-e CONF="${CONF}" -e ODP_PLATFORM_PARAMS="--vdev=${{matrix.driver}}"
-e ODP_CONFIG_FILE=/odp/platform/linux-dpdk/test/crypto.conf
$CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/check_validation.sh
- - name: Failure log
- if: ${{ failure() }}
- run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
+ - if: ${{ failure() }}
+ uses: ./.github/actions/run-failure-log
diff --git a/CHANGELOG b/CHANGELOG
index 08bf49d75..4cb2a57cb 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,105 @@
+== OpenDataPlane (1.42.1.0)
+
+=== Backward compatible API changes
+==== Classifier
+* Add new `odp_cls_pmr_create_multi()` function for creating multiple packet
+matching rules with a single call.
+* Add new `odp_cls_pmr_destroy_multi()` function for destroying multiple PMRs
+with a single call.
+* Add new `odp_cls_cos_create_multi()` function for creating multiple class-of-
+services with a single call.
+* Add new `odp_cos_destroy_multi()` function for destroying multiple CoSes with
+a single call.
+
+==== Crypto
+* Clarify packet ordering of async crypto ops (`odp_crypto_op_enq()`).
+* Add `odp_crypto_packet_op_param_t.null_crypto` parameter that tells that a
+packet should be processed as if the configured algorithms were null cipher and
+null auth algorithm.
+* Add `ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP` crypto operation type that allows both
+basic and out-of-place operations in the same session.
+
+==== Packet IO
+* Add new API define `ODP_PKTIO_MAX_INDEX` for maximum packet IO interface
+index.
+
+==== Queue
+* Add new `odp_queue_create_multi()` function for creating multiple queues with
+a single call.
+* Add new `odp_queue_destroy_multi()` function for destroying multiple queues
+with a single call.
+* Clarify `odp_queue_param_t` default value specification.
+
+==== System
+* Add enumerations for ARM ISA versions ARMv8.8-A, ARMv8.9-A, and ARMv9.3-A.
+
+==== Timer
+* Change `odp_timer_pool_param_t.num_timers` description to allow applications
+to attempt to allocate more timers than there are in a timer pool.
+* Add new `odp_timeout_alloc_multi()` function for allocating multiple timeouts
+with a single call.
+* Add new `odp_timeout_free_multi()` function for freeing multiple timeouts with
+a single call.
+
+=== Helper (1.4.0)
+==== Backward incompatible changes
+===== Protocols
+* Rename `ODP_GTP_HLEN` define to `ODPH_GTP_HLEN`.
+* Rename `ODP_IGMP_HLEN` define to `ODPH_IGMP_HLEN`.
+* Remove unused ICMP defines and add missing `ODPH_` prefix to the remaining
+ones.
+
+==== Backward compatible changes
+===== Macros
+* Add new `ODPH_MIN()` and `ODPH_MAX()` helper macros for comparison operations.
+* Add new `ODPH_ARRAY_SIZE()` helper macro for calculating array size.
+* Add new `ODPH_ABS()` helper macro for calculating the absolute value of a
+signed variable.
+
+=== Implementation
+==== CPU
+* Optimize `odp_cpu_cycles()` performance on aarch64 by implementing the
+function using `cntvct_el0` virtual counter register.
+
+==== Packet IO
+* Transmitting packet vectors is not supported by the current API, so remove
+the code from the implementation. This may improve performance when transmitting
+packets through event queues.
+* Add support for packet transmit completion check through polling
+(`ODP_PACKET_TX_COMPL_POLL`).
+
+=== Example Applications
+==== sysinfo
+* Add prints for various missing capabilities (e.g. pool, packet IO, timer).
+
+==== timer_accuracy
+* Add new (`-c, --count`) option to set the CPU count.
+* Add new (`-t, --queue_type`) option to set the queue sync type.
+* Add new (`-q, --num_queue`) option to set the number of queues.
+* Add new (`-G, --sched_groups`) option to use a dedicated schedule group for
+each queue.
+
+=== Performance Tests
+==== bench_pktio_sp
+* Add new `odp_bench_pktio_sp` application for measuring delays of ODP packet IO
+slow path functions.
+
+==== dmafwd
+* Add new `odp_dmafwd` application for comparing packet forwarding throughput
+when received packets are first copied either with software memory copy
+or with DMA offload and then echoed back to sender(s).
+
+==== packet_gen
+* Add new (`-m, --tx_mode`) option for selecting how packets are transmitted.
+
+==== stash_perf
+* Add new `odp_stash_perf` application for measuring ODP stash fast path API
+performance.
+
+==== timer_perf
+* Add new mode (`-m 2`) for measuring `odp_schedule()` overhead while
+continuously restarting expiring timers.
+
== OpenDataPlane (1.42.0.0)
=== Backward incompatible API changes
@@ -2673,7 +2775,7 @@ The ODP Reference Implementation corporates a number of improvements that
result in better code organization as well as improved processing efficiency.
==== Pktio null device support
-In the LNG Reference Implemenations of ODP, the `odp_pktio_open()` API may now
+In the LNG Reference Implementations of ODP, the `odp_pktio_open()` API may now
specify devices of class `null` to indicate the PktIO is treated as a dummy
device. Null devices behave just like Linux `/dev/null` in that they never
receive packets and simply discard any packets sent to them.
@@ -3750,7 +3852,7 @@ directory to provide stress-testing of packet ordering features of ODP.
=== Documentation
In addition to expanded documentation related to the new packet reference APIs,
-a section on applicatin portability has been added that discusses the types
+a section on application portability has been added that discusses the types
of portability offered by ODP and the tradeoffs that application writers should
consider when using ODP.
@@ -3934,7 +4036,7 @@ manipulation.
==== Ordered Queue Improvements
The implementation of ordered queues has been streamlined and made more
-scaleable in multi-core systems.
+scalable in multi-core systems.
==== Packet Segmentation Improvements
The more advance segmentation capabilities present in the new ODP packet
@@ -4440,9 +4542,9 @@ containing a larger number of CPUs (typically 24 or more).
implementation-specific capability limits for enhanced program portability.
==== Classification
-* Addtion of a structure that defines system level classification capability
+* Addition of a structure that defines system level classification capability
* Addition of range PMRs to complement the existing value PMRs to permit
- application to specifiy classification rules over a range of values.
+ application to specify classification rules over a range of values.
==== Cryptography
* Provides a way to get the available cipher and authentication algorithms.
@@ -4467,13 +4569,13 @@ containing a larger number of CPUs (typically 24 or more).
* Replaced config definition for maximum pktio entries with maximum packet IO
index call
* Added the classify_enable bit to the odp_pktin_queue_param_t that allows
- applications to explicity control which pktin queues are subject to full
+ applications to explicitly control which pktin queues are subject to full
classifier support.
* Addition of pktin configuration options to control packet timestamping
and checksum validation processing.
* Addition of pktout configuration options to control packet checksum
offload processing.
-* Add the ability to query (via capabilties) whether a pktio interface
+* Add the ability to query (via capabilities) whether a pktio interface
supports operating in loopback mode and if so to enable/disable this
mode of operation.
* Round out the polling APIs be adding the ability to receive packets in
@@ -4499,8 +4601,8 @@ containing a larger number of CPUs (typically 24 or more).
* Add a capability inquiry API to obtain implementation traffic mngr limits.
* Split TOS marking into two separate calls.
* Add new APIs to support VLAN, ECN, and drop precedence marking.
-* Add destroy APIs for shapers, scheduler profiles, threshholds, WRED profiles,
- TM queues, and TM nodes for symmetry and completeness to allow applictions
+* Add destroy APIs for shapers, scheduler profiles, thresholds, WRED profiles,
+ TM queues, and TM nodes for symmetry and completeness to allow applications
to terminate gracefully without resource leakage.
* Add the ability to disconnect TM queues from their fanouts.
* Add TM node contexts to permit applications to anchor user context areas
@@ -4585,7 +4687,7 @@ opendataplane (1.8.0.0)
- test: performance: crypto: measure crypto operation performance
- test: pktio_perf: finalize port to use new pktio api
- test: pktio_perf: port to use new pktio api
- - validataion: packet: add tests for broadcast and multicast flags
+ - validation: packet: add tests for broadcast and multicast flags
- validation: classification: add test case for odp_cos_drop() function
- validation: classifier: port to use new pktio api
- validation: packet: test if user area is properly set
@@ -4827,10 +4929,10 @@ opendataplane (1.7.0.0)
- linux-generic: sysinfo: make the cpu_hz per-CPU data
- linux-generic: sysinfo: make the model_str per-CPU data
- linux-generic: sysinfo: move ARM system info codes to default arch file
- - linux-generic: sysinfo: move MIPS system info codes to its plarform file
- - linux-generic: sysinfo: move PowerPC system info codes to its plarform file
+ - linux-generic: sysinfo: move MIPS system info codes to its platform file
+ - linux-generic: sysinfo: move PowerPC system info codes to its platform file
- linux-generic: sysinfo: move cpu_arch_str to odp_system_info_t
- - linux-generic: sysinfo: move x86 system info codes to its plarform file
+ - linux-generic: sysinfo: move x86 system info codes to its platform file
- linux-generic: sysinfo: rename odp_cpu_hz_current with odp_ prefix
- linux-generic: sysinfo: rename variable cpu_hz to cpu_hz_max
- linux-generic: sysinfo: revise odp_cpu_hz() to return current frequency
@@ -5043,7 +5145,7 @@ opendataplane (1.4.0.0)
- odp_cpumask_def_control() renamed to odp_cpumask_default_control()
- odp init extended with num worker and control threads
- new: int odp_queue_lock_count(odp_queue_t queue);
- - refine api doc for scheduler and schedule orderd locks
+ - refine api doc for scheduler and schedule ordered locks
- argument of odp_schedule_order_lock() and odp_schedule_order_unlock changed to unsigned
- new: int odp_thread_count_max(void)
- ** Packet **
@@ -5120,7 +5222,7 @@ opendataplane (1.4.0.0)
- pktio: fill in L2 parse results by default
- pktio: implement odp_pktio_param_init() API
- packet: implement flow hash support
- - schedule: fix odp_schdule_wait_time
+ - schedule: fix odp_schedule_wait_time
- queue: change lock_index from uint32_t to unsigned to match API
- queue: direct internal enqueues to target queue
- queue: fix pktout_enqueue() logic
@@ -5217,7 +5319,7 @@ opendataplane (1.3.0.0)
opendataplane (1.2.0.0)
* API:
- docs: doxygen grouping clean up and remove excess references to ODP
- - pool: remove shm paramter from odp_pool_create()
+ - pool: remove shm parameter from odp_pool_create()
- packet_io: clarify what happens when not all packets are sent
- cpumask: added default masks and cpumask_setall
- thrmask: added thread mask
@@ -5232,7 +5334,7 @@ opendataplane (1.2.0.0)
- deleted odph_linux_cpumask_default
* test:
* validation:
- - tests execution moved to platfrom side
+ - tests execution moved to platform side
- test: pktio_perf: add missing atomic init
- test: synchronizers: use thread_id instead of cpu_id to detect slow threa
- validation: pktio: do not dequeue from scheduled queue
@@ -5393,7 +5495,7 @@ opendataplane (1.0.2)
- example: l2fwd print packets per second
- linux-generic: linux: destroy used pthread attr
* bugs:
- - validation: packet: use non-zero as true indicato
+ - validation: packet: use non-zero as true indication
- linux-generic: pktio check for NULL entry
- linux-generic: fix incorrect pmr_term_value update in odp_pmr_create_xxx() function
- replace strtok_r with strtok and fix leaks
diff --git a/config/odp-linux-dpdk.conf b/config/odp-linux-dpdk.conf
index de6130362..e2c64c5b3 100644
--- a/config/odp-linux-dpdk.conf
+++ b/config/odp-linux-dpdk.conf
@@ -275,8 +275,8 @@ timer: {
# accordingly.
inline_poll_interval_nsec = 500000
- # Use experimental DPDK alternate timer API based implementation
- alternate = 0
+ # Use DPDK alternate timer API based implementation
+ alternate = 1
}
ipsec: {
diff --git a/configure.ac b/configure.ac
index b0e16930e..33aba2688 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@ AC_PREREQ([2.5])
##########################################################################
m4_define([odp_version_generation], [1])
m4_define([odp_version_major], [42])
-m4_define([odp_version_minor], [0])
+m4_define([odp_version_minor], [1])
m4_define([odp_version_patch], [0])
m4_define([odp_version_api],
@@ -27,7 +27,7 @@ AC_SUBST(ODP_VERSION_API)
# Helper library version
##########################################################################
m4_define([odph_version_generation], [1])
-m4_define([odph_version_major], [3])
+m4_define([odph_version_major], [4])
m4_define([odph_version_minor], [0])
m4_define([odph_version],
@@ -247,7 +247,14 @@ AC_ARG_ENABLE([lto],
# Fat LTO object file contains GIMPLE bytecodes and the usual
# final code. There are less build problems (e.g. due to older
# binutils), but object files are larger.
- ODP_LTO_FLAGS="-flto -ffat-lto-objects"
+ #
+ # -flto=auto and -ffat-lto-objects are currently not supported by clang.
+ $CC --version | grep -q clang
+ if test $? -ne 0; then
+ ODP_LTO_FLAGS="-flto=auto -ffat-lto-objects"
+ else
+ ODP_LTO_FLAGS="-flto"
+ fi
fi])
ODP_CFLAGS="$ODP_CFLAGS $ODP_LTO_FLAGS"
diff --git a/doc/users-guide/users-guide-cls.adoc b/doc/users-guide/users-guide-cls.adoc
index 359d225d8..59163a2da 100644
--- a/doc/users-guide/users-guide-cls.adoc
+++ b/doc/users-guide/users-guide-cls.adoc
@@ -203,7 +203,7 @@ with either cost1, cos11, cos12. In this case the packet was subjected to two
match attempts in total.
The remaining two lines illustrate how a packet that matches pmr_match11 could
-end up wth either cos11, cos21 or cos31, depending on whether it matches
+end up with either cos11, cos21 or cos31, depending on whether it matches
pmr_march1, pmr_march2 or pmr_match3.
=== Practical example
diff --git a/doc/users-guide/users-guide-pktio.adoc b/doc/users-guide/users-guide-pktio.adoc
index 1698060e9..b7da188d0 100644
--- a/doc/users-guide/users-guide-pktio.adoc
+++ b/doc/users-guide/users-guide-pktio.adoc
@@ -314,7 +314,7 @@ typedef union odp_pktin_config_opt_t {
uint64_t all_bits;
} odp_pktin_config_opt_t;
-----
-These are used to control packet timestamping as well as default packet checkum
+These are used to control packet timestamping as well as default packet checksum
verification processing.
==== PktIO Parsing Configuration
diff --git a/doc/users-guide/users-guide-timer.adoc b/doc/users-guide/users-guide-timer.adoc
index e854b5f2d..f644477a0 100644
--- a/doc/users-guide/users-guide-timer.adoc
+++ b/doc/users-guide/users-guide-timer.adoc
@@ -29,7 +29,7 @@ _i.e.,_ trigger both state machines.
.ODP Timers lifecycle State Diagram
image::timer_fsm.svg[align="center"]
-.ODP Timeout event lifecyle State Diagram
+.ODP Timeout event lifecycle State Diagram
image::timeout_fsm.svg[align="center"]
Reminder:
diff --git a/doc/users-guide/users-guide.adoc b/doc/users-guide/users-guide.adoc
index eaff6867e..73ec55c41 100644
--- a/doc/users-guide/users-guide.adoc
+++ b/doc/users-guide/users-guide.adoc
@@ -1317,7 +1317,7 @@ typedef struct odp_schedule_config_t {
* scheduling of the event and synchronization is maintained per flow
* within each queue.
*
- * Depeding on implementation, there may be much more flows supported
+ * Depending on implementation, there may be much more flows supported
* than queues, as flows are lightweight entities.
*
* @see odp_schedule_capability_t, odp_event_flow_id()
diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c
index 5b66003fe..4f71c835b 100644
--- a/example/classifier/odp_classifier.c
+++ b/example/classifier/odp_classifier.c
@@ -1303,7 +1303,7 @@ static void print_info(char *progname, appl_args_t *appl_args)
}
/**
- * Prinf usage information
+ * Print usage information
*/
static void usage(void)
{
diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c
index b980ee180..95ba04c1e 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -35,7 +35,6 @@
#define APPL_MODE_UDP 0 /**< UDP mode */
#define APPL_MODE_PING 1 /**< ping mode */
#define APPL_MODE_RCV 2 /**< receive mode */
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#define PING_THR_TX 0
#define PING_THR_RX 1
@@ -119,7 +118,7 @@ typedef struct {
/** * Thread specific arguments
*/
typedef struct {
- counters_t counters; /**< Packet conters */
+ counters_t counters; /**< Packet counters */
odp_bool_t stop; /**< Stop packet processing */
union {
struct {
@@ -462,7 +461,7 @@ static odp_packet_t setup_icmp_pkt_ref(odp_pool_t pool,
/* icmp */
icmp = (odph_icmphdr_t *)(buf + ODPH_ETHHDR_LEN + ODPH_IPV4HDR_LEN);
- icmp->type = ICMP_ECHO;
+ icmp->type = ODPH_ICMP_ECHO;
icmp->code = 0;
icmp->un.echo.id = 0;
icmp->un.echo.sequence = 0;
@@ -813,7 +812,7 @@ static void process_icmp_pkt(int thr, thread_args_t *thr_args,
uint64_t rtt_ms, rtt_us;
odph_icmphdr_t *icmp = (odph_icmphdr_t *)_icmp;
- if (icmp->type == ICMP_ECHOREPLY) {
+ if (icmp->type == ODPH_ICMP_ECHOREPLY) {
thr_args->counters.ctr_icmp_reply_rcv++;
memcpy(&tsend, (uint8_t *)icmp + ODPH_ICMPHDR_LEN,
@@ -826,7 +825,7 @@ static void process_icmp_pkt(int thr, thread_args_t *thr_args,
PRIu64 ".%.03" PRIu64" ms\n", thr,
odp_be_to_cpu_16(icmp->un.echo.sequence),
rtt_ms, rtt_us);
- } else if (icmp->type == ICMP_ECHO) {
+ } else if (icmp->type == ODPH_ICMP_ECHO) {
printf(" [%02i] ICMP Echo Request\n", thr);
}
}
@@ -1700,7 +1699,7 @@ static void print_info(char *progname, appl_args_t *appl_args)
}
/**
- * Prinf usage information
+ * Print usage information
*/
static void usage(char *progname)
{
diff --git a/example/ipsec_api/odp_ipsec.c b/example/ipsec_api/odp_ipsec.c
index 8491eeabc..524b1ae76 100644
--- a/example/ipsec_api/odp_ipsec.c
+++ b/example/ipsec_api/odp_ipsec.c
@@ -1350,7 +1350,7 @@ static void print_info(char *progname, appl_args_t *appl_args)
}
/**
- * Prinf usage information
+ * Print usage information
*/
static void usage(char *progname)
{
diff --git a/example/ipsec_crypto/odp_ipsec.c b/example/ipsec_crypto/odp_ipsec.c
index ca7a534d4..06d52c311 100644
--- a/example/ipsec_crypto/odp_ipsec.c
+++ b/example/ipsec_crypto/odp_ipsec.c
@@ -317,7 +317,7 @@ odp_event_t polled_odp_schedule_cb(odp_queue_t *from)
}
/**
- * IPsec pre argument processing intialization
+ * IPsec pre argument processing initialization
*/
static
void ipsec_init_pre(void)
@@ -376,7 +376,7 @@ void ipsec_init_pre(void)
}
/**
- * IPsec post argument processing intialization
+ * IPsec post argument processing initialization
*
* Resolve SP DB with SA DB and create corresponding IPsec cache entries
*
@@ -1629,7 +1629,7 @@ static void print_info(char *progname, appl_args_t *appl_args)
}
/**
- * Prinf usage information
+ * Print usage information
*/
static void usage(char *progname)
{
diff --git a/example/ipsec_crypto/odp_ipsec_fwd_db.h b/example/ipsec_crypto/odp_ipsec_fwd_db.h
index 46fda2b87..c6d9c6c99 100644
--- a/example/ipsec_crypto/odp_ipsec_fwd_db.h
+++ b/example/ipsec_crypto/odp_ipsec_fwd_db.h
@@ -71,7 +71,7 @@ void resolve_fwd_db(char *intf, odp_pktio_t pktio, odp_pktout_queue_t pktout,
uint8_t *mac);
/**
- * Display one fowarding database entry
+ * Display one forwarding database entry
*
* @param entry Pointer to entry to display
*/
diff --git a/example/ipsec_crypto/odp_ipsec_misc.h b/example/ipsec_crypto/odp_ipsec_misc.h
index 9f9985c57..69788d115 100644
--- a/example/ipsec_crypto/odp_ipsec_misc.h
+++ b/example/ipsec_crypto/odp_ipsec_misc.h
@@ -30,7 +30,7 @@ extern "C" {
#define KEY_BITS_SHA1_96 160 /**< MD5_96 auth key length in bits */
#define KEY_BITS_SHA256_128 256 /**< SHA256_128 auth key length in bits */
-/**< Number of bits represnted by a string of hexadecimal characters */
+/**< Number of bits represented by a string of hexadecimal characters */
#define KEY_STR_BITS(str) (4 * strlen(str))
/** IPv4 helpers for data length and uint8t pointer */
diff --git a/example/ipsec_crypto/odp_ipsec_sa_db.h b/example/ipsec_crypto/odp_ipsec_sa_db.h
index 771fcb215..72231369f 100644
--- a/example/ipsec_crypto/odp_ipsec_sa_db.h
+++ b/example/ipsec_crypto/odp_ipsec_sa_db.h
@@ -29,7 +29,7 @@ typedef enum sa_flags_s {
typedef struct sa_db_entry_s {
struct sa_db_entry_s *next; /**< Next entry on list */
uint32_t src_ip; /**< Source IPv4 address */
- uint32_t dst_ip; /**< Desitnation IPv4 address */
+ uint32_t dst_ip; /**< Destination IPv4 address */
uint32_t spi; /**< Security Parameter Index */
ipsec_alg_t alg; /**< Cipher/auth algorithm */
ipsec_key_t key; /**< Cipher/auth key */
diff --git a/example/ipsec_crypto/odp_ipsec_stream.c b/example/ipsec_crypto/odp_ipsec_stream.c
index 0a0710a13..f8bc64eae 100644
--- a/example/ipsec_crypto/odp_ipsec_stream.c
+++ b/example/ipsec_crypto/odp_ipsec_stream.c
@@ -324,7 +324,7 @@ odp_packet_t create_ipv4_packet(stream_db_entry_t *stream,
/* ICMP header so we can see it on wireshark */
icmp = (odph_icmphdr_t *)data;
data += sizeof(*icmp);
- icmp->type = ICMP_ECHO;
+ icmp->type = ODPH_ICMP_ECHO;
icmp->code = 0;
icmp->un.echo.id = odp_cpu_to_be_16(0x1234);
icmp->un.echo.sequence = odp_cpu_to_be_16(stream->created);
@@ -583,7 +583,7 @@ clear_packet:
/* Verify ICMP header */
data += sizeof(*icmp);
- if (ICMP_ECHO != icmp->type)
+ if (ODPH_ICMP_ECHO != icmp->type)
return FALSE;
if (0x1234 != odp_be_to_cpu_16(icmp->un.echo.id))
return FALSE;
diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
index 8b2bb55e3..df4528d18 100644
--- a/example/packet/odp_pktio.c
+++ b/example/packet/odp_pktio.c
@@ -718,7 +718,7 @@ static void print_info(char *progname, appl_args_t *appl_args)
}
/**
- * Prinf usage information
+ * Print usage information
*/
static void usage(char *progname)
{
diff --git a/example/ping/odp_ping.c b/example/ping/odp_ping.c
index 52efda9d8..dbe453319 100644
--- a/example/ping/odp_ping.c
+++ b/example/ping/odp_ping.c
@@ -1,7 +1,5 @@
-/* Copyright (c) 2019-2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2019-2023 Nokia
*/
#include <stdio.h>
@@ -16,7 +14,6 @@
#include <odp/helper/odph_api.h>
#define MAX_PKTIOS 32
-#define MAX_PKTIO_INDEXES 1024
#define MAX_PKTIO_NAME 255
#define MAX_PKT_NUM 1024
@@ -48,7 +45,7 @@ typedef struct test_global_t {
} pktio[MAX_PKTIOS];
/* Pktio index lookup table */
- uint8_t pktio_from_idx[MAX_PKTIO_INDEXES];
+ uint8_t pktio_from_idx[ODP_PKTIO_MAX_INDEX + 1];
} test_global_t;
@@ -196,9 +193,6 @@ static int open_pktios(test_global_t *global)
return -1;
}
- if (odp_pktio_max_index() >= MAX_PKTIO_INDEXES)
- printf("Warning: max pktio index (%u) is too large\n", odp_pktio_max_index());
-
odp_pktio_param_init(&pktio_param);
pktio_param.in_mode = ODP_PKTIN_MODE_SCHED;
pktio_param.out_mode = ODP_PKTOUT_MODE_DIRECT;
@@ -287,8 +281,8 @@ static int init_pktio_lookup_tbl(test_global_t *global)
odp_pktio_t pktio = global->pktio[i].pktio;
int pktio_idx = odp_pktio_index(pktio);
- if (pktio_idx < 0 || pktio_idx >= MAX_PKTIO_INDEXES) {
- ODPH_ERR("Bad pktio index: %i\n", pktio_idx);
+ if (pktio_idx < 0) {
+ ODPH_ERR("odp_pktio_index() failed: %s\n", global->opt.pktio_name[i]);
return -1;
}
@@ -564,12 +558,12 @@ static void icmp_reply(test_global_t *global, odp_packet_t pkt)
if (icmp_hdr == NULL || len < 4)
goto error;
- if (icmp_hdr->type != 8 || icmp_hdr->code != 0)
+ if (icmp_hdr->type != ODPH_ICMP_ECHO || icmp_hdr->code != 0)
goto error;
/* Echo reply */
old = *(uint16_t *)(uintptr_t)icmp_hdr;
- icmp_hdr->type = 0;
+ icmp_hdr->type = ODPH_ICMP_ECHOREPLY;
new = *(uint16_t *)(uintptr_t)icmp_hdr;
icmp_hdr->chksum = update_chksum(icmp_hdr->chksum, old, new);
diff --git a/example/switch/odp_switch.c b/example/switch/odp_switch.c
index b40f5c07c..ae12b0b11 100644
--- a/example/switch/odp_switch.c
+++ b/example/switch/odp_switch.c
@@ -1114,8 +1114,6 @@ int main(int argc, char **argv)
thr_param[i].thr_type = ODP_THREAD_WORKER;
}
- odph_thread_create(thread_tbl, &thr_common, thr_param, num_workers);
-
/* Start packet receive and transmit */
for (i = 0; i < if_count; ++i) {
odp_pktio_t pktio;
@@ -1129,6 +1127,8 @@ int main(int argc, char **argv)
}
}
+ odph_thread_create(thread_tbl, &thr_common, thr_param, num_workers);
+
ret = print_speed_stats(num_workers, gbl_args->stats,
gbl_args->appl.time, gbl_args->appl.accuracy);
odp_atomic_store_u32(&gbl_args->exit_threads, 1);
diff --git a/example/sysinfo/odp_sysinfo.c b/example/sysinfo/odp_sysinfo.c
index 093b2f1bf..0bebac4a2 100644
--- a/example/sysinfo/odp_sysinfo.c
+++ b/example/sysinfo/odp_sysinfo.c
@@ -1,20 +1,46 @@
/* Copyright (c) 2018, Linaro Limited
- * Copyright (c) 2022, Nokia
+ * Copyright (c) 2022-2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#include <getopt.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <inttypes.h>
#include <odp_api.h>
+#include <odp/helper/odph_api.h>
#define KB 1024
#define MB (1024 * 1024)
#define MAX_HUGE_PAGES 32
+#define MAX_IFACES 32
+#define MAX_NAME_LEN 128
+
+#define PROG_NAME "odp_sysinfo"
+
+typedef struct {
+ char name[MAX_NAME_LEN];
+ odp_pktio_capability_t capa;
+ odp_proto_stats_capability_t proto_stats_capa;
+} pktio_t;
+
+typedef struct {
+ int num_pktio;
+ pktio_t pktio[MAX_IFACES];
+ struct {
+ odp_timer_capability_t capa[ODP_CLOCK_NUM_SRC];
+ odp_timer_pool_info_t pool_info[ODP_CLOCK_NUM_SRC];
+ int num;
+ } timer;
+} appl_args_t;
/* Check that prints can use %u instead of %PRIu32 */
ODP_STATIC_ASSERT(sizeof(unsigned int) >= sizeof(uint32_t), "unsigned int smaller than uint32_t");
@@ -72,12 +98,18 @@ static const char *arm_isa(odp_cpu_arch_arm_t isa)
return "ARMv8.6-A";
case ODP_CPU_ARCH_ARMV8_7:
return "ARMv8.7-A";
+ case ODP_CPU_ARCH_ARMV8_8:
+ return "ARMv8.8-A";
+ case ODP_CPU_ARCH_ARMV8_9:
+ return "ARMv8.9-A";
case ODP_CPU_ARCH_ARMV9_0:
return "ARMv9.0-A";
case ODP_CPU_ARCH_ARMV9_1:
return "ARMv9.1-A";
case ODP_CPU_ARCH_ARMV9_2:
return "ARMv9.2-A";
+ case ODP_CPU_ARCH_ARMV9_3:
+ return "ARMv9.3-A";
default:
return "Unknown";
}
@@ -361,7 +393,332 @@ static void print_auth(odp_auth_alg_t alg)
printf("%s ", auth_alg_name(alg));
}
-int main(void)
+static int pktio_capability(appl_args_t *appl_args)
+{
+ odp_pool_param_t pool_param;
+ odp_pool_t pool;
+ int ret = 0;
+
+ odp_pool_param_init(&pool_param);
+
+ pool_param.type = ODP_POOL_PACKET;
+ pool_param.pkt.num = 128;
+
+ pool = odp_pool_create("pktio_pool", &pool_param);
+ if (pool == ODP_POOL_INVALID) {
+ ODPH_ERR("Creating packet pool failed\n");
+ return -1;
+ }
+
+ for (int i = 0; i < appl_args->num_pktio; i++) {
+ odp_pktio_param_t param;
+ odp_pktio_t pktio;
+
+ odp_pktio_param_init(&param);
+
+ param.in_mode = ODP_PKTIN_MODE_SCHED;
+ param.out_mode = ODP_PKTOUT_MODE_DIRECT;
+
+ pktio = odp_pktio_open(appl_args->pktio[i].name, pool, &param);
+ if (pktio == ODP_PKTIO_INVALID) {
+ ODPH_ERR("Opening pktio %s failed\n", appl_args->pktio[i].name);
+ ret = -1;
+ break;
+ }
+
+ if (odp_pktio_capability(pktio, &appl_args->pktio[i].capa)) {
+ ODPH_ERR("Reading pktio %s capa failed\n", appl_args->pktio[i].name);
+ ret = -1;
+ }
+
+ if (odp_proto_stats_capability(pktio, &appl_args->pktio[i].proto_stats_capa)) {
+ ODPH_ERR("Reading pktio %s proto stats capa failed\n",
+ appl_args->pktio[i].name);
+ ret = -1;
+ }
+
+ if (odp_pktio_close(pktio)) {
+ ODPH_ERR("Closing pktio %s failed\n", appl_args->pktio[i].name);
+ ret = -1;
+ }
+
+ if (ret)
+ break;
+ }
+
+ if (odp_pool_destroy(pool)) {
+ ODPH_ERR("Destroying pktio pool failed\n");
+ return -1;
+ }
+ return ret;
+}
+
+static void print_pktio_capa(appl_args_t *appl_args)
+{
+ for (int i = 0; i < appl_args->num_pktio; i++) {
+ odp_pktio_capability_t *capa = &appl_args->pktio[i].capa;
+
+ printf("\n");
+ printf(" PKTIO (%s)\n", appl_args->pktio[i].name);
+ printf(" (in_mode: ODP_PKTIN_MODE_SCHED)\n");
+ printf(" (out_mode: ODP_PKTOUT_MODE_DIRECT)\n");
+ printf(" max_input_queues: %u\n", capa->max_input_queues);
+ printf(" min_input_queue_size: %u\n", capa->min_input_queue_size);
+ printf(" max_input_queue_size: %u\n", capa->max_input_queue_size);
+ printf(" max_output_queues: %u\n", capa->max_output_queues);
+ printf(" min_output_queue_size: %u\n", capa->min_output_queue_size);
+ printf(" max_output_queue_size: %u\n", capa->max_output_queue_size);
+ printf(" config.pktin: 0x%" PRIx64 "\n",
+ capa->config.pktin.all_bits);
+ printf(" config.pktout: 0x%" PRIx64 "\n",
+ capa->config.pktout.all_bits);
+ printf(" set_op: 0x%" PRIx32 "\n", capa->set_op.all_bits);
+ printf(" vector.supported: %s\n",
+ support_level(capa->vector.supported));
+ printf(" vector.max_size: %u\n", capa->vector.max_size);
+ printf(" vector.min_size: %u\n", capa->vector.min_size);
+ printf(" vector.max_tmo_ns: %" PRIu64 " ns\n",
+ capa->vector.max_tmo_ns);
+ printf(" vector.min_tmo_ns: %" PRIu64 " ns\n",
+ capa->vector.min_tmo_ns);
+ printf(" lso.max_profiles: %u\n", capa->lso.max_profiles);
+ printf(" lso.max_profiles_per_pktio: %u\n", capa->lso.max_profiles_per_pktio);
+ printf(" lso.max_packet_segments: %u\n", capa->lso.max_packet_segments);
+ printf(" lso.max_segments: %u\n", capa->lso.max_segments);
+ printf(" lso.max_payload_len: %u B\n", capa->lso.max_payload_len);
+ printf(" lso.max_payload_offset: %u B\n", capa->lso.max_payload_offset);
+ printf(" lso.mod_op.add_segment_num: %u\n", capa->lso.mod_op.add_segment_num);
+ printf(" lso.mod_op.add_payload_len: %u\n", capa->lso.mod_op.add_payload_len);
+ printf(" lso.mod_op.add_payload_offset: %u\n",
+ capa->lso.mod_op.add_payload_offset);
+ printf(" lso.max_num_custom: %u\n", capa->lso.max_num_custom);
+ printf(" lso.proto.custom: %u\n", capa->lso.proto.custom);
+ printf(" lso.proto.ipv4: %u\n", capa->lso.proto.ipv4);
+ printf(" lso.proto.ipv6: %u\n", capa->lso.proto.ipv6);
+ printf(" lso.proto.tcp_ipv4: %u\n", capa->lso.proto.tcp_ipv4);
+ printf(" lso.proto.tcp_ipv6: %u\n", capa->lso.proto.tcp_ipv6);
+ printf(" lso.proto.sctp_ipv4: %u\n", capa->lso.proto.sctp_ipv4);
+ printf(" lso.proto.sctp_ipv6: %u\n", capa->lso.proto.sctp_ipv6);
+ printf(" maxlen.equal: %i\n", capa->maxlen.equal);
+ printf(" maxlen.min_input: %u B\n", capa->maxlen.min_input);
+ printf(" maxlen.max_input: %u B\n", capa->maxlen.max_input);
+ printf(" maxlen.min_output: %u B\n", capa->maxlen.min_output);
+ printf(" maxlen.max_output: %u B\n", capa->maxlen.max_output);
+ printf(" max_tx_aging_tmo_ns: %" PRIu64 " ns\n",
+ capa->max_tx_aging_tmo_ns);
+ printf(" tx_compl.queue_type_sched: %i\n", capa->tx_compl.queue_type_sched);
+ printf(" tx_compl.queue_type_plain: %i\n", capa->tx_compl.queue_type_plain);
+ printf(" tx_compl.mode_event: %u\n", capa->tx_compl.mode_event);
+ printf(" tx_compl.mode_poll: %u\n", capa->tx_compl.mode_poll);
+ printf(" tx_compl.max_compl_id: %u\n", capa->tx_compl.max_compl_id);
+ printf(" free_ctrl.dont_free: %u\n", capa->free_ctrl.dont_free);
+ printf(" reassembly.ip: %i\n", capa->reassembly.ip);
+ printf(" reassembly.ipv4: %i\n", capa->reassembly.ipv4);
+ printf(" reassembly.ipv6: %i\n", capa->reassembly.ipv6);
+ printf(" reassembly.max_wait_time: %" PRIu64 " ns\n",
+ capa->reassembly.max_wait_time);
+ printf(" reassembly.max_num_frags: %u\n", capa->reassembly.max_num_frags);
+ printf(" stats.pktio: 0x%" PRIx64 "\n",
+ capa->stats.pktio.all_counters);
+ printf(" stats.pktin_queue: 0x%" PRIx64 "\n",
+ capa->stats.pktin_queue.all_counters);
+ printf(" stats.pktout_queue: 0x%" PRIx64 "\n",
+ capa->stats.pktout_queue.all_counters);
+ printf(" flow_control.pause_rx: %u\n", capa->flow_control.pause_rx);
+ printf(" flow_control.pfc_rx: %u\n", capa->flow_control.pfc_rx);
+ printf(" flow_control.pause_tx: %u\n", capa->flow_control.pause_tx);
+ printf(" flow_control.pfc_tx: %u\n", capa->flow_control.pfc_tx);
+ }
+}
+
+static void print_proto_stats_capa(appl_args_t *appl_args)
+{
+ for (int i = 0; i < appl_args->num_pktio; i++) {
+ odp_proto_stats_capability_t *capa = &appl_args->pktio[i].proto_stats_capa;
+
+ printf("\n");
+ printf(" PROTO STATS (%s)\n", appl_args->pktio[i].name);
+ printf(" tx.counters: 0x%" PRIx64 "\n", capa->tx.counters.all_bits);
+ printf(" tx.oct_count0_adj: %i\n", capa->tx.oct_count0_adj);
+ printf(" tx.oct_count1_adj: %i\n", capa->tx.oct_count1_adj);
+ }
+}
+
+static int timer_capability(appl_args_t *appl_args)
+{
+ for (int i = 0; i < ODP_CLOCK_NUM_SRC; i++) {
+ int ret;
+ odp_timer_pool_t pool;
+ odp_timer_pool_param_t params;
+ odp_timer_capability_t *capa = &appl_args->timer.capa[appl_args->timer.num];
+ odp_timer_pool_info_t *info = &appl_args->timer.pool_info[appl_args->timer.num];
+
+ ret = odp_timer_capability(i, capa);
+ if (ret && i == ODP_CLOCK_DEFAULT) {
+ ODPH_ERR("odp_timer_capability() failed for default clock source: %d\n",
+ ret);
+ return -1;
+ }
+ if (ret == -1)
+ continue;
+ if (ret < -1) {
+ ODPH_ERR("odp_timer_capability() for clock source %d failed: %d\n", i, ret);
+ return -1;
+ }
+
+ odp_timer_pool_param_init(&params);
+ params.clk_src = i;
+ params.res_ns = capa->max_res.res_ns;
+ params.min_tmo = capa->max_res.min_tmo;
+ params.max_tmo = capa->max_res.max_tmo;
+ params.num_timers = 1;
+
+ pool = odp_timer_pool_create("timer_pool", &params);
+ if (pool == ODP_TIMER_POOL_INVALID) {
+ ODPH_ERR("odp_timer_pool_create() failed for clock source: %d\n", i);
+ return -1;
+ }
+
+ odp_timer_pool_start();
+
+ ret = odp_timer_pool_info(pool, info);
+ if (ret) {
+ ODPH_ERR("odp_timer_pool_info() for clock source %d failed: %d\n", i, ret);
+ return -1;
+ }
+
+ odp_timer_pool_destroy(pool);
+
+ appl_args->timer.num++;
+ }
+ return 0;
+}
+
+static void print_timer_capa(appl_args_t *appl_args)
+{
+ for (int i = 0; i < appl_args->timer.num; i++) {
+ odp_timer_capability_t *capa = &appl_args->timer.capa[i];
+ odp_timer_pool_info_t *info = &appl_args->timer.pool_info[i];
+
+ printf("\n");
+ printf(" TIMER (SRC %d)\n", i);
+
+ printf(" max_pools_combined: %u\n", capa->max_pools_combined);
+ printf(" max_pools: %u\n", capa->max_pools);
+ printf(" max_timers: %u\n", capa->max_timers);
+ printf(" queue_type_sched: %i\n", capa->queue_type_sched);
+ printf(" queue_type_plain: %i\n", capa->queue_type_plain);
+ printf(" highest_res_ns: %" PRIu64 " nsec\n", capa->highest_res_ns);
+ printf(" maximum resolution\n");
+ printf(" res_ns: %" PRIu64 " nsec\n", capa->max_res.res_ns);
+ printf(" res_hz: %" PRIu64 " hz\n", capa->max_res.res_hz);
+ printf(" min_tmo: %" PRIu64 " nsec\n", capa->max_res.min_tmo);
+ printf(" max_tmo: %" PRIu64 " nsec\n", capa->max_res.max_tmo);
+ printf(" maximum timeout\n");
+ printf(" res_ns: %" PRIu64 " nsec\n", capa->max_tmo.res_ns);
+ printf(" res_hz: %" PRIu64 " hz\n", capa->max_tmo.res_hz);
+ printf(" min_tmo: %" PRIu64 " nsec\n", capa->max_tmo.min_tmo);
+ printf(" max_tmo: %" PRIu64 " nsec\n", capa->max_tmo.max_tmo);
+ printf(" periodic\n");
+ printf(" max_pools: %u\n", capa->periodic.max_pools);
+ printf(" max_timers: %u\n", capa->periodic.max_timers);
+ printf(" min_base_freq_hz: %" PRIu64 " %" PRIu64 "/%" PRIu64 " Hz\n",
+ capa->periodic.min_base_freq_hz.integer,
+ capa->periodic.min_base_freq_hz.numer,
+ capa->periodic.min_base_freq_hz.denom);
+ printf(" max_base_freq_hz: %" PRIu64 " %" PRIu64 "/%" PRIu64 " Hz\n",
+ capa->periodic.max_base_freq_hz.integer,
+ capa->periodic.max_base_freq_hz.numer,
+ capa->periodic.max_base_freq_hz.denom);
+ printf(" timer pool tick info (max_res)\n");
+ printf(" freq: %" PRIu64 " %" PRIu64 "/%" PRIu64 " Hz\n",
+ info->tick_info.freq.integer,
+ info->tick_info.freq.numer,
+ info->tick_info.freq.denom);
+ printf(" nsec: %" PRIu64 " %" PRIu64 "/%" PRIu64 " ns\n",
+ info->tick_info.nsec.integer,
+ info->tick_info.nsec.numer,
+ info->tick_info.nsec.denom);
+ printf(" clk_cycle: %" PRIu64 " %" PRIu64 "/%" PRIu64 " cycles\n",
+ info->tick_info.clk_cycle.integer,
+ info->tick_info.clk_cycle.numer,
+ info->tick_info.clk_cycle.denom);
+ }
+}
+
+static void usage(void)
+{
+ printf("\n"
+ "System Information\n"
+ "\n"
+ "Usage: %s OPTIONS\n"
+ " E.g. %s -i eth0\n"
+ "\n"
+ "Optional OPTIONS:\n"
+ " -i, --interfaces Ethernet interfaces for packet I/O, comma-separated, no\n"
+ " spaces.\n"
+ " -h, --help Display help and exit.\n"
+ "\n", PROG_NAME, PROG_NAME);
+}
+
+static void parse_interfaces(appl_args_t *config, const char *optarg)
+{
+ char *tmp_str = strdup(optarg), *tmp;
+
+ if (tmp_str == NULL)
+ return;
+
+ tmp = strtok(tmp_str, ",");
+
+ while (tmp && config->num_pktio < MAX_IFACES) {
+ if (strlen(tmp) + 1 > MAX_NAME_LEN) {
+ ODPH_ERR("Unable to store interface name (MAX_NAME_LEN=%d)\n",
+ MAX_NAME_LEN);
+ exit(EXIT_FAILURE);
+ }
+ strncpy(config->pktio[config->num_pktio].name, tmp, MAX_NAME_LEN);
+
+ config->num_pktio++;
+
+ tmp = strtok(NULL, ",");
+ }
+
+ free(tmp_str);
+}
+
+static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
+{
+ int opt;
+ int long_index;
+ static const struct option longopts[] = {
+ {"interfaces", required_argument, NULL, 'i'},
+ {"help", no_argument, NULL, 'h'},
+ {NULL, 0, NULL, 0}
+ };
+ static const char *shortopts = "i:h";
+
+ while (1) {
+ opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
+
+ if (opt == -1)
+ break; /* No more options */
+
+ switch (opt) {
+ case 'i':
+ parse_interfaces(appl_args, optarg);
+ break;
+ case 'h':
+ usage();
+ exit(EXIT_SUCCESS);
+ case '?':
+ default:
+ usage();
+ exit(EXIT_FAILURE);
+ }
+ }
+}
+
+int main(int argc, char **argv)
{
odp_instance_t inst;
int i, num_hp, num_hp_print;
@@ -370,15 +727,16 @@ int main(void)
odp_system_info_t sysinfo;
odp_shm_capability_t shm_capa;
odp_pool_capability_t pool_capa;
+ odp_pool_ext_capability_t pool_ext_capa;
odp_cls_capability_t cls_capa;
odp_comp_capability_t comp_capa;
odp_dma_capability_t dma_capa;
odp_queue_capability_t queue_capa;
- odp_timer_capability_t timer_capa;
odp_crypto_capability_t crypto_capa;
odp_ipsec_capability_t ipsec_capa;
odp_schedule_capability_t schedule_capa;
odp_stash_capability_t stash_capa;
+ appl_args_t appl_args;
uint64_t huge_page[MAX_HUGE_PAGES];
char ava_mask_str[ODP_CPUMASK_STR_SIZE];
char work_mask_str[ODP_CPUMASK_STR_SIZE];
@@ -386,19 +744,23 @@ int main(void)
int crypto_ret;
int ipsec_ret;
+ memset(&appl_args, 0, sizeof(appl_args_t));
+
printf("\n");
printf("ODP system info example\n");
printf("***********************************************************\n");
printf("\n");
+ parse_args(argc, argv, &appl_args);
+
if (odp_init_global(&inst, NULL, NULL)) {
- printf("Global init failed.\n");
- return -1;
+ ODPH_ERR("Global init failed.\n");
+ exit(EXIT_FAILURE);
}
if (odp_init_local(inst, ODP_THREAD_CONTROL)) {
- printf("Local init failed.\n");
- return -1;
+ ODPH_ERR("Local init failed.\n");
+ exit(EXIT_FAILURE);
}
printf("\n");
@@ -412,8 +774,8 @@ int main(void)
odp_sys_config_print();
if (odp_system_info(&sysinfo)) {
- printf("system info call failed\n");
- return -1;
+ ODPH_ERR("system info call failed\n");
+ exit(EXIT_FAILURE);
}
memset(ava_mask_str, 0, ODP_CPUMASK_STR_SIZE);
@@ -435,57 +797,67 @@ int main(void)
num_hp_print = MAX_HUGE_PAGES;
if (odp_shm_capability(&shm_capa)) {
- printf("shm capability failed\n");
- return -1;
+ ODPH_ERR("shm capability failed\n");
+ exit(EXIT_FAILURE);
}
if (odp_pool_capability(&pool_capa)) {
- printf("pool capability failed\n");
- return -1;
+ ODPH_ERR("pool capability failed\n");
+ exit(EXIT_FAILURE);
+ }
+
+ if (odp_pool_ext_capability(ODP_POOL_PACKET, &pool_ext_capa)) {
+ ODPH_ERR("external packet pool capability failed\n");
+ exit(EXIT_FAILURE);
+ }
+
+ if (pktio_capability(&appl_args)) {
+ ODPH_ERR("pktio capability failed\n");
+ exit(EXIT_FAILURE);
}
if (odp_cls_capability(&cls_capa)) {
- printf("classifier capability failed\n");
- return -1;
+ ODPH_ERR("classifier capability failed\n");
+ exit(EXIT_FAILURE);
}
if (odp_comp_capability(&comp_capa)) {
- printf("compression capability failed\n");
- return -1;
+ ODPH_ERR("compression capability failed\n");
+ exit(EXIT_FAILURE);
}
if (odp_dma_capability(&dma_capa)) {
- printf("dma capability failed\n");
- return -1;
+ ODPH_ERR("dma capability failed\n");
+ exit(EXIT_FAILURE);
}
if (odp_queue_capability(&queue_capa)) {
- printf("queue capability failed\n");
- return -1;
+ ODPH_ERR("queue capability failed\n");
+ exit(EXIT_FAILURE);
}
if (odp_schedule_capability(&schedule_capa)) {
- printf("schedule capability failed\n");
- return -1;
+ ODPH_ERR("schedule capability failed\n");
+ exit(EXIT_FAILURE);
}
if (odp_stash_capability(&stash_capa, ODP_STASH_TYPE_DEFAULT)) {
- printf("stash capability failed\n");
- return -1;
+ ODPH_ERR("stash capability failed\n");
+ exit(EXIT_FAILURE);
}
- if (odp_timer_capability(ODP_CLOCK_DEFAULT, &timer_capa)) {
- printf("timer capability failed\n");
- return -1;
+ if (timer_capability(&appl_args)) {
+ ODPH_ERR("timer capability failed\n");
+ exit(EXIT_FAILURE);
}
crypto_ret = odp_crypto_capability(&crypto_capa);
if (crypto_ret < 0)
- printf("crypto capability failed\n");
+ ODPH_ERR("crypto capability failed\n");
ipsec_ret = odp_ipsec_capability(&ipsec_capa);
if (ipsec_ret < 0)
- printf("IPsec capability failed\n");
+ ODPH_ERR("IPsec capability failed\n");
printf("\n");
printf("S Y S T E M I N F O R M A T I O N\n");
@@ -541,45 +913,89 @@ int main(void)
printf("\n");
printf(" POOL\n");
- printf(" max_pools: %u\n", pool_capa.max_pools);
- printf(" buf.max_pools: %u\n", pool_capa.buf.max_pools);
- printf(" buf.max_align: %u B\n", pool_capa.buf.max_align);
- printf(" buf.max_size: %u kB\n", pool_capa.buf.max_size / KB);
- printf(" buf.max_num: %u\n", pool_capa.buf.max_num);
- printf(" buf.min_cache_size: %u\n", pool_capa.buf.min_cache_size);
- printf(" buf.max_cache_size: %u\n", pool_capa.buf.max_cache_size);
- printf(" pkt.max_pools: %u\n", pool_capa.pkt.max_pools);
- printf(" pkt.max_len: %u kB\n", pool_capa.pkt.max_len / KB);
- printf(" pkt.max_num: %u\n", pool_capa.pkt.max_num);
- printf(" pkt.max_align: %u\n", pool_capa.pkt.max_align);
- printf(" pkt.max_headroom: %u\n", pool_capa.pkt.max_headroom);
- printf(" pkt.max_segs_per_pkt: %u\n", pool_capa.pkt.max_segs_per_pkt);
- printf(" pkt.max_seg_len: %u B\n", pool_capa.pkt.max_seg_len);
- printf(" pkt.max_uarea_size: %u B\n", pool_capa.pkt.max_uarea_size);
- printf(" pkt.max_num_subparam: %u\n", pool_capa.pkt.max_num_subparam);
- printf(" pkt.min_cache_size: %u\n", pool_capa.pkt.min_cache_size);
- printf(" pkt.max_cache_size: %u\n", pool_capa.pkt.max_cache_size);
- printf(" tmo.max_pools: %u\n", pool_capa.tmo.max_pools);
- printf(" tmo.max_num: %u\n", pool_capa.tmo.max_num);
- printf(" tmo.min_cache_size: %u\n", pool_capa.tmo.min_cache_size);
- printf(" tmo.max_cache_size: %u\n", pool_capa.tmo.max_cache_size);
- printf(" vector.max_pools: %u\n", pool_capa.vector.max_pools);
- printf(" vector.max_num: %u\n", pool_capa.vector.max_num);
- printf(" vector.max_size: %u\n", pool_capa.vector.max_size);
- printf(" vector.min_cache_size:%u\n", pool_capa.vector.min_cache_size);
- printf(" vector.max_cache_size:%u\n", pool_capa.vector.max_cache_size);
+ printf(" max_pools: %u\n", pool_capa.max_pools);
+ printf(" buf.max_pools: %u\n", pool_capa.buf.max_pools);
+ printf(" buf.max_align: %u B\n", pool_capa.buf.max_align);
+ printf(" buf.max_size: %u kB\n", pool_capa.buf.max_size / KB);
+ printf(" buf.max_num: %u\n", pool_capa.buf.max_num);
+ printf(" buf.max_uarea_size: %u B\n", pool_capa.buf.max_uarea_size);
+ printf(" buf.uarea_persistence: %i\n", pool_capa.buf.uarea_persistence);
+ printf(" buf.min_cache_size: %u\n", pool_capa.buf.min_cache_size);
+ printf(" buf.max_cache_size: %u\n", pool_capa.buf.max_cache_size);
+ printf(" buf.stats: 0x%" PRIx64 "\n", pool_capa.buf.stats.all);
+ printf(" pkt.max_pools: %u\n", pool_capa.pkt.max_pools);
+ printf(" pkt.max_len: %u kB\n", pool_capa.pkt.max_len / KB);
+ printf(" pkt.max_num: %u\n", pool_capa.pkt.max_num);
+ printf(" pkt.max_align: %u B\n", pool_capa.pkt.max_align);
+ printf(" pkt.min_headroom: %u B\n", pool_capa.pkt.min_headroom);
+ printf(" pkt.max_headroom: %u B\n", pool_capa.pkt.max_headroom);
+ printf(" pkt.min_tailroom: %u B\n", pool_capa.pkt.min_tailroom);
+ printf(" pkt.max_segs_per_pkt: %u\n", pool_capa.pkt.max_segs_per_pkt);
+ printf(" pkt.min_seg_len: %u B\n", pool_capa.pkt.min_seg_len);
+ printf(" pkt.max_seg_len: %u B\n", pool_capa.pkt.max_seg_len);
+ printf(" pkt.max_uarea_size: %u B\n", pool_capa.pkt.max_uarea_size);
+ printf(" pkt.uarea_persistence: %i\n", pool_capa.pkt.uarea_persistence);
+ printf(" pkt.max_num_subparam: %u\n", pool_capa.pkt.max_num_subparam);
+ printf(" pkt.min_cache_size: %u\n", pool_capa.pkt.min_cache_size);
+ printf(" pkt.max_cache_size: %u\n", pool_capa.pkt.max_cache_size);
+ printf(" pkt.stats: 0x%" PRIx64 "\n", pool_capa.pkt.stats.all);
+ printf(" tmo.max_pools: %u\n", pool_capa.tmo.max_pools);
+ printf(" tmo.max_num: %u\n", pool_capa.tmo.max_num);
+ printf(" tmo.max_uarea_size: %u B\n", pool_capa.tmo.max_uarea_size);
+ printf(" tmo.uarea_persistence: %i\n", pool_capa.tmo.uarea_persistence);
+ printf(" tmo.min_cache_size: %u\n", pool_capa.tmo.min_cache_size);
+ printf(" tmo.max_cache_size: %u\n", pool_capa.tmo.max_cache_size);
+ printf(" tmo.stats: 0x%" PRIx64 "\n", pool_capa.tmo.stats.all);
+ printf(" vector.max_pools: %u\n", pool_capa.vector.max_pools);
+ printf(" vector.max_num: %u\n", pool_capa.vector.max_num);
+ printf(" vector.max_size: %u\n", pool_capa.vector.max_size);
+ printf(" vector.max_uarea_size: %u B\n", pool_capa.vector.max_uarea_size);
+ printf(" vector.uarea_persistence: %i\n", pool_capa.vector.uarea_persistence);
+ printf(" vector.min_cache_size: %u\n", pool_capa.vector.min_cache_size);
+ printf(" vector.max_cache_size: %u\n", pool_capa.vector.max_cache_size);
+ printf(" vector.stats: 0x%" PRIx64 "\n", pool_capa.vector.stats.all);
+
+ printf("\n");
+ printf(" POOL EXT (pkt)\n");
+ printf(" max_pools: %u\n", pool_ext_capa.max_pools);
+ if (pool_ext_capa.max_pools) {
+ printf(" min_cache_size: %u\n", pool_ext_capa.min_cache_size);
+ printf(" max_cache_size: %u\n", pool_ext_capa.max_cache_size);
+ printf(" stats: 0x%" PRIx64 "\n", pool_ext_capa.stats.all);
+ printf(" pkt.max_num_buf: %u\n", pool_ext_capa.pkt.max_num_buf);
+ printf(" pkt.max_buf_size: %u B\n", pool_ext_capa.pkt.max_buf_size);
+ printf(" pkt.odp_header_size: %u B\n", pool_ext_capa.pkt.odp_header_size);
+ printf(" pkt.odp_trailer_size: %u B\n", pool_ext_capa.pkt.odp_trailer_size);
+ printf(" pkt.min_mem_align: %u B\n", pool_ext_capa.pkt.min_mem_align);
+ printf(" pkt.min_buf_align: %u B\n", pool_ext_capa.pkt.min_buf_align);
+ printf(" pkt.min_head_align: %u B\n", pool_ext_capa.pkt.min_head_align);
+ printf(" pkt.buf_size_aligned: %u\n", pool_ext_capa.pkt.buf_size_aligned);
+ printf(" pkt.max_headroom: %u B\n", pool_ext_capa.pkt.max_headroom);
+ printf(" pkt.max_headroom_size: %u B\n", pool_ext_capa.pkt.max_headroom_size);
+ printf(" pkt.max_segs_per_pkt: %u\n", pool_ext_capa.pkt.max_segs_per_pkt);
+ printf(" pkt.max_uarea_size: %u B\n", pool_ext_capa.pkt.max_uarea_size);
+ printf(" pkt.uarea_persistence: %i\n", pool_ext_capa.pkt.uarea_persistence);
+ }
+
+ print_pktio_capa(&appl_args);
+
+ print_proto_stats_capa(&appl_args);
printf("\n");
printf(" CLASSIFIER\n");
- printf(" supported_terms: 0x%" PRIx64 "\n", cls_capa.supported_terms.all_bits);
- printf(" max_pmr_terms: %u\n", cls_capa.max_pmr_terms);
- printf(" available_pmr_terms: %u\n", cls_capa.available_pmr_terms);
- printf(" max_cos: %u\n", cls_capa.max_cos);
- printf(" max_hash_queues: %u\n", cls_capa.max_hash_queues);
- printf(" hash_protocols: 0x%x\n", cls_capa.hash_protocols.all_bits);
- printf(" pmr_range_supported: %i\n", cls_capa.pmr_range_supported);
- printf(" max_mark: %" PRIu64 "\n", cls_capa.max_mark);
- printf(" stats.queue: 0x%" PRIx64 "\n", cls_capa.stats.queue.all_counters);
+ printf(" supported_terms: 0x%" PRIx64 "\n", cls_capa.supported_terms.all_bits);
+ printf(" max_pmr_terms: %u\n", cls_capa.max_pmr_terms);
+ printf(" available_pmr_terms: %u\n", cls_capa.available_pmr_terms);
+ printf(" max_cos: %u\n", cls_capa.max_cos);
+ printf(" max_hash_queues: %u\n", cls_capa.max_hash_queues);
+ printf(" hash_protocols: 0x%x\n", cls_capa.hash_protocols.all_bits);
+ printf(" pmr_range_supported: %i\n", cls_capa.pmr_range_supported);
+ printf(" random_early_detection: %s\n", support_level(cls_capa.random_early_detection));
+ printf(" threshold_red: 0x%" PRIx8 "\n", cls_capa.threshold_red.all_bits);
+ printf(" back_pressure: %s\n", support_level(cls_capa.back_pressure));
+ printf(" threshold_bp: 0x%" PRIx8 "\n", cls_capa.threshold_bp.all_bits);
+ printf(" max_mark: %" PRIu64 "\n", cls_capa.max_mark);
+ printf(" stats.queue: 0x%" PRIx64 "\n", cls_capa.stats.queue.all_counters);
printf("\n");
printf(" COMPRESSION\n");
@@ -591,19 +1007,21 @@ int main(void)
printf("\n");
printf(" DMA\n");
- printf(" max_sessions: %u\n", dma_capa.max_sessions);
- printf(" max_transfers: %u\n", dma_capa.max_transfers);
- printf(" max_src_segs: %u\n", dma_capa.max_src_segs);
- printf(" max_dst_segs: %u\n", dma_capa.max_dst_segs);
- printf(" max_segs: %u\n", dma_capa.max_segs);
- printf(" max_seg_len: %u\n", dma_capa.max_seg_len);
- printf(" compl_mode_mask: 0x%x\n", dma_capa.compl_mode_mask);
- printf(" queue_type_sched: %i\n", dma_capa.queue_type_sched);
- printf(" queue_type_plain: %i\n", dma_capa.queue_type_plain);
- printf(" pool.max_pools: %u\n", dma_capa.pool.max_pools);
- printf(" pool.max_num: %u\n", dma_capa.pool.max_num);
- printf(" pool.min_cache_size: %u\n", dma_capa.pool.min_cache_size);
- printf(" pool.max_cache_size: %u\n", dma_capa.pool.max_cache_size);
+ printf(" max_sessions: %u\n", dma_capa.max_sessions);
+ printf(" max_transfers: %u\n", dma_capa.max_transfers);
+ printf(" max_src_segs: %u\n", dma_capa.max_src_segs);
+ printf(" max_dst_segs: %u\n", dma_capa.max_dst_segs);
+ printf(" max_segs: %u\n", dma_capa.max_segs);
+ printf(" max_seg_len: %u B\n", dma_capa.max_seg_len);
+ printf(" compl_mode_mask: 0x%x\n", dma_capa.compl_mode_mask);
+ printf(" queue_type_sched: %i\n", dma_capa.queue_type_sched);
+ printf(" queue_type_plain: %i\n", dma_capa.queue_type_plain);
+ printf(" pool.max_pools: %u\n", dma_capa.pool.max_pools);
+ printf(" pool.max_num: %u\n", dma_capa.pool.max_num);
+ printf(" pool.max_uarea_size: %u B\n", dma_capa.pool.max_uarea_size);
+ printf(" pool.uarea_persistence: %u\n", dma_capa.pool.uarea_persistence);
+ printf(" pool.min_cache_size: %u\n", dma_capa.pool.min_cache_size);
+ printf(" pool.max_cache_size: %u\n", dma_capa.pool.max_cache_size);
printf("\n");
printf(" QUEUE\n");
@@ -623,58 +1041,57 @@ int main(void)
printf(" max_queues: %u\n", schedule_capa.max_queues);
printf(" max_queue_size: %u\n", schedule_capa.max_queue_size);
printf(" max_flow_id: %u\n", schedule_capa.max_flow_id);
- printf(" lockfree_queues: %ssupported\n",
- schedule_capa.lockfree_queues ? "" : "not ");
- printf(" waitfree_queues: %ssupported\n",
- schedule_capa.waitfree_queues ? "" : "not ");
+ printf(" lockfree_queues: %s\n", support_level(schedule_capa.lockfree_queues));
+ printf(" waitfree_queues: %s\n", support_level(schedule_capa.waitfree_queues));
+ printf(" order_wait: %s\n", support_level(schedule_capa.order_wait));
printf("\n");
printf(" STASH\n");
printf(" max_stashes_any_type: %u\n", stash_capa.max_stashes_any_type);
printf(" max_stashes: %u\n", stash_capa.max_stashes);
printf(" max_num_obj: %" PRIu64 "\n", stash_capa.max_num_obj);
- printf(" max_obj_size: %u\n", stash_capa.max_obj_size);
+ printf(" max_num.u8: %" PRIu64 "\n", stash_capa.max_num.u8);
+ printf(" max_num.u16: %" PRIu64 "\n", stash_capa.max_num.u16);
+ printf(" max_num.u32: %" PRIu64 "\n", stash_capa.max_num.u32);
+ printf(" max_num.u64: %" PRIu64 "\n", stash_capa.max_num.u64);
+ printf(" max_num.u128: %" PRIu64 "\n", stash_capa.max_num.u128);
+ printf(" max_num.max_obj_size: %" PRIu64 "\n", stash_capa.max_num.max_obj_size);
+ printf(" max_obj_size: %u B\n", stash_capa.max_obj_size);
printf(" max_cache_size: %u\n", stash_capa.max_cache_size);
+ printf(" max_get_batch: %u\n", stash_capa.max_get_batch);
+ printf(" max_put_batch: %u\n", stash_capa.max_put_batch);
+ printf(" stats: 0x%" PRIx64 "\n", stash_capa.stats.all);
- printf("\n");
- printf(" TIMER (ODP_CLOCK_DEFAULT)\n");
- printf(" max_pools_combined: %u\n", timer_capa.max_pools_combined);
- printf(" max_pools: %u\n", timer_capa.max_pools);
- printf(" max_timers: %u\n", timer_capa.max_timers);
- printf(" queue_type_sched: %i\n", timer_capa.queue_type_sched);
- printf(" queue_type_plain: %i\n", timer_capa.queue_type_plain);
- printf(" highest_res_ns: %" PRIu64 " nsec\n", timer_capa.highest_res_ns);
- printf(" maximum resolution\n");
- printf(" res_ns: %" PRIu64 " nsec\n", timer_capa.max_res.res_ns);
- printf(" res_hz: %" PRIu64 " hz\n", timer_capa.max_res.res_hz);
- printf(" min_tmo: %" PRIu64 " nsec\n", timer_capa.max_res.min_tmo);
- printf(" max_tmo: %" PRIu64 " nsec\n", timer_capa.max_res.max_tmo);
- printf(" maximum timeout\n");
- printf(" res_ns: %" PRIu64 " nsec\n", timer_capa.max_tmo.res_ns);
- printf(" res_hz: %" PRIu64 " hz\n", timer_capa.max_tmo.res_hz);
- printf(" min_tmo: %" PRIu64 " nsec\n", timer_capa.max_tmo.min_tmo);
- printf(" max_tmo: %" PRIu64 " nsec\n", timer_capa.max_tmo.max_tmo);
- printf("\n");
+ print_timer_capa(&appl_args);
if (crypto_ret == 0) {
+ printf("\n");
printf(" CRYPTO\n");
- printf(" max sessions: %u\n", crypto_capa.max_sessions);
- printf(" sync mode support: %s\n", support_level(crypto_capa.sync_mode));
- printf(" async mode support: %s\n", support_level(crypto_capa.async_mode));
- printf(" queue_type_sched: %i\n", crypto_capa.queue_type_sched);
- printf(" queue_type_plain: %i\n", crypto_capa.queue_type_plain);
- printf(" cipher algorithms: ");
+ printf(" max sessions: %u\n", crypto_capa.max_sessions);
+ printf(" sync mode support: %s\n", support_level(crypto_capa.sync_mode));
+ printf(" async mode support: %s\n", support_level(crypto_capa.async_mode));
+ printf(" queue_type_sched: %i\n", crypto_capa.queue_type_sched);
+ printf(" queue_type_plain: %i\n", crypto_capa.queue_type_plain);
+ printf(" cipher algorithms: ");
foreach_cipher(crypto_capa.ciphers, print_cipher);
printf("\n");
foreach_cipher(crypto_capa.ciphers, print_cipher_capa);
- printf(" auth algorithms: ");
+ printf(" cipher algorithms (HW): ");
+ foreach_cipher(crypto_capa.hw_ciphers, print_cipher);
+ printf("\n");
+ foreach_cipher(crypto_capa.hw_ciphers, print_cipher_capa);
+ printf(" auth algorithms: ");
foreach_auth(crypto_capa.auths, print_auth);
printf("\n");
foreach_auth(crypto_capa.auths, print_auth_capa);
+ printf(" auth algorithms (HW): ");
+ foreach_auth(crypto_capa.hw_auths, print_auth);
printf("\n");
+ foreach_auth(crypto_capa.hw_auths, print_auth_capa);
}
if (ipsec_ret == 0) {
+ printf("\n");
printf(" IPSEC\n");
printf(" max SAs: %u\n", ipsec_capa.max_num_sa);
printf(" sync mode support: %s\n",
@@ -708,18 +1125,42 @@ int main(void)
printf(" max destination queues: %u\n", ipsec_capa.max_queues);
printf(" queue_type_sched: %i\n", ipsec_capa.queue_type_sched);
printf(" queue_type_plain: %i\n", ipsec_capa.queue_type_plain);
+ printf(" vector support: %s\n",
+ support_level(ipsec_capa.vector.supported));
+ printf(" min_size: %u\n", ipsec_capa.vector.min_size);
+ printf(" max_size: %u\n", ipsec_capa.vector.max_size);
+ printf(" min_tmo_ns: %" PRIu64 " ns\n",
+ ipsec_capa.vector.min_tmo_ns);
+ printf(" max_tmo_ns: %" PRIu64 " ns\n",
+ ipsec_capa.vector.max_tmo_ns);
printf(" max anti-replay window size: %u\n",
ipsec_capa.max_antireplay_ws);
printf(" inline TM pipelining: %s\n",
support_level(ipsec_capa.inline_ipsec_tm));
+ printf(" testing capabilities:\n");
+ printf(" sa_operations.seq_num: %i\n",
+ ipsec_capa.test.sa_operations.seq_num);
+ printf(" sa_operations.antireplay_window_top: %i\n",
+ ipsec_capa.test.sa_operations.antireplay_window_top);
+ printf(" post-IPsec reassembly support:\n");
+ printf(" ip: %i\n", ipsec_capa.reassembly.ip);
+ printf(" ipv4: %i\n", ipsec_capa.reassembly.ipv4);
+ printf(" ipv6: %i\n", ipsec_capa.reassembly.ipv6);
+ printf(" max_wait_time: %" PRIu64 "\n",
+ ipsec_capa.reassembly.max_wait_time);
+ printf(" max_num_frags: %" PRIu16 "\n",
+ ipsec_capa.reassembly.max_num_frags);
+ printf(" reass_async: %i\n", ipsec_capa.reass_async);
+ printf(" reass_inline: %i\n", ipsec_capa.reass_inline);
printf(" cipher algorithms: ");
foreach_cipher(ipsec_capa.ciphers, print_cipher);
printf("\n");
printf(" auth algorithms: ");
foreach_auth(ipsec_capa.auths, print_auth);
- printf("\n\n");
+ printf("\n");
}
+ printf("\n");
printf(" SHM MEMORY BLOCKS:\n");
odp_shm_print_all();
@@ -728,14 +1169,14 @@ int main(void)
printf("\n");
if (odp_term_local()) {
- printf("Local term failed.\n");
- return -1;
+ ODPH_ERR("Local term failed.\n");
+ exit(EXIT_FAILURE);
}
if (odp_term_global(inst)) {
- printf("Global term failed.\n");
- return -1;
+ ODPH_ERR("Global term failed.\n");
+ exit(EXIT_FAILURE);
}
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/example/timer/odp_timer_accuracy.c b/example/timer/odp_timer_accuracy.c
index 2400a7bf8..9a4593a9a 100644
--- a/example/timer/odp_timer_accuracy.c
+++ b/example/timer/odp_timer_accuracy.c
@@ -15,7 +15,10 @@
#include <getopt.h>
#include <odp_api.h>
+#include <odp/helper/odph_api.h>
+#define MAX_WORKERS (ODP_THREAD_COUNT_MAX - 1)
+#define MAX_QUEUES 1024
#define MAX_FILENAME 128
enum mode_e {
@@ -25,12 +28,44 @@ enum mode_e {
MODE_PERIODIC,
};
+typedef struct test_opt_t {
+ int cpu_count;
+ unsigned long long period_ns;
+ long long res_ns;
+ unsigned long long res_hz;
+ unsigned long long offset_ns;
+ unsigned long long max_tmo_ns;
+ unsigned long long num;
+ unsigned long long num_warmup;
+ unsigned long long burst;
+ unsigned long long burst_gap;
+ odp_fract_u64_t freq;
+ unsigned long long max_multiplier;
+ unsigned long long multiplier;
+ enum mode_e mode;
+ int clk_src;
+ odp_queue_type_t queue_type;
+ int num_queue;
+ int groups;
+ int init;
+ int output;
+ int early_retry;
+ uint64_t warmup_timers;
+ uint64_t tot_timers;
+ uint64_t alloc_timers;
+ char filename[MAX_FILENAME + 1];
+} test_opt_t;
+
typedef struct timer_ctx_t {
odp_timer_t timer;
odp_event_t event;
uint64_t nsec;
uint64_t count;
uint64_t first_period;
+ int tmo_tick;
+ int64_t first_tmo_diff;
+ int64_t nsec_final;
+
} timer_ctx_t;
typedef struct {
@@ -46,10 +81,6 @@ typedef struct {
uint64_t nsec_after_max;
uint64_t nsec_after_max_idx;
- int tmo_tick;
- int64_t first_tmo_diff;
- int64_t nsec_final;
-
uint64_t num_before;
uint64_t num_exact;
uint64_t num_after;
@@ -61,49 +92,31 @@ typedef struct {
typedef struct test_log_t {
uint64_t tmo_ns;
int64_t diff_ns;
+ int tid;
} test_log_t;
typedef struct test_global_t {
- struct {
- unsigned long long period_ns;
- long long res_ns;
- unsigned long long res_hz;
- unsigned long long offset_ns;
- unsigned long long max_tmo_ns;
- unsigned long long num;
- unsigned long long num_warmup;
- unsigned long long burst;
- unsigned long long burst_gap;
- odp_fract_u64_t freq;
- unsigned long long max_multiplier;
- unsigned long long multiplier;
- enum mode_e mode;
- int clk_src;
- int init;
- int output;
- int early_retry;
- } opt;
-
- test_stat_t stat;
-
- odp_queue_t queue;
+ test_opt_t opt;
+
+ test_stat_t stat[MAX_WORKERS];
+
+ odp_queue_t queue[MAX_QUEUES];
+ odp_schedule_group_t group[MAX_WORKERS];
odp_timer_pool_t timer_pool;
odp_pool_t timeout_pool;
timer_ctx_t *timer_ctx;
double res_ns;
- uint64_t warmup_timers;
- uint64_t tot_timers;
- uint64_t alloc_timers;
uint64_t start_tick;
uint64_t start_ns;
uint64_t period_tick;
double period_dbl;
odp_fract_u64_t base_freq;
- odp_shm_t log_shm;
test_log_t *log;
FILE *file;
- char filename[MAX_FILENAME + 1];
+ odp_barrier_t barrier;
+ odp_atomic_u64_t events;
+ odp_atomic_u64_t last_events;
} test_global_t;
@@ -113,6 +126,7 @@ static void print_usage(void)
"Timer accuracy test application.\n"
"\n"
"OPTIONS:\n"
+ " -c, --count <num> CPU count, 0=all available, default=1\n"
" -p, --period <nsec> Timeout period in nsec. Not used in periodic mode. Default: 200 msec\n"
" -r, --res_ns <nsec> Timeout resolution in nsec. Default value is 0. Special values:\n"
" 0: Use period / 10 as the resolution\n"
@@ -141,14 +155,21 @@ static void print_usage(void)
" -s, --clk_src Clock source select (default 0):\n"
" 0: ODP_CLOCK_DEFAULT\n"
" 1: ODP_CLOCK_SRC_1, ...\n"
+ " -t, --queue_type Queue sync type. Default is 0 (PARALLEL).\n"
+ " 0: PARALLEL\n"
+ " 1: ATOMIC\n"
+ " 2: ORDERED\n"
+ " -q, --num_queue Number of queues. Default is 1.\n"
+ " -G, --sched_groups Use dedicated schedule group for each worker.\n"
" -i, --init Set global init parameters. Default: init params not set.\n"
" -h, --help Display help and exit.\n\n");
}
-static int parse_options(int argc, char *argv[], test_global_t *test_global)
+static int parse_options(int argc, char *argv[], test_opt_t *test_opt)
{
int opt, long_index;
const struct option longopts[] = {
+ {"count", required_argument, NULL, 'c'},
{"period", required_argument, NULL, 'p'},
{"res_ns", required_argument, NULL, 'r'},
{"res_hz", required_argument, NULL, 'R'},
@@ -164,32 +185,40 @@ static int parse_options(int argc, char *argv[], test_global_t *test_global)
{"output", required_argument, NULL, 'o'},
{"early_retry", required_argument, NULL, 'e'},
{"clk_src", required_argument, NULL, 's'},
+ {"queue_type", required_argument, NULL, 't'},
+ {"num_queue", required_argument, NULL, 'q'},
+ {"sched_groups", no_argument, NULL, 'G'},
{"init", no_argument, NULL, 'i'},
{"help", no_argument, NULL, 'h'},
{NULL, 0, NULL, 0}
};
- const char *shortopts = "+p:r:R:f:x:n:w:b:g:m:P:M:o:e:s:ih";
+ const char *shortopts = "+c:p:r:R:f:x:n:w:b:g:m:P:M:o:e:s:t:q:Gih";
int ret = 0;
- test_global->opt.period_ns = 200 * ODP_TIME_MSEC_IN_NS;
- test_global->opt.res_ns = 0;
- test_global->opt.res_hz = 0;
- test_global->opt.offset_ns = UINT64_MAX;
- test_global->opt.max_tmo_ns = 0;
- test_global->opt.num = 50;
- test_global->opt.num_warmup = 0;
- test_global->opt.burst = 1;
- test_global->opt.burst_gap = 0;
- test_global->opt.mode = MODE_ONESHOT;
- test_global->opt.freq.integer = ODP_TIME_SEC_IN_NS / test_global->opt.period_ns;
- test_global->opt.freq.numer = 0;
- test_global->opt.freq.denom = 0;
- test_global->opt.max_multiplier = 1;
- test_global->opt.multiplier = 1;
- test_global->opt.clk_src = ODP_CLOCK_DEFAULT;
- test_global->opt.init = 0;
- test_global->opt.output = 0;
- test_global->opt.early_retry = 0;
+ memset(test_opt, 0, sizeof(*test_opt));
+
+ test_opt->period_ns = 200 * ODP_TIME_MSEC_IN_NS;
+ test_opt->res_ns = 0;
+ test_opt->res_hz = 0;
+ test_opt->offset_ns = UINT64_MAX;
+ test_opt->max_tmo_ns = 0;
+ test_opt->num = 50;
+ test_opt->num_warmup = 0;
+ test_opt->burst = 1;
+ test_opt->burst_gap = 0;
+ test_opt->mode = MODE_ONESHOT;
+ test_opt->freq.integer = ODP_TIME_SEC_IN_NS / test_opt->period_ns;
+ test_opt->freq.numer = 0;
+ test_opt->freq.denom = 0;
+ test_opt->max_multiplier = 1;
+ test_opt->multiplier = 1;
+ test_opt->clk_src = ODP_CLOCK_DEFAULT;
+ test_opt->queue_type = ODP_SCHED_SYNC_PARALLEL;
+ test_opt->groups = 0;
+ test_opt->num_queue = 1;
+ test_opt->init = 0;
+ test_opt->output = 0;
+ test_opt->early_retry = 0;
while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
@@ -198,59 +227,79 @@ static int parse_options(int argc, char *argv[], test_global_t *test_global)
break; /* No more options */
switch (opt) {
+ case 'c':
+ test_opt->cpu_count = atoi(optarg);
+ break;
case 'p':
- test_global->opt.period_ns = strtoull(optarg, NULL, 0);
+ test_opt->period_ns = strtoull(optarg, NULL, 0);
break;
case 'r':
- test_global->opt.res_ns = strtoll(optarg, NULL, 0);
+ test_opt->res_ns = strtoll(optarg, NULL, 0);
break;
case 'R':
- test_global->opt.res_hz = strtoull(optarg, NULL, 0);
+ test_opt->res_hz = strtoull(optarg, NULL, 0);
break;
case 'f':
- test_global->opt.offset_ns = strtoull(optarg, NULL, 0);
+ test_opt->offset_ns = strtoull(optarg, NULL, 0);
break;
case 'x':
- test_global->opt.max_tmo_ns = strtoull(optarg, NULL, 0);
+ test_opt->max_tmo_ns = strtoull(optarg, NULL, 0);
break;
case 'n':
- test_global->opt.num = strtoull(optarg, NULL, 0);
+ test_opt->num = strtoull(optarg, NULL, 0);
break;
case 'w':
- test_global->opt.num_warmup = strtoull(optarg, NULL, 0);
+ test_opt->num_warmup = strtoull(optarg, NULL, 0);
break;
case 'b':
- test_global->opt.burst = strtoull(optarg, NULL, 0);
+ test_opt->burst = strtoull(optarg, NULL, 0);
break;
case 'g':
- test_global->opt.burst_gap = strtoull(optarg, NULL, 0);
+ test_opt->burst_gap = strtoull(optarg, NULL, 0);
break;
case 'm':
- test_global->opt.mode = atoi(optarg);
+ test_opt->mode = atoi(optarg);
break;
case 'P':
sscanf(optarg, "%" SCNu64 ":%" SCNu64 ":%" SCNu64 ":%llu",
- &test_global->opt.freq.integer,
- &test_global->opt.freq.numer,
- &test_global->opt.freq.denom,
- &test_global->opt.max_multiplier);
+ &test_opt->freq.integer, &test_opt->freq.numer,
+ &test_opt->freq.denom, &test_opt->max_multiplier);
break;
case 'M':
- test_global->opt.multiplier = strtoull(optarg, NULL, 0);
+ test_opt->multiplier = strtoull(optarg, NULL, 0);
break;
case 'o':
- test_global->opt.output = 1;
+ test_opt->output = 1;
/* filename is NULL terminated in anycase */
- strncpy(test_global->filename, optarg, MAX_FILENAME);
+ strncpy(test_opt->filename, optarg, MAX_FILENAME);
break;
case 'e':
- test_global->opt.early_retry = atoi(optarg);
+ test_opt->early_retry = atoi(optarg);
break;
case 's':
- test_global->opt.clk_src = atoi(optarg);
+ test_opt->clk_src = atoi(optarg);
+ break;
+ case 't':
+ switch (atoi(optarg)) {
+ case 1:
+ test_opt->queue_type = ODP_SCHED_SYNC_ATOMIC;
+ break;
+ case 2:
+ test_opt->queue_type = ODP_SCHED_SYNC_ORDERED;
+ break;
+ default:
+ test_opt->queue_type = ODP_SCHED_SYNC_PARALLEL;
+ break;
+ }
+ break;
+ case 'q':
+ test_opt->num_queue = atoi(optarg);
+ break;
+ case 'G':
+ test_opt->groups = 1;
break;
case 'i':
- test_global->opt.init = 1;
+ test_opt->init = 1;
break;
case 'h':
print_usage();
@@ -263,35 +312,36 @@ static int parse_options(int argc, char *argv[], test_global_t *test_global)
}
}
- if (test_global->opt.mode == MODE_PERIODIC) {
- if ((test_global->opt.freq.integer == 0 && test_global->opt.freq.numer == 0) ||
- (test_global->opt.freq.numer != 0 && test_global->opt.freq.denom == 0)) {
+ if (test_opt->mode == MODE_PERIODIC) {
+ if ((test_opt->freq.integer == 0 && test_opt->freq.numer == 0) ||
+ (test_opt->freq.numer != 0 && test_opt->freq.denom == 0)) {
printf("Bad frequency\n");
return -1;
}
- test_global->opt.period_ns = 0;
+ test_opt->period_ns =
+ ODP_TIME_SEC_IN_NS / odp_fract_u64_to_dbl(&test_opt->freq);
- if (test_global->opt.offset_ns == UINT64_MAX)
- test_global->opt.offset_ns = 0;
+ if (test_opt->offset_ns == UINT64_MAX)
+ test_opt->offset_ns = 0;
} else {
- if (test_global->opt.res_ns < 0) {
+ if (test_opt->res_ns < 0) {
printf("Resolution (res_ns) must be >= 0 with single shot timer\n");
return -1;
}
- if (test_global->opt.offset_ns == UINT64_MAX)
- test_global->opt.offset_ns = 300 * ODP_TIME_MSEC_IN_NS;
+ if (test_opt->offset_ns == UINT64_MAX)
+ test_opt->offset_ns = 300 * ODP_TIME_MSEC_IN_NS;
}
- test_global->warmup_timers = test_global->opt.num_warmup * test_global->opt.burst;
- test_global->tot_timers =
- test_global->warmup_timers + test_global->opt.num * test_global->opt.burst;
+ test_opt->warmup_timers = test_opt->num_warmup * test_opt->burst;
+ test_opt->tot_timers =
+ test_opt->warmup_timers + test_opt->num * test_opt->burst;
- if (test_global->opt.mode == MODE_ONESHOT)
- test_global->alloc_timers = test_global->tot_timers;
+ if (test_opt->mode == MODE_ONESHOT)
+ test_opt->alloc_timers = test_opt->tot_timers;
else
- test_global->alloc_timers = test_global->opt.burst;
+ test_opt->alloc_timers = test_opt->burst;
return ret;
}
@@ -302,7 +352,7 @@ static int single_shot_params(test_global_t *test_global, odp_timer_pool_param_t
uint64_t res_ns, res_hz;
uint64_t max_res_ns, max_res_hz;
uint64_t period_ns = test_global->opt.period_ns;
- uint64_t num_tmo = test_global->opt.num;
+ uint64_t num_tmo = test_global->opt.num + test_global->opt.num_warmup;
uint64_t offset_ns = test_global->opt.offset_ns;
enum mode_e mode = test_global->opt.mode;
@@ -455,7 +505,7 @@ static int periodic_params(test_global_t *test_global, odp_timer_pool_param_t *t
return 0;
}
-static int start_timers(test_global_t *test_global)
+static int create_timers(test_global_t *test_global)
{
odp_pool_t pool;
odp_pool_param_t pool_param;
@@ -463,32 +513,31 @@ static int start_timers(test_global_t *test_global)
odp_timer_pool_param_t timer_param;
odp_timer_capability_t timer_capa;
odp_timer_t timer;
- odp_queue_t queue;
+ odp_queue_t *queue;
+ odp_schedule_group_t *group;
odp_queue_param_t queue_param;
- uint64_t start_tick;
- uint64_t period_ns, start_ns, nsec, offset_ns;
+ uint64_t offset_ns;
uint32_t max_timers;
odp_event_t event;
odp_timeout_t timeout;
- odp_time_t time;
- uint64_t i, j, idx, num_tmo, num_warmup, burst, burst_gap;
+ uint64_t i, num_tmo, num_warmup, burst, burst_gap;
uint64_t tot_timers, alloc_timers;
enum mode_e mode;
odp_timer_clk_src_t clk_src;
int ret;
mode = test_global->opt.mode;
- alloc_timers = test_global->alloc_timers;
- tot_timers = test_global->tot_timers;
- num_tmo = test_global->opt.num;
+ alloc_timers = test_global->opt.alloc_timers;
+ tot_timers = test_global->opt.tot_timers;
num_warmup = test_global->opt.num_warmup;
+ num_tmo = num_warmup + test_global->opt.num;
burst = test_global->opt.burst;
burst_gap = test_global->opt.burst_gap;
- period_ns = test_global->opt.period_ns;
offset_ns = test_global->opt.offset_ns;
+ queue = test_global->queue;
+ group = test_global->group;
/* Always init globals for destroy calls */
- test_global->queue = ODP_QUEUE_INVALID;
test_global->timer_pool = ODP_TIMER_POOL_INVALID;
test_global->timeout_pool = ODP_POOL_INVALID;
@@ -497,19 +546,39 @@ static int start_timers(test_global_t *test_global)
test_global->timer_ctx[i].event = ODP_EVENT_INVALID;
}
+ if (test_global->opt.groups) {
+ /* Create groups */
+
+ odp_thrmask_t zero;
+
+ odp_thrmask_zero(&zero);
+
+ for (i = 0; i < (uint64_t)test_global->opt.cpu_count; i++) {
+ group[i] = odp_schedule_group_create(NULL, &zero);
+
+ if (group[i] == ODP_SCHED_GROUP_INVALID) {
+ printf("Group create failed.\n");
+ return -1;
+ }
+ }
+ }
+
odp_queue_param_init(&queue_param);
queue_param.type = ODP_QUEUE_TYPE_SCHED;
queue_param.sched.prio = odp_schedule_default_prio();
- queue_param.sched.sync = ODP_SCHED_SYNC_ATOMIC;
+ queue_param.sched.sync = test_global->opt.queue_type;
queue_param.sched.group = ODP_SCHED_GROUP_ALL;
- queue = odp_queue_create("timeout_queue", &queue_param);
- if (queue == ODP_QUEUE_INVALID) {
- printf("Queue create failed.\n");
- return -1;
- }
+ for (i = 0; i < (uint64_t)test_global->opt.num_queue; i++) {
+ if (test_global->opt.groups)
+ queue_param.sched.group = group[i % test_global->opt.cpu_count];
- test_global->queue = queue;
+ queue[i] = odp_queue_create(NULL, &queue_param);
+ if (queue[i] == ODP_QUEUE_INVALID) {
+ printf("Queue create failed.\n");
+ return -1;
+ }
+ }
odp_pool_param_init(&pool_param);
pool_param.type = ODP_POOL_TIMEOUT;
@@ -540,10 +609,10 @@ static int start_timers(test_global_t *test_global)
max_timers = timer_capa.periodic.max_timers;
}
- if (max_timers && test_global->alloc_timers > max_timers) {
+ if (max_timers && test_global->opt.alloc_timers > max_timers) {
printf("Error: Too many timers: %" PRIu64 ".\n"
" Max timers: %u\n",
- test_global->alloc_timers, max_timers);
+ test_global->opt.alloc_timers, max_timers);
return -1;
}
@@ -551,6 +620,9 @@ static int start_timers(test_global_t *test_global)
printf(" clock source: %i\n", clk_src);
printf(" max timers capa: %" PRIu32 "\n", max_timers);
printf(" mode: %i\n", mode);
+ printf(" queue type: %i\n", test_global->opt.queue_type);
+ printf(" num queue: %i\n", test_global->opt.num_queue);
+ printf(" sched groups: %s\n", test_global->opt.groups ? "yes" : "no");
odp_timer_pool_param_init(&timer_param);
@@ -575,7 +647,7 @@ static int start_timers(test_global_t *test_global)
printf(" restart retries: %i\n", test_global->opt.early_retry);
if (test_global->opt.output)
- printf(" log file: %s\n", test_global->filename);
+ printf(" log file: %s\n", test_global->opt.filename);
printf(" start offset: %" PRIu64 " nsec\n", offset_ns);
printf(" min timeout: %" PRIu64 " nsec\n", timer_param.min_tmo);
printf(" max timeout: %" PRIu64 " nsec\n", timer_param.max_tmo);
@@ -584,7 +656,7 @@ static int start_timers(test_global_t *test_global)
printf(" burst size: %" PRIu64 "\n", burst);
printf(" burst gap: %" PRIu64 "\n", burst_gap);
printf(" total timers: %" PRIu64 "\n", tot_timers);
- printf(" warmup timers: %" PRIu64 "\n", test_global->warmup_timers);
+ printf(" warmup timers: %" PRIu64 "\n", test_global->opt.warmup_timers);
printf(" alloc timers: %" PRIu64 "\n", alloc_timers);
printf(" warmup time: %.2f sec\n",
(offset_ns + (num_warmup * test_global->period_dbl)) / 1000000000.0);
@@ -599,6 +671,7 @@ static int start_timers(test_global_t *test_global)
}
odp_timer_pool_start();
+ odp_timer_pool_print(timer_pool);
/* Spend some time so that current tick would not be zero */
odp_time_wait_ns(100 * ODP_TIME_MSEC_IN_NS);
@@ -608,7 +681,7 @@ static int start_timers(test_global_t *test_global)
for (i = 0; i < alloc_timers; i++) {
timer_ctx_t *ctx = &test_global->timer_ctx[i];
- timer = odp_timer_alloc(timer_pool, queue, ctx);
+ timer = odp_timer_alloc(timer_pool, queue[i % test_global->opt.num_queue], ctx);
if (timer == ODP_TIMER_INVALID) {
printf("Timer alloc failed.\n");
@@ -637,13 +710,33 @@ static int start_timers(test_global_t *test_global)
}
}
+ return 0;
+}
+
+static int start_timers(test_global_t *test_global)
+{
+ odp_timer_pool_t timer_pool;
+ uint64_t start_tick;
+ uint64_t period_ns, start_ns, nsec, offset_ns;
+ odp_time_t time;
+ uint64_t i, j, idx, num_tmo, num_warmup, burst, burst_gap;
+ enum mode_e mode;
+
+ mode = test_global->opt.mode;
+ num_warmup = test_global->opt.num_warmup;
+ num_tmo = num_warmup + test_global->opt.num;
+ burst = test_global->opt.burst;
+ burst_gap = test_global->opt.burst_gap;
+ period_ns = test_global->opt.period_ns;
+ offset_ns = test_global->opt.offset_ns;
+ timer_pool = test_global->timer_pool;
idx = 0;
/* Record test start time and tick. Memory barriers forbid compiler and out-of-order
* CPU to move samples apart. */
odp_mb_full();
start_tick = odp_timer_current_tick(timer_pool);
- time = odp_time_local();
+ time = odp_time_global();
odp_mb_full();
start_ns = odp_time_to_ns(time);
@@ -703,6 +796,8 @@ static int start_timers(test_global_t *test_global)
}
}
+ printf("\nStarting timers took %" PRIu64 " nsec\n", odp_time_global_ns() - start_ns);
+
return 0;
}
@@ -713,7 +808,7 @@ static int destroy_timers(test_global_t *test_global)
odp_event_t ev;
int ret = 0;
- alloc_timers = test_global->alloc_timers;
+ alloc_timers = test_global->opt.alloc_timers;
for (i = 0; i < alloc_timers; i++) {
timer = test_global->timer_ctx[i].timer;
@@ -737,61 +832,115 @@ static int destroy_timers(test_global_t *test_global)
}
}
- if (test_global->queue != ODP_QUEUE_INVALID) {
- if (odp_queue_destroy(test_global->queue)) {
+ for (i = 0; i < (uint64_t)test_global->opt.num_queue; i++) {
+ if (odp_queue_destroy(test_global->queue[i])) {
printf("Queue destroy failed.\n");
ret = -1;
}
}
+ if (test_global->opt.groups) {
+ for (i = 0; i < (uint64_t)test_global->opt.cpu_count; i++) {
+ if (odp_schedule_group_destroy(test_global->group[i])) {
+ printf("Group destroy failed.\n");
+ ret = -1;
+ }
+ }
+ }
+
return ret;
}
-static void print_nsec_error(const char *str, uint64_t nsec, double res_ns,
- uint64_t idx)
+static void print_nsec_error(const char *str, int64_t nsec, double res_ns,
+ int tid, int idx)
{
- printf(" %s: %12" PRIu64 " / %.3fx resolution",
+ printf(" %s: %12" PRIi64 " / %.3fx resolution",
str, nsec, (double)nsec / res_ns);
- if (idx != UINT64_MAX)
- printf(", event %" PRIu64, idx);
+ if (tid >= 0)
+ printf(", thread %d", tid);
+ if (idx >= 0)
+ printf(", event %d", idx);
printf("\n");
}
static void print_stat(test_global_t *test_global)
{
uint64_t i;
- uint64_t tot_timers = test_global->tot_timers;
- test_stat_t *stat = &test_global->stat;
+ test_stat_t test_stat;
+ test_stat_t *stat = &test_stat;
+ uint64_t tot_timers;
+ test_stat_t *s = test_global->stat;
test_log_t *log = test_global->log;
- double ave_after = 0.0;
- double ave_before = 0.0;
double res_ns = test_global->res_ns;
+ uint64_t ave_after = 0;
+ uint64_t ave_before = 0;
+ uint64_t nsec_before_min_tid = 0;
+ uint64_t nsec_before_max_tid = 0;
+ uint64_t nsec_after_min_tid = 0;
+ uint64_t nsec_after_max_tid = 0;
+
+ memset(stat, 0, sizeof(*stat));
+ stat->nsec_before_min = UINT64_MAX;
+ stat->nsec_after_min = UINT64_MAX;
+
+ for (int i = 1; i < test_global->opt.cpu_count + 1; i++) {
+ stat->nsec_before_sum += s[i].nsec_before_sum;
+ stat->nsec_after_sum += s[i].nsec_after_sum;
+ stat->num_before += s[i].num_before;
+ stat->num_exact += s[i].num_exact;
+ stat->num_after += s[i].num_after;
+ stat->num_too_near += s[i].num_too_near;
+
+ if (s[i].nsec_before_min < stat->nsec_before_min) {
+ stat->nsec_before_min = s[i].nsec_before_min;
+ stat->nsec_before_min_idx = s[i].nsec_before_min_idx;
+ nsec_before_min_tid = i;
+ }
+
+ if (s[i].nsec_after_min < stat->nsec_after_min) {
+ stat->nsec_after_min = s[i].nsec_after_min;
+ stat->nsec_after_min_idx = s[i].nsec_after_min_idx;
+ nsec_after_min_tid = i;
+ }
+
+ if (s[i].nsec_before_max > stat->nsec_before_max) {
+ stat->nsec_before_max = s[i].nsec_before_max;
+ stat->nsec_before_max_idx = s[i].nsec_before_max_idx;
+ nsec_before_max_tid = i;
+ }
+
+ if (s[i].nsec_after_max > stat->nsec_after_max) {
+ stat->nsec_after_max = s[i].nsec_after_max;
+ stat->nsec_after_max_idx = s[i].nsec_after_max_idx;
+ nsec_after_max_tid = i;
+ }
+ }
if (stat->num_after)
- ave_after = (double)stat->nsec_after_sum / stat->num_after;
+ ave_after = stat->nsec_after_sum / stat->num_after;
else
stat->nsec_after_min = 0;
if (stat->num_before)
- ave_before = (double)stat->nsec_before_sum / stat->num_before;
+ ave_before = stat->nsec_before_sum / stat->num_before;
else
stat->nsec_before_min = 0;
+ tot_timers = stat->num_before + stat->num_after + stat->num_exact;
+
if (log) {
FILE *file = test_global->file;
- fprintf(file, " Timer tmo(ns) diff(ns)\n");
+ fprintf(file, " Timer thread tmo(ns) diff(ns)\n");
- for (i = test_global->warmup_timers; i < tot_timers; i++) {
- fprintf(file, "%8" PRIu64 " %12" PRIu64 " %10"
- PRIi64 "\n", i, log[i].tmo_ns, log[i].diff_ns);
+ for (i = 0; i < tot_timers; i++) {
+ fprintf(file, "%8" PRIu64 " %7u %12" PRIu64 " %10"
+ PRIi64 "\n", i, log[i].tid, log[i].tmo_ns, log[i].diff_ns);
}
fprintf(file, "\n");
}
- tot_timers -= test_global->warmup_timers;
-
printf("\nTest results:\n");
printf(" num after: %12" PRIu64 " / %.2f%%\n",
stat->num_after, 100.0 * stat->num_after / tot_timers);
@@ -802,24 +951,50 @@ static void print_stat(test_global_t *test_global)
printf(" num retry: %12" PRIu64 " / %.2f%%\n",
stat->num_too_near, 100.0 * stat->num_too_near / tot_timers);
printf(" error after (nsec):\n");
- print_nsec_error("min", stat->nsec_after_min, res_ns, stat->nsec_after_min_idx);
- print_nsec_error("max", stat->nsec_after_max, res_ns, stat->nsec_after_max_idx);
- print_nsec_error("ave", ave_after, res_ns, UINT64_MAX);
+ print_nsec_error("min", stat->nsec_after_min, res_ns, nsec_after_min_tid,
+ stat->nsec_after_min_idx);
+ print_nsec_error("max", stat->nsec_after_max, res_ns, nsec_after_max_tid,
+ stat->nsec_after_max_idx);
+ print_nsec_error("ave", ave_after, res_ns, -1, -1);
printf(" error before (nsec):\n");
- print_nsec_error("min", stat->nsec_before_min, res_ns, stat->nsec_before_min_idx);
- print_nsec_error("max", stat->nsec_before_max, res_ns, stat->nsec_before_max_idx);
- print_nsec_error("ave", ave_before, res_ns, UINT64_MAX);
+ print_nsec_error("min", stat->nsec_before_min, res_ns, nsec_before_min_tid,
+ stat->nsec_before_min_idx);
+ print_nsec_error("max", stat->nsec_before_max, res_ns, nsec_before_max_tid,
+ stat->nsec_before_max_idx);
+ print_nsec_error("ave", ave_before, res_ns, -1, -1);
if (test_global->opt.mode == MODE_PERIODIC && !test_global->opt.offset_ns) {
- printf(" first timeout difference to one period (nsec):\n");
- printf(" %12" PRIi64 " / %.3fx resolution, based on %s\n",
- stat->first_tmo_diff, (double)stat->first_tmo_diff / res_ns,
- stat->tmo_tick ? "timeout tick" : "time");
+ int idx = 0;
+ int64_t max = 0;
+
+ for (int i = 0; i < (int)test_global->opt.alloc_timers; i++) {
+ timer_ctx_t *t = &test_global->timer_ctx[i];
+ int64_t v = t->first_tmo_diff;
+
+ if (ODPH_ABS(v) > ODPH_ABS(max)) {
+ max = v;
+ idx = i;
+ }
+ }
+
+ printf(" first timeout difference to one period, based on %s (nsec):\n",
+ test_global->timer_ctx[idx].tmo_tick ? "timeout tick" : "time");
+ print_nsec_error("max", max, res_ns, -1, -1);
+ }
+
+ int64_t max = 0;
+
+ for (int i = 0; i < (int)test_global->opt.alloc_timers; i++) {
+ timer_ctx_t *t = &test_global->timer_ctx[i];
+ int64_t v = t->nsec_final;
+
+ if (ODPH_ABS(v) > ODPH_ABS(max))
+ max = v;
}
printf(" final timeout error (nsec):\n");
- printf(" %12" PRIi64 " / %.3fx resolution\n",
- stat->nsec_final, (double)stat->nsec_final / res_ns);
+ print_nsec_error("max", max, res_ns, -1, -1);
+
printf("\n");
}
@@ -827,12 +1002,8 @@ static void cancel_periodic_timers(test_global_t *test_global)
{
uint64_t i, alloc_timers;
odp_timer_t timer;
- odp_event_t ev;
-
- if (test_global->opt.mode != MODE_PERIODIC)
- return;
- alloc_timers = test_global->alloc_timers;
+ alloc_timers = test_global->opt.alloc_timers;
for (i = 0; i < alloc_timers; i++) {
timer = test_global->timer_ctx[i].timer;
@@ -843,47 +1014,69 @@ static void cancel_periodic_timers(test_global_t *test_global)
if (odp_timer_periodic_cancel(timer))
printf("Failed to cancel periodic timer.\n");
}
-
- while (alloc_timers) {
- odp_timeout_t tmo;
- timer_ctx_t *ctx;
-
- ev = odp_schedule(NULL, ODP_SCHED_WAIT);
- tmo = odp_timeout_from_event(ev);
- ctx = odp_timeout_user_ptr(tmo);
- if (odp_timer_periodic_ack(ctx->timer, ev) != 2)
- continue;
- odp_event_free(ev);
- alloc_timers--;
- }
}
-static void run_test(test_global_t *test_global)
+static int run_test(void *arg)
{
- uint64_t burst, num, num_tmo, next_tmo;
- uint64_t i, tot_timers;
+ test_global_t *test_global = (test_global_t *)arg;
odp_event_t ev;
odp_time_t time;
uint64_t time_ns, diff_ns;
odp_timeout_t tmo;
uint64_t tmo_ns;
timer_ctx_t *ctx;
- test_stat_t *stat = &test_global->stat;
+ odp_thrmask_t mask;
+ uint64_t wait = odp_schedule_wait_time(10 * ODP_TIME_MSEC_IN_NS);
+ odp_schedule_group_t group = ODP_SCHED_GROUP_INVALID;
test_log_t *log = test_global->log;
enum mode_e mode = test_global->opt.mode;
+ uint64_t tot_timers = test_global->opt.tot_timers;
double period_dbl = test_global->period_dbl;
odp_timer_pool_t tp = test_global->timer_pool;
+ int tid = odp_thread_id();
+
+ if (tid > test_global->opt.cpu_count) {
+ printf("Error: tid %d is larger than cpu_count %d.\n", tid,
+ test_global->opt.cpu_count);
+ return 0;
+ }
- num = 0;
- next_tmo = 1;
- num_tmo = test_global->opt.num;
- burst = test_global->opt.burst;
- tot_timers = test_global->tot_timers;
+ test_stat_t *stat = &test_global->stat[tid];
- for (i = 0; i < tot_timers; i++) {
- ev = odp_schedule(NULL, ODP_SCHED_WAIT);
+ memset(stat, 0, sizeof(*stat));
+ stat->nsec_before_min = UINT64_MAX;
+ stat->nsec_after_min = UINT64_MAX;
+
+ if (test_global->opt.groups) {
+ odp_thrmask_zero(&mask);
+ odp_thrmask_set(&mask, tid);
+ group = test_global->group[tid - 1];
+
+ if (odp_schedule_group_join(group, &mask)) {
+ printf("odp_schedule_group_join() failed\n");
+ return 0;
+ }
+ }
+
+ odp_barrier_wait(&test_global->barrier);
+
+ while (1) {
+ ev = odp_schedule(NULL, wait);
+ time = odp_time_global_strict();
+
+ if (ev == ODP_EVENT_INVALID) {
+ if (mode == MODE_PERIODIC) {
+ if (odp_atomic_load_u64(&test_global->last_events) >=
+ test_global->opt.alloc_timers)
+ break;
+
+ } else if (odp_atomic_load_u64(&test_global->events) >= tot_timers) {
+ break;
+ }
+
+ continue;
+ }
- time = odp_time_local();
time_ns = odp_time_to_ns(time);
tmo = odp_timeout_from_event(ev);
ctx = odp_timeout_user_ptr(tmo);
@@ -904,17 +1097,17 @@ static void run_test(test_global_t *test_global)
* Adjust by the difference between one period after start
* time and the timeout tick.
*/
- stat->tmo_tick = 1;
- stat->first_tmo_diff =
+ ctx->tmo_tick = 1;
+ ctx->first_tmo_diff =
(int64_t)odp_timer_tick_to_ns(tp, tmo_tick) -
(int64_t)odp_timer_tick_to_ns(tp, ctx->first_period);
- tmo_ns += stat->first_tmo_diff;
+ tmo_ns += ctx->first_tmo_diff;
} else {
/*
* Timeout tick is not provided, so the best we can do is
* to just take the current time as a baseline.
*/
- stat->first_tmo_diff = (int64_t)time_ns - (int64_t)tmo_ns;
+ ctx->first_tmo_diff = (int64_t)time_ns - (int64_t)tmo_ns;
tmo_ns = ctx->nsec = time_ns;
}
@@ -926,57 +1119,54 @@ static void run_test(test_global_t *test_global)
ctx->count++;
}
- if (i == test_global->warmup_timers) {
- int tmo_tick = stat->tmo_tick;
- int64_t first_tmo_diff = stat->first_tmo_diff;
-
- memset(stat, 0, sizeof(*stat));
- stat->nsec_before_min = UINT64_MAX;
- stat->nsec_after_min = UINT64_MAX;
- stat->tmo_tick = tmo_tick;
- stat->first_tmo_diff = first_tmo_diff;
- }
+ uint64_t events = odp_atomic_fetch_inc_u64(&test_global->events);
- stat->nsec_final = (int64_t)time_ns - (int64_t)tmo_ns;
+ if (events >= test_global->opt.warmup_timers && events < tot_timers) {
+ uint64_t i = events - test_global->opt.warmup_timers;
- if (log)
- log[i].tmo_ns = tmo_ns;
+ ctx->nsec_final = (int64_t)time_ns - (int64_t)tmo_ns;
- if (time_ns > tmo_ns) {
- diff_ns = time_ns - tmo_ns;
- stat->num_after++;
- stat->nsec_after_sum += diff_ns;
- if (diff_ns < stat->nsec_after_min) {
- stat->nsec_after_min = diff_ns;
- stat->nsec_after_min_idx = i;
- }
- if (diff_ns > stat->nsec_after_max) {
- stat->nsec_after_max = diff_ns;
- stat->nsec_after_max_idx = i;
+ if (log) {
+ log[i].tmo_ns = tmo_ns;
+ log[i].tid = tid;
}
- if (log)
- log[i].diff_ns = diff_ns;
-
- } else if (time_ns < tmo_ns) {
- diff_ns = tmo_ns - time_ns;
- stat->num_before++;
- stat->nsec_before_sum += diff_ns;
- if (diff_ns < stat->nsec_before_min) {
- stat->nsec_before_min = diff_ns;
- stat->nsec_before_min_idx = i;
- }
- if (diff_ns > stat->nsec_before_max) {
- stat->nsec_before_max = diff_ns;
- stat->nsec_before_max_idx = i;
+
+ if (time_ns > tmo_ns) {
+ diff_ns = time_ns - tmo_ns;
+ stat->num_after++;
+ stat->nsec_after_sum += diff_ns;
+ if (diff_ns < stat->nsec_after_min) {
+ stat->nsec_after_min = diff_ns;
+ stat->nsec_after_min_idx = i;
+ }
+ if (diff_ns > stat->nsec_after_max) {
+ stat->nsec_after_max = diff_ns;
+ stat->nsec_after_max_idx = i;
+ }
+ if (log)
+ log[i].diff_ns = diff_ns;
+
+ } else if (time_ns < tmo_ns) {
+ diff_ns = tmo_ns - time_ns;
+ stat->num_before++;
+ stat->nsec_before_sum += diff_ns;
+ if (diff_ns < stat->nsec_before_min) {
+ stat->nsec_before_min = diff_ns;
+ stat->nsec_before_min_idx = i;
+ }
+ if (diff_ns > stat->nsec_before_max) {
+ stat->nsec_before_max = diff_ns;
+ stat->nsec_before_max_idx = i;
+ }
+ if (log)
+ log[i].diff_ns = -diff_ns;
+ } else {
+ stat->num_exact++;
}
- if (log)
- log[i].diff_ns = -diff_ns;
- } else {
- stat->num_exact++;
}
if ((mode == MODE_RESTART_ABS || mode == MODE_RESTART_REL) &&
- next_tmo < num_tmo) {
+ events < tot_timers - 1) {
/* Reset timer for next period */
odp_timer_t tim;
uint64_t nsec, tick;
@@ -1012,56 +1202,61 @@ static void run_test(test_global_t *test_global)
start_param.tick = tick;
ret = odp_timer_start(tim, &start_param);
- if (ret == ODP_TIMER_TOO_NEAR)
- stat->num_too_near++;
- else
+ if (ret == ODP_TIMER_TOO_NEAR) {
+ if (events >= test_global->opt.warmup_timers)
+ stat->num_too_near++;
+ } else {
break;
+ }
}
if (ret != ODP_TIMER_SUCCESS) {
printf("Timer set failed: %i. Timeout nsec "
"%" PRIu64 "\n", ret, ctx->nsec);
- return;
+ return 0;
}
} else if (mode == MODE_PERIODIC) {
- if (odp_timer_periodic_ack(ctx->timer, ev))
+ int ret = odp_timer_periodic_ack(ctx->timer, ev);
+
+ if (ret < 0)
printf("Failed to ack a periodic timer.\n");
- } else {
- odp_event_free(ev);
- }
- num++;
+ if (ret == 2)
+ odp_atomic_inc_u64(&test_global->last_events);
- if (num == burst) {
- next_tmo++;
- num = 0;
+ if (ret == 2 || ret < 0)
+ odp_event_free(ev);
+ } else {
+ odp_event_free(ev);
}
-
}
- cancel_periodic_timers(test_global);
-
- /* Free current scheduler context. There should be no more events. */
- while ((ev = odp_schedule(NULL, ODP_SCHED_NO_WAIT))
- != ODP_EVENT_INVALID) {
- printf("Dropping extra event\n");
- odp_event_free(ev);
+ if (test_global->opt.groups) {
+ if (odp_schedule_group_leave(group, &mask))
+ printf("odp_schedule_group_leave() failed\n");
}
+
+ return 0;
}
int main(int argc, char *argv[])
{
odp_instance_t instance;
odp_init_t init;
- test_global_t test_global;
+ test_opt_t test_opt;
+ test_global_t *test_global;
+ odph_helper_options_t helper_options;
odp_init_t *init_ptr = NULL;
int ret = 0;
- memset(&test_global, 0, sizeof(test_global_t));
- test_global.stat.nsec_before_min = UINT64_MAX;
- test_global.stat.nsec_after_min = UINT64_MAX;
+ /* Let helper collect its own arguments (e.g. --odph_proc) */
+ argc = odph_parse_options(argc, argv);
+ if (odph_options(&helper_options)) {
+ ODPH_ERR("Reading ODP helper options failed.\n");
+ exit(EXIT_FAILURE);
+ }
- if (parse_options(argc, argv, &test_global))
+ if (parse_options(argc, argv, &test_opt))
return -1;
/* List features not to be used (may optimize performance) */
@@ -1072,7 +1267,9 @@ int main(int argc, char *argv[])
init.not_used.feat.ipsec = 1;
init.not_used.feat.tm = 1;
- if (test_global.opt.init)
+ init.mem_model = helper_options.mem_model;
+
+ if (test_opt.init)
init_ptr = &init;
/* Init ODP before calling anything else */
@@ -1082,7 +1279,7 @@ int main(int argc, char *argv[])
}
/* Init this thread */
- if (odp_init_local(instance, ODP_THREAD_WORKER)) {
+ if (odp_init_local(instance, ODP_THREAD_CONTROL)) {
printf("Local init failed.\n");
return -1;
}
@@ -1092,63 +1289,128 @@ int main(int argc, char *argv[])
/* Configure scheduler */
odp_schedule_config(NULL);
- test_global.timer_ctx = calloc(test_global.alloc_timers,
- sizeof(timer_ctx_t));
+ odp_shm_t shm = ODP_SHM_INVALID, shm_ctx = ODP_SHM_INVALID, shm_log = ODP_SHM_INVALID;
+ uint64_t size = sizeof(test_global_t);
+
+ shm = odp_shm_reserve("timer_accuracy", size,
+ ODP_CACHE_LINE_SIZE, ODP_SHM_SINGLE_VA);
+
+ if (shm == ODP_SHM_INVALID) {
+ printf("Shm alloc failed.\n");
+ return -1;
+ }
+
+ test_global = odp_shm_addr(shm);
+ memset(test_global, 0, size);
+ memcpy(&test_global->opt, &test_opt, sizeof(test_opt_t));
+
+ size = test_global->opt.alloc_timers * sizeof(timer_ctx_t);
+ shm_ctx = odp_shm_reserve("timer_accuracy_ctx", size,
+ ODP_CACHE_LINE_SIZE, ODP_SHM_SINGLE_VA);
- if (test_global.timer_ctx == NULL) {
- printf("Timer context table calloc failed.\n");
+ if (shm_ctx == ODP_SHM_INVALID) {
+ printf("Timer context alloc failed.\n");
ret = -1;
goto quit;
}
- if (test_global.opt.output) {
- odp_shm_t shm;
- void *addr;
- uint64_t size = test_global.tot_timers * sizeof(test_log_t);
+ test_global->timer_ctx = odp_shm_addr(shm_ctx);
+ memset(test_global->timer_ctx, 0, size);
- test_global.file = fopen(test_global.filename, "w");
- if (test_global.file == NULL) {
+ if (test_global->opt.output) {
+ test_global->file = fopen(test_global->opt.filename, "w");
+ if (test_global->file == NULL) {
printf("Failed to open output file %s: %s\n",
- test_global.filename, strerror(errno));
+ test_global->opt.filename, strerror(errno));
ret = -1;
goto quit;
}
- shm = odp_shm_reserve("timer_accuracy_log", size,
- sizeof(test_log_t), 0);
+ size = (test_global->opt.tot_timers - test_global->opt.warmup_timers) *
+ sizeof(test_log_t);
+ shm_log = odp_shm_reserve("timer_accuracy_log", size, sizeof(test_log_t),
+ ODP_SHM_SINGLE_VA);
- if (shm == ODP_SHM_INVALID) {
+ if (shm_log == ODP_SHM_INVALID) {
printf("Test log alloc failed.\n");
ret = -1;
goto quit;
}
- addr = odp_shm_addr(shm);
- memset(addr, 0, size);
- test_global.log = addr;
- test_global.log_shm = shm;
+ test_global->log = odp_shm_addr(shm_log);
+ memset(test_global->log, 0, size);
}
- ret = start_timers(&test_global);
+ odph_thread_t thread_tbl[MAX_WORKERS];
+ int num_workers;
+ odp_cpumask_t cpumask;
+ char cpumaskstr[ODP_CPUMASK_STR_SIZE];
+ odph_thread_common_param_t thr_common;
+ odph_thread_param_t thr_param;
+
+ memset(thread_tbl, 0, sizeof(thread_tbl));
+
+ num_workers = MAX_WORKERS;
+ if (test_global->opt.cpu_count && test_global->opt.cpu_count < MAX_WORKERS)
+ num_workers = test_global->opt.cpu_count;
+ num_workers = odp_cpumask_default_worker(&cpumask, num_workers);
+ test_global->opt.cpu_count = num_workers;
+ odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr));
+
+ printf("num worker threads: %i\n", num_workers);
+ printf("first CPU: %i\n", odp_cpumask_first(&cpumask));
+ printf("cpu mask: %s\n", cpumaskstr);
+
+ ret = create_timers(test_global);
+ if (ret)
+ goto quit;
+
+ odp_barrier_init(&test_global->barrier, num_workers + 1);
+ odp_atomic_init_u64(&test_global->events, 0);
+ odp_atomic_init_u64(&test_global->last_events, 0);
+
+ odph_thread_param_init(&thr_param);
+ thr_param.start = run_test;
+ thr_param.arg = (void *)test_global;
+ thr_param.thr_type = ODP_THREAD_WORKER;
+
+ odph_thread_common_param_init(&thr_common);
+ thr_common.instance = instance;
+ thr_common.cpumask = &cpumask;
+ thr_common.share_param = 1;
+
+ odph_thread_create(thread_tbl, &thr_common, &thr_param, num_workers);
+ odp_barrier_wait(&test_global->barrier);
+
+ ret = start_timers(test_global);
if (ret)
goto quit;
- run_test(&test_global);
+ if (test_global->opt.mode == MODE_PERIODIC) {
+ while (odp_atomic_load_u64(&test_global->events) < test_global->opt.tot_timers)
+ odp_time_wait_ns(10 * ODP_TIME_MSEC_IN_NS);
+
+ cancel_periodic_timers(test_global);
+ }
- print_stat(&test_global);
+ odph_thread_join(thread_tbl, num_workers);
+ print_stat(test_global);
quit:
- if (test_global.file)
- fclose(test_global.file);
+ if (test_global->file)
+ fclose(test_global->file);
- if (test_global.timer_ctx && destroy_timers(&test_global))
+ if (destroy_timers(test_global))
ret = -1;
- if (test_global.timer_ctx)
- free(test_global.timer_ctx);
+ if (shm_log != ODP_SHM_INVALID && odp_shm_free(shm_log))
+ ret = -1;
+
+ if (shm_ctx != ODP_SHM_INVALID && odp_shm_free(shm_ctx))
+ ret = -1;
- if (test_global.log)
- odp_shm_free(test_global.log_shm);
+ if (odp_shm_free(shm))
+ ret = -1;
if (odp_term_local()) {
printf("Term local failed.\n");
diff --git a/example/timer/odp_timer_simple.c b/example/timer/odp_timer_simple.c
index 4e3120653..fdf38c9d3 100644
--- a/example/timer/odp_timer_simple.c
+++ b/example/timer/odp_timer_simple.c
@@ -19,8 +19,6 @@
#include <odp/helper/odph_api.h>
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
-
int main(int argc ODP_UNUSED, char *argv[] ODP_UNUSED)
{
odp_instance_t instance;
@@ -71,8 +69,8 @@ int main(int argc ODP_UNUSED, char *argv[] ODP_UNUSED)
}
odp_timer_pool_param_init(&tparams);
- tparams.res_ns = MAX(10 * ODP_TIME_MSEC_IN_NS,
- timer_capa.highest_res_ns);
+ tparams.res_ns = ODPH_MAX(10 * ODP_TIME_MSEC_IN_NS,
+ timer_capa.highest_res_ns);
tparams.min_tmo = 10 * ODP_TIME_MSEC_IN_NS;
tparams.max_tmo = 1 * ODP_TIME_SEC_IN_NS;
tparams.num_timers = 1; /* One timer per worker */
diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c
index 0e3fa7346..924ffe13f 100644
--- a/example/timer/odp_timer_test.c
+++ b/example/timer/odp_timer_test.c
@@ -21,7 +21,6 @@
#define MAX_WORKERS (ODP_THREAD_COUNT_MAX - 1)
#define NUM_TMOS 10000 /**< Number of timers */
#define WAIT_NUM 10 /**< Max tries to rx last tmo per worker */
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
/** Test arguments */
typedef struct {
@@ -282,9 +281,7 @@ static int parse_args(int argc, char *argv[], test_args_t *args)
return -1;
args->cpu_count = 1;
- args->resolution_us = MAX(10000,
- timer_capa.highest_res_ns /
- ODP_TIME_USEC_IN_NS);
+ args->resolution_us = ODPH_MAX(10000u, timer_capa.highest_res_ns / ODP_TIME_USEC_IN_NS);
args->min_us = 0;
args->max_us = 10000000;
args->period_us = 1000000;
diff --git a/example/traffic_mgmt/odp_traffic_mgmt.c b/example/traffic_mgmt/odp_traffic_mgmt.c
index 689cac2ae..5c97c5433 100644
--- a/example/traffic_mgmt/odp_traffic_mgmt.c
+++ b/example/traffic_mgmt/odp_traffic_mgmt.c
@@ -21,6 +21,7 @@
#include <unistd.h>
#include <odp_api.h>
+#include <odp/helper/odph_api.h>
#define NUM_SVC_CLASSES 4
#define USERS_PER_SVC_CLASS 2
@@ -39,9 +40,6 @@
#define FALSE 0
#define TRUE 1
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
-#define MIN(a, b) (((a) < (b)) ? (a) : (b))
-
#define RANDOM_BUF_LEN 1024
typedef struct {
@@ -302,7 +300,7 @@ static uint32_t tm_shaper_max_burst;
static uint64_t
clamp_rate(uint64_t rate)
{
- uint64_t val = MIN(MAX(rate, tm_shaper_min_rate), tm_shaper_max_rate);
+ uint64_t val = ODPH_MIN(ODPH_MAX(rate, tm_shaper_min_rate), tm_shaper_max_rate);
if (!rate)
return 0;
@@ -316,7 +314,7 @@ clamp_rate(uint64_t rate)
static uint32_t
clamp_burst(uint32_t burst)
{
- uint32_t val = MIN(MAX(burst, tm_shaper_min_burst), tm_shaper_max_burst);
+ uint32_t val = ODPH_MIN(ODPH_MAX(burst, tm_shaper_min_burst), tm_shaper_max_burst);
if (!burst)
return 0;
@@ -765,7 +763,7 @@ static int traffic_generator(uint32_t pkts_to_send)
queue_num = random_16() & (TM_QUEUES_PER_CLASS - 1);
tm_queue = queue_num_tbls[svc_class][queue_num];
pkt_len = ((uint32_t)((random_8() & 0x7F) + 2)) * 32;
- pkt_len = MIN(pkt_len, 1500);
+ pkt_len = ODPH_MIN(pkt_len, 1500u);
pkt = make_odp_packet(pkt_len);
pkt_cnt++;
diff --git a/helper/Makefile.am b/helper/Makefile.am
index edcde4f5b..54d4fbf66 100644
--- a/helper/Makefile.am
+++ b/helper/Makefile.am
@@ -27,6 +27,7 @@ helperinclude_HEADERS = \
include/odp/helper/igmp.h\
include/odp/helper/ip.h\
include/odp/helper/ipsec.h\
+ include/odp/helper/macros.h\
include/odp/helper/odph_api.h\
include/odp/helper/odph_cuckootable.h\
include/odp/helper/odph_hashtable.h\
diff --git a/helper/chksum.c b/helper/chksum.c
index 0ac07393b..69781291c 100644
--- a/helper/chksum.c
+++ b/helper/chksum.c
@@ -1,7 +1,5 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
#include <odp_api.h>
diff --git a/helper/cli.c b/helper/cli.c
index fef42ec61..4ce4bf62e 100644
--- a/helper/cli.c
+++ b/helper/cli.c
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021-2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021-2022 Nokia
*/
#include <odp/helper/cli.h>
diff --git a/helper/cuckootable.c b/helper/cuckootable.c
index ecf95a83a..85f715b3c 100644
--- a/helper/cuckootable.c
+++ b/helper/cuckootable.c
@@ -1,7 +1,5 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
/*-
@@ -87,7 +85,7 @@ struct cuckoo_table_key_value {
};
/** @internal bucket structure
- * Put the elements with defferent keys but a same signature
+ * Put the elements with different keys but a same signature
* into a bucket, and each bucket has at most HASH_BUCKET_ENTRIES
* elements.
*/
diff --git a/helper/eth.c b/helper/eth.c
index 12218442d..171563ca8 100644
--- a/helper/eth.c
+++ b/helper/eth.c
@@ -1,7 +1,5 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
#include <odp/helper/eth.h>
diff --git a/helper/hashtable.c b/helper/hashtable.c
index 0c571db91..28c23a58c 100644
--- a/helper/hashtable.c
+++ b/helper/hashtable.c
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
#include <stdio.h>
@@ -27,7 +25,7 @@
#define ODPH_MAX_BUCKET_NUM 0x10000
/** @inner element structure of hash table
- * To resolve the hash confict:
+ * To resolve the hash conflict:
* we put the elements with different keys but a same HASH-value
* into a list
*/
diff --git a/helper/include/odp/helper/chksum.h b/helper/include/odp/helper/chksum.h
index 148b98601..f9b3f2dc2 100644
--- a/helper/include/odp/helper/chksum.h
+++ b/helper/include/odp/helper/chksum.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2014-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2014-2018 Linaro Limited
*/
/**
@@ -18,8 +16,10 @@ extern "C" {
#include <odp_api.h>
-/** @addtogroup odph_chksum ODPH CHECK SUM
- * @{
+/** @defgroup odph_chksum ODPH CHECKSUM
+ * TCP/UDP/SCTP checksum
+ *
+ * @{
*/
/**
diff --git a/helper/include/odp/helper/cli.h b/helper/include/odp/helper/cli.h
index e9351147f..8a77ab763 100644
--- a/helper/include/odp/helper/cli.h
+++ b/helper/include/odp/helper/cli.h
@@ -1,17 +1,11 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
/**
* @file
*
- * ODP CLI helper API
- *
- * This API allows control of ODP CLI server, which may be connected to
- * using a telnet client. CLI commands may be used to get information
- * from an ODP instance, for debugging purposes.
+ * ODP CLI helper
*/
#ifndef ODPH_CLI_H_
@@ -25,7 +19,14 @@ extern "C" {
#include <stdarg.h>
/**
- * @addtogroup odph_cli ODPH CLI
+ * @defgroup odph_cli ODPH CLI
+ * Command line interface
+ *
+ * @details
+ * This API allows control of ODP CLI server, which may be connected to using a
+ * telnet client. CLI commands may be used to get information from an ODP
+ * instance, for debugging purposes.
+ *
* @{
*/
diff --git a/helper/include/odp/helper/deprecated.h b/helper/include/odp/helper/deprecated.h
index 3415b2127..9251f2ca8 100644
--- a/helper/include/odp/helper/deprecated.h
+++ b/helper/include/odp/helper/deprecated.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
+ * Copyright (c) 2021 Nokia
*/
/**
diff --git a/helper/include/odp/helper/eth.h b/helper/include/odp/helper/eth.h
index 31ced14b2..2a1f3f159 100644
--- a/helper/include/odp/helper/eth.h
+++ b/helper/include/odp/helper/eth.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2014-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2014-2018 Linaro Limited
*/
/**
@@ -19,8 +17,11 @@ extern "C" {
#include <odp_api.h>
-/** @addtogroup odph_header ODPH HEADER
- * @{
+/**
+ * @defgroup odph_protocols ODPH PROTOCOLS
+ * Network protocols
+ *
+ * @{
*/
#define ODPH_ETHADDR_LEN 6 /**< Ethernet address length */
@@ -51,13 +52,9 @@ extern "C" {
* Ethernet MAC address
*/
typedef struct ODP_PACKED {
- uint8_t addr[ODPH_ETHADDR_LEN]; /**< @private Address */
+ uint8_t addr[ODPH_ETHADDR_LEN]; /**< Address */
} odph_ethaddr_t;
-/** @internal Compile time assert */
-ODP_STATIC_ASSERT(sizeof(odph_ethaddr_t) == ODPH_ETHADDR_LEN,
- "ODPH_ETHADDR_T__SIZE_ERROR");
-
/**
* Ethernet header
*/
@@ -67,10 +64,6 @@ typedef struct ODP_PACKED {
odp_u16be_t type; /**< EtherType */
} odph_ethhdr_t;
-/** @internal Compile time assert */
-ODP_STATIC_ASSERT(sizeof(odph_ethhdr_t) == ODPH_ETHHDR_LEN,
- "ODPH_ETHHDR_T__SIZE_ERROR");
-
/**
* IEEE 802.1Q VLAN header
*
@@ -85,9 +78,16 @@ typedef struct ODP_PACKED {
odp_u16be_t type; /**< Inner EtherType */
} odph_vlanhdr_t;
-/** @internal Compile time assert */
+/** @cond _ODP_HIDE_FROM_DOXYGEN_ */
+ODP_STATIC_ASSERT(sizeof(odph_ethaddr_t) == ODPH_ETHADDR_LEN,
+ "ODPH_ETHADDR_T__SIZE_ERROR");
+
+ODP_STATIC_ASSERT(sizeof(odph_ethhdr_t) == ODPH_ETHHDR_LEN,
+ "ODPH_ETHHDR_T__SIZE_ERROR");
+
ODP_STATIC_ASSERT(sizeof(odph_vlanhdr_t) == ODPH_VLANHDR_LEN,
"ODPH_VLANHDR_T__SIZE_ERROR");
+/** @endcond */
/* Ethernet header Ether Type ('type') values, a selected few */
#define ODPH_ETHTYPE_IPV4 0x0800 /**< Internet Protocol version 4 */
diff --git a/helper/include/odp/helper/gtp.h b/helper/include/odp/helper/gtp.h
index d542dc6b3..b4fb21cb8 100644
--- a/helper/include/odp/helper/gtp.h
+++ b/helper/include/odp/helper/gtp.h
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(C) 2020 Marvell.
+ * Copyright(c) 2020 Marvell
*/
+
/**
* @file
*
@@ -16,6 +17,11 @@ extern "C" {
#include <odp_api.h>
/**
+ * @addtogroup odph_protocols
+ * @{
+ */
+
+/**
* Simplified GTP protocol header.
* Contains 8-bit gtp_hdr_info, 8-bit msg_type,
* 16-bit plen, 32-bit teid.
@@ -29,7 +35,11 @@ typedef struct ODP_PACKED {
} odph_gtphdr_t;
/** GTP header length */
-#define ODP_GTP_HLEN sizeof(odph_gtphdr_t)
+#define ODPH_GTP_HLEN sizeof(odph_gtphdr_t)
+
+/**
+ * @}
+ */
#ifdef __cplusplus
}
diff --git a/helper/include/odp/helper/icmp.h b/helper/include/odp/helper/icmp.h
index 3be0c345f..9dbc02a9f 100644
--- a/helper/include/odp/helper/icmp.h
+++ b/helper/include/odp/helper/icmp.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2014-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2014-2018 Linaro Limited
*/
@@ -20,8 +18,9 @@ extern "C" {
#include <odp_api.h>
-/** @addtogroup odph_header ODPH HEADER
- * @{
+/**
+ * @addtogroup odph_protocols
+ * @{
*/
/** ICMP header length */
@@ -48,55 +47,13 @@ typedef struct ODP_PACKED {
} un; /**< icmp sub header */
} odph_icmphdr_t;
-#define ICMP_ECHOREPLY 0 /**< Echo Reply */
-#define ICMP_DEST_UNREACH 3 /**< Destination Unreachable */
-#define ICMP_SOURCE_QUENCH 4 /**< Source Quench */
-#define ICMP_REDIRECT 5 /**< Redirect (change route) */
-#define ICMP_ECHO 8 /**< Echo Request */
-#define ICMP_TIME_EXCEEDED 11 /**< Time Exceeded */
-#define ICMP_PARAMETERPROB 12 /**< Parameter Problem */
-#define ICMP_TIMESTAMP 13 /**< Timestamp Request */
-#define ICMP_TIMESTAMPREPLY 14 /**< Timestamp Reply */
-#define ICMP_INFO_REQUEST 15 /**< Information Request */
-#define ICMP_INFO_REPLY 16 /**< Information Reply */
-#define ICMP_ADDRESS 17 /**< Address Mask Request */
-#define ICMP_ADDRESSREPLY 18 /**< Address Mask Reply */
-#define NR_ICMP_TYPES 18 /**< Number of icmp types */
-
-/* Codes for UNREACH. */
-#define ICMP_NET_UNREACH 0 /**< Network Unreachable */
-#define ICMP_HOST_UNREACH 1 /**< Host Unreachable */
-#define ICMP_PROT_UNREACH 2 /**< Protocol Unreachable */
-#define ICMP_PORT_UNREACH 3 /**< Port Unreachable */
-#define ICMP_FRAG_NEEDED 4 /**< Fragmentation Needed/DF set*/
-#define ICMP_SR_FAILED 5 /**< Source Route failed */
-#define ICMP_NET_UNKNOWN 6 /**< Network Unknown */
-#define ICMP_HOST_UNKNOWN 7 /**< Host Unknown */
-#define ICMP_HOST_ISOLATED 8 /**< Host Isolated */
-#define ICMP_NET_ANO 9 /**< ICMP_NET_ANO */
-#define ICMP_HOST_ANO 10 /**< ICMP_HOST_ANO */
-#define ICMP_NET_UNR_TOS 11 /**< ICMP_NET_UNR_TOS */
-#define ICMP_HOST_UNR_TOS 12 /**< ICMP_HOST_UNR_TOS */
-#define ICMP_PKT_FILTERED 13 /**< Packet filtered */
-#define ICMP_PREC_VIOLATION 14 /**< Precedence violation */
-#define ICMP_PREC_CUTOFF 15 /**< Precedence cut off */
-#define NR_ICMP_UNREACH 15 /**< instead of hardcoding
- immediate value */
-
-/* Codes for REDIRECT. */
-#define ICMP_REDIR_NET 0 /**< Redirect Net */
-#define ICMP_REDIR_HOST 1 /**< Redirect Host */
-#define ICMP_REDIR_NETTOS 2 /**< Redirect Net for TOS */
-#define ICMP_REDIR_HOSTTOS 3 /**< Redirect Host for TOS */
-
-/* Codes for TIME_EXCEEDED. */
-#define ICMP_EXC_TTL 0 /**< TTL count exceeded */
-#define ICMP_EXC_FRAGTIME 1 /**< Fragment Reass time
- exceeded*/
+#define ODPH_ICMP_ECHOREPLY 0 /**< Echo Reply */
+#define ODPH_ICMP_ECHO 8 /**< Echo Request */
-/** @internal Compile time assert */
+/** @cond _ODP_HIDE_FROM_DOXYGEN_ */
ODP_STATIC_ASSERT(sizeof(odph_icmphdr_t) == ODPH_ICMPHDR_LEN,
"ODPH_ICMPHDR_T__SIZE_ERROR");
+/** @endcond */
/**
* @}
diff --git a/helper/include/odp/helper/igmp.h b/helper/include/odp/helper/igmp.h
index 5cff41aab..64adc1bda 100644
--- a/helper/include/odp/helper/igmp.h
+++ b/helper/include/odp/helper/igmp.h
@@ -1,5 +1,5 @@
/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(C) 2020 Marvell.
+ * Copyright(c) 2020 Marvell
*/
/**
@@ -17,20 +17,29 @@ extern "C" {
#include <odp_api.h>
/**
+ * @addtogroup odph_protocols
+ * @{
+ */
+
+/**
* Simplified IGMP protocol header.
* Contains 8-bit type, 8-bit code,
* 16-bit csum, 32-bit group.
* No optional fields and next extension header.
*/
typedef struct ODP_PACKED {
- uint8_t type; /** Message Type */
- uint8_t code; /** Max response code */
- odp_u16be_t csum; /** Checksum */
- odp_u32be_t group; /** Group address */
+ uint8_t type; /**< Message Type */
+ uint8_t code; /**< Max response code */
+ odp_u16be_t csum; /**< Checksum */
+ odp_u32be_t group; /**< Group address */
} odph_igmphdr_t;
/** IGMP header length */
-#define ODP_IGMP_HLEN sizeof(odph_igmphdr_t)
+#define ODPH_IGMP_HLEN sizeof(odph_igmphdr_t)
+
+/**
+ * @}
+ */
#ifdef __cplusplus
}
diff --git a/helper/include/odp/helper/ip.h b/helper/include/odp/helper/ip.h
index 0faf47f82..733c145d8 100644
--- a/helper/include/odp/helper/ip.h
+++ b/helper/include/odp/helper/ip.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2014-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2014-2018 Linaro Limited
*/
/**
@@ -22,8 +20,9 @@ extern "C" {
#include <string.h>
-/** @addtogroup odph_header ODPH HEADER
- * @{
+/**
+ * @addtogroup odph_protocols
+ * @{
*/
#define ODPH_IPV4 4 /**< IP version 4 */
@@ -91,9 +90,10 @@ typedef struct ODP_PACKED {
odp_u32be_t dst_addr; /**< Destination address */
} odph_ipv4hdr_t;
-/** @internal Compile time assert */
+/** @cond _ODP_HIDE_FROM_DOXYGEN_ */
ODP_STATIC_ASSERT(sizeof(odph_ipv4hdr_t) == ODPH_IPV4HDR_LEN,
"ODPH_IPV4HDR_T__SIZE_ERROR");
+/** @endcond */
/**
* Calculate IPv4 header checksum
@@ -232,9 +232,10 @@ typedef struct ODP_PACKED {
uint8_t dst_addr[16]; /**< Destination address */
} odph_ipv6hdr_t;
-/** @internal Compile time assert */
+/** @cond _ODP_HIDE_FROM_DOXYGEN_ */
ODP_STATIC_ASSERT(sizeof(odph_ipv6hdr_t) == ODPH_IPV6HDR_LEN,
"ODPH_IPV6HDR_T__SIZE_ERROR");
+/** @endcond */
/**
* IPv6 Header extensions
@@ -247,9 +248,9 @@ typedef struct ODP_PACKED {
uint8_t filler[6]; /**< Fill out first 8 byte segment */
} odph_ipv6hdr_ext_t;
-/** @name
+/*
* IP protocol values (IPv4:'proto' or IPv6:'next_hdr')
- * @{*/
+ */
#define ODPH_IPPROTO_HOPOPTS 0x00 /**< IPv6 hop-by-hop options */
#define ODPH_IPPROTO_ICMPV4 0x01 /**< Internet Control Message Protocol (1) */
#define ODPH_IPPROTO_IGMP 0x02 /**< Internet Group Message Protocol (1) */
@@ -264,8 +265,6 @@ typedef struct ODP_PACKED {
(132) */
#define ODPH_IPPROTO_INVALID 0xFF /**< Reserved invalid by IANA */
-/**@}*/
-
/**
* Parse IPv4 address from a string
*
diff --git a/helper/include/odp/helper/ipsec.h b/helper/include/odp/helper/ipsec.h
index 197c7f7e8..11b7a3829 100644
--- a/helper/include/odp/helper/ipsec.h
+++ b/helper/include/odp/helper/ipsec.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2014-2018, Linaro Limited
- * Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2014-2018 Linaro Limited
+ * Copyright (c) 2021 Nokia
*/
@@ -21,8 +19,9 @@ extern "C" {
#include <odp_api.h>
-/** @addtogroup odph_header ODPH HEADER
- * @{
+/**
+ * @addtogroup odph_protocols
+ * @{
*/
#define ODPH_ESPHDR_LEN 8 /**< IPSec ESP header length */
@@ -38,10 +37,6 @@ typedef struct ODP_PACKED {
uint8_t iv[]; /**< Initialization vector */
} odph_esphdr_t;
-/** @internal Compile time assert */
-ODP_STATIC_ASSERT(sizeof(odph_esphdr_t) == ODPH_ESPHDR_LEN,
- "ODPH_ESPHDR_T__SIZE_ERROR");
-
/**
* IPSec ESP trailer
*/
@@ -51,10 +46,6 @@ typedef struct ODP_PACKED {
uint8_t icv[]; /**< Integrity Check Value (optional) */
} odph_esptrl_t;
-/** @internal Compile time assert */
-ODP_STATIC_ASSERT(sizeof(odph_esptrl_t) == ODPH_ESPTRL_LEN,
- "ODPH_ESPTRL_T__SIZE_ERROR");
-
/**
* IPSec AH header
*/
@@ -67,9 +58,16 @@ typedef struct ODP_PACKED {
uint8_t icv[]; /**< Integrity Check Value */
} odph_ahhdr_t;
-/** @internal Compile time assert */
+/** @cond _ODP_HIDE_FROM_DOXYGEN_ */
+ODP_STATIC_ASSERT(sizeof(odph_esphdr_t) == ODPH_ESPHDR_LEN,
+ "ODPH_ESPHDR_T__SIZE_ERROR");
+
+ODP_STATIC_ASSERT(sizeof(odph_esptrl_t) == ODPH_ESPTRL_LEN,
+ "ODPH_ESPTRL_T__SIZE_ERROR");
+
ODP_STATIC_ASSERT(sizeof(odph_ahhdr_t) == ODPH_AHHDR_LEN,
"ODPH_AHHDR_T__SIZE_ERROR");
+/** @endcond */
/**
* Check IPSEC algorithm support
diff --git a/helper/include/odp/helper/linux.h b/helper/include/odp/helper/linux.h
index f63385ec1..df852569f 100644
--- a/helper/include/odp/helper/linux.h
+++ b/helper/include/odp/helper/linux.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
/**
diff --git a/helper/include/odp/helper/linux/process.h b/helper/include/odp/helper/linux/process.h
index 620db7405..0f34d604b 100644
--- a/helper/include/odp/helper/linux/process.h
+++ b/helper/include/odp/helper/linux/process.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
/**
@@ -11,7 +9,7 @@
*
* This file is not part of ODP APIs, but can be optionally used to ease common
* setups in a Linux system. User is free to implement the same setups in
- * otherways (not via this file).
+ * other ways (not via this file).
*/
#ifndef ODPH_LINUX_PROCESS_H_
@@ -24,8 +22,9 @@
extern "C" {
#endif
-/** @ingroup odph_linux
- * @{
+/**
+ * @addtogroup odph_thread
+ * @{
*/
/**
diff --git a/helper/include/odp/helper/linux/pthread.h b/helper/include/odp/helper/linux/pthread.h
index 298536893..5a2f6fd53 100644
--- a/helper/include/odp/helper/linux/pthread.h
+++ b/helper/include/odp/helper/linux/pthread.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
/**
@@ -11,7 +9,7 @@
*
* This file is not part of ODP APIs, but can be optionally used to ease common
* setups in a Linux system. User is free to implement the same setups in
- * otherways (not via this file).
+ * other ways (not via this file).
*/
#ifndef ODPH_LINUX_PTHREAD_H_
@@ -24,8 +22,9 @@
extern "C" {
#endif
-/** @ingroup odph_linux
- * @{
+/**
+ * @addtogroup odph_thread
+ * @{
*/
/**
diff --git a/helper/include/odp/helper/macros.h b/helper/include/odp/helper/macros.h
new file mode 100644
index 000000000..e30db7bab
--- /dev/null
+++ b/helper/include/odp/helper/macros.h
@@ -0,0 +1,67 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2023 Nokia
+ */
+
+/**
+ * @file
+ *
+ * Common helper macros
+ */
+
+#ifndef ODPH_MACROS_H_
+#define ODPH_MACROS_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @defgroup odph_macros ODPH MACROS
+ * Helper macros
+ *
+ * @{
+ */
+
+/**
+ * Return number of elements in array
+ */
+#define ODPH_ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+
+/**
+ * Return minimum of two numbers
+ */
+#define ODPH_MIN(a, b) \
+ __extension__ ({ \
+ __typeof__(a) tmp_a = (a); \
+ __typeof__(b) tmp_b = (b); \
+ tmp_a < tmp_b ? tmp_a : tmp_b; \
+ })
+
+/**
+ * Return maximum of two numbers
+ */
+#define ODPH_MAX(a, b) \
+ __extension__ ({ \
+ __typeof__(a) tmp_a = (a); \
+ __typeof__(b) tmp_b = (b); \
+ tmp_a > tmp_b ? tmp_a : tmp_b; \
+ })
+
+/**
+ * Return absolute value of signed variable
+ */
+#define ODPH_ABS(v) \
+ __extension__ ({ \
+ __typeof__(v) tmp_v = (v); \
+ tmp_v < 0 ? -tmp_v : tmp_v; \
+ })
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ODPH_MACROS_H_ */
diff --git a/helper/include/odp/helper/odph_api.h b/helper/include/odp/helper/odph_api.h
index 3c321b9d4..94d43a61b 100644
--- a/helper/include/odp/helper/odph_api.h
+++ b/helper/include/odp/helper/odph_api.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
/**
@@ -30,6 +28,7 @@ extern "C" {
#include <odp/helper/igmp.h>
#include <odp/helper/ip.h>
#include <odp/helper/ipsec.h>
+#include <odp/helper/macros.h>
#include <odp/helper/odph_lineartable.h>
#include <odp/helper/odph_iplookuptable.h>
#include <odp/helper/sctp.h>
diff --git a/helper/include/odp/helper/odph_cuckootable.h b/helper/include/odp/helper/odph_cuckootable.h
index 5b0a48e5b..1c87a3d42 100644
--- a/helper/include/odp/helper/odph_cuckootable.h
+++ b/helper/include/odp/helper/odph_cuckootable.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
/*-
@@ -53,7 +51,9 @@ extern "C" {
#endif
/**
- * @addtogroup odph_cuckootable ODPH CUCKOO TABLE
+ * @defgroup odph_cuckootable ODPH CUCKOO TABLE
+ * Cuckoo table
+ *
* @{
*/
diff --git a/helper/include/odp/helper/odph_debug.h b/helper/include/odp/helper/odph_debug.h
index 7cb2ee617..41b425ab2 100644
--- a/helper/include/odp/helper/odph_debug.h
+++ b/helper/include/odp/helper/odph_debug.h
@@ -1,9 +1,6 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * Copyright (c) 2019, Nokia
- *
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
+ * Copyright (c) 2019 Nokia
*/
/**
@@ -30,8 +27,11 @@ extern "C" {
#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#endif
-/** @addtogroup odph_debug ODPH DEBUG
- * @{
+/**
+ * @defgroup odph_debug ODPH DEBUG
+ * Debug logging
+ *
+ * @{
*/
/**
diff --git a/helper/include/odp/helper/odph_hashtable.h b/helper/include/odp/helper/odph_hashtable.h
index 03c07c433..b2dd21920 100644
--- a/helper/include/odp/helper/odph_hashtable.h
+++ b/helper/include/odp/helper/odph_hashtable.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
@@ -20,7 +18,9 @@ extern "C" {
#endif
/**
- * @addtogroup odph_hash_table ODPH HASH TABLE
+ * @defgroup odph_hash_table ODPH HASH TABLE
+ * Hash table
+ *
* @{
*/
diff --git a/helper/include/odp/helper/odph_iplookuptable.h b/helper/include/odp/helper/odph_iplookuptable.h
index 14bb2495b..41235ecc6 100644
--- a/helper/include/odp/helper/odph_iplookuptable.h
+++ b/helper/include/odp/helper/odph_iplookuptable.h
@@ -1,18 +1,11 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
/**
* @file
*
* ODP IP Lookup Table
- *
- * This is an implementation of the IP lookup table. The key of
- * this table is IPv4 address (32 bits), and the value can be
- * defined by user. This table uses the 16,8,8 ip lookup (longest
- * prefix matching) algorithm.
*/
#ifndef ODPH_IPLOOKUP_TABLE_H_
@@ -25,7 +18,14 @@ extern "C" {
#endif
/**
- * @addtogroup odph_iplookuptable ODPH IP LOOKUP TABLE
+ * @defgroup odph_iplookuptable ODPH IP LOOKUP TABLE
+ * IP lookup table
+ *
+ * @details
+ * This is an implementation of the IP lookup table. The key of this table is
+ * IPv4 address (32 bits), and the value can be defined by user. This table uses
+ * the 16,8,8 ip lookup (longest prefix matching) algorithm.
+ *
* @{
*/
diff --git a/helper/include/odp/helper/odph_lineartable.h b/helper/include/odp/helper/odph_lineartable.h
index b8d8cecc6..dc61113a5 100644
--- a/helper/include/odp/helper/odph_lineartable.h
+++ b/helper/include/odp/helper/odph_lineartable.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
@@ -21,7 +19,9 @@ extern "C" {
#endif
/**
- * @addtogroup odph_lineartable ODPH LINEAR TABLE
+ * @defgroup odph_lineartable ODPH LINEAR TABLE
+ * Linear table
+ *
* @{
*/
diff --git a/helper/include/odp/helper/sctp.h b/helper/include/odp/helper/sctp.h
index c81bd6313..f6661e390 100644
--- a/helper/include/odp/helper/sctp.h
+++ b/helper/include/odp/helper/sctp.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2014-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2014-2018 Linaro Limited
*/
/**
@@ -19,8 +17,9 @@ extern "C" {
#include <odp_api.h>
-/** @addtogroup odph_header ODPH HEADER
- * @{
+/**
+ * @addtogroup odph_protocols
+ * @{
*/
/** SCTP header length */
@@ -34,9 +33,10 @@ typedef struct ODP_PACKED {
odp_u32be_t chksum; /**< SCTP header and data checksum */
} odph_sctphdr_t;
-/** @internal Compile time assert */
+/** @cond _ODP_HIDE_FROM_DOXYGEN_ */
ODP_STATIC_ASSERT(sizeof(odph_sctphdr_t) == ODPH_SCTPHDR_LEN,
"ODPH_SCTPHDR_T__SIZE_ERROR");
+/** @endcond */
/**
* @}
diff --git a/helper/include/odp/helper/strong_types.h b/helper/include/odp/helper/strong_types.h
index 645d0bfd6..b0f504c16 100644
--- a/helper/include/odp/helper/strong_types.h
+++ b/helper/include/odp/helper/strong_types.h
@@ -1,24 +1,18 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
* @file
*
* ODP Strong Types. Common macros for implementing strong typing
- * for ODP abstract data types
+ * for ODPH abstract data types
*/
#ifndef ODPH_STRONG_TYPES_H_
#define ODPH_STRONG_TYPES_H_
-/** @addtogroup odph_strong_types ODPH STRONG TYPES
- * @{
- */
-
-/** Use strong typing for ODP types */
+/** Use strong typing for ODPH types */
#ifdef __cplusplus
/** @internal C++ helper macro for strong typing @param type @return */
#define ODPH_HANDLE_T(type) struct _##type { uint8_t unused_dummy_var; } *type
@@ -28,17 +22,13 @@
#define ODPH_HANDLE_T(type) odph_handle_t type
#endif
-/** Internal macro to get value of an ODP handle */
+/** Internal macro to get value of an ODPH handle */
#define _odph_typeval(handle) ((uintptr_t)(handle))
-/** Internal macro to get printable value of an ODP handle */
+/** Internal macro to get printable value of an ODPH handle */
#define _odph_pri(handle) ((uint64_t)(uintptr_t)(handle))
/** Internal macro to convert a scalar to a typed handle */
#define _odph_cast_scalar(type, val) ((type)(uintptr_t)(val))
-/**
- * @}
- */
-
#endif
diff --git a/helper/include/odp/helper/table.h b/helper/include/odp/helper/table.h
index b1f8b4469..6a24e742b 100644
--- a/helper/include/odp/helper/table.h
+++ b/helper/include/odp/helper/table.h
@@ -1,14 +1,25 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
* @file
*
* ODP table
+ */
+
+#ifndef ODPH_TABLE_H_
+#define ODPH_TABLE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @defgroup odph_tables ODPH TABLES
+ * Table interface
*
+ * @details
* TCAM(Ternary Content Addressable Memory) is used widely in packet
* forwarding to speedup the table lookup.
*
@@ -56,7 +67,7 @@
* actions and action meta-data describing what processing to be
* applied for the packets of the current flow, such as whether
* encryption/decryption is required on this packet, what kind of cipher
- * algorithm should be chosed.
+ * algorithm should be chosen.
* <li>Algorithm: Hash
* </ol>
*
@@ -71,17 +82,6 @@
* notes: key/value and key/associated data mean the same thing
* in this file unless otherwise mentioned.
*
- */
-
-#ifndef ODPH_TABLE_H_
-#define ODPH_TABLE_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @addtogroup odph_tables ODPH TABLES
* @{
*/
@@ -149,7 +149,7 @@ typedef int (*odph_table_destroy)(odph_table_t table);
/**
* Add (key,associated data) pair into the specific table.
- * When no associated data is currently assocated with key,
+ * When no associated data is currently associated with key,
* then the (key,assocatied data) association is created.
* When key is already associated with data0, then association (key, data0)
* will be removed and association (key, associated data) is created.
diff --git a/helper/include/odp/helper/tcp.h b/helper/include/odp/helper/tcp.h
index ebc8ddf1b..8a14efa15 100644
--- a/helper/include/odp/helper/tcp.h
+++ b/helper/include/odp/helper/tcp.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2014-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2014-2018 Linaro Limited
*/
@@ -20,8 +18,9 @@ extern "C" {
#include <odp_api.h>
-/** @addtogroup odph_header ODPH HEADER
- * @{
+/**
+ * @addtogroup odph_protocols
+ * @{
*/
#define ODPH_TCPHDR_LEN 20 /**< Min length of TCP header (no options) */
diff --git a/helper/include/odp/helper/threads.h b/helper/include/odp/helper/threads.h
index 00f47fd76..358543c85 100644
--- a/helper/include/odp/helper/threads.h
+++ b/helper/include/odp/helper/threads.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2019-2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2019-2021 Nokia
*/
@@ -13,7 +11,7 @@
*
* This file is an optional helper to ODP APIs. These functions are provided
* to ease common setups in a Linux system. User is free to implement the same
- * setups in otherways (not via this API).
+ * setups in other ways (not via this API).
*/
#ifndef ODPH_LINUX_H_
@@ -30,8 +28,11 @@ extern "C" {
#include <getopt.h>
#include <sys/types.h>
-/** @addtogroup odph_linux ODPH LINUX
- * @{
+/**
+ * @defgroup odph_thread ODPH THREAD
+ * Setup threads/processes
+ *
+ * @{
*/
/** Thread parameter for Linux pthreads and processes */
diff --git a/helper/include/odp/helper/udp.h b/helper/include/odp/helper/udp.h
index 17a7e7129..53ac7281a 100644
--- a/helper/include/odp/helper/udp.h
+++ b/helper/include/odp/helper/udp.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2014-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2014-2018 Linaro Limited
*/
/**
@@ -20,8 +18,9 @@ extern "C" {
#include <odp_api.h>
#include <odp/helper/chksum.h>
-/** @addtogroup odph_header ODPH HEADER
- * @{
+/**
+ * @addtogroup odph_protocols
+ * @{
*/
/** UDP header length */
@@ -52,9 +51,10 @@ static inline uint16_t odph_ipv4_udp_chksum(odp_packet_t pkt)
return (rc == 0) ? chksum : 0;
}
-/** @internal Compile time assert */
+/** @cond _ODP_HIDE_FROM_DOXYGEN_ */
ODP_STATIC_ASSERT(sizeof(odph_udphdr_t) == ODPH_UDPHDR_LEN,
"ODPH_UDPHDR_T__SIZE_ERROR");
+/** @endcond */
/**
* @}
diff --git a/helper/include/odp/helper/version.h.in b/helper/include/odp/helper/version.h.in
index 127b3ff9d..e576de561 100644
--- a/helper/include/odp/helper/version.h.in
+++ b/helper/include/odp/helper/version.h.in
@@ -1,7 +1,5 @@
-/* Copyright (c) 2019, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2019 Nokia
*/
@@ -19,7 +17,9 @@ extern "C" {
#endif
/**
- * @defgroup odph_version VERSION
+ * @defgroup odph_version ODPH VERSION
+ * Helper library version
+ *
* @{
*/
diff --git a/helper/include/odph_list_internal.h b/helper/include/odph_list_internal.h
index fd889d971..d90b07ebc 100644
--- a/helper/include/odph_list_internal.h
+++ b/helper/include/odph_list_internal.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/helper/ip.c b/helper/ip.c
index 9e02892aa..964544ddb 100644
--- a/helper/ip.c
+++ b/helper/ip.c
@@ -1,7 +1,5 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
#include <odp/helper/ip.h>
diff --git a/helper/iplookuptable.c b/helper/iplookuptable.c
index f8f8e9cc5..31273a0a5 100644
--- a/helper/iplookuptable.c
+++ b/helper/iplookuptable.c
@@ -1,7 +1,5 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
#include <string.h>
@@ -155,7 +153,7 @@ cache_destroy(odph_iplookup_table_impl *impl)
}
}
-/** According to the type of cahce, set the value of
+/** According to the type of cache, set the value of
* a buffer to the initial value.
*/
static void
diff --git a/helper/ipsec.c b/helper/ipsec.c
index 05f8b841a..bb7d5d0eb 100644
--- a/helper/ipsec.c
+++ b/helper/ipsec.c
@@ -1,9 +1,7 @@
-/* Copyright (c) 2017-2018, Linaro Limited
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
* Copyright (c) 2020 Marvell
* Copyright (c) 2021 Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
*/
#include <odp/helper/ipsec.h>
diff --git a/helper/lineartable.c b/helper/lineartable.c
index 5362d80f5..290a90c02 100644
--- a/helper/lineartable.c
+++ b/helper/lineartable.c
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
#include <stdio.h>
@@ -28,7 +26,7 @@
typedef struct {
uint32_t magicword; /**< for check */
uint32_t init_cap; /**< input param of capacity */
- /** given the capacity, caculate out the max supported nodes number */
+ /** given the capacity, calculate out the max supported nodes number */
uint32_t node_sum;
/** size of a lineartable element,including the rwlock in the head */
uint32_t value_size;
@@ -54,7 +52,7 @@ odph_table_t odph_linear_table_create(const char *name, uint32_t capacity,
printf("create para input error or less than !");
return NULL;
}
- /* check name confict in shm*/
+ /* check name conflict in shm*/
if (odp_shm_lookup(name) != ODP_SHM_INVALID) {
ODPH_DBG("name already exist\n");
return NULL;
@@ -75,7 +73,7 @@ odph_table_t odph_linear_table_create(const char *name, uint32_t capacity,
strncpy(tbl->name, name, ODPH_TABLE_NAME_LEN - 1);
- /* for linear table, the key is just the index, without confict
+ /* for linear table, the key is just the index, without conflict
* so we just need to record the value content
* there is a rwlock in the head of every node
*/
diff --git a/helper/linux/thread.c b/helper/linux/thread.c
index 3d90d794c..d5b016833 100644
--- a/helper/linux/thread.c
+++ b/helper/linux/thread.c
@@ -1,7 +1,5 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
#ifndef _GNU_SOURCE
diff --git a/helper/test/.gitignore b/helper/test/.gitignore
index e1e5ab7b2..3db451f68 100644
--- a/helper/test/.gitignore
+++ b/helper/test/.gitignore
@@ -4,6 +4,7 @@ chksum
cli
cuckootable
iplookuptable
+macros
odpthreads
parse
process
diff --git a/helper/test/Makefile.am b/helper/test/Makefile.am
index 84dbd3e03..80aac1083 100644
--- a/helper/test/Makefile.am
+++ b/helper/test/Makefile.am
@@ -3,10 +3,11 @@ include $(top_srcdir)/test/Makefile.inc
EXECUTABLES = version \
debug \
chksum \
- cuckootable \
- parse\
- table \
- iplookuptable
+ cuckootable \
+ macros \
+ parse\
+ table \
+ iplookuptable
#These are platform specific extensions that are not portable
#They are a convenience to app writers who have chosen to
@@ -35,10 +36,11 @@ endif
test_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
-EXTRA_DIST = odpthreads_as_processes odpthreads_as_pthreads
+dist_check_SCRIPTS = odpthreads_as_processes odpthreads_as_pthreads
chksum_SOURCES = chksum.c
cuckootable_SOURCES = cuckootable.c
+macros_SOURCES = macros.c
odpthreads_SOURCES = odpthreads.c
parse_SOURCES = parse.c
table_SOURCES = table.c
diff --git a/helper/test/chksum.c b/helper/test/chksum.c
index 3b1f8ed9f..d7273284a 100644
--- a/helper/test/chksum.c
+++ b/helper/test/chksum.c
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
#include <odp_api.h>
diff --git a/helper/test/cli.c b/helper/test/cli.c
index 4fa403f5a..08e750153 100644
--- a/helper/test/cli.c
+++ b/helper/test/cli.c
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp_api.h>
diff --git a/helper/test/cuckootable.c b/helper/test/cuckootable.c
index d11e944f9..d17f79562 100644
--- a/helper/test/cuckootable.c
+++ b/helper/test/cuckootable.c
@@ -1,7 +1,5 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
/*-
@@ -392,7 +390,7 @@ static int test_five_keys(void)
#define BUCKET_ENTRIES 4
#define HASH_ENTRIES_MAX 1048576
/*
- * Do tests for cuchoo tabke creation with bad parameters.
+ * Do tests for cuchoo table creation with bad parameters.
*/
static int test_creation_with_bad_parameters(void)
{
diff --git a/helper/test/debug.c b/helper/test/debug.c
index 3b8a69d8b..78ffb6347 100644
--- a/helper/test/debug.c
+++ b/helper/test/debug.c
@@ -1,7 +1,5 @@
-/* Copyright (c) 2019, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2019 Nokia
*/
#include <odp/helper/autoheader_external.h>
diff --git a/helper/test/iplookuptable.c b/helper/test/iplookuptable.c
index bd724b1b7..669d334dd 100644
--- a/helper/test/iplookuptable.c
+++ b/helper/test/iplookuptable.c
@@ -1,7 +1,5 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
#include <stdio.h>
diff --git a/helper/test/linux/process.c b/helper/test/linux/process.c
index 8d3f31af0..54614a695 100644
--- a/helper/test/linux/process.c
+++ b/helper/test/linux/process.c
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
#include <odp_api.h>
diff --git a/helper/test/linux/pthread.c b/helper/test/linux/pthread.c
index 770308faa..f6c624df7 100644
--- a/helper/test/linux/pthread.c
+++ b/helper/test/linux/pthread.c
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
#include <odp_api.h>
diff --git a/helper/test/macros.c b/helper/test/macros.c
new file mode 100644
index 000000000..e6a203e20
--- /dev/null
+++ b/helper/test/macros.c
@@ -0,0 +1,71 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2023 Nokia
+ */
+
+#include <odp_api.h>
+#include <odp/helper/odph_api.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(void)
+{
+ int a, b;
+ int ret = 0;
+ int arr_1[1];
+ int arr_10[10];
+
+ printf("Running helper macro tests\n");
+
+ if (ODPH_MIN(0, 10) != 0)
+ ret++;
+
+ if (ODPH_MAX(0, 10) != 10)
+ ret++;
+
+ if (ODPH_MIN(-1, 10) != -1)
+ ret++;
+
+ if (ODPH_MAX(-1, 10) != 10)
+ ret++;
+
+ a = 0;
+ b = 10;
+ if (ODPH_MIN(a--, b--) != 0)
+ ret++;
+
+ a = 0;
+ b = 10;
+ if (ODPH_MAX(++a, ++b) != 11)
+ ret++;
+
+ if (ODPH_ARRAY_SIZE(arr_1) != 1)
+ ret++;
+
+ if (ODPH_ARRAY_SIZE(arr_10) != 10)
+ ret++;
+
+ if (ODPH_ABS(-1) != 1)
+ ret++;
+
+ if (ODPH_ABS(1) != 1)
+ ret++;
+
+ if (ODPH_ABS(0) != 0)
+ ret++;
+
+ a = -1;
+ if (ODPH_ABS(a++) != 1)
+ ret++;
+
+ a = -1;
+ if (ODPH_ABS(--a) != 2)
+ ret++;
+
+ if (!ret)
+ printf("All tests passed\n");
+ else
+ printf("%d tests failed\n", ret);
+
+ return ret ? EXIT_FAILURE : EXIT_SUCCESS;
+}
diff --git a/helper/test/odpthreads.c b/helper/test/odpthreads.c
index b7b4c2104..bf623569b 100644
--- a/helper/test/odpthreads.c
+++ b/helper/test/odpthreads.c
@@ -1,8 +1,6 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
+ * Copyright (c) 2021 Nokia
*/
/*
diff --git a/helper/test/odpthreads_as_processes b/helper/test/odpthreads_as_processes
index 88f759272..f71717b6b 100755
--- a/helper/test/odpthreads_as_processes
+++ b/helper/test/odpthreads_as_processes
@@ -1,9 +1,7 @@
#!/bin/sh
#
-# Copyright (c) 2016-2018, Linaro Limited
-# All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2016-2018 Linaro Limited
#
PATH=$(dirname $0):$PATH
diff --git a/helper/test/odpthreads_as_pthreads b/helper/test/odpthreads_as_pthreads
index 92f43ef90..b666e1a4d 100755
--- a/helper/test/odpthreads_as_pthreads
+++ b/helper/test/odpthreads_as_pthreads
@@ -1,9 +1,7 @@
#!/bin/sh
#
-# Copyright (c) 2016-2018, Linaro Limited
-# All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2016-2018 Linaro Limited
#
PATH=$(dirname $0):$PATH
diff --git a/helper/test/parse.c b/helper/test/parse.c
index 3097ae476..6f4dcc16c 100644
--- a/helper/test/parse.c
+++ b/helper/test/parse.c
@@ -1,7 +1,5 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
#include <odp_api.h>
diff --git a/helper/test/table.c b/helper/test/table.c
index df7a23d6e..fb17e8a37 100644
--- a/helper/test/table.c
+++ b/helper/test/table.c
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier:BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
#include <odp_api.h>
diff --git a/helper/test/version.c b/helper/test/version.c
index 925d305da..17c971886 100644
--- a/helper/test/version.c
+++ b/helper/test/version.c
@@ -1,7 +1,5 @@
-/* Copyright (c) 2019, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2019 Nokia
*/
#include <odp_api.h>
diff --git a/helper/threads.c b/helper/threads.c
index 74f64b138..63b4cc019 100644
--- a/helper/threads.c
+++ b/helper/threads.c
@@ -1,8 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2019-2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2019-2022 Nokia
*/
#ifndef _GNU_SOURCE
diff --git a/helper/version.c b/helper/version.c
index 586abbe41..f2635a6c2 100644
--- a/helper/version.c
+++ b/helper/version.c
@@ -1,7 +1,5 @@
-/* Copyright (c) 2019, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2019 Nokia
*/
#include <odp/helper/version.h>
diff --git a/include/README b/include/README
index 180ff62c7..90498c7fa 100644
--- a/include/README
+++ b/include/README
@@ -1,8 +1,6 @@
-Copyright (c) 2017, Linaro Limited
-Copyright (c) 2023, Nokia
-All rights reserved.
-
-SPDX-License-Identifier: BSD-3-Clause
+SPDX-License-Identifier: BSD-3-Clause
+Copyright (c) 2017 Linaro Limited
+Copyright (c) 2023 Nokia
# ODP specification
diff --git a/include/odp/api/abi-default/align.h b/include/odp/api/abi-default/align.h
index b3bbed199..0fa058549 100644
--- a/include/odp/api/abi-default/align.h
+++ b/include/odp/api/abi-default/align.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/abi-default/atomic.h b/include/odp/api/abi-default/atomic.h
index ce454499c..9999360fc 100644
--- a/include/odp/api/abi-default/atomic.h
+++ b/include/odp/api/abi-default/atomic.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * Copyright (c) 2021, ARM Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
+ * Copyright (c) 2021 ARM Limited
*/
/**
diff --git a/include/odp/api/abi-default/barrier.h b/include/odp/api/abi-default/barrier.h
index cff12c577..ee0329a97 100644
--- a/include/odp/api/abi-default/barrier.h
+++ b/include/odp/api/abi-default/barrier.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/abi-default/buffer.h b/include/odp/api/abi-default/buffer.h
index 59b81186b..dce3fcac3 100644
--- a/include/odp/api/abi-default/buffer.h
+++ b/include/odp/api/abi-default/buffer.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#ifndef ODP_ABI_BUFFER_H_
diff --git a/include/odp/api/abi-default/buffer_types.h b/include/odp/api/abi-default/buffer_types.h
index f01466151..59588224f 100644
--- a/include/odp/api/abi-default/buffer_types.h
+++ b/include/odp/api/abi-default/buffer_types.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
+ * Copyright (c) 2023 Nokia
*/
#ifndef ODP_ABI_BUFFER_TYPES_H_
diff --git a/include/odp/api/abi-default/byteorder.h b/include/odp/api/abi-default/byteorder.h
index 66a721b93..a3a512598 100644
--- a/include/odp/api/abi-default/byteorder.h
+++ b/include/odp/api/abi-default/byteorder.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/abi-default/classification.h b/include/odp/api/abi-default/classification.h
index 1e73f439b..e7519329a 100644
--- a/include/odp/api/abi-default/classification.h
+++ b/include/odp/api/abi-default/classification.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#ifndef ODP_ABI_CLASSIFICATION_H_
diff --git a/include/odp/api/abi-default/comp.h b/include/odp/api/abi-default/comp.h
index 8a1145af5..b5638eba8 100644
--- a/include/odp/api/abi-default/comp.h
+++ b/include/odp/api/abi-default/comp.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#ifndef ODP_ABI_COMP_H_
diff --git a/include/odp/api/abi-default/cpu.h b/include/odp/api/abi-default/cpu.h
index 24e5351ad..7bc444236 100644
--- a/include/odp/api/abi-default/cpu.h
+++ b/include/odp/api/abi-default/cpu.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
#ifndef ODP_ABI_CPU_H_
diff --git a/include/odp/api/abi-default/cpumask.h b/include/odp/api/abi-default/cpumask.h
index 66445f7da..bb7638f0c 100644
--- a/include/odp/api/abi-default/cpumask.h
+++ b/include/odp/api/abi-default/cpumask.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/abi-default/crypto.h b/include/odp/api/abi-default/crypto.h
index 0e9e8506a..aa80587c4 100644
--- a/include/odp/api/abi-default/crypto.h
+++ b/include/odp/api/abi-default/crypto.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
+ * Copyright (c) 2022 Nokia
*/
#ifndef ODP_ABI_CRYPTO_H_
diff --git a/include/odp/api/abi-default/crypto_types.h b/include/odp/api/abi-default/crypto_types.h
index 4fa9a63a4..58898dfea 100644
--- a/include/odp/api/abi-default/crypto_types.h
+++ b/include/odp/api/abi-default/crypto_types.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
+ * Copyright (c) 2022 Nokia
*/
#ifndef ODP_ABI_CRYPTO_TYPES_H_
diff --git a/include/odp/api/abi-default/debug.h b/include/odp/api/abi-default/debug.h
index 2c498f71b..5b196d589 100644
--- a/include/odp/api/abi-default/debug.h
+++ b/include/odp/api/abi-default/debug.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/abi-default/dma.h b/include/odp/api/abi-default/dma.h
index e7e0ad970..dcc67bc71 100644
--- a/include/odp/api/abi-default/dma.h
+++ b/include/odp/api/abi-default/dma.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
#ifndef ODP_ABI_DMA_H_
diff --git a/include/odp/api/abi-default/dma_types.h b/include/odp/api/abi-default/dma_types.h
index c2b0eca64..ce133661e 100644
--- a/include/odp/api/abi-default/dma_types.h
+++ b/include/odp/api/abi-default/dma_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#ifndef ODP_ABI_DMA_TYPES_H_
diff --git a/include/odp/api/abi-default/errno.h b/include/odp/api/abi-default/errno.h
index 6437930a0..d8eee49fb 100644
--- a/include/odp/api/abi-default/errno.h
+++ b/include/odp/api/abi-default/errno.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Marvell
*/
/**
diff --git a/include/odp/api/abi-default/event.h b/include/odp/api/abi-default/event.h
index a1563ac9b..295f8608d 100644
--- a/include/odp/api/abi-default/event.h
+++ b/include/odp/api/abi-default/event.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#ifndef ODP_ABI_EVENT_H_
diff --git a/include/odp/api/abi-default/event_types.h b/include/odp/api/abi-default/event_types.h
index 0fa20e692..7955e53b8 100644
--- a/include/odp/api/abi-default/event_types.h
+++ b/include/odp/api/abi-default/event_types.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
+ * Copyright (c) 2022 Nokia
*/
#ifndef ODP_ABI_EVENT_TYPES_H_
diff --git a/include/odp/api/abi-default/hash.h b/include/odp/api/abi-default/hash.h
index 06e9e06c4..9cd0fb03d 100644
--- a/include/odp/api/abi-default/hash.h
+++ b/include/odp/api/abi-default/hash.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Marvell
*/
/**
diff --git a/include/odp/api/abi-default/init.h b/include/odp/api/abi-default/init.h
index bab17f9ad..221567e24 100644
--- a/include/odp/api/abi-default/init.h
+++ b/include/odp/api/abi-default/init.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/abi-default/ipsec.h b/include/odp/api/abi-default/ipsec.h
index 1cbc257a1..ab3d5b643 100644
--- a/include/odp/api/abi-default/ipsec.h
+++ b/include/odp/api/abi-default/ipsec.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
+ * Copyright (c) 2022 Nokia
*/
#ifndef ODP_ABI_IPSEC_H_
diff --git a/include/odp/api/abi-default/ipsec_types.h b/include/odp/api/abi-default/ipsec_types.h
index 94fac6a20..737f67153 100644
--- a/include/odp/api/abi-default/ipsec_types.h
+++ b/include/odp/api/abi-default/ipsec_types.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
+ * Copyright (c) 2022 Nokia
*/
#ifndef ODP_ABI_IPSEC_TYPES_H_
diff --git a/include/odp/api/abi-default/packet.h b/include/odp/api/abi-default/packet.h
index 3f6e82c5c..033f50cea 100644
--- a/include/odp/api/abi-default/packet.h
+++ b/include/odp/api/abi-default/packet.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#ifndef ODP_ABI_PACKET_H_
diff --git a/include/odp/api/abi-default/packet_flags.h b/include/odp/api/abi-default/packet_flags.h
index 11001e930..ee1e6ae11 100644
--- a/include/odp/api/abi-default/packet_flags.h
+++ b/include/odp/api/abi-default/packet_flags.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/abi-default/packet_io.h b/include/odp/api/abi-default/packet_io.h
index 3a2b53a9b..f9b089778 100644
--- a/include/odp/api/abi-default/packet_io.h
+++ b/include/odp/api/abi-default/packet_io.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#ifndef ODP_ABI_PACKET_IO_H_
diff --git a/include/odp/api/abi-default/packet_io_types.h b/include/odp/api/abi-default/packet_io_types.h
index 1c4785c46..ddf8c3a3f 100644
--- a/include/odp/api/abi-default/packet_io_types.h
+++ b/include/odp/api/abi-default/packet_io_types.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * Copyright (c) 2020-2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
+ * Copyright (c) 2020-2023 Nokia
*/
/**
@@ -49,6 +47,8 @@ typedef struct odp_pktout_queue_t {
#define ODP_PKTIO_INVALID ((odp_pktio_t)0)
#define ODP_LSO_PROFILE_INVALID ((odp_lso_profile_t)0)
+#define ODP_PKTIO_MAX_INDEX 63
+
#define ODP_PKTIO_MACADDR_MAXSIZE 16
#define ODP_PKTIN_NO_WAIT 0
diff --git a/include/odp/api/abi-default/packet_types.h b/include/odp/api/abi-default/packet_types.h
index 73cfdcafa..300eaf177 100644
--- a/include/odp/api/abi-default/packet_types.h
+++ b/include/odp/api/abi-default/packet_types.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
+ * Copyright (c) 2021 Nokia
*/
#ifndef ODP_ABI_PACKET_TYPES_H_
diff --git a/include/odp/api/abi-default/pool.h b/include/odp/api/abi-default/pool.h
index a61706e19..dd2f66ac5 100644
--- a/include/odp/api/abi-default/pool.h
+++ b/include/odp/api/abi-default/pool.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#ifndef ODP_ABI_POOL_H_
diff --git a/include/odp/api/abi-default/pool_types.h b/include/odp/api/abi-default/pool_types.h
index dde7f723b..e4ca40422 100644
--- a/include/odp/api/abi-default/pool_types.h
+++ b/include/odp/api/abi-default/pool_types.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
+ * Copyright (c) 2022 Nokia
*/
#ifndef ODP_ABI_POOL_TYPES_H_
diff --git a/include/odp/api/abi-default/proto_stats.h b/include/odp/api/abi-default/proto_stats.h
index dd7ff09b7..9b3147762 100644
--- a/include/odp/api/abi-default/proto_stats.h
+++ b/include/odp/api/abi-default/proto_stats.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Marvell
*/
#ifndef ODP_ABI_PROTO_STATS_H_
diff --git a/include/odp/api/abi-default/proto_stats_types.h b/include/odp/api/abi-default/proto_stats_types.h
index 2e8e4aeef..0d87012f3 100644
--- a/include/odp/api/abi-default/proto_stats_types.h
+++ b/include/odp/api/abi-default/proto_stats_types.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2021, Marvell
- * Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Marvell
+ * Copyright (c) 2021 Nokia
*/
#ifndef ODP_ABI_PROTO_STATS_TYPES_H_
diff --git a/include/odp/api/abi-default/queue.h b/include/odp/api/abi-default/queue.h
index f74080dbb..5ad307801 100644
--- a/include/odp/api/abi-default/queue.h
+++ b/include/odp/api/abi-default/queue.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#ifndef ODP_ABI_QUEUE_H_
diff --git a/include/odp/api/abi-default/queue_types.h b/include/odp/api/abi-default/queue_types.h
index bf9862149..5a1dc40d9 100644
--- a/include/odp/api/abi-default/queue_types.h
+++ b/include/odp/api/abi-default/queue_types.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
+ * Copyright (c) 2021 Nokia
*/
#ifndef ODP_ABI_QUEUE_TYPES_H_
diff --git a/include/odp/api/abi-default/random.h b/include/odp/api/abi-default/random.h
index b997240d1..b99419155 100644
--- a/include/odp/api/abi-default/random.h
+++ b/include/odp/api/abi-default/random.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#ifndef ODP_ABI_RANDOM_H_
diff --git a/include/odp/api/abi-default/rwlock.h b/include/odp/api/abi-default/rwlock.h
index 219e1c583..300108e67 100644
--- a/include/odp/api/abi-default/rwlock.h
+++ b/include/odp/api/abi-default/rwlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/abi-default/rwlock_recursive.h b/include/odp/api/abi-default/rwlock_recursive.h
index 66a52c194..eb5c000c0 100644
--- a/include/odp/api/abi-default/rwlock_recursive.h
+++ b/include/odp/api/abi-default/rwlock_recursive.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/abi-default/schedule.h b/include/odp/api/abi-default/schedule.h
index 89b92297b..73c51a7c6 100644
--- a/include/odp/api/abi-default/schedule.h
+++ b/include/odp/api/abi-default/schedule.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
#ifndef ODP_ABI_SCHEDULE_H_
diff --git a/include/odp/api/abi-default/schedule_types.h b/include/odp/api/abi-default/schedule_types.h
index 5e91c6e61..45366ffa6 100644
--- a/include/odp/api/abi-default/schedule_types.h
+++ b/include/odp/api/abi-default/schedule_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/abi-default/shared_memory.h b/include/odp/api/abi-default/shared_memory.h
index 4668927cd..f4930da27 100644
--- a/include/odp/api/abi-default/shared_memory.h
+++ b/include/odp/api/abi-default/shared_memory.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#ifndef ODP_ABI_SHM_H_
diff --git a/include/odp/api/abi-default/spinlock.h b/include/odp/api/abi-default/spinlock.h
index 52af523ce..68f8aa8aa 100644
--- a/include/odp/api/abi-default/spinlock.h
+++ b/include/odp/api/abi-default/spinlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/abi-default/spinlock_recursive.h b/include/odp/api/abi-default/spinlock_recursive.h
index 38efd1b38..6f8068033 100644
--- a/include/odp/api/abi-default/spinlock_recursive.h
+++ b/include/odp/api/abi-default/spinlock_recursive.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/abi-default/stash.h b/include/odp/api/abi-default/stash.h
index db4469124..ec9316e68 100644
--- a/include/odp/api/abi-default/stash.h
+++ b/include/odp/api/abi-default/stash.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Nokia
*/
#ifndef ODP_ABI_STASH_H_
diff --git a/include/odp/api/abi-default/stash_types.h b/include/odp/api/abi-default/stash_types.h
index 30bc3ca5f..10db242d3 100644
--- a/include/odp/api/abi-default/stash_types.h
+++ b/include/odp/api/abi-default/stash_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#ifndef ODP_ABI_STASH_TYPES_H_
diff --git a/include/odp/api/abi-default/std.h b/include/odp/api/abi-default/std.h
index 2500af800..7de653653 100644
--- a/include/odp/api/abi-default/std.h
+++ b/include/odp/api/abi-default/std.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
#ifndef ODP_ABI_STD_H_
diff --git a/include/odp/api/abi-default/std_types.h b/include/odp/api/abi-default/std_types.h
index df7bd8db5..cb8c4230f 100644
--- a/include/odp/api/abi-default/std_types.h
+++ b/include/odp/api/abi-default/std_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
#ifndef ODP_ABI_STD_TYPES_H_
diff --git a/include/odp/api/abi-default/sync.h b/include/odp/api/abi-default/sync.h
index 1609dbf78..862081a50 100644
--- a/include/odp/api/abi-default/sync.h
+++ b/include/odp/api/abi-default/sync.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/abi-default/thread.h b/include/odp/api/abi-default/thread.h
index e31651a26..3113278d3 100644
--- a/include/odp/api/abi-default/thread.h
+++ b/include/odp/api/abi-default/thread.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/abi-default/thrmask.h b/include/odp/api/abi-default/thrmask.h
index 5aa9b5570..a5aff670b 100644
--- a/include/odp/api/abi-default/thrmask.h
+++ b/include/odp/api/abi-default/thrmask.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/abi-default/ticketlock.h b/include/odp/api/abi-default/ticketlock.h
index 77e11f778..d8489ad9d 100644
--- a/include/odp/api/abi-default/ticketlock.h
+++ b/include/odp/api/abi-default/ticketlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/abi-default/time.h b/include/odp/api/abi-default/time.h
index e601e6fd2..e8af62c0f 100644
--- a/include/odp/api/abi-default/time.h
+++ b/include/odp/api/abi-default/time.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
#ifndef ODP_ABI_TIME_H_
diff --git a/include/odp/api/abi-default/time_types.h b/include/odp/api/abi-default/time_types.h
index 4b7ec47eb..32d9384dd 100644
--- a/include/odp/api/abi-default/time_types.h
+++ b/include/odp/api/abi-default/time_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
#ifndef ODP_ABI_TIME_TYPES_H_
diff --git a/include/odp/api/abi-default/timer.h b/include/odp/api/abi-default/timer.h
index faf690ae3..39b71c6a3 100644
--- a/include/odp/api/abi-default/timer.h
+++ b/include/odp/api/abi-default/timer.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#ifndef ODP_ABI_TIMER_H_
diff --git a/include/odp/api/abi-default/timer_types.h b/include/odp/api/abi-default/timer_types.h
index a653dcbaa..89b237fdb 100644
--- a/include/odp/api/abi-default/timer_types.h
+++ b/include/odp/api/abi-default/timer_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/abi-default/traffic_mngr.h b/include/odp/api/abi-default/traffic_mngr.h
index 78985313d..32a0ab473 100644
--- a/include/odp/api/abi-default/traffic_mngr.h
+++ b/include/odp/api/abi-default/traffic_mngr.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * Copyright (c) 2022, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
+ * Copyright (c) 2022 Marvell
*/
/**
diff --git a/include/odp/api/abi-default/version.h b/include/odp/api/abi-default/version.h
index 59cf32408..f15058623 100644
--- a/include/odp/api/abi-default/version.h
+++ b/include/odp/api/abi-default/version.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
#ifndef ODP_ABI_VERSION_H_
diff --git a/include/odp/api/align.h b/include/odp/api/align.h
index 4364d5839..c003b714d 100644
--- a/include/odp/api/align.h
+++ b/include/odp/api/align.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/atomic.h b/include/odp/api/atomic.h
index a81b9abbf..7f79256e8 100644
--- a/include/odp/api/atomic.h
+++ b/include/odp/api/atomic.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/barrier.h b/include/odp/api/barrier.h
index 95dc808fb..768b66c0d 100644
--- a/include/odp/api/barrier.h
+++ b/include/odp/api/barrier.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/buffer.h b/include/odp/api/buffer.h
index a56cd0660..13a31d169 100644
--- a/include/odp/api/buffer.h
+++ b/include/odp/api/buffer.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/buffer_types.h b/include/odp/api/buffer_types.h
index 767aae560..73d2294be 100644
--- a/include/odp/api/buffer_types.h
+++ b/include/odp/api/buffer_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
/**
diff --git a/include/odp/api/byteorder.h b/include/odp/api/byteorder.h
index 6f33a84e6..39857381f 100644
--- a/include/odp/api/byteorder.h
+++ b/include/odp/api/byteorder.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2014-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2014-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/chksum.h b/include/odp/api/chksum.h
index 591534e46..39cb08f7c 100644
--- a/include/odp/api/chksum.h
+++ b/include/odp/api/chksum.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/classification.h b/include/odp/api/classification.h
index baa188663..5a14a9e79 100644
--- a/include/odp/api/classification.h
+++ b/include/odp/api/classification.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2014-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2014-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/comp.h b/include/odp/api/comp.h
index 300d12a61..fa14d4631 100644
--- a/include/odp/api/comp.h
+++ b/include/odp/api/comp.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h
index 08a0536ec..43729b5ab 100644
--- a/include/odp/api/cpu.h
+++ b/include/odp/api/cpu.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/cpumask.h b/include/odp/api/cpumask.h
index f5649106f..662888288 100644
--- a/include/odp/api/cpumask.h
+++ b/include/odp/api/cpumask.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/crypto.h b/include/odp/api/crypto.h
index 336304553..ce9d0f26a 100644
--- a/include/odp/api/crypto.h
+++ b/include/odp/api/crypto.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2014-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2014-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/crypto_types.h b/include/odp/api/crypto_types.h
index 225ff7df0..922410c11 100644
--- a/include/odp/api/crypto_types.h
+++ b/include/odp/api/crypto_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
/**
diff --git a/include/odp/api/debug.h b/include/odp/api/debug.h
index 836914801..a9eccbc43 100644
--- a/include/odp/api/debug.h
+++ b/include/odp/api/debug.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/deprecated.h b/include/odp/api/deprecated.h
index 992330ee1..afa2dd4e7 100644
--- a/include/odp/api/deprecated.h
+++ b/include/odp/api/deprecated.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/dma.h b/include/odp/api/dma.h
index 10e00a506..20f079859 100644
--- a/include/odp/api/dma.h
+++ b/include/odp/api/dma.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
/**
diff --git a/include/odp/api/dma_types.h b/include/odp/api/dma_types.h
index eeaa7bee8..c6aedcd49 100644
--- a/include/odp/api/dma_types.h
+++ b/include/odp/api/dma_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021-2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021-2022 Nokia
*/
/**
diff --git a/include/odp/api/errno.h b/include/odp/api/errno.h
index 212e51244..4b37dbf60 100644
--- a/include/odp/api/errno.h
+++ b/include/odp/api/errno.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/event.h b/include/odp/api/event.h
index 73774a603..26fb9b97d 100644
--- a/include/odp/api/event.h
+++ b/include/odp/api/event.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/event_types.h b/include/odp/api/event_types.h
index a4d20a341..8254583d7 100644
--- a/include/odp/api/event_types.h
+++ b/include/odp/api/event_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
/**
diff --git a/include/odp/api/hash.h b/include/odp/api/hash.h
index f059d51ce..135fd2aef 100644
--- a/include/odp/api/hash.h
+++ b/include/odp/api/hash.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/hints.h b/include/odp/api/hints.h
index 4b1c61ca9..bcd2780d1 100644
--- a/include/odp/api/hints.h
+++ b/include/odp/api/hints.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/init.h b/include/odp/api/init.h
index 50a880a89..259c6f765 100644
--- a/include/odp/api/init.h
+++ b/include/odp/api/init.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/ipsec.h b/include/odp/api/ipsec.h
index 8116610b4..b61edaa6a 100644
--- a/include/odp/api/ipsec.h
+++ b/include/odp/api/ipsec.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/ipsec_types.h b/include/odp/api/ipsec_types.h
index 9954f7215..ddbf04ed1 100644
--- a/include/odp/api/ipsec_types.h
+++ b/include/odp/api/ipsec_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
/**
diff --git a/include/odp/api/packet.h b/include/odp/api/packet.h
index 1f04c026d..e5733595f 100644
--- a/include/odp/api/packet.h
+++ b/include/odp/api/packet.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2022 Nokia
*/
/**
diff --git a/include/odp/api/packet_flags.h b/include/odp/api/packet_flags.h
index c10663479..15e085270 100644
--- a/include/odp/api/packet_flags.h
+++ b/include/odp/api/packet_flags.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2014-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2014-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h
index 9959d96fc..5f3e9d3e3 100644
--- a/include/odp/api/packet_io.h
+++ b/include/odp/api/packet_io.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/packet_io_stats.h b/include/odp/api/packet_io_stats.h
index 40d0ae58c..fa16ae290 100644
--- a/include/odp/api/packet_io_stats.h
+++ b/include/odp/api/packet_io_stats.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/packet_io_types.h b/include/odp/api/packet_io_types.h
index 2f221b7b4..c5fd72e96 100644
--- a/include/odp/api/packet_io_types.h
+++ b/include/odp/api/packet_io_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
/**
diff --git a/include/odp/api/packet_types.h b/include/odp/api/packet_types.h
index 678f3519c..647810259 100644
--- a/include/odp/api/packet_types.h
+++ b/include/odp/api/packet_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021-2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021-2022 Nokia
*/
/**
diff --git a/include/odp/api/pool.h b/include/odp/api/pool.h
index 9e2fe2b05..0f4dfab27 100644
--- a/include/odp/api/pool.h
+++ b/include/odp/api/pool.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/pool_types.h b/include/odp/api/pool_types.h
index 18d5dd9d5..d2b88c332 100644
--- a/include/odp/api/pool_types.h
+++ b/include/odp/api/pool_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
/**
diff --git a/include/odp/api/proto_stats.h b/include/odp/api/proto_stats.h
index bceaeaac9..2f16dfbf0 100644
--- a/include/odp/api/proto_stats.h
+++ b/include/odp/api/proto_stats.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Marvell
*/
/**
diff --git a/include/odp/api/proto_stats_types.h b/include/odp/api/proto_stats_types.h
index b12a0f34f..c6bae0842 100644
--- a/include/odp/api/proto_stats_types.h
+++ b/include/odp/api/proto_stats_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
/**
diff --git a/include/odp/api/protocols.h b/include/odp/api/protocols.h
index b5f3742a4..232e96904 100644
--- a/include/odp/api/protocols.h
+++ b/include/odp/api/protocols.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Marvell
*/
/**
diff --git a/include/odp/api/queue.h b/include/odp/api/queue.h
index 666d5eaf9..b3728f1ab 100644
--- a/include/odp/api/queue.h
+++ b/include/odp/api/queue.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2022 Nokia
*/
/**
diff --git a/include/odp/api/queue_types.h b/include/odp/api/queue_types.h
index 7c9a83bfe..3aefdb3d0 100644
--- a/include/odp/api/queue_types.h
+++ b/include/odp/api/queue_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
/**
diff --git a/include/odp/api/random.h b/include/odp/api/random.h
index 257694918..27cd593b0 100644
--- a/include/odp/api/random.h
+++ b/include/odp/api/random.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/random_types.h b/include/odp/api/random_types.h
index c9ed2cc04..2b90f61ee 100644
--- a/include/odp/api/random_types.h
+++ b/include/odp/api/random_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
/**
diff --git a/include/odp/api/reassembly.h b/include/odp/api/reassembly.h
index 153fd6a12..2d52f6e15 100644
--- a/include/odp/api/reassembly.h
+++ b/include/odp/api/reassembly.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Marvell
*/
/**
diff --git a/include/odp/api/rwlock.h b/include/odp/api/rwlock.h
index 2240c187e..ca852a5be 100644
--- a/include/odp/api/rwlock.h
+++ b/include/odp/api/rwlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2014-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2014-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/rwlock_recursive.h b/include/odp/api/rwlock_recursive.h
index 1b33039f3..288975476 100644
--- a/include/odp/api/rwlock_recursive.h
+++ b/include/odp/api/rwlock_recursive.h
@@ -1,13 +1,11 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
* @file
*
- * ODP resursive read/write lock
+ * ODP recursive read/write lock
*/
#ifndef ODP_API_RWLOCK_RECURSIVE_H_
diff --git a/include/odp/api/schedule.h b/include/odp/api/schedule.h
index 4d97634b8..1a0e31276 100644
--- a/include/odp/api/schedule.h
+++ b/include/odp/api/schedule.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/schedule_types.h b/include/odp/api/schedule_types.h
index ced5752ba..1b415b578 100644
--- a/include/odp/api/schedule_types.h
+++ b/include/odp/api/schedule_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/shared_memory.h b/include/odp/api/shared_memory.h
index 988c30f02..a08f84cc4 100644
--- a/include/odp/api/shared_memory.h
+++ b/include/odp/api/shared_memory.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/spec/align.h b/include/odp/api/spec/align.h
index 99f8f1db0..d5e5910aa 100644
--- a/include/odp/api/spec/align.h
+++ b/include/odp/api/spec/align.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/spec/atomic.h b/include/odp/api/spec/atomic.h
index a77527e85..3a098ead1 100644
--- a/include/odp/api/spec/atomic.h
+++ b/include/odp/api/spec/atomic.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2021, ARM Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2021 ARM Limited
*/
/**
diff --git a/include/odp/api/spec/barrier.h b/include/odp/api/spec/barrier.h
index 2f90fc2c5..e83d46c35 100644
--- a/include/odp/api/spec/barrier.h
+++ b/include/odp/api/spec/barrier.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/spec/buffer.h b/include/odp/api/spec/buffer.h
index dd3749afe..11750136d 100644
--- a/include/odp/api/spec/buffer.h
+++ b/include/odp/api/spec/buffer.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2022-2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2022-2023 Nokia
*/
/**
diff --git a/include/odp/api/spec/buffer_types.h b/include/odp/api/spec/buffer_types.h
index 7a7bc770f..7b0e80584 100644
--- a/include/odp/api/spec/buffer_types.h
+++ b/include/odp/api/spec/buffer_types.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2023 Nokia
*/
/**
diff --git a/include/odp/api/spec/byteorder.h b/include/odp/api/spec/byteorder.h
index 29856b400..65d2e722a 100644
--- a/include/odp/api/spec/byteorder.h
+++ b/include/odp/api/spec/byteorder.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2014-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2014-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/spec/chksum.h b/include/odp/api/spec/chksum.h
index 4e40bf55a..800aab2c2 100644
--- a/include/odp/api/spec/chksum.h
+++ b/include/odp/api/spec/chksum.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h
index aefe2845a..f513eea94 100644
--- a/include/odp/api/spec/classification.h
+++ b/include/odp/api/spec/classification.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2014-2018, Linaro Limited
- * Copyright (c) 2021-2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2014-2018 Linaro Limited
+ * Copyright (c) 2021-2023 Nokia
*/
/**
@@ -550,7 +548,7 @@ typedef struct odp_cls_capability_t {
* supported. */
uint32_t max_cos_stats;
- /** Maximun number of queues supported per CoS
+ /** Maximum number of queues supported per CoS
* if the value is 1, then hashing is not supported*/
uint32_t max_hash_queues;
@@ -742,6 +740,30 @@ odp_cos_t odp_cls_cos_create(const char *name,
const odp_cls_cos_param_t *param);
/**
+ * Create multiple class-of-services
+ *
+ * Otherwise like odp_cls_cos_create(), but creates multiple CoSes with a
+ * single call. The output CoS handles are written in the same order as input
+ * parameters. A single odp_cls_cos_create_multi() call is equivalent to calling
+ * odp_cls_cos_create() 'num' times in row.
+ *
+ * Each parameter array must contain 'num' elements with the exception that
+ * 'name' array may also be NULL.
+ *
+ * @param name Array of CoS name pointers or NULL. NULL is also valid
+ * CoS name pointer value.
+ * @param param Array of CoS parameters
+ * @param[out] cos Array of CoS handles for output
+ * @param num Number of CoSes to create
+ *
+ * @return Number of CoSes actually created (0 ... num)
+ * @retval <0 on failure
+ */
+int odp_cls_cos_create_multi(const char *name[],
+ const odp_cls_cos_param_t param[],
+ odp_cos_t cos[], int num);
+
+/**
* Queue hash result
* Returns the queue within a CoS in which a particular packet will be enqueued
* based on the packet parameters and hash protocol field configured with the
@@ -773,6 +795,20 @@ odp_queue_t odp_cls_hash_result(odp_cos_t cos, odp_packet_t packet);
int odp_cos_destroy(odp_cos_t cos);
/**
+ * Destroy multiple class-of-services
+ *
+ * Otherwise like odp_cos_destroy(), but destroys multiple CoSes with a single
+ * call.
+ *
+ * @param cos Array of CoS handles
+ * @param num Number of CoSes to destroy
+ *
+ * @retval Number of CoSes actually destroyed (1 ... num)
+ * @retval <0 on failure
+ */
+int odp_cos_destroy_multi(odp_cos_t cos[], int num);
+
+/**
* Assign a queue for a class-of-service
*
* Action of the given CoS may not be ODP_COS_ACTION_DROP.
@@ -990,6 +1026,30 @@ odp_pmr_t odp_cls_pmr_create(const odp_pmr_param_t *terms, int num_terms,
*/
odp_pmr_t odp_cls_pmr_create_opt(const odp_pmr_create_opt_t *opt,
odp_cos_t src_cos, odp_cos_t dst_cos);
+
+/**
+ * Create multiple packet matching rules
+ *
+ * Otherwise like odp_cls_pmr_create_opt(), but creates multiple rules with a
+ * single call. The output PMR handles are written in the same order as input
+ * parameters. A single odp_cls_pmr_create_multi() call is equivalent to calling
+ * odp_cls_pmr_create_opt() 'num' times in row.
+ *
+ * Each parameter array must contain 'num' elements.
+ *
+ * @param opt Array of PMR create options
+ * @param src_cos Array of source CoS handles
+ * @param dst_cos Array of destination CoS handles
+ * @param[out] pmr Array of PMR handles for output
+ * @param num Number of packet matching rules to create
+ *
+ * @return Number of PMRs actually created (0 ... num)
+ * @retval <0 on failure
+ */
+int odp_cls_pmr_create_multi(const odp_pmr_create_opt_t opt[],
+ odp_cos_t src_cos[], odp_cos_t dst_cos[],
+ odp_pmr_t pmr[], int num);
+
/**
* Function to destroy a packet match rule
*
@@ -1010,6 +1070,20 @@ odp_pmr_t odp_cls_pmr_create_opt(const odp_pmr_create_opt_t *opt,
int odp_cls_pmr_destroy(odp_pmr_t pmr);
/**
+ * Destroy multiple packet matching rules
+ *
+ * Otherwise like odp_cls_pmr_destroy(), but destroys multiple PMRs with a
+ * single call.
+ *
+ * @param pmr Array of PMR handles
+ * @param num Number of PMRs to destroy
+ *
+ * @retval Number of PMRs actually destroyed (1 ... num)
+ * @retval <0 on failure
+ */
+int odp_cls_pmr_destroy_multi(odp_pmr_t pmr[], int num);
+
+/**
* Assigns a packet pool for a specific class of service
*
* All the packets belonging to the given class of service will
diff --git a/include/odp/api/spec/comp.h b/include/odp/api/spec/comp.h
index a1f6f48fb..49ccf4509 100644
--- a/include/odp/api/spec/comp.h
+++ b/include/odp/api/spec/comp.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
/**
@@ -184,7 +182,7 @@ typedef struct odp_comp_capability_t {
/** Synchronous compression mode support (ODP_COMP_OP_MODE_SYNC) */
odp_support_t sync;
- /** Aynchronous compression mode support (ODP_COMP_OP_MODE_ASYNC) */
+ /** Asynchronous compression mode support (ODP_COMP_OP_MODE_ASYNC) */
odp_support_t async;
} odp_comp_capability_t;
diff --git a/include/odp/api/spec/cpu.h b/include/odp/api/spec/cpu.h
index bacd0fac5..9550354fa 100644
--- a/include/odp/api/spec/cpu.h
+++ b/include/odp/api/spec/cpu.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/spec/cpumask.h b/include/odp/api/spec/cpumask.h
index 6b3185bad..a6c08e6c0 100644
--- a/include/odp/api/spec/cpumask.h
+++ b/include/odp/api/spec/cpumask.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2022 Nokia
*/
/**
diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h
index 453eb9eeb..e0e232dbe 100644
--- a/include/odp/api/spec/crypto.h
+++ b/include/odp/api/spec/crypto.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2014-2018, Linaro Limited
- * Copyright (c) 2021-2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2014-2018 Linaro Limited
+ * Copyright (c) 2021-2023 Nokia
*/
/**
@@ -238,7 +236,7 @@ int odp_crypto_result(odp_crypto_packet_result_t *result,
* segmentation) of the output packet may differ from that of the input
* packet.
*
- * The value of pktout[n] is ignored as pktout[n] is used purely as an
+ * The value of pkt_out[n] is ignored as pkt_out[n] is used purely as an
* output parameter that returns the handle of the newly allocated packet.
*
* ODP_CRYPTO_OP_TYPE_OOP:
@@ -266,6 +264,12 @@ int odp_crypto_result(odp_crypto_packet_result_t *result,
* the MAC/digest result. pkt_out[n] must not be the same as any input
* packet or any other output packet.
*
+ * OOP_CRYPTO_OP_TYPE_BASIC_AND_OOP:
+ *
+ * Behaves as the ODP_CRYPTO_OP_TYPE_BASIC operation type if pkt_out[n] is
+ * ODP_PACKET_INVALID. Otherwise behaves as the ODP_CRYPTO_OP_TYPE_OOP
+ * operation type.
+ *
* @param pkt_in Packets to be processed
* @param[in,out] pkt_out Packet handle array for resulting packets
* @param param Operation parameters array
@@ -298,6 +302,17 @@ int odp_crypto_op(const odp_packet_t pkt_in[],
* All arrays should be of num_pkt size, except that pkt_out parameter
* is ignored when the crypto operation type is ODP_CRYPTO_OP_TYPE_BASIC.
*
+ * From packet ordering perspective this function behaves as if each input
+ * packet was enqueued to a crypto session specific ODP queue in the order
+ * the packets appear in the parameter array. The conceptual session input
+ * queue has the same order type (ODP_QUEUE_ORDER_KEEP or
+ * ODP_QUEUE_ORDER_IGNORE) as the completion queue of the session.
+ * The order of output events of a crypto session in a completion queue is
+ * the same as the order of the corresponding input packets in the conceptual
+ * session input queue. The order of output events of different crypto
+ * sessions is not defined even when they go through the same crypto
+ * completion queue.
+ *
* @param pkt_in Packets to be processed
* @param pkt_out Packet handle array for resulting packets
* @param param Operation parameters array
diff --git a/include/odp/api/spec/crypto_types.h b/include/odp/api/spec/crypto_types.h
index 6aa3f38a6..7752f1957 100644
--- a/include/odp/api/spec/crypto_types.h
+++ b/include/odp/api/spec/crypto_types.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2014-2018, Linaro Limited
- * Copyright (c) 2021-2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2014-2018 Linaro Limited
+ * Copyright (c) 2021-2023 Nokia
*/
/**
@@ -536,6 +534,21 @@ typedef enum odp_crypto_op_type_t {
* MAC/digest (in encode sessions) of the input packet.
*/
ODP_CRYPTO_OP_TYPE_OOP,
+
+ /**
+ * Basic or out-of-place crypto operation depending on op params.
+ *
+ * If the output packet specified in a crypto operation (i.e.
+ * pkt_out[i] is ODP_PACKET_INVALID) then the packet is processed
+ * the same way as in the ODP_CRYPTO_OP_TYPE_BASIC operation type.
+ * Otherwise the packet is processed as in the ODP_CRYPTO_OP_TYPE_OOP
+ * operation type.
+ *
+ * Sessions of this operation type may have lower performance than
+ * the more specific operation types.
+ */
+ ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP,
+
} odp_crypto_op_type_t;
/**
@@ -613,6 +626,20 @@ typedef struct odp_crypto_session_param_t {
*/
odp_bool_t hash_result_in_auth_range;
+ /** Enable skipping crypto on per-packet basis
+ *
+ * When this flag is true, the null_crypto flag of crypto operation
+ * parameters can be set to request skipping of ciphering and
+ * authentication of a packet regardless of session configuration.
+ * This may be useful for preserving packet order between packets
+ * that require crypto processing and packets that do not.
+ *
+ * This flag must be set false when op_mode is ODP_CRYPTO_SYNC.
+ *
+ * The default value is false.
+ */
+ odp_bool_t null_crypto_enable;
+
/** Operation mode when using packet interface: sync or async
*
* The default value is ODP_CRYPTO_SYNC.
@@ -803,6 +830,14 @@ typedef struct odp_crypto_packet_op_param_t {
*/
int32_t dst_offset_shift;
+ /** Use null crypto algorithms
+ *
+ * Process packet using the null cipher and null auth algorithm
+ * instead of the algoithms configured in the session. This flag is
+ * ignored if the null_crypto_enable session parameter is not set.
+ */
+ uint8_t null_crypto :1;
+
} odp_crypto_packet_op_param_t;
/**
@@ -887,7 +922,7 @@ typedef enum {
} ODP_DEPRECATE(odp_crypto_hw_err_t);
/**
- * Cryto API per packet operation completion status
+ * Crypto API per packet operation completion status
*/
typedef struct odp_crypto_op_status {
/** Algorithm specific return code */
diff --git a/include/odp/api/spec/debug.h b/include/odp/api/spec/debug.h
index 1bc0caf56..0cf5179a8 100644
--- a/include/odp/api/spec/debug.h
+++ b/include/odp/api/spec/debug.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
* @file
diff --git a/include/odp/api/spec/deprecated.h.in b/include/odp/api/spec/deprecated.h.in
index ae7ae53be..d062842c1 100644
--- a/include/odp/api/spec/deprecated.h.in
+++ b/include/odp/api/spec/deprecated.h.in
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/spec/dma.h b/include/odp/api/spec/dma.h
index 658b31058..5303dc03f 100644
--- a/include/odp/api/spec/dma.h
+++ b/include/odp/api/spec/dma.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021-2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021-2023 Nokia
*/
/**
diff --git a/include/odp/api/spec/dma_types.h b/include/odp/api/spec/dma_types.h
index 5e18faab2..0a0e267df 100644
--- a/include/odp/api/spec/dma_types.h
+++ b/include/odp/api/spec/dma_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021-2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021-2023 Nokia
*/
/**
diff --git a/include/odp/api/spec/errno.h b/include/odp/api/spec/errno.h
index 98884da01..85c002e2b 100644
--- a/include/odp/api/spec/errno.h
+++ b/include/odp/api/spec/errno.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/spec/event.h b/include/odp/api/spec/event.h
index 65b5dd7ff..a8737d3a5 100644
--- a/include/odp/api/spec/event.h
+++ b/include/odp/api/spec/event.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * Copyright (c) 2022-2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
+ * Copyright (c) 2022-2023 Nokia
*/
/**
diff --git a/include/odp/api/spec/event_types.h b/include/odp/api/spec/event_types.h
index 489119247..9df5e03ef 100644
--- a/include/odp/api/spec/event_types.h
+++ b/include/odp/api/spec/event_types.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
+ * Copyright (c) 2022 Nokia
*/
/**
diff --git a/include/odp/api/spec/hash.h b/include/odp/api/spec/hash.h
index 560f515a9..cb4f3241a 100644
--- a/include/odp/api/spec/hash.h
+++ b/include/odp/api/spec/hash.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/spec/hints.h b/include/odp/api/spec/hints.h
index 55ddf8418..032b483df 100644
--- a/include/odp/api/spec/hints.h
+++ b/include/odp/api/spec/hints.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/spec/init.h b/include/odp/api/spec/init.h
index 371222267..f0491ad5b 100644
--- a/include/odp/api/spec/init.h
+++ b/include/odp/api/spec/init.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2019-2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2019-2023 Nokia
*/
/**
diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h
index 603bf3aef..b66e9a1ca 100644
--- a/include/odp/api/spec/ipsec.h
+++ b/include/odp/api/spec/ipsec.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * Copyright (c) 2021-2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
+ * Copyright (c) 2021-2022 Nokia
*/
/**
diff --git a/include/odp/api/spec/ipsec_types.h b/include/odp/api/spec/ipsec_types.h
index b34fb5982..00fd944f5 100644
--- a/include/odp/api/spec/ipsec_types.h
+++ b/include/odp/api/spec/ipsec_types.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
+ * Copyright (c) 2022 Nokia
*/
/**
@@ -1001,7 +999,7 @@ typedef struct odp_ipsec_stats_t {
/** Number of packets with algorithm errors */
uint64_t alg_err;
- /** Number of packes with MTU errors */
+ /** Number of packets with MTU errors */
uint64_t mtu_err;
/** Number of packets with hard lifetime(bytes) expired */
diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h
index 267bf819c..187aedbb9 100644
--- a/include/odp/api/spec/packet.h
+++ b/include/odp/api/spec/packet.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2021-2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2021-2023 Nokia
*/
/**
diff --git a/include/odp/api/spec/packet_flags.h b/include/odp/api/spec/packet_flags.h
index c62e50885..3bbd8f331 100644
--- a/include/odp/api/spec/packet_flags.h
+++ b/include/odp/api/spec/packet_flags.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2014-2018, Linaro Limited
- * Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2014-2018 Linaro Limited
+ * Copyright (c) 2023 Nokia
*/
/**
diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h
index 54aa2214b..cfb463c39 100644
--- a/include/odp/api/spec/packet_io.h
+++ b/include/odp/api/spec/packet_io.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2020-2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2020-2023 Nokia
*/
/**
@@ -128,6 +126,7 @@ int odp_pktio_capability(odp_pktio_t pktio, odp_pktio_capability_t *capa);
*
* Return the maximum packet IO interface index. Interface indexes
* (e.g. returned by odp_pktio_index()) range from zero to this maximum value.
+ * The return value does not exceed #ODP_PKTIO_MAX_INDEX.
*
* @return Maximum packet IO interface index
*/
diff --git a/include/odp/api/spec/packet_io_stats.h b/include/odp/api/spec/packet_io_stats.h
index bd3908867..d711d75f7 100644
--- a/include/odp/api/spec/packet_io_stats.h
+++ b/include/odp/api/spec/packet_io_stats.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * Copyright (c) 2021-2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
+ * Copyright (c) 2021-2022 Nokia
*/
/**
diff --git a/include/odp/api/spec/packet_io_types.h b/include/odp/api/spec/packet_io_types.h
index fcdf49eb4..6b80611ec 100644
--- a/include/odp/api/spec/packet_io_types.h
+++ b/include/odp/api/spec/packet_io_types.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2020-2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2020-2023 Nokia
*/
/**
@@ -61,6 +59,12 @@ extern "C" {
*/
/**
+ * @def ODP_PKTIO_MAX_INDEX
+ * Maximum packet IO interface index. Use odp_pktio_max_index() to check the
+ * runtime maximum value, which may be smaller than this value.
+ */
+
+/**
* @def ODP_PKTIO_MACADDR_MAXSIZE
* Minimum size of output buffer for odp_pktio_mac_addr()
* Actual MAC address sizes may be different.
diff --git a/include/odp/api/spec/packet_types.h b/include/odp/api/spec/packet_types.h
index 5114582ab..ee62de4ff 100644
--- a/include/odp/api/spec/packet_types.h
+++ b/include/odp/api/spec/packet_types.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2021-2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2021-2023 Nokia
*/
/**
diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h
index e51ce0b0d..4fade6470 100644
--- a/include/odp/api/spec/pool.h
+++ b/include/odp/api/spec/pool.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * Copyright (c) 2020-2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
+ * Copyright (c) 2020-2023 Nokia
*/
/**
diff --git a/include/odp/api/spec/pool_types.h b/include/odp/api/spec/pool_types.h
index 81974abc6..7820349ef 100644
--- a/include/odp/api/spec/pool_types.h
+++ b/include/odp/api/spec/pool_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021-2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021-2023 Nokia
*/
/**
diff --git a/include/odp/api/spec/proto_stats.h b/include/odp/api/spec/proto_stats.h
index 0957c9e0e..1a1f67886 100644
--- a/include/odp/api/spec/proto_stats.h
+++ b/include/odp/api/spec/proto_stats.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Marvell
*/
/**
diff --git a/include/odp/api/spec/proto_stats_types.h b/include/odp/api/spec/proto_stats_types.h
index ff5f352b9..f3ca80426 100644
--- a/include/odp/api/spec/proto_stats_types.h
+++ b/include/odp/api/spec/proto_stats_types.h
@@ -1,8 +1,6 @@
-/* Copyright(C) 2021, Marvell
- * Copyright(C) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Marvell
+ * Copyright (c) 2021 Nokia
*/
/**
diff --git a/include/odp/api/spec/protocols.h b/include/odp/api/spec/protocols.h
index 95c9bc0ed..104002937 100644
--- a/include/odp/api/spec/protocols.h
+++ b/include/odp/api/spec/protocols.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Marvell
*/
/**
diff --git a/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h
index 0315d1312..87f6e0d19 100644
--- a/include/odp/api/spec/queue.h
+++ b/include/odp/api/spec/queue.h
@@ -1,7 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2023 Nokia
*/
/**
@@ -30,12 +29,11 @@ extern "C" {
/**
* Queue create
*
- * Create a queue according to the queue parameters. Queue type is specified by
- * queue parameter 'type'. Use odp_queue_param_init() to initialize parameters
- * into their default values. Default values are also used when 'param' pointer
- * is NULL. The default queue type is ODP_QUEUE_TYPE_PLAIN. The use of queue
- * name is optional. Unique names are not required. However, odp_queue_lookup()
- * returns only a single matching queue.
+ * Create a queue according to the queue parameters. The use of queue name is
+ * optional. Unique names are not required. However, odp_queue_lookup() returns
+ * only a single matching queue. Use odp_queue_param_init() to initialize
+ * parameters into their default values. Default values are also used when
+ * 'param' pointer is NULL.
*
* @param name Name of the queue or NULL. Maximum string length is
* ODP_QUEUE_NAME_LEN.
@@ -47,6 +45,34 @@ extern "C" {
odp_queue_t odp_queue_create(const char *name, const odp_queue_param_t *param);
/**
+ * Create multiple queues
+ *
+ * Otherwise like odp_queue_create(), but creates multiple queues with a single
+ * call. The output queue handles are written in the same order as input
+ * parameters. A single odp_queue_create_multi() call is equivalent to calling
+ * odp_queue_create() 'num' times in row.
+ *
+ * If 'share_param' value is false, 'param' array must contain 'num' elements.
+ * If the value is true, only a single element is required and it's used as
+ * queue parameters for all created queues. If 'name' array is not NULL, the
+ * array must contain 'num' elements.
+ *
+ * @param name Array of queue name pointers or NULL. NULL is also
+ * valid queue name pointer value.
+ * @param param Array of queue parameters
+ * @param share_param If true, use same parameters ('param[0]') for all
+ * queues.
+ * @param[out] queue Array of queue handles for output
+ * @param num Number of queues to create
+ *
+ * @return Number of queues actually created (0 ... num)
+ * @retval <0 on failure
+ */
+int odp_queue_create_multi(const char *name[], const odp_queue_param_t param[],
+ odp_bool_t share_param, odp_queue_t queue[],
+ int num);
+
+/**
* Destroy ODP queue
*
* Destroys ODP queue. The queue must be empty and detached from other
@@ -62,6 +88,20 @@ odp_queue_t odp_queue_create(const char *name, const odp_queue_param_t *param);
int odp_queue_destroy(odp_queue_t queue);
/**
+ * Destroy multiple queues
+ *
+ * Otherwise like odp_queue_destroy(), but destroys multiple queues with a
+ * single call.
+ *
+ * @param queue Array of queue handles
+ * @param num Number of queues to destroy
+ *
+ * @retval Number of queues actually destroyed (1 ... num)
+ * @retval <0 on failure
+ */
+int odp_queue_destroy_multi(odp_queue_t queue[], int num);
+
+/**
* Find a queue by name
*
* @param name Queue name
diff --git a/include/odp/api/spec/queue_types.h b/include/odp/api/spec/queue_types.h
index 384761e87..5f84a5f49 100644
--- a/include/odp/api/spec/queue_types.h
+++ b/include/odp/api/spec/queue_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
/**
@@ -227,7 +225,7 @@ typedef struct odp_queue_param_t {
/** Queue type
*
* Valid values for other parameters in this structure depend on
- * the queue type. */
+ * the queue type. The default value is ODP_QUEUE_TYPE_PLAIN. */
odp_queue_type_t type;
/** Enqueue mode
@@ -290,7 +288,7 @@ typedef struct odp_queue_param_t {
* The queue must be able to store at minimum this many events
* simultaneously. The value must not exceed 'max_size' queue
* capability. The value of zero means implementation specific
- * default size. */
+ * default size. The default value is 0. */
uint32_t size;
} odp_queue_param_t;
diff --git a/include/odp/api/spec/random.h b/include/odp/api/spec/random.h
index e90a57737..dd30f9d48 100644
--- a/include/odp/api/spec/random.h
+++ b/include/odp/api/spec/random.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/spec/random_types.h b/include/odp/api/spec/random_types.h
index e098394be..cb7dccc7c 100644
--- a/include/odp/api/spec/random_types.h
+++ b/include/odp/api/spec/random_types.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
+ * Copyright (c) 2022 Nokia
*/
/**
diff --git a/include/odp/api/spec/reassembly.h b/include/odp/api/spec/reassembly.h
index 7ec49d220..6f1b22390 100644
--- a/include/odp/api/spec/reassembly.h
+++ b/include/odp/api/spec/reassembly.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Marvell
*/
/**
diff --git a/include/odp/api/spec/rwlock.h b/include/odp/api/spec/rwlock.h
index aa9a0e3ad..de749add8 100644
--- a/include/odp/api/spec/rwlock.h
+++ b/include/odp/api/spec/rwlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2014-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2014-2018 Linaro Limited
*/
#ifndef ODP_API_SPEC_RWLOCK_H_
diff --git a/include/odp/api/spec/rwlock_recursive.h b/include/odp/api/spec/rwlock_recursive.h
index bec4a350e..6b4afcbbe 100644
--- a/include/odp/api/spec/rwlock_recursive.h
+++ b/include/odp/api/spec/rwlock_recursive.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/spec/schedule.h b/include/odp/api/spec/schedule.h
index 9aa898ccc..31da38e4d 100644
--- a/include/odp/api/spec/schedule.h
+++ b/include/odp/api/spec/schedule.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/spec/schedule_types.h b/include/odp/api/spec/schedule_types.h
index aafc52513..5e2f5a2da 100644
--- a/include/odp/api/spec/schedule_types.h
+++ b/include/odp/api/spec/schedule_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/spec/shared_memory.h b/include/odp/api/spec/shared_memory.h
index 52fbd7ae9..3845f6e4d 100644
--- a/include/odp/api/spec/shared_memory.h
+++ b/include/odp/api/spec/shared_memory.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2019-2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2019-2021 Nokia
*/
/**
diff --git a/include/odp/api/spec/spinlock.h b/include/odp/api/spec/spinlock.h
index b156bd91b..a71c83c52 100644
--- a/include/odp/api/spec/spinlock.h
+++ b/include/odp/api/spec/spinlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/spec/spinlock_recursive.h b/include/odp/api/spec/spinlock_recursive.h
index e5c982488..bc42f1ce1 100644
--- a/include/odp/api/spec/spinlock_recursive.h
+++ b/include/odp/api/spec/spinlock_recursive.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/spec/stash.h b/include/odp/api/spec/stash.h
index 2453ed6bb..756214abe 100644
--- a/include/odp/api/spec/stash.h
+++ b/include/odp/api/spec/stash.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020-2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020-2023 Nokia
*/
/**
diff --git a/include/odp/api/spec/stash_types.h b/include/odp/api/spec/stash_types.h
index 3e6e966be..96e136d78 100644
--- a/include/odp/api/spec/stash_types.h
+++ b/include/odp/api/spec/stash_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020-2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020-2023 Nokia
*/
/**
diff --git a/include/odp/api/spec/std.h b/include/odp/api/spec/std.h
index 0341f734e..fba1ee31d 100644
--- a/include/odp/api/spec/std.h
+++ b/include/odp/api/spec/std.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
+ * Copyright (c) 2021 Nokia
*/
/**
diff --git a/include/odp/api/spec/std_types.h b/include/odp/api/spec/std_types.h
index accbd81d8..e2630e044 100644
--- a/include/odp/api/spec/std_types.h
+++ b/include/odp/api/spec/std_types.h
@@ -1,9 +1,7 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2021, ARM Limited
- * Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2021 ARM Limited
+ * Copyright (c) 2021 Nokia
*/
/**
diff --git a/include/odp/api/spec/system_info.h b/include/odp/api/spec/system_info.h
index 118d8f895..98efe06f7 100644
--- a/include/odp/api/spec/system_info.h
+++ b/include/odp/api/spec/system_info.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2020-2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2020-2021 Nokia
*/
/**
@@ -90,6 +88,12 @@ typedef enum odp_cpu_arch_arm_t {
/** ARMv8.7-A ISA */
ODP_CPU_ARCH_ARMV8_7,
+ /** ARMv8.8-A ISA */
+ ODP_CPU_ARCH_ARMV8_8,
+
+ /** ARMv8.9-A ISA */
+ ODP_CPU_ARCH_ARMV8_9,
+
/** ARMv9.0-A ISA */
ODP_CPU_ARCH_ARMV9_0,
@@ -99,6 +103,9 @@ typedef enum odp_cpu_arch_arm_t {
/** ARMv9.2-A ISA */
ODP_CPU_ARCH_ARMV9_2,
+ /** ARMv9.3-A ISA */
+ ODP_CPU_ARCH_ARMV9_3,
+
} odp_cpu_arch_arm_t;
/**
diff --git a/include/odp/api/spec/thread.h b/include/odp/api/spec/thread.h
index 0d85b3432..d595a9563 100644
--- a/include/odp/api/spec/thread.h
+++ b/include/odp/api/spec/thread.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2022 Nokia
*/
/**
diff --git a/include/odp/api/spec/thread_types.h b/include/odp/api/spec/thread_types.h
index 5a59223ed..60cf4897b 100644
--- a/include/odp/api/spec/thread_types.h
+++ b/include/odp/api/spec/thread_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/spec/threshold.h b/include/odp/api/spec/threshold.h
index f9100cb99..732da7274 100644
--- a/include/odp/api/spec/threshold.h
+++ b/include/odp/api/spec/threshold.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/spec/thrmask.h b/include/odp/api/spec/thrmask.h
index 12d1d70a7..725690e9e 100644
--- a/include/odp/api/spec/thrmask.h
+++ b/include/odp/api/spec/thrmask.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/spec/ticketlock.h b/include/odp/api/spec/ticketlock.h
index 0d5d67a88..2a14273ee 100644
--- a/include/odp/api/spec/ticketlock.h
+++ b/include/odp/api/spec/ticketlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/spec/time.h b/include/odp/api/spec/time.h
index f4496c4c7..54ab5f19a 100644
--- a/include/odp/api/spec/time.h
+++ b/include/odp/api/spec/time.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2020-2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2020-2023 Nokia
*/
/**
diff --git a/include/odp/api/spec/time_types.h b/include/odp/api/spec/time_types.h
index 9065b8004..5f5685745 100644
--- a/include/odp/api/spec/time_types.h
+++ b/include/odp/api/spec/time_types.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2020-2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2020-2023 Nokia
*/
/**
diff --git a/include/odp/api/spec/timer.h b/include/odp/api/spec/timer.h
index a6ad6f2b3..c42c5cf5e 100644
--- a/include/odp/api/spec/timer.h
+++ b/include/odp/api/spec/timer.h
@@ -1,9 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2019-2023, Nokia
- *
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2019-2023 Nokia
*/
/**
@@ -582,6 +579,20 @@ void *odp_timeout_user_area(odp_timeout_t tmo);
odp_timeout_t odp_timeout_alloc(odp_pool_t pool);
/**
+ * Allocate multiple timeouts
+ *
+ * Otherwise like odp_timeout_alloc(), but allocates multiple timeouts from a pool.
+ *
+ * @param pool Pool handle
+ * @param[out] tmo Array of timeout handles for output
+ * @param num Number of timeouts to allocate
+ *
+ * @return Number of timeouts actually allocated (0 ... num)
+ * @retval <0 on failure
+ */
+int odp_timeout_alloc_multi(odp_pool_t pool, odp_timeout_t tmo[], int num);
+
+/**
* Timeout free
*
* Frees the timeout back to the pool it was allocated from.
@@ -591,6 +602,16 @@ odp_timeout_t odp_timeout_alloc(odp_pool_t pool);
void odp_timeout_free(odp_timeout_t tmo);
/**
+ * Free multiple timeouts
+ *
+ * Otherwise like odp_timeout_free(), but frees multiple timeouts to their originating pools.
+ *
+ * @param tmo Array of timeout handles
+ * @param num Number of timeouts to free
+ */
+void odp_timeout_free_multi(odp_timeout_t tmo[], int num);
+
+/**
* Print timer pool debug information
*
* Prints implementation specific debug information about
diff --git a/include/odp/api/spec/timer_types.h b/include/odp/api/spec/timer_types.h
index f1e199352..0fd5d4f70 100644
--- a/include/odp/api/spec/timer_types.h
+++ b/include/odp/api/spec/timer_types.h
@@ -1,9 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2019-2023, Nokia
- *
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2019-2023 Nokia
*/
/**
@@ -389,8 +386,7 @@ typedef struct {
} periodic;
- /** Number of timers needed. Application will create in maximum this
- * many concurrent timers from the timer pool. */
+ /** Number of timers in the pool. */
uint32_t num_timers;
/** Thread private timer pool. When zero, multiple thread may use the
diff --git a/include/odp/api/spec/traffic_mngr.h b/include/odp/api/spec/traffic_mngr.h
index 2331cc133..117ed22cd 100644
--- a/include/odp/api/spec/traffic_mngr.h
+++ b/include/odp/api/spec/traffic_mngr.h
@@ -1,9 +1,7 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * Copyright (c) 2021-2022, Nokia
- * Copyright (c) 2022, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
+ * Copyright (c) 2021-2022 Nokia
+ * Copyright (c) 2022 Marvell
*/
#ifndef ODP_API_SPEC_TRAFFIC_MNGR_H_
diff --git a/include/odp/api/spec/version.h.in b/include/odp/api/spec/version.h.in
index f07a9125f..19c5f2ec1 100644
--- a/include/odp/api/spec/version.h.in
+++ b/include/odp/api/spec/version.h.in
@@ -1,8 +1,6 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2020-2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2020-2021 Nokia
*/
/**
diff --git a/include/odp/api/spinlock.h b/include/odp/api/spinlock.h
index cc195d488..de4a86bf7 100644
--- a/include/odp/api/spinlock.h
+++ b/include/odp/api/spinlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/spinlock_recursive.h b/include/odp/api/spinlock_recursive.h
index 403510e77..6717a3958 100644
--- a/include/odp/api/spinlock_recursive.h
+++ b/include/odp/api/spinlock_recursive.h
@@ -1,13 +1,11 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
* @file
*
- * ODP resursive spinlock
+ * ODP recursive spinlock
*/
#ifndef ODP_API_SPINLOCK_RECURSIVE_H_
diff --git a/include/odp/api/stash.h b/include/odp/api/stash.h
index ce11d3c6d..e3071ec4e 100644
--- a/include/odp/api/stash.h
+++ b/include/odp/api/stash.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Nokia
*/
/**
diff --git a/include/odp/api/stash_types.h b/include/odp/api/stash_types.h
index 3d227d958..429a47b27 100644
--- a/include/odp/api/stash_types.h
+++ b/include/odp/api/stash_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
/**
diff --git a/include/odp/api/std.h b/include/odp/api/std.h
index 6af95b55a..7a057efc6 100644
--- a/include/odp/api/std.h
+++ b/include/odp/api/std.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
#ifndef ODP_API_STD_H_
diff --git a/include/odp/api/std_types.h b/include/odp/api/std_types.h
index a18835cbd..b94007314 100644
--- a/include/odp/api/std_types.h
+++ b/include/odp/api/std_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/sync.h b/include/odp/api/sync.h
index 183cdda06..c936a1477 100644
--- a/include/odp/api/sync.h
+++ b/include/odp/api/sync.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/system_info.h b/include/odp/api/system_info.h
index a69e2a2c3..d830a4f9c 100644
--- a/include/odp/api/system_info.h
+++ b/include/odp/api/system_info.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/thread.h b/include/odp/api/thread.h
index acc65159b..2e0288886 100644
--- a/include/odp/api/thread.h
+++ b/include/odp/api/thread.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/threshold.h b/include/odp/api/threshold.h
index 021d1181e..f8e85e206 100644
--- a/include/odp/api/threshold.h
+++ b/include/odp/api/threshold.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/thrmask.h b/include/odp/api/thrmask.h
index 0300622a6..04cdffb99 100644
--- a/include/odp/api/thrmask.h
+++ b/include/odp/api/thrmask.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/ticketlock.h b/include/odp/api/ticketlock.h
index 90ac5ff8c..6ca983b3b 100644
--- a/include/odp/api/ticketlock.h
+++ b/include/odp/api/ticketlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/time.h b/include/odp/api/time.h
index fb550724d..24757bbc6 100644
--- a/include/odp/api/time.h
+++ b/include/odp/api/time.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/time_types.h b/include/odp/api/time_types.h
index f7281d456..6cb14ffc7 100644
--- a/include/odp/api/time_types.h
+++ b/include/odp/api/time_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
/**
diff --git a/include/odp/api/timer.h b/include/odp/api/timer.h
index 356f7e951..512c9aec0 100644
--- a/include/odp/api/timer.h
+++ b/include/odp/api/timer.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/timer_types.h b/include/odp/api/timer_types.h
index 8d3385594..0fb0c7e1e 100644
--- a/include/odp/api/timer_types.h
+++ b/include/odp/api/timer_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
/**
diff --git a/include/odp/api/traffic_mngr.h b/include/odp/api/traffic_mngr.h
index 7ae9b40b3..96ccff170 100644
--- a/include/odp/api/traffic_mngr.h
+++ b/include/odp/api/traffic_mngr.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2015-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Linaro Limited
*/
/**
diff --git a/include/odp/api/version.h b/include/odp/api/version.h
index 3e584e0fc..4461ccc32 100644
--- a/include/odp/api/version.h
+++ b/include/odp/api/version.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/align.h b/include/odp/arch/arm32-linux/odp/api/abi/align.h
index 7fa343078..aa8f2eab7 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/align.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/align.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/align.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/atomic.h b/include/odp/arch/arm32-linux/odp/api/abi/atomic.h
index da89426c7..ab7c3f17b 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/atomic.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/atomic.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/atomic.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/barrier.h b/include/odp/arch/arm32-linux/odp/api/abi/barrier.h
index 56b64b81d..c3388fd2a 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/barrier.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/barrier.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/barrier.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/buffer.h b/include/odp/arch/arm32-linux/odp/api/abi/buffer.h
index 217ed4a93..2ffa07d1f 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/buffer.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/buffer.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/buffer.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/buffer_types.h b/include/odp/arch/arm32-linux/odp/api/abi/buffer_types.h
index 8dd78321f..331e123c7 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/buffer_types.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/buffer_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
#include <odp/api/abi-default/buffer_types.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/byteorder.h b/include/odp/arch/arm32-linux/odp/api/abi/byteorder.h
index eb383cd33..9c9728840 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/byteorder.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/byteorder.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/byteorder.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/classification.h b/include/odp/arch/arm32-linux/odp/api/abi/classification.h
index 732eb27e0..789f3a92a 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/classification.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/classification.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/classification.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/comp.h b/include/odp/arch/arm32-linux/odp/api/abi/comp.h
index a8f6439f4..7b4be9d3e 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/comp.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/comp.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/comp.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/cpu.h b/include/odp/arch/arm32-linux/odp/api/abi/cpu.h
index d7485c090..575f4a5ec 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/cpu.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/cpu.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
#ifndef ODP_API_ABI_CPU_H_
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/cpumask.h b/include/odp/arch/arm32-linux/odp/api/abi/cpumask.h
index c64bf2a69..696f8664f 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/cpumask.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/cpumask.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/cpumask.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/crypto.h b/include/odp/arch/arm32-linux/odp/api/abi/crypto.h
index 386384285..9d39ba7bc 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/crypto.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/crypto.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/crypto.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/crypto_types.h b/include/odp/arch/arm32-linux/odp/api/abi/crypto_types.h
index ddadec1c1..7e1da759a 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/crypto_types.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/crypto_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/crypto_types.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/debug.h b/include/odp/arch/arm32-linux/odp/api/abi/debug.h
index 97d028d51..8a2ef2ade 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/debug.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/debug.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/debug.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/dma.h b/include/odp/arch/arm32-linux/odp/api/abi/dma.h
index f4656c4cf..f5e42a076 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/dma.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/dma.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
#include <odp/api/abi-default/dma.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/dma_types.h b/include/odp/arch/arm32-linux/odp/api/abi/dma_types.h
index 76ccd895d..cd96b9933 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/dma_types.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/dma_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/dma_types.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/errno.h b/include/odp/arch/arm32-linux/odp/api/abi/errno.h
index 69de49a0b..9d197a8d4 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/errno.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/errno.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Marvell
*/
#include <odp/api/abi-default/errno.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/event.h b/include/odp/arch/arm32-linux/odp/api/abi/event.h
index 408433ad8..6f7074bb1 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/event.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/event.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/event.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/event_types.h b/include/odp/arch/arm32-linux/odp/api/abi/event_types.h
index a8321920c..ece9cbef0 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/event_types.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/event_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/event_types.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/hash.h b/include/odp/arch/arm32-linux/odp/api/abi/hash.h
index c9fb1976c..72431f765 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/hash.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/hash.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Marvell
*/
#include <odp/api/abi-default/hash.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/init.h b/include/odp/arch/arm32-linux/odp/api/abi/init.h
index 7ad523fde..936644f46 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/init.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/init.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/init.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/ipsec.h b/include/odp/arch/arm32-linux/odp/api/abi/ipsec.h
index 13151beeb..33c03cbe2 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/ipsec.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/ipsec.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/ipsec.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/ipsec_types.h b/include/odp/arch/arm32-linux/odp/api/abi/ipsec_types.h
index 49d854444..854e7aa01 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/ipsec_types.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/ipsec_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/ipsec_types.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/packet.h b/include/odp/arch/arm32-linux/odp/api/abi/packet.h
index be8809aed..9d560e6c8 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/packet.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/packet.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/packet.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/packet_flags.h b/include/odp/arch/arm32-linux/odp/api/abi/packet_flags.h
index 2ff0e0016..598047d96 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/packet_flags.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/packet_flags.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/packet_flags.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/packet_io.h b/include/odp/arch/arm32-linux/odp/api/abi/packet_io.h
index ec02e3a2b..4356eb007 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/packet_io.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/packet_io.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/packet_io.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/packet_io_types.h b/include/odp/arch/arm32-linux/odp/api/abi/packet_io_types.h
index d4f26338f..3e8962f6a 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/packet_io_types.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/packet_io_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/packet_io_types.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/packet_types.h b/include/odp/arch/arm32-linux/odp/api/abi/packet_types.h
index c92ffd684..9af00c158 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/packet_types.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/packet_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/packet_types.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/pool.h b/include/odp/arch/arm32-linux/odp/api/abi/pool.h
index 3b1f21d97..2f2e9164f 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/pool.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/pool.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/pool.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/pool_types.h b/include/odp/arch/arm32-linux/odp/api/abi/pool_types.h
index 2c5cb121a..a8366b5d2 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/pool_types.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/pool_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/pool_types.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/proto_stats_types.h b/include/odp/arch/arm32-linux/odp/api/abi/proto_stats_types.h
index 1cb6128b6..f6884a40a 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/proto_stats_types.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/proto_stats_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/proto_stats_types.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/queue.h b/include/odp/arch/arm32-linux/odp/api/abi/queue.h
index 53f046f80..2ba9174d0 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/queue.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/queue.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/queue.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/queue_types.h b/include/odp/arch/arm32-linux/odp/api/abi/queue_types.h
index 51837734a..f1a8e197d 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/queue_types.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/queue_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/queue_types.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/random.h b/include/odp/arch/arm32-linux/odp/api/abi/random.h
index 87aa943b8..703dcf5a0 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/random.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/random.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/random.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/rwlock.h b/include/odp/arch/arm32-linux/odp/api/abi/rwlock.h
index 96dbc9b83..5f953d6f6 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/rwlock.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/rwlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/rwlock.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/rwlock_recursive.h b/include/odp/arch/arm32-linux/odp/api/abi/rwlock_recursive.h
index 14c964c9d..f10116aeb 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/rwlock_recursive.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/rwlock_recursive.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/rwlock_recursive.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/schedule.h b/include/odp/arch/arm32-linux/odp/api/abi/schedule.h
index 748c6aa8a..cd16a1161 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/schedule.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/schedule.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/schedule.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/schedule_types.h b/include/odp/arch/arm32-linux/odp/api/abi/schedule_types.h
index d5164ff79..1b2990c2b 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/schedule_types.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/schedule_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/schedule_types.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/shared_memory.h b/include/odp/arch/arm32-linux/odp/api/abi/shared_memory.h
index 784170abe..7ba8a2248 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/shared_memory.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/shared_memory.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/shared_memory.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/spinlock.h b/include/odp/arch/arm32-linux/odp/api/abi/spinlock.h
index fbfbce5cc..c626baae5 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/spinlock.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/spinlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/spinlock.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/spinlock_recursive.h b/include/odp/arch/arm32-linux/odp/api/abi/spinlock_recursive.h
index cc93b6acb..6794590ca 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/spinlock_recursive.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/spinlock_recursive.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/spinlock_recursive.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/stash.h b/include/odp/arch/arm32-linux/odp/api/abi/stash.h
index d98413dea..ed2cbbc64 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/stash.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/stash.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Nokia
*/
#include <odp/api/abi-default/stash.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/stash_types.h b/include/odp/arch/arm32-linux/odp/api/abi/stash_types.h
index 998f75432..0f2759726 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/stash_types.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/stash_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/stash_types.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/std.h b/include/odp/arch/arm32-linux/odp/api/abi/std.h
index a7243c4d4..936009922 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/std.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/std.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/std.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/std_types.h b/include/odp/arch/arm32-linux/odp/api/abi/std_types.h
index 594e6f9dd..c0d930e1f 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/std_types.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/std_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/std_types.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/sync.h b/include/odp/arch/arm32-linux/odp/api/abi/sync.h
index 37b03bcd9..dbe3a95ab 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/sync.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/sync.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/sync.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/thread.h b/include/odp/arch/arm32-linux/odp/api/abi/thread.h
index be44ad8aa..b6a233c96 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/thread.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/thread.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/thread.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/thrmask.h b/include/odp/arch/arm32-linux/odp/api/abi/thrmask.h
index ab05cd83f..2bb61d233 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/thrmask.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/thrmask.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/thrmask.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/ticketlock.h b/include/odp/arch/arm32-linux/odp/api/abi/ticketlock.h
index 0750f7e72..4317157b8 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/ticketlock.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/ticketlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/ticketlock.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/time.h b/include/odp/arch/arm32-linux/odp/api/abi/time.h
index a86a526dc..0f2425669 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/time.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/time.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/time.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/time_types.h b/include/odp/arch/arm32-linux/odp/api/abi/time_types.h
index cba80f508..a415200a0 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/time_types.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/time_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
#include <odp/api/abi-default/time_types.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/timer.h b/include/odp/arch/arm32-linux/odp/api/abi/timer.h
index 0351468d3..0d7965bf7 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/timer.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/timer.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/timer.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/timer_types.h b/include/odp/arch/arm32-linux/odp/api/abi/timer_types.h
index cd384c2bc..51b578aa7 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/timer_types.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/timer_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/timer_types.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/traffic_mngr.h b/include/odp/arch/arm32-linux/odp/api/abi/traffic_mngr.h
index 0e6bc7982..9a457c370 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/traffic_mngr.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/traffic_mngr.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/traffic_mngr.h>
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/version.h b/include/odp/arch/arm32-linux/odp/api/abi/version.h
index 429d4f3fa..cf4b9a128 100644
--- a/include/odp/arch/arm32-linux/odp/api/abi/version.h
+++ b/include/odp/arch/arm32-linux/odp/api/abi/version.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/version.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/align.h b/include/odp/arch/arm64-linux/odp/api/abi/align.h
index 7fa343078..aa8f2eab7 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/align.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/align.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/align.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/atomic.h b/include/odp/arch/arm64-linux/odp/api/abi/atomic.h
index da89426c7..ab7c3f17b 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/atomic.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/atomic.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/atomic.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/barrier.h b/include/odp/arch/arm64-linux/odp/api/abi/barrier.h
index 56b64b81d..c3388fd2a 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/barrier.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/barrier.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/barrier.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/buffer.h b/include/odp/arch/arm64-linux/odp/api/abi/buffer.h
index 217ed4a93..2ffa07d1f 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/buffer.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/buffer.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/buffer.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/buffer_types.h b/include/odp/arch/arm64-linux/odp/api/abi/buffer_types.h
index 8dd78321f..331e123c7 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/buffer_types.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/buffer_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
#include <odp/api/abi-default/buffer_types.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/byteorder.h b/include/odp/arch/arm64-linux/odp/api/abi/byteorder.h
index eb383cd33..9c9728840 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/byteorder.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/byteorder.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/byteorder.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/classification.h b/include/odp/arch/arm64-linux/odp/api/abi/classification.h
index 732eb27e0..789f3a92a 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/classification.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/classification.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/classification.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/comp.h b/include/odp/arch/arm64-linux/odp/api/abi/comp.h
index a8f6439f4..7b4be9d3e 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/comp.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/comp.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/comp.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/cpu.h b/include/odp/arch/arm64-linux/odp/api/abi/cpu.h
index d7485c090..575f4a5ec 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/cpu.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/cpu.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
#ifndef ODP_API_ABI_CPU_H_
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/cpumask.h b/include/odp/arch/arm64-linux/odp/api/abi/cpumask.h
index c64bf2a69..696f8664f 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/cpumask.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/cpumask.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/cpumask.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/crypto.h b/include/odp/arch/arm64-linux/odp/api/abi/crypto.h
index 386384285..9d39ba7bc 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/crypto.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/crypto.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/crypto.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/crypto_types.h b/include/odp/arch/arm64-linux/odp/api/abi/crypto_types.h
index ddadec1c1..7e1da759a 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/crypto_types.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/crypto_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/crypto_types.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/debug.h b/include/odp/arch/arm64-linux/odp/api/abi/debug.h
index 97d028d51..8a2ef2ade 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/debug.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/debug.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/debug.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/dma.h b/include/odp/arch/arm64-linux/odp/api/abi/dma.h
index f4656c4cf..f5e42a076 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/dma.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/dma.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
#include <odp/api/abi-default/dma.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/dma_types.h b/include/odp/arch/arm64-linux/odp/api/abi/dma_types.h
index 76ccd895d..cd96b9933 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/dma_types.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/dma_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/dma_types.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/errno.h b/include/odp/arch/arm64-linux/odp/api/abi/errno.h
index 69de49a0b..9d197a8d4 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/errno.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/errno.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Marvell
*/
#include <odp/api/abi-default/errno.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/event.h b/include/odp/arch/arm64-linux/odp/api/abi/event.h
index 408433ad8..6f7074bb1 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/event.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/event.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/event.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/event_types.h b/include/odp/arch/arm64-linux/odp/api/abi/event_types.h
index a8321920c..ece9cbef0 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/event_types.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/event_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/event_types.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/hash.h b/include/odp/arch/arm64-linux/odp/api/abi/hash.h
index c9fb1976c..72431f765 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/hash.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/hash.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Marvell
*/
#include <odp/api/abi-default/hash.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/init.h b/include/odp/arch/arm64-linux/odp/api/abi/init.h
index 7ad523fde..936644f46 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/init.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/init.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/init.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/ipsec.h b/include/odp/arch/arm64-linux/odp/api/abi/ipsec.h
index 13151beeb..33c03cbe2 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/ipsec.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/ipsec.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/ipsec.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/ipsec_types.h b/include/odp/arch/arm64-linux/odp/api/abi/ipsec_types.h
index 49d854444..854e7aa01 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/ipsec_types.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/ipsec_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/ipsec_types.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/packet.h b/include/odp/arch/arm64-linux/odp/api/abi/packet.h
index be8809aed..9d560e6c8 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/packet.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/packet.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/packet.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/packet_flags.h b/include/odp/arch/arm64-linux/odp/api/abi/packet_flags.h
index 2ff0e0016..598047d96 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/packet_flags.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/packet_flags.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/packet_flags.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/packet_io.h b/include/odp/arch/arm64-linux/odp/api/abi/packet_io.h
index ec02e3a2b..4356eb007 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/packet_io.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/packet_io.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/packet_io.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/packet_io_types.h b/include/odp/arch/arm64-linux/odp/api/abi/packet_io_types.h
index d4f26338f..3e8962f6a 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/packet_io_types.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/packet_io_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/packet_io_types.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/packet_types.h b/include/odp/arch/arm64-linux/odp/api/abi/packet_types.h
index c92ffd684..9af00c158 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/packet_types.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/packet_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/packet_types.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/pool.h b/include/odp/arch/arm64-linux/odp/api/abi/pool.h
index 3b1f21d97..2f2e9164f 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/pool.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/pool.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/pool.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/pool_types.h b/include/odp/arch/arm64-linux/odp/api/abi/pool_types.h
index 2c5cb121a..a8366b5d2 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/pool_types.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/pool_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/pool_types.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/proto_stats_types.h b/include/odp/arch/arm64-linux/odp/api/abi/proto_stats_types.h
index 1cb6128b6..f6884a40a 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/proto_stats_types.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/proto_stats_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/proto_stats_types.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/queue.h b/include/odp/arch/arm64-linux/odp/api/abi/queue.h
index 53f046f80..2ba9174d0 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/queue.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/queue.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/queue.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/queue_types.h b/include/odp/arch/arm64-linux/odp/api/abi/queue_types.h
index 51837734a..f1a8e197d 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/queue_types.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/queue_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/queue_types.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/random.h b/include/odp/arch/arm64-linux/odp/api/abi/random.h
index 87aa943b8..703dcf5a0 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/random.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/random.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/random.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/rwlock.h b/include/odp/arch/arm64-linux/odp/api/abi/rwlock.h
index 96dbc9b83..5f953d6f6 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/rwlock.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/rwlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/rwlock.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/rwlock_recursive.h b/include/odp/arch/arm64-linux/odp/api/abi/rwlock_recursive.h
index 14c964c9d..f10116aeb 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/rwlock_recursive.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/rwlock_recursive.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/rwlock_recursive.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/schedule.h b/include/odp/arch/arm64-linux/odp/api/abi/schedule.h
index 748c6aa8a..cd16a1161 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/schedule.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/schedule.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/schedule.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/schedule_types.h b/include/odp/arch/arm64-linux/odp/api/abi/schedule_types.h
index d5164ff79..1b2990c2b 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/schedule_types.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/schedule_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/schedule_types.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/shared_memory.h b/include/odp/arch/arm64-linux/odp/api/abi/shared_memory.h
index 784170abe..7ba8a2248 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/shared_memory.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/shared_memory.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/shared_memory.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/spinlock.h b/include/odp/arch/arm64-linux/odp/api/abi/spinlock.h
index fbfbce5cc..c626baae5 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/spinlock.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/spinlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/spinlock.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/spinlock_recursive.h b/include/odp/arch/arm64-linux/odp/api/abi/spinlock_recursive.h
index cc93b6acb..6794590ca 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/spinlock_recursive.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/spinlock_recursive.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/spinlock_recursive.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/stash.h b/include/odp/arch/arm64-linux/odp/api/abi/stash.h
index d98413dea..ed2cbbc64 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/stash.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/stash.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Nokia
*/
#include <odp/api/abi-default/stash.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/stash_types.h b/include/odp/arch/arm64-linux/odp/api/abi/stash_types.h
index 998f75432..0f2759726 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/stash_types.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/stash_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/stash_types.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/std.h b/include/odp/arch/arm64-linux/odp/api/abi/std.h
index a7243c4d4..936009922 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/std.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/std.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/std.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/std_types.h b/include/odp/arch/arm64-linux/odp/api/abi/std_types.h
index 594e6f9dd..c0d930e1f 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/std_types.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/std_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/std_types.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/sync.h b/include/odp/arch/arm64-linux/odp/api/abi/sync.h
index 37b03bcd9..dbe3a95ab 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/sync.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/sync.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/sync.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/thread.h b/include/odp/arch/arm64-linux/odp/api/abi/thread.h
index be44ad8aa..b6a233c96 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/thread.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/thread.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/thread.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/thrmask.h b/include/odp/arch/arm64-linux/odp/api/abi/thrmask.h
index ab05cd83f..2bb61d233 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/thrmask.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/thrmask.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/thrmask.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/ticketlock.h b/include/odp/arch/arm64-linux/odp/api/abi/ticketlock.h
index 0750f7e72..4317157b8 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/ticketlock.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/ticketlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/ticketlock.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/time.h b/include/odp/arch/arm64-linux/odp/api/abi/time.h
index a86a526dc..0f2425669 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/time.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/time.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/time.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/time_types.h b/include/odp/arch/arm64-linux/odp/api/abi/time_types.h
index cba80f508..a415200a0 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/time_types.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/time_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
#include <odp/api/abi-default/time_types.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/timer.h b/include/odp/arch/arm64-linux/odp/api/abi/timer.h
index 0351468d3..0d7965bf7 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/timer.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/timer.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/timer.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/timer_types.h b/include/odp/arch/arm64-linux/odp/api/abi/timer_types.h
index cd384c2bc..51b578aa7 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/timer_types.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/timer_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/timer_types.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/traffic_mngr.h b/include/odp/arch/arm64-linux/odp/api/abi/traffic_mngr.h
index 0e6bc7982..9a457c370 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/traffic_mngr.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/traffic_mngr.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/traffic_mngr.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/version.h b/include/odp/arch/arm64-linux/odp/api/abi/version.h
index 429d4f3fa..cf4b9a128 100644
--- a/include/odp/arch/arm64-linux/odp/api/abi/version.h
+++ b/include/odp/arch/arm64-linux/odp/api/abi/version.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/version.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/align.h b/include/odp/arch/default-linux/odp/api/abi/align.h
index 250338cf3..d5b26ba72 100644
--- a/include/odp/arch/default-linux/odp/api/abi/align.h
+++ b/include/odp/arch/default-linux/odp/api/abi/align.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/align.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/atomic.h b/include/odp/arch/default-linux/odp/api/abi/atomic.h
index d224edfa9..6645faf14 100644
--- a/include/odp/arch/default-linux/odp/api/abi/atomic.h
+++ b/include/odp/arch/default-linux/odp/api/abi/atomic.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/atomic.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/barrier.h b/include/odp/arch/default-linux/odp/api/abi/barrier.h
index 156a6e209..23537289c 100644
--- a/include/odp/arch/default-linux/odp/api/abi/barrier.h
+++ b/include/odp/arch/default-linux/odp/api/abi/barrier.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/barrier.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/buffer.h b/include/odp/arch/default-linux/odp/api/abi/buffer.h
index 74e8aadce..092054239 100644
--- a/include/odp/arch/default-linux/odp/api/abi/buffer.h
+++ b/include/odp/arch/default-linux/odp/api/abi/buffer.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/buffer.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/buffer_types.h b/include/odp/arch/default-linux/odp/api/abi/buffer_types.h
index 8dd78321f..331e123c7 100644
--- a/include/odp/arch/default-linux/odp/api/abi/buffer_types.h
+++ b/include/odp/arch/default-linux/odp/api/abi/buffer_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
#include <odp/api/abi-default/buffer_types.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/byteorder.h b/include/odp/arch/default-linux/odp/api/abi/byteorder.h
index b2d174ce1..479077adb 100644
--- a/include/odp/arch/default-linux/odp/api/abi/byteorder.h
+++ b/include/odp/arch/default-linux/odp/api/abi/byteorder.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/byteorder.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/classification.h b/include/odp/arch/default-linux/odp/api/abi/classification.h
index 0e1271889..7eccb6819 100644
--- a/include/odp/arch/default-linux/odp/api/abi/classification.h
+++ b/include/odp/arch/default-linux/odp/api/abi/classification.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/classification.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/comp.h b/include/odp/arch/default-linux/odp/api/abi/comp.h
index a8f6439f4..7b4be9d3e 100644
--- a/include/odp/arch/default-linux/odp/api/abi/comp.h
+++ b/include/odp/arch/default-linux/odp/api/abi/comp.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/comp.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/cpu.h b/include/odp/arch/default-linux/odp/api/abi/cpu.h
index d7485c090..575f4a5ec 100644
--- a/include/odp/arch/default-linux/odp/api/abi/cpu.h
+++ b/include/odp/arch/default-linux/odp/api/abi/cpu.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
#ifndef ODP_API_ABI_CPU_H_
diff --git a/include/odp/arch/default-linux/odp/api/abi/cpumask.h b/include/odp/arch/default-linux/odp/api/abi/cpumask.h
index f99009497..c14cd36ba 100644
--- a/include/odp/arch/default-linux/odp/api/abi/cpumask.h
+++ b/include/odp/arch/default-linux/odp/api/abi/cpumask.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/cpumask.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/crypto.h b/include/odp/arch/default-linux/odp/api/abi/crypto.h
index 69efdd766..1fc496fdd 100644
--- a/include/odp/arch/default-linux/odp/api/abi/crypto.h
+++ b/include/odp/arch/default-linux/odp/api/abi/crypto.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/crypto.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/crypto_types.h b/include/odp/arch/default-linux/odp/api/abi/crypto_types.h
index ddadec1c1..7e1da759a 100644
--- a/include/odp/arch/default-linux/odp/api/abi/crypto_types.h
+++ b/include/odp/arch/default-linux/odp/api/abi/crypto_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/crypto_types.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/debug.h b/include/odp/arch/default-linux/odp/api/abi/debug.h
index 8bce796ab..59d18a02d 100644
--- a/include/odp/arch/default-linux/odp/api/abi/debug.h
+++ b/include/odp/arch/default-linux/odp/api/abi/debug.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/debug.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/dma.h b/include/odp/arch/default-linux/odp/api/abi/dma.h
index f4656c4cf..f5e42a076 100644
--- a/include/odp/arch/default-linux/odp/api/abi/dma.h
+++ b/include/odp/arch/default-linux/odp/api/abi/dma.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
#include <odp/api/abi-default/dma.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/dma_types.h b/include/odp/arch/default-linux/odp/api/abi/dma_types.h
index 76ccd895d..cd96b9933 100644
--- a/include/odp/arch/default-linux/odp/api/abi/dma_types.h
+++ b/include/odp/arch/default-linux/odp/api/abi/dma_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/dma_types.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/errno.h b/include/odp/arch/default-linux/odp/api/abi/errno.h
index 69de49a0b..9d197a8d4 100644
--- a/include/odp/arch/default-linux/odp/api/abi/errno.h
+++ b/include/odp/arch/default-linux/odp/api/abi/errno.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Marvell
*/
#include <odp/api/abi-default/errno.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/event.h b/include/odp/arch/default-linux/odp/api/abi/event.h
index 90b5eb284..5e6286ebd 100644
--- a/include/odp/arch/default-linux/odp/api/abi/event.h
+++ b/include/odp/arch/default-linux/odp/api/abi/event.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/event.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/event_types.h b/include/odp/arch/default-linux/odp/api/abi/event_types.h
index a8321920c..ece9cbef0 100644
--- a/include/odp/arch/default-linux/odp/api/abi/event_types.h
+++ b/include/odp/arch/default-linux/odp/api/abi/event_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/event_types.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/hash.h b/include/odp/arch/default-linux/odp/api/abi/hash.h
index c9fb1976c..72431f765 100644
--- a/include/odp/arch/default-linux/odp/api/abi/hash.h
+++ b/include/odp/arch/default-linux/odp/api/abi/hash.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Marvell
*/
#include <odp/api/abi-default/hash.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/init.h b/include/odp/arch/default-linux/odp/api/abi/init.h
index 9ab42ec88..babb44bad 100644
--- a/include/odp/arch/default-linux/odp/api/abi/init.h
+++ b/include/odp/arch/default-linux/odp/api/abi/init.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/init.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/ipsec.h b/include/odp/arch/default-linux/odp/api/abi/ipsec.h
index 17fcc6348..877515add 100644
--- a/include/odp/arch/default-linux/odp/api/abi/ipsec.h
+++ b/include/odp/arch/default-linux/odp/api/abi/ipsec.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/ipsec.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/ipsec_types.h b/include/odp/arch/default-linux/odp/api/abi/ipsec_types.h
index 49d854444..854e7aa01 100644
--- a/include/odp/arch/default-linux/odp/api/abi/ipsec_types.h
+++ b/include/odp/arch/default-linux/odp/api/abi/ipsec_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/ipsec_types.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/packet.h b/include/odp/arch/default-linux/odp/api/abi/packet.h
index a6cbeed72..8cee03484 100644
--- a/include/odp/arch/default-linux/odp/api/abi/packet.h
+++ b/include/odp/arch/default-linux/odp/api/abi/packet.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/packet.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/packet_flags.h b/include/odp/arch/default-linux/odp/api/abi/packet_flags.h
index 48bc878ff..00afba64c 100644
--- a/include/odp/arch/default-linux/odp/api/abi/packet_flags.h
+++ b/include/odp/arch/default-linux/odp/api/abi/packet_flags.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/packet_flags.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/packet_io.h b/include/odp/arch/default-linux/odp/api/abi/packet_io.h
index b322ba885..107a480dd 100644
--- a/include/odp/arch/default-linux/odp/api/abi/packet_io.h
+++ b/include/odp/arch/default-linux/odp/api/abi/packet_io.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/packet_io.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/packet_io_types.h b/include/odp/arch/default-linux/odp/api/abi/packet_io_types.h
index d4f26338f..3e8962f6a 100644
--- a/include/odp/arch/default-linux/odp/api/abi/packet_io_types.h
+++ b/include/odp/arch/default-linux/odp/api/abi/packet_io_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/packet_io_types.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/packet_types.h b/include/odp/arch/default-linux/odp/api/abi/packet_types.h
index c92ffd684..9af00c158 100644
--- a/include/odp/arch/default-linux/odp/api/abi/packet_types.h
+++ b/include/odp/arch/default-linux/odp/api/abi/packet_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/packet_types.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/pool.h b/include/odp/arch/default-linux/odp/api/abi/pool.h
index 3e8ab7e42..9c5d5d4fe 100644
--- a/include/odp/arch/default-linux/odp/api/abi/pool.h
+++ b/include/odp/arch/default-linux/odp/api/abi/pool.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/pool.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/pool_types.h b/include/odp/arch/default-linux/odp/api/abi/pool_types.h
index 2c5cb121a..a8366b5d2 100644
--- a/include/odp/arch/default-linux/odp/api/abi/pool_types.h
+++ b/include/odp/arch/default-linux/odp/api/abi/pool_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/pool_types.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/proto_stats_types.h b/include/odp/arch/default-linux/odp/api/abi/proto_stats_types.h
index 1cb6128b6..f6884a40a 100644
--- a/include/odp/arch/default-linux/odp/api/abi/proto_stats_types.h
+++ b/include/odp/arch/default-linux/odp/api/abi/proto_stats_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/proto_stats_types.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/queue.h b/include/odp/arch/default-linux/odp/api/abi/queue.h
index 7860f6fac..352885307 100644
--- a/include/odp/arch/default-linux/odp/api/abi/queue.h
+++ b/include/odp/arch/default-linux/odp/api/abi/queue.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/queue.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/queue_types.h b/include/odp/arch/default-linux/odp/api/abi/queue_types.h
index 51837734a..f1a8e197d 100644
--- a/include/odp/arch/default-linux/odp/api/abi/queue_types.h
+++ b/include/odp/arch/default-linux/odp/api/abi/queue_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/queue_types.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/random.h b/include/odp/arch/default-linux/odp/api/abi/random.h
index 87aa943b8..703dcf5a0 100644
--- a/include/odp/arch/default-linux/odp/api/abi/random.h
+++ b/include/odp/arch/default-linux/odp/api/abi/random.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/random.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/rwlock.h b/include/odp/arch/default-linux/odp/api/abi/rwlock.h
index 2e073cb29..e77c35549 100644
--- a/include/odp/arch/default-linux/odp/api/abi/rwlock.h
+++ b/include/odp/arch/default-linux/odp/api/abi/rwlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/rwlock.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/rwlock_recursive.h b/include/odp/arch/default-linux/odp/api/abi/rwlock_recursive.h
index c266ef1bd..b347e9c87 100644
--- a/include/odp/arch/default-linux/odp/api/abi/rwlock_recursive.h
+++ b/include/odp/arch/default-linux/odp/api/abi/rwlock_recursive.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/rwlock_recursive.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/schedule.h b/include/odp/arch/default-linux/odp/api/abi/schedule.h
index ca4cf77b2..3c00f79da 100644
--- a/include/odp/arch/default-linux/odp/api/abi/schedule.h
+++ b/include/odp/arch/default-linux/odp/api/abi/schedule.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/schedule.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/schedule_types.h b/include/odp/arch/default-linux/odp/api/abi/schedule_types.h
index 93c4db55f..2731cfbb7 100644
--- a/include/odp/arch/default-linux/odp/api/abi/schedule_types.h
+++ b/include/odp/arch/default-linux/odp/api/abi/schedule_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/schedule_types.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/shared_memory.h b/include/odp/arch/default-linux/odp/api/abi/shared_memory.h
index 1184fb0d1..ddf32054c 100644
--- a/include/odp/arch/default-linux/odp/api/abi/shared_memory.h
+++ b/include/odp/arch/default-linux/odp/api/abi/shared_memory.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/shared_memory.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/spinlock.h b/include/odp/arch/default-linux/odp/api/abi/spinlock.h
index 7b162c013..8fe21357d 100644
--- a/include/odp/arch/default-linux/odp/api/abi/spinlock.h
+++ b/include/odp/arch/default-linux/odp/api/abi/spinlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/spinlock.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/spinlock_recursive.h b/include/odp/arch/default-linux/odp/api/abi/spinlock_recursive.h
index 8666a2df0..366c181ec 100644
--- a/include/odp/arch/default-linux/odp/api/abi/spinlock_recursive.h
+++ b/include/odp/arch/default-linux/odp/api/abi/spinlock_recursive.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/spinlock_recursive.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/stash.h b/include/odp/arch/default-linux/odp/api/abi/stash.h
index d98413dea..ed2cbbc64 100644
--- a/include/odp/arch/default-linux/odp/api/abi/stash.h
+++ b/include/odp/arch/default-linux/odp/api/abi/stash.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Nokia
*/
#include <odp/api/abi-default/stash.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/stash_types.h b/include/odp/arch/default-linux/odp/api/abi/stash_types.h
index 998f75432..0f2759726 100644
--- a/include/odp/arch/default-linux/odp/api/abi/stash_types.h
+++ b/include/odp/arch/default-linux/odp/api/abi/stash_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/stash_types.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/std.h b/include/odp/arch/default-linux/odp/api/abi/std.h
index bc1abf1a6..ae8d69371 100644
--- a/include/odp/arch/default-linux/odp/api/abi/std.h
+++ b/include/odp/arch/default-linux/odp/api/abi/std.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/std.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/std_types.h b/include/odp/arch/default-linux/odp/api/abi/std_types.h
index 8cd05f78a..3d011d980 100644
--- a/include/odp/arch/default-linux/odp/api/abi/std_types.h
+++ b/include/odp/arch/default-linux/odp/api/abi/std_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/std_types.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/sync.h b/include/odp/arch/default-linux/odp/api/abi/sync.h
index 809c31f25..e6d26db02 100644
--- a/include/odp/arch/default-linux/odp/api/abi/sync.h
+++ b/include/odp/arch/default-linux/odp/api/abi/sync.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/sync.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/thread.h b/include/odp/arch/default-linux/odp/api/abi/thread.h
index e90128286..26b2f6be0 100644
--- a/include/odp/arch/default-linux/odp/api/abi/thread.h
+++ b/include/odp/arch/default-linux/odp/api/abi/thread.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/thread.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/thrmask.h b/include/odp/arch/default-linux/odp/api/abi/thrmask.h
index b7f6ff4cb..305be2ca4 100644
--- a/include/odp/arch/default-linux/odp/api/abi/thrmask.h
+++ b/include/odp/arch/default-linux/odp/api/abi/thrmask.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/thrmask.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/ticketlock.h b/include/odp/arch/default-linux/odp/api/abi/ticketlock.h
index e3220d327..53d4fa04a 100644
--- a/include/odp/arch/default-linux/odp/api/abi/ticketlock.h
+++ b/include/odp/arch/default-linux/odp/api/abi/ticketlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/ticketlock.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/time.h b/include/odp/arch/default-linux/odp/api/abi/time.h
index ffa8cd9aa..1b61b9e8d 100644
--- a/include/odp/arch/default-linux/odp/api/abi/time.h
+++ b/include/odp/arch/default-linux/odp/api/abi/time.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/time.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/time_types.h b/include/odp/arch/default-linux/odp/api/abi/time_types.h
index cba80f508..a415200a0 100644
--- a/include/odp/arch/default-linux/odp/api/abi/time_types.h
+++ b/include/odp/arch/default-linux/odp/api/abi/time_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
#include <odp/api/abi-default/time_types.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/timer.h b/include/odp/arch/default-linux/odp/api/abi/timer.h
index 0351468d3..0d7965bf7 100644
--- a/include/odp/arch/default-linux/odp/api/abi/timer.h
+++ b/include/odp/arch/default-linux/odp/api/abi/timer.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/timer.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/timer_types.h b/include/odp/arch/default-linux/odp/api/abi/timer_types.h
index 3050e4a61..40fd26343 100644
--- a/include/odp/arch/default-linux/odp/api/abi/timer_types.h
+++ b/include/odp/arch/default-linux/odp/api/abi/timer_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/timer_types.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/traffic_mngr.h b/include/odp/arch/default-linux/odp/api/abi/traffic_mngr.h
index 2c9b01251..8904e4291 100644
--- a/include/odp/arch/default-linux/odp/api/abi/traffic_mngr.h
+++ b/include/odp/arch/default-linux/odp/api/abi/traffic_mngr.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/traffic_mngr.h>
diff --git a/include/odp/arch/default-linux/odp/api/abi/version.h b/include/odp/arch/default-linux/odp/api/abi/version.h
index 89b7d3611..3249a2e26 100644
--- a/include/odp/arch/default-linux/odp/api/abi/version.h
+++ b/include/odp/arch/default-linux/odp/api/abi/version.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/version.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/align.h b/include/odp/arch/power64-linux/odp/api/abi/align.h
index 7fa343078..aa8f2eab7 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/align.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/align.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/align.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/atomic.h b/include/odp/arch/power64-linux/odp/api/abi/atomic.h
index da89426c7..ab7c3f17b 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/atomic.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/atomic.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/atomic.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/barrier.h b/include/odp/arch/power64-linux/odp/api/abi/barrier.h
index 56b64b81d..c3388fd2a 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/barrier.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/barrier.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/barrier.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/buffer.h b/include/odp/arch/power64-linux/odp/api/abi/buffer.h
index 217ed4a93..2ffa07d1f 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/buffer.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/buffer.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/buffer.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/buffer_types.h b/include/odp/arch/power64-linux/odp/api/abi/buffer_types.h
index 8dd78321f..331e123c7 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/buffer_types.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/buffer_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
#include <odp/api/abi-default/buffer_types.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/byteorder.h b/include/odp/arch/power64-linux/odp/api/abi/byteorder.h
index eb383cd33..9c9728840 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/byteorder.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/byteorder.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/byteorder.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/classification.h b/include/odp/arch/power64-linux/odp/api/abi/classification.h
index 732eb27e0..789f3a92a 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/classification.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/classification.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/classification.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/comp.h b/include/odp/arch/power64-linux/odp/api/abi/comp.h
index a8f6439f4..7b4be9d3e 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/comp.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/comp.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/comp.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/cpu.h b/include/odp/arch/power64-linux/odp/api/abi/cpu.h
index 42a5dd22c..55b59b1ab 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/cpu.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/cpu.h
@@ -1,8 +1,6 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
+ * Copyright (c) 2021 Nokia
*/
#ifndef ODP_API_ABI_CPU_H_
diff --git a/include/odp/arch/power64-linux/odp/api/abi/cpumask.h b/include/odp/arch/power64-linux/odp/api/abi/cpumask.h
index c64bf2a69..696f8664f 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/cpumask.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/cpumask.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/cpumask.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/crypto.h b/include/odp/arch/power64-linux/odp/api/abi/crypto.h
index 386384285..9d39ba7bc 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/crypto.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/crypto.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/crypto.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/crypto_types.h b/include/odp/arch/power64-linux/odp/api/abi/crypto_types.h
index ddadec1c1..7e1da759a 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/crypto_types.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/crypto_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/crypto_types.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/debug.h b/include/odp/arch/power64-linux/odp/api/abi/debug.h
index 97d028d51..8a2ef2ade 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/debug.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/debug.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/debug.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/dma.h b/include/odp/arch/power64-linux/odp/api/abi/dma.h
index f4656c4cf..f5e42a076 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/dma.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/dma.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
#include <odp/api/abi-default/dma.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/dma_types.h b/include/odp/arch/power64-linux/odp/api/abi/dma_types.h
index 76ccd895d..cd96b9933 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/dma_types.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/dma_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/dma_types.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/errno.h b/include/odp/arch/power64-linux/odp/api/abi/errno.h
index 69de49a0b..9d197a8d4 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/errno.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/errno.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Marvell
*/
#include <odp/api/abi-default/errno.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/event.h b/include/odp/arch/power64-linux/odp/api/abi/event.h
index 408433ad8..6f7074bb1 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/event.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/event.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/event.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/event_types.h b/include/odp/arch/power64-linux/odp/api/abi/event_types.h
index a8321920c..ece9cbef0 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/event_types.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/event_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/event_types.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/hash.h b/include/odp/arch/power64-linux/odp/api/abi/hash.h
index c9fb1976c..72431f765 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/hash.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/hash.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Marvell
*/
#include <odp/api/abi-default/hash.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/init.h b/include/odp/arch/power64-linux/odp/api/abi/init.h
index 7ad523fde..936644f46 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/init.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/init.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/init.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/ipsec.h b/include/odp/arch/power64-linux/odp/api/abi/ipsec.h
index 13151beeb..33c03cbe2 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/ipsec.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/ipsec.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/ipsec.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/ipsec_types.h b/include/odp/arch/power64-linux/odp/api/abi/ipsec_types.h
index 49d854444..854e7aa01 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/ipsec_types.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/ipsec_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/ipsec_types.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/packet.h b/include/odp/arch/power64-linux/odp/api/abi/packet.h
index be8809aed..9d560e6c8 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/packet.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/packet.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/packet.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/packet_flags.h b/include/odp/arch/power64-linux/odp/api/abi/packet_flags.h
index 2ff0e0016..598047d96 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/packet_flags.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/packet_flags.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/packet_flags.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/packet_io.h b/include/odp/arch/power64-linux/odp/api/abi/packet_io.h
index ec02e3a2b..4356eb007 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/packet_io.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/packet_io.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/packet_io.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/packet_io_types.h b/include/odp/arch/power64-linux/odp/api/abi/packet_io_types.h
index d4f26338f..3e8962f6a 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/packet_io_types.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/packet_io_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/packet_io_types.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/packet_types.h b/include/odp/arch/power64-linux/odp/api/abi/packet_types.h
index c92ffd684..9af00c158 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/packet_types.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/packet_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/packet_types.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/pool.h b/include/odp/arch/power64-linux/odp/api/abi/pool.h
index 3b1f21d97..2f2e9164f 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/pool.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/pool.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/pool.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/pool_types.h b/include/odp/arch/power64-linux/odp/api/abi/pool_types.h
index 2c5cb121a..a8366b5d2 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/pool_types.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/pool_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/pool_types.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/proto_stats_types.h b/include/odp/arch/power64-linux/odp/api/abi/proto_stats_types.h
index 1cb6128b6..f6884a40a 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/proto_stats_types.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/proto_stats_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/proto_stats_types.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/queue.h b/include/odp/arch/power64-linux/odp/api/abi/queue.h
index 53f046f80..2ba9174d0 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/queue.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/queue.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/queue.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/queue_types.h b/include/odp/arch/power64-linux/odp/api/abi/queue_types.h
index 51837734a..f1a8e197d 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/queue_types.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/queue_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/queue_types.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/random.h b/include/odp/arch/power64-linux/odp/api/abi/random.h
index 87aa943b8..703dcf5a0 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/random.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/random.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/random.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/rwlock.h b/include/odp/arch/power64-linux/odp/api/abi/rwlock.h
index 96dbc9b83..5f953d6f6 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/rwlock.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/rwlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/rwlock.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/rwlock_recursive.h b/include/odp/arch/power64-linux/odp/api/abi/rwlock_recursive.h
index 14c964c9d..f10116aeb 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/rwlock_recursive.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/rwlock_recursive.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/rwlock_recursive.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/schedule.h b/include/odp/arch/power64-linux/odp/api/abi/schedule.h
index 748c6aa8a..cd16a1161 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/schedule.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/schedule.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/schedule.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/schedule_types.h b/include/odp/arch/power64-linux/odp/api/abi/schedule_types.h
index d5164ff79..1b2990c2b 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/schedule_types.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/schedule_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/schedule_types.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/shared_memory.h b/include/odp/arch/power64-linux/odp/api/abi/shared_memory.h
index 784170abe..7ba8a2248 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/shared_memory.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/shared_memory.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/shared_memory.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/spinlock.h b/include/odp/arch/power64-linux/odp/api/abi/spinlock.h
index fbfbce5cc..c626baae5 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/spinlock.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/spinlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/spinlock.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/spinlock_recursive.h b/include/odp/arch/power64-linux/odp/api/abi/spinlock_recursive.h
index cc93b6acb..6794590ca 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/spinlock_recursive.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/spinlock_recursive.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/spinlock_recursive.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/stash.h b/include/odp/arch/power64-linux/odp/api/abi/stash.h
index d98413dea..ed2cbbc64 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/stash.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/stash.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Nokia
*/
#include <odp/api/abi-default/stash.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/stash_types.h b/include/odp/arch/power64-linux/odp/api/abi/stash_types.h
index 998f75432..0f2759726 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/stash_types.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/stash_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/stash_types.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/std.h b/include/odp/arch/power64-linux/odp/api/abi/std.h
index a7243c4d4..936009922 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/std.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/std.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/std.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/std_types.h b/include/odp/arch/power64-linux/odp/api/abi/std_types.h
index 594e6f9dd..c0d930e1f 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/std_types.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/std_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/std_types.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/sync.h b/include/odp/arch/power64-linux/odp/api/abi/sync.h
index 37b03bcd9..dbe3a95ab 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/sync.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/sync.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/sync.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/thread.h b/include/odp/arch/power64-linux/odp/api/abi/thread.h
index be44ad8aa..b6a233c96 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/thread.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/thread.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/thread.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/thrmask.h b/include/odp/arch/power64-linux/odp/api/abi/thrmask.h
index ab05cd83f..2bb61d233 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/thrmask.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/thrmask.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/thrmask.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/ticketlock.h b/include/odp/arch/power64-linux/odp/api/abi/ticketlock.h
index 0750f7e72..4317157b8 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/ticketlock.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/ticketlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/ticketlock.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/time.h b/include/odp/arch/power64-linux/odp/api/abi/time.h
index a86a526dc..0f2425669 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/time.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/time.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/time.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/time_types.h b/include/odp/arch/power64-linux/odp/api/abi/time_types.h
index cba80f508..a415200a0 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/time_types.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/time_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
#include <odp/api/abi-default/time_types.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/timer.h b/include/odp/arch/power64-linux/odp/api/abi/timer.h
index 0351468d3..0d7965bf7 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/timer.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/timer.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/timer.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/timer_types.h b/include/odp/arch/power64-linux/odp/api/abi/timer_types.h
index cd384c2bc..51b578aa7 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/timer_types.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/timer_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/timer_types.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/traffic_mngr.h b/include/odp/arch/power64-linux/odp/api/abi/traffic_mngr.h
index 0e6bc7982..9a457c370 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/traffic_mngr.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/traffic_mngr.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/traffic_mngr.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/version.h b/include/odp/arch/power64-linux/odp/api/abi/version.h
index 429d4f3fa..cf4b9a128 100644
--- a/include/odp/arch/power64-linux/odp/api/abi/version.h
+++ b/include/odp/arch/power64-linux/odp/api/abi/version.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/version.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/align.h b/include/odp/arch/x86_32-linux/odp/api/abi/align.h
index 7fa343078..aa8f2eab7 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/align.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/align.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/align.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/atomic.h b/include/odp/arch/x86_32-linux/odp/api/abi/atomic.h
index da89426c7..ab7c3f17b 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/atomic.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/atomic.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/atomic.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/barrier.h b/include/odp/arch/x86_32-linux/odp/api/abi/barrier.h
index 56b64b81d..c3388fd2a 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/barrier.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/barrier.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/barrier.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/buffer.h b/include/odp/arch/x86_32-linux/odp/api/abi/buffer.h
index 217ed4a93..2ffa07d1f 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/buffer.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/buffer.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/buffer.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/buffer_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/buffer_types.h
index 8dd78321f..331e123c7 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/buffer_types.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/buffer_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
#include <odp/api/abi-default/buffer_types.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/byteorder.h b/include/odp/arch/x86_32-linux/odp/api/abi/byteorder.h
index eb383cd33..9c9728840 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/byteorder.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/byteorder.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/byteorder.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/classification.h b/include/odp/arch/x86_32-linux/odp/api/abi/classification.h
index 732eb27e0..789f3a92a 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/classification.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/classification.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/classification.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/comp.h b/include/odp/arch/x86_32-linux/odp/api/abi/comp.h
index a8f6439f4..7b4be9d3e 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/comp.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/comp.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/comp.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/cpu.h b/include/odp/arch/x86_32-linux/odp/api/abi/cpu.h
index d7485c090..575f4a5ec 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/cpu.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/cpu.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
#ifndef ODP_API_ABI_CPU_H_
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/cpumask.h b/include/odp/arch/x86_32-linux/odp/api/abi/cpumask.h
index c64bf2a69..696f8664f 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/cpumask.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/cpumask.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/cpumask.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/crypto.h b/include/odp/arch/x86_32-linux/odp/api/abi/crypto.h
index 386384285..9d39ba7bc 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/crypto.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/crypto.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/crypto.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/crypto_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/crypto_types.h
index ddadec1c1..7e1da759a 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/crypto_types.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/crypto_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/crypto_types.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/debug.h b/include/odp/arch/x86_32-linux/odp/api/abi/debug.h
index 97d028d51..8a2ef2ade 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/debug.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/debug.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/debug.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/dma.h b/include/odp/arch/x86_32-linux/odp/api/abi/dma.h
index f4656c4cf..f5e42a076 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/dma.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/dma.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
#include <odp/api/abi-default/dma.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/dma_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/dma_types.h
index 76ccd895d..cd96b9933 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/dma_types.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/dma_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/dma_types.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/errno.h b/include/odp/arch/x86_32-linux/odp/api/abi/errno.h
index 69de49a0b..9d197a8d4 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/errno.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/errno.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Marvell
*/
#include <odp/api/abi-default/errno.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/event.h b/include/odp/arch/x86_32-linux/odp/api/abi/event.h
index 408433ad8..6f7074bb1 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/event.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/event.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/event.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/event_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/event_types.h
index a8321920c..ece9cbef0 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/event_types.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/event_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/event_types.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/hash.h b/include/odp/arch/x86_32-linux/odp/api/abi/hash.h
index c9fb1976c..72431f765 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/hash.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/hash.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Marvell
*/
#include <odp/api/abi-default/hash.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/init.h b/include/odp/arch/x86_32-linux/odp/api/abi/init.h
index 7ad523fde..936644f46 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/init.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/init.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/init.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/ipsec.h b/include/odp/arch/x86_32-linux/odp/api/abi/ipsec.h
index 13151beeb..33c03cbe2 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/ipsec.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/ipsec.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/ipsec.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/ipsec_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/ipsec_types.h
index 49d854444..854e7aa01 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/ipsec_types.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/ipsec_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/ipsec_types.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/packet.h b/include/odp/arch/x86_32-linux/odp/api/abi/packet.h
index be8809aed..9d560e6c8 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/packet.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/packet.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/packet.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/packet_flags.h b/include/odp/arch/x86_32-linux/odp/api/abi/packet_flags.h
index 2ff0e0016..598047d96 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/packet_flags.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/packet_flags.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/packet_flags.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/packet_io.h b/include/odp/arch/x86_32-linux/odp/api/abi/packet_io.h
index ec02e3a2b..4356eb007 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/packet_io.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/packet_io.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/packet_io.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/packet_io_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/packet_io_types.h
index d4f26338f..3e8962f6a 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/packet_io_types.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/packet_io_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/packet_io_types.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/packet_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/packet_types.h
index c92ffd684..9af00c158 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/packet_types.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/packet_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/packet_types.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/pool.h b/include/odp/arch/x86_32-linux/odp/api/abi/pool.h
index 3b1f21d97..2f2e9164f 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/pool.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/pool.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/pool.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/pool_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/pool_types.h
index 2c5cb121a..a8366b5d2 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/pool_types.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/pool_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/pool_types.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/proto_stats_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/proto_stats_types.h
index 1cb6128b6..f6884a40a 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/proto_stats_types.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/proto_stats_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/proto_stats_types.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/queue.h b/include/odp/arch/x86_32-linux/odp/api/abi/queue.h
index 53f046f80..2ba9174d0 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/queue.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/queue.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/queue.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/queue_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/queue_types.h
index 51837734a..f1a8e197d 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/queue_types.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/queue_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/queue_types.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/random.h b/include/odp/arch/x86_32-linux/odp/api/abi/random.h
index 87aa943b8..703dcf5a0 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/random.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/random.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/random.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/rwlock.h b/include/odp/arch/x86_32-linux/odp/api/abi/rwlock.h
index 96dbc9b83..5f953d6f6 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/rwlock.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/rwlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/rwlock.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/rwlock_recursive.h b/include/odp/arch/x86_32-linux/odp/api/abi/rwlock_recursive.h
index 14c964c9d..f10116aeb 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/rwlock_recursive.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/rwlock_recursive.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/rwlock_recursive.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/schedule.h b/include/odp/arch/x86_32-linux/odp/api/abi/schedule.h
index 748c6aa8a..cd16a1161 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/schedule.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/schedule.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/schedule.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/schedule_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/schedule_types.h
index d5164ff79..1b2990c2b 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/schedule_types.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/schedule_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/schedule_types.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/shared_memory.h b/include/odp/arch/x86_32-linux/odp/api/abi/shared_memory.h
index 784170abe..7ba8a2248 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/shared_memory.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/shared_memory.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/shared_memory.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/spinlock.h b/include/odp/arch/x86_32-linux/odp/api/abi/spinlock.h
index fbfbce5cc..c626baae5 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/spinlock.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/spinlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/spinlock.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/spinlock_recursive.h b/include/odp/arch/x86_32-linux/odp/api/abi/spinlock_recursive.h
index cc93b6acb..6794590ca 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/spinlock_recursive.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/spinlock_recursive.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/spinlock_recursive.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/stash.h b/include/odp/arch/x86_32-linux/odp/api/abi/stash.h
index d98413dea..ed2cbbc64 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/stash.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/stash.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Nokia
*/
#include <odp/api/abi-default/stash.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/stash_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/stash_types.h
index 998f75432..0f2759726 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/stash_types.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/stash_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/stash_types.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/std.h b/include/odp/arch/x86_32-linux/odp/api/abi/std.h
index a7243c4d4..936009922 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/std.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/std.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/std.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/std_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/std_types.h
index 594e6f9dd..c0d930e1f 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/std_types.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/std_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/std_types.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/sync.h b/include/odp/arch/x86_32-linux/odp/api/abi/sync.h
index 37b03bcd9..dbe3a95ab 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/sync.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/sync.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/sync.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/thread.h b/include/odp/arch/x86_32-linux/odp/api/abi/thread.h
index be44ad8aa..b6a233c96 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/thread.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/thread.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/thread.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/thrmask.h b/include/odp/arch/x86_32-linux/odp/api/abi/thrmask.h
index ab05cd83f..2bb61d233 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/thrmask.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/thrmask.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/thrmask.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/ticketlock.h b/include/odp/arch/x86_32-linux/odp/api/abi/ticketlock.h
index 0750f7e72..4317157b8 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/ticketlock.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/ticketlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/ticketlock.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/time.h b/include/odp/arch/x86_32-linux/odp/api/abi/time.h
index a86a526dc..0f2425669 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/time.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/time.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/time.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/time_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/time_types.h
index cba80f508..a415200a0 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/time_types.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/time_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
#include <odp/api/abi-default/time_types.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/timer.h b/include/odp/arch/x86_32-linux/odp/api/abi/timer.h
index 0351468d3..0d7965bf7 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/timer.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/timer.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/timer.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/timer_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/timer_types.h
index cd384c2bc..51b578aa7 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/timer_types.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/timer_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/timer_types.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/traffic_mngr.h b/include/odp/arch/x86_32-linux/odp/api/abi/traffic_mngr.h
index 0e6bc7982..9a457c370 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/traffic_mngr.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/traffic_mngr.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/traffic_mngr.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/version.h b/include/odp/arch/x86_32-linux/odp/api/abi/version.h
index 429d4f3fa..cf4b9a128 100644
--- a/include/odp/arch/x86_32-linux/odp/api/abi/version.h
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/version.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/version.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/align.h b/include/odp/arch/x86_64-linux/odp/api/abi/align.h
index 7fa343078..aa8f2eab7 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/align.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/align.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/align.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/atomic.h b/include/odp/arch/x86_64-linux/odp/api/abi/atomic.h
index da89426c7..ab7c3f17b 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/atomic.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/atomic.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/atomic.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/barrier.h b/include/odp/arch/x86_64-linux/odp/api/abi/barrier.h
index 56b64b81d..c3388fd2a 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/barrier.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/barrier.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/barrier.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/buffer.h b/include/odp/arch/x86_64-linux/odp/api/abi/buffer.h
index 217ed4a93..2ffa07d1f 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/buffer.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/buffer.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/buffer.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/buffer_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/buffer_types.h
index 8dd78321f..331e123c7 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/buffer_types.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/buffer_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
#include <odp/api/abi-default/buffer_types.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/byteorder.h b/include/odp/arch/x86_64-linux/odp/api/abi/byteorder.h
index eb383cd33..9c9728840 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/byteorder.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/byteorder.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/byteorder.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/classification.h b/include/odp/arch/x86_64-linux/odp/api/abi/classification.h
index 732eb27e0..789f3a92a 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/classification.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/classification.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/classification.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/comp.h b/include/odp/arch/x86_64-linux/odp/api/abi/comp.h
index a8f6439f4..7b4be9d3e 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/comp.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/comp.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
*/
#include <odp/api/abi-default/comp.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/cpu.h b/include/odp/arch/x86_64-linux/odp/api/abi/cpu.h
index d7485c090..575f4a5ec 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/cpu.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/cpu.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
#ifndef ODP_API_ABI_CPU_H_
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/cpumask.h b/include/odp/arch/x86_64-linux/odp/api/abi/cpumask.h
index c64bf2a69..696f8664f 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/cpumask.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/cpumask.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/cpumask.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/crypto.h b/include/odp/arch/x86_64-linux/odp/api/abi/crypto.h
index 386384285..9d39ba7bc 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/crypto.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/crypto.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/crypto.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/crypto_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/crypto_types.h
index ddadec1c1..7e1da759a 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/crypto_types.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/crypto_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/crypto_types.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/debug.h b/include/odp/arch/x86_64-linux/odp/api/abi/debug.h
index 97d028d51..8a2ef2ade 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/debug.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/debug.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/debug.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/dma.h b/include/odp/arch/x86_64-linux/odp/api/abi/dma.h
index f4656c4cf..f5e42a076 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/dma.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/dma.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
#include <odp/api/abi-default/dma.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/dma_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/dma_types.h
index 76ccd895d..cd96b9933 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/dma_types.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/dma_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/dma_types.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/errno.h b/include/odp/arch/x86_64-linux/odp/api/abi/errno.h
index 69de49a0b..9d197a8d4 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/errno.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/errno.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Marvell
*/
#include <odp/api/abi-default/errno.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/event.h b/include/odp/arch/x86_64-linux/odp/api/abi/event.h
index 408433ad8..6f7074bb1 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/event.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/event.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/event.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/event_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/event_types.h
index a8321920c..ece9cbef0 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/event_types.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/event_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/event_types.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/hash.h b/include/odp/arch/x86_64-linux/odp/api/abi/hash.h
index c9fb1976c..72431f765 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/hash.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/hash.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Marvell
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Marvell
*/
#include <odp/api/abi-default/hash.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/init.h b/include/odp/arch/x86_64-linux/odp/api/abi/init.h
index 7ad523fde..936644f46 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/init.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/init.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/init.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/ipsec.h b/include/odp/arch/x86_64-linux/odp/api/abi/ipsec.h
index 13151beeb..33c03cbe2 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/ipsec.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/ipsec.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/ipsec.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/ipsec_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/ipsec_types.h
index 49d854444..854e7aa01 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/ipsec_types.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/ipsec_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/ipsec_types.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/packet.h b/include/odp/arch/x86_64-linux/odp/api/abi/packet.h
index be8809aed..9d560e6c8 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/packet.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/packet.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/packet.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/packet_flags.h b/include/odp/arch/x86_64-linux/odp/api/abi/packet_flags.h
index 2ff0e0016..598047d96 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/packet_flags.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/packet_flags.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/packet_flags.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/packet_io.h b/include/odp/arch/x86_64-linux/odp/api/abi/packet_io.h
index ec02e3a2b..4356eb007 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/packet_io.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/packet_io.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/packet_io.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/packet_io_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/packet_io_types.h
index d4f26338f..3e8962f6a 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/packet_io_types.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/packet_io_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/packet_io_types.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/packet_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/packet_types.h
index c92ffd684..9af00c158 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/packet_types.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/packet_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/packet_types.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/pool.h b/include/odp/arch/x86_64-linux/odp/api/abi/pool.h
index 3b1f21d97..2f2e9164f 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/pool.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/pool.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/pool.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/pool_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/pool_types.h
index 2c5cb121a..a8366b5d2 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/pool_types.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/pool_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/pool_types.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/proto_stats_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/proto_stats_types.h
index 1cb6128b6..f6884a40a 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/proto_stats_types.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/proto_stats_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/proto_stats_types.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/queue.h b/include/odp/arch/x86_64-linux/odp/api/abi/queue.h
index 53f046f80..2ba9174d0 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/queue.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/queue.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/queue.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/queue_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/queue_types.h
index 51837734a..f1a8e197d 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/queue_types.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/queue_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2021, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2021 Nokia
*/
#include <odp/api/abi-default/queue_types.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/random.h b/include/odp/arch/x86_64-linux/odp/api/abi/random.h
index 87aa943b8..703dcf5a0 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/random.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/random.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/random.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/rwlock.h b/include/odp/arch/x86_64-linux/odp/api/abi/rwlock.h
index 96dbc9b83..5f953d6f6 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/rwlock.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/rwlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/rwlock.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/rwlock_recursive.h b/include/odp/arch/x86_64-linux/odp/api/abi/rwlock_recursive.h
index 14c964c9d..f10116aeb 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/rwlock_recursive.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/rwlock_recursive.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/rwlock_recursive.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/schedule.h b/include/odp/arch/x86_64-linux/odp/api/abi/schedule.h
index 748c6aa8a..cd16a1161 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/schedule.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/schedule.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/schedule.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/schedule_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/schedule_types.h
index d5164ff79..1b2990c2b 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/schedule_types.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/schedule_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/schedule_types.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/shared_memory.h b/include/odp/arch/x86_64-linux/odp/api/abi/shared_memory.h
index 784170abe..7ba8a2248 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/shared_memory.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/shared_memory.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/shared_memory.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/spinlock.h b/include/odp/arch/x86_64-linux/odp/api/abi/spinlock.h
index fbfbce5cc..c626baae5 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/spinlock.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/spinlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/spinlock.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/spinlock_recursive.h b/include/odp/arch/x86_64-linux/odp/api/abi/spinlock_recursive.h
index cc93b6acb..6794590ca 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/spinlock_recursive.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/spinlock_recursive.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/spinlock_recursive.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/stash.h b/include/odp/arch/x86_64-linux/odp/api/abi/stash.h
index d98413dea..ed2cbbc64 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/stash.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/stash.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2020, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Nokia
*/
#include <odp/api/abi-default/stash.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/stash_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/stash_types.h
index 998f75432..0f2759726 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/stash_types.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/stash_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/stash_types.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/std.h b/include/odp/arch/x86_64-linux/odp/api/abi/std.h
index a7243c4d4..936009922 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/std.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/std.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/std.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/std_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/std_types.h
index 594e6f9dd..c0d930e1f 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/std_types.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/std_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/std_types.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/sync.h b/include/odp/arch/x86_64-linux/odp/api/abi/sync.h
index 37b03bcd9..dbe3a95ab 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/sync.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/sync.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/sync.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/thread.h b/include/odp/arch/x86_64-linux/odp/api/abi/thread.h
index be44ad8aa..b6a233c96 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/thread.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/thread.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/thread.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/thrmask.h b/include/odp/arch/x86_64-linux/odp/api/abi/thrmask.h
index ab05cd83f..2bb61d233 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/thrmask.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/thrmask.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/thrmask.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/ticketlock.h b/include/odp/arch/x86_64-linux/odp/api/abi/ticketlock.h
index 0750f7e72..4317157b8 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/ticketlock.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/ticketlock.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/ticketlock.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/time.h b/include/odp/arch/x86_64-linux/odp/api/abi/time.h
index a86a526dc..0f2425669 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/time.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/time.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/time.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/time_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/time_types.h
index cba80f508..a415200a0 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/time_types.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/time_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2023, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
*/
#include <odp/api/abi-default/time_types.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/timer.h b/include/odp/arch/x86_64-linux/odp/api/abi/timer.h
index 0351468d3..0d7965bf7 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/timer.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/timer.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2022, Nokia
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022 Nokia
*/
#include <odp/api/abi-default/timer.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/timer_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/timer_types.h
index cd384c2bc..51b578aa7 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/timer_types.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/timer_types.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/timer_types.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/traffic_mngr.h b/include/odp/arch/x86_64-linux/odp/api/abi/traffic_mngr.h
index 0e6bc7982..9a457c370 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/traffic_mngr.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/traffic_mngr.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/traffic_mngr.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/version.h b/include/odp/arch/x86_64-linux/odp/api/abi/version.h
index 429d4f3fa..cf4b9a128 100644
--- a/include/odp/arch/x86_64-linux/odp/api/abi/version.h
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/version.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2017-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2017-2018 Linaro Limited
*/
#include <odp/api/abi-default/version.h>
diff --git a/include/odp/visibility_begin.h b/include/odp/visibility_begin.h
index e335dab34..25ac005f5 100644
--- a/include/odp/visibility_begin.h
+++ b/include/odp/visibility_begin.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
/*
diff --git a/include/odp/visibility_end.h b/include/odp/visibility_end.h
index 48942467e..4580ff03e 100644
--- a/include/odp/visibility_end.h
+++ b/include/odp/visibility_end.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2016-2018, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
/*
diff --git a/include/odp_api.h b/include/odp_api.h
index 00d2c243a..e7cad266f 100644
--- a/include/odp_api.h
+++ b/include/odp_api.h
@@ -1,7 +1,5 @@
-/* Copyright (c) 2013-2018, Linaro Limited
- * All rights reserved
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
*/
/**
diff --git a/m4/odp_dpdk.m4 b/m4/odp_dpdk.m4
index 140debfb0..9871cb537 100644
--- a/m4/odp_dpdk.m4
+++ b/m4/odp_dpdk.m4
@@ -234,6 +234,13 @@ if test "x$use_pkg_config" = "xyes"; then
DPDK_LIBS_LT="$DPDK_LIBS_LIBODP"
fi
DPDK_LIBS=$DPDK_LIBS_LIBODP
+
+ # Use PKG_CHECK_MODULES_STATIC to look for rte_net_pcap in Libs.private
+ PKG_CHECK_MODULES_STATIC([DPDK_STATIC], [libdpdk])
+ have_pmd_pcap=no
+ if grep -q "librte_net_pcap" <<< "$DPDK_STATIC_LIBS"; then
+ have_pmd_pcap=yes
+ fi
fi
])
diff --git a/platform/linux-dpdk/Makefile.am b/platform/linux-dpdk/Makefile.am
index ad608c4e1..8598b767a 100644
--- a/platform/linux-dpdk/Makefile.am
+++ b/platform/linux-dpdk/Makefile.am
@@ -310,12 +310,13 @@ noinst_HEADERS += arch/arm/odp_atomic.h \
endif
if ARCH_IS_AARCH64
__LIB__libodp_dpdk_la_SOURCES += arch/aarch64/odp_atomic.c \
- arch/default/odp_cpu_cycles.c \
+ arch/aarch64/odp_cpu_cycles.c \
arch/aarch64/cpu_flags.c \
arch/default/odp_hash_crc32.c \
arch/default/odp_random.c \
arch/aarch64/odp_sysinfo_parse.c
-odpapiabiarchinclude_HEADERS += arch/aarch64/odp/api/abi/hash_crc32.h
+odpapiabiarchinclude_HEADERS += arch/aarch64/odp/api/abi/hash_crc32.h \
+ arch/aarch64/odp/api/abi/time_cpu.h
if !ODP_ABI_COMPAT
odpapiabiarchinclude_HEADERS += arch/default/odp/api/abi/atomic_generic.h \
arch/aarch64/odp/api/abi/atomic_inlines.h \
diff --git a/platform/linux-dpdk/arch/aarch64/odp/api/abi/time_cpu.h b/platform/linux-dpdk/arch/aarch64/odp/api/abi/time_cpu.h
new file mode 120000
index 000000000..f00ac2b3f
--- /dev/null
+++ b/platform/linux-dpdk/arch/aarch64/odp/api/abi/time_cpu.h
@@ -0,0 +1 @@
+../../../../../../linux-generic/arch/aarch64/odp/api/abi/time_cpu.h \ No newline at end of file
diff --git a/platform/linux-dpdk/arch/aarch64/odp_cpu_cycles.c b/platform/linux-dpdk/arch/aarch64/odp_cpu_cycles.c
new file mode 120000
index 000000000..7cf2fef20
--- /dev/null
+++ b/platform/linux-dpdk/arch/aarch64/odp_cpu_cycles.c
@@ -0,0 +1 @@
+../../../linux-generic/arch/aarch64/odp_cpu_cycles.c \ No newline at end of file
diff --git a/platform/linux-dpdk/include/odp/api/plat/packet_inline_types.h b/platform/linux-dpdk/include/odp/api/plat/packet_inline_types.h
index 5466ce58b..5bbcadd32 100644
--- a/platform/linux-dpdk/include/odp/api/plat/packet_inline_types.h
+++ b/platform/linux-dpdk/include/odp/api/plat/packet_inline_types.h
@@ -121,7 +121,7 @@ typedef union {
uint32_t all_flags;
struct {
- uint32_t reserved1: 5;
+ uint32_t reserved1: 4;
/*
* Init flags
@@ -139,7 +139,8 @@ typedef union {
uint32_t l4_chksum_set: 1; /* L4 chksum bit is valid */
uint32_t l4_chksum: 1; /* L4 chksum override */
uint32_t ts_set: 1; /* Set Tx timestamp */
- uint32_t tx_compl: 1; /* Tx completion event requested */
+ uint32_t tx_compl_ev: 1; /* Tx completion event requested */
+ uint32_t tx_compl_poll: 1; /* Tx completion poll requested */
uint32_t free_ctrl: 1; /* Don't free option */
uint32_t tx_aging: 1; /* Packet aging at Tx requested */
uint32_t shaper_len_adj: 8; /* Adjustment for traffic mgr */
@@ -158,8 +159,8 @@ typedef union {
/* Flag groups */
struct {
- uint32_t reserved2: 5;
- uint32_t other: 20; /* All other flags */
+ uint32_t reserved2: 4;
+ uint32_t other: 21; /* All other flags */
uint32_t error: 7; /* All error flags */
} all;
diff --git a/platform/linux-dpdk/include/odp_config_internal.h b/platform/linux-dpdk/include/odp_config_internal.h
index e104b9d24..0c9d6def7 100644
--- a/platform/linux-dpdk/include/odp_config_internal.h
+++ b/platform/linux-dpdk/include/odp_config_internal.h
@@ -133,10 +133,11 @@ extern "C" {
/*
* Number of shared memory blocks reserved for implementation internal use.
*
- * Each packet pool requires one SHM block and 20 blocks are reserved for
- * ODP module global data.
+ * Each packet pool requires one SHM block, 20 blocks are reserved for ODP
+ * module global data, and one block per packet I/O is reserved for TX
+ * completion usage.
*/
-#define CONFIG_INTERNAL_SHM_BLOCKS (ODP_CONFIG_POOLS + 20)
+#define CONFIG_INTERNAL_SHM_BLOCKS (ODP_CONFIG_POOLS + 20 + ODP_CONFIG_PKTIO_ENTRIES)
/*
* Maximum number of shared memory blocks.
diff --git a/platform/linux-dpdk/include/odp_packet_internal.h b/platform/linux-dpdk/include/odp_packet_internal.h
index b4d1f5d44..c86f0646a 100644
--- a/platform/linux-dpdk/include/odp_packet_internal.h
+++ b/platform/linux-dpdk/include/odp_packet_internal.h
@@ -161,6 +161,9 @@ typedef struct ODP_ALIGNED_CACHE odp_packet_hdr_t {
* request + requested drop timeout). */
uint64_t tx_aging_ns;
+ /* Tx completion poll completion identifier */
+ uint32_t tx_compl_id;
+
/* LSO profile index */
uint8_t lso_profile_idx;
diff --git a/platform/linux-dpdk/include/odp_packet_io_internal.h b/platform/linux-dpdk/include/odp_packet_io_internal.h
index ac22cff99..ece33b538 100644
--- a/platform/linux-dpdk/include/odp_packet_io_internal.h
+++ b/platform/linux-dpdk/include/odp_packet_io_internal.h
@@ -126,6 +126,10 @@ typedef struct ODP_ALIGNED_CACHE {
/* Pool for Tx completion events */
odp_pool_t tx_compl_pool;
+ /* Status map SHM handle */
+ odp_shm_t tx_compl_status_shm;
+ /* Status map for Tx completion identifiers */
+ odp_atomic_u32_t *tx_compl_status;
/* Storage for queue handles
* Multi-queue support is pktio driver specific */
@@ -313,8 +317,8 @@ int _odp_lso_create_packets(odp_packet_t packet, const odp_packet_lso_opt_t *lso
uint32_t payload_len, uint32_t left_over_len,
odp_packet_t pkt_out[], int num_pkt);
-void _odp_pktio_allocate_and_send_tx_compl_events(const pktio_entry_t *entry,
- const odp_packet_t packets[], int num);
+void _odp_pktio_process_tx_compl(const pktio_entry_t *entry, const odp_packet_t packets[],
+ int num);
static inline int _odp_pktio_packet_to_pool(odp_packet_t *pkt,
odp_packet_hdr_t **pkt_hdr,
diff --git a/platform/linux-dpdk/m4/configure.m4 b/platform/linux-dpdk/m4/configure.m4
index 70295400f..a7c58eb91 100644
--- a/platform/linux-dpdk/m4/configure.m4
+++ b/platform/linux-dpdk/m4/configure.m4
@@ -39,7 +39,7 @@ AC_ARG_ENABLE([dpdk-shared],
# Check for DPDK availability
#
# DPDK pmd drivers are not linked unless the --whole-archive option is
-# used. No spaces are allowed between the --whole-arhive flags.
+# used. No spaces are allowed between the --whole-archive flags.
##########################################################################
ODP_DPDK([$DPDK_PATH], [$dpdk_shared], [],
[AC_MSG_FAILURE([can't find DPDK])])
@@ -104,5 +104,7 @@ AC_CONFIG_FILES([platform/linux-dpdk/Makefile
platform/linux-dpdk/test/example/ping/Makefile
platform/linux-dpdk/test/example/simple_pipeline/Makefile
platform/linux-dpdk/test/example/switch/Makefile
+ platform/linux-dpdk/test/performance/Makefile
+ platform/linux-dpdk/test/performance/dmafwd/Makefile
platform/linux-dpdk/test/validation/api/pktio/Makefile])
])
diff --git a/platform/linux-dpdk/odp_crypto.c b/platform/linux-dpdk/odp_crypto.c
index 59854c11f..aeb9c11e3 100644
--- a/platform/linux-dpdk/odp_crypto.c
+++ b/platform/linux-dpdk/odp_crypto.c
@@ -1936,6 +1936,10 @@ static void op_prepare(crypto_op_t *ops[],
op->state.status = S_NOP;
continue;
}
+ if (odp_unlikely(session->p.null_crypto_enable && param->null_crypto)) {
+ op->state.status = S_NOP;
+ continue;
+ }
if (odp_unlikely(linearize_pkt(session, op->state.pkt))) {
op->state.status = S_ERROR_LIN;
diff --git a/platform/linux-dpdk/odp_init.c b/platform/linux-dpdk/odp_init.c
index 7e6aaab55..4d6f395c5 100644
--- a/platform/linux-dpdk/odp_init.c
+++ b/platform/linux-dpdk/odp_init.c
@@ -34,8 +34,8 @@ enum init_stage {
NO_INIT = 0, /* No init stages completed */
LIBCONFIG_INIT,
CPUMASK_INIT,
- CPU_CYCLES_INIT,
SYSINFO_INIT,
+ CPU_CYCLES_INIT,
TIME_INIT,
ISHM_INIT,
FDSERVER_INIT,
@@ -480,6 +480,7 @@ static int term_global(enum init_stage stage)
}
/* Fall through */
+ case CPU_CYCLES_INIT:
case SYSINFO_INIT:
if (_odp_system_info_term()) {
_ODP_ERR("ODP system info term failed.\n");
@@ -487,8 +488,6 @@ static int term_global(enum init_stage stage)
}
/* Fall through */
- case CPU_CYCLES_INIT:
- /* Fall through */
case CPUMASK_INIT:
if (_odp_cpumask_term_global()) {
_ODP_ERR("ODP cpumask term failed.\n");
@@ -547,12 +546,6 @@ int odp_init_global(odp_instance_t *instance,
}
stage = CPUMASK_INIT;
- if (_odp_cpu_cycles_init_global()) {
- _ODP_ERR("ODP cpu cycle init failed.\n");
- goto init_failed;
- }
- stage = CPU_CYCLES_INIT;
-
if (_odp_init_dpdk((const char *)platform_params)) {
_ODP_ERR("ODP dpdk init failed.\n");
return -1;
@@ -564,6 +557,12 @@ int odp_init_global(odp_instance_t *instance,
}
stage = SYSINFO_INIT;
+ if (_odp_cpu_cycles_init_global()) {
+ _ODP_ERR("ODP cpu cycle init failed.\n");
+ goto init_failed;
+ }
+ stage = CPU_CYCLES_INIT;
+
if (_odp_time_init_global()) {
_ODP_ERR("ODP time init failed.\n");
goto init_failed;
diff --git a/platform/linux-dpdk/odp_packet.c b/platform/linux-dpdk/odp_packet.c
index 95149118e..a61c4c34a 100644
--- a/platform/linux-dpdk/odp_packet.c
+++ b/platform/linux-dpdk/odp_packet.c
@@ -1766,8 +1766,26 @@ int odp_packet_tx_compl_request(odp_packet_t pkt, const odp_packet_tx_compl_opt_
{
odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt);
- pkt_hdr->p.flags.tx_compl = opt->mode == ODP_PACKET_TX_COMPL_EVENT ? 1 : 0;
- pkt_hdr->dst_queue = opt->queue;
+ switch (opt->mode) {
+ case ODP_PACKET_TX_COMPL_DISABLED:
+ pkt_hdr->p.flags.tx_compl_ev = 0;
+ pkt_hdr->p.flags.tx_compl_poll = 0;
+ break;
+ case ODP_PACKET_TX_COMPL_EVENT:
+ _ODP_ASSERT(opt->queue != ODP_QUEUE_INVALID);
+ pkt_hdr->p.flags.tx_compl_ev = 1;
+ pkt_hdr->p.flags.tx_compl_poll = 0;
+ pkt_hdr->dst_queue = opt->queue;
+ break;
+ case ODP_PACKET_TX_COMPL_POLL:
+ pkt_hdr->p.flags.tx_compl_ev = 0;
+ pkt_hdr->p.flags.tx_compl_poll = 1;
+ pkt_hdr->tx_compl_id = opt->compl_id;
+ break;
+ default:
+ _ODP_ERR("Bad TX completion mode: %i\n", opt->mode);
+ return -1;
+ }
return 0;
}
@@ -1776,7 +1794,7 @@ int odp_packet_has_tx_compl_request(odp_packet_t pkt)
{
odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt);
- return pkt_hdr->p.flags.tx_compl;
+ return pkt_hdr->p.flags.tx_compl_ev || pkt_hdr->p.flags.tx_compl_poll;
}
void odp_packet_tx_compl_free(odp_packet_tx_compl_t tx_compl)
@@ -1803,10 +1821,7 @@ void *odp_packet_tx_compl_user_ptr(odp_packet_tx_compl_t tx_compl)
int odp_packet_tx_compl_done(odp_pktio_t pktio, uint32_t compl_id)
{
- (void)pktio;
- (void)compl_id;
-
- return -1;
+ return odp_atomic_load_acq_u32(&get_pktio_entry(pktio)->tx_compl_status[compl_id]);
}
void odp_packet_free_ctrl_set(odp_packet_t pkt, odp_packet_free_ctrl_t ctrl)
diff --git a/platform/linux-dpdk/odp_pool.c b/platform/linux-dpdk/odp_pool.c
index fd27cd79e..6d284ddf9 100644
--- a/platform/linux-dpdk/odp_pool.c
+++ b/platform/linux-dpdk/odp_pool.c
@@ -1085,8 +1085,21 @@ int odp_pool_ext_capability(odp_pool_type_t type,
{
odp_pool_stats_opt_t supported_stats;
- if (type != ODP_POOL_PACKET)
+ _ODP_ASSERT(capa != NULL);
+
+ switch (type) {
+ case ODP_POOL_PACKET:
+ break;
+ case ODP_POOL_BUFFER:
+ case ODP_POOL_TIMEOUT:
+ case ODP_POOL_VECTOR:
+ case ODP_POOL_DMA_COMPL:
+ memset(capa, 0, sizeof(odp_pool_ext_capability_t));
+ return 0;
+ default:
+ _ODP_ERR("Invalid pool type: %d\n", type);
return -1;
+ }
supported_stats.all = 0;
diff --git a/platform/linux-dpdk/odp_queue_basic.c b/platform/linux-dpdk/odp_queue_basic.c
index ebe86ef1b..4b9dee891 100644
--- a/platform/linux-dpdk/odp_queue_basic.c
+++ b/platform/linux-dpdk/odp_queue_basic.c
@@ -349,6 +349,29 @@ static odp_queue_t queue_create(const char *name,
return handle;
}
+static int queue_create_multi(const char *name[], const odp_queue_param_t param[],
+ odp_bool_t share_param, odp_queue_t queue[], int num)
+{
+ int i;
+
+ _ODP_ASSERT(param != NULL);
+ _ODP_ASSERT(queue != NULL);
+ _ODP_ASSERT(num > 0);
+
+ for (i = 0; i < num; i++) {
+ odp_queue_t cur_queue;
+ const char *cur_name = name != NULL ? name[i] : NULL;
+ const odp_queue_param_t *cur_param = share_param ? &param[0] : &param[i];
+
+ cur_queue = queue_create(cur_name, cur_param);
+ if (cur_queue == ODP_QUEUE_INVALID)
+ return (i == 0) ? -1 : i;
+
+ queue[i] = cur_queue;
+ }
+ return i;
+}
+
void _odp_sched_queue_set_status(uint32_t queue_index, int status)
{
queue_entry_t *queue = qentry_from_index(queue_index);
@@ -425,6 +448,23 @@ static int queue_destroy(odp_queue_t handle)
return 0;
}
+static int queue_destroy_multi(odp_queue_t handle[], int num)
+{
+ int i;
+
+ _ODP_ASSERT(handle != NULL);
+ _ODP_ASSERT(num > 0);
+
+ for (i = 0; i < num; i++) {
+ int ret = queue_destroy(handle[i]);
+
+ if (ret)
+ return (i == 0) ? ret : i;
+ }
+
+ return i;
+}
+
static int queue_context_set(odp_queue_t handle, void *context,
uint32_t len ODP_UNUSED)
{
@@ -1177,7 +1217,9 @@ static odp_event_t queue_api_deq(odp_queue_t handle)
/* API functions */
_odp_queue_api_fn_t _odp_queue_basic_api = {
.queue_create = queue_create,
+ .queue_create_multi = queue_create_multi,
.queue_destroy = queue_destroy,
+ .queue_destroy_multi = queue_destroy_multi,
.queue_lookup = queue_lookup,
.queue_capability = queue_capability,
.queue_context_set = queue_context_set,
diff --git a/platform/linux-dpdk/odp_queue_if.c b/platform/linux-dpdk/odp_queue_if.c
index 04ac1fd60..efe3eb155 100644
--- a/platform/linux-dpdk/odp_queue_if.c
+++ b/platform/linux-dpdk/odp_queue_if.c
@@ -1,4 +1,5 @@
/* Copyright (c) 2018, Linaro Limited
+ * Copyright (c) 2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -36,11 +37,23 @@ odp_queue_t odp_queue_create(const char *name, const odp_queue_param_t *param)
return _odp_queue_api->queue_create(name, param);
}
+int odp_queue_create_multi(const char *name[], const odp_queue_param_t param[],
+ odp_bool_t share_param, odp_queue_t queue[], int num)
+{
+ return _odp_queue_api->queue_create_multi(name, param, share_param,
+ queue, num);
+}
+
int odp_queue_destroy(odp_queue_t queue)
{
return _odp_queue_api->queue_destroy(queue);
}
+int odp_queue_destroy_multi(odp_queue_t queue[], int num)
+{
+ return _odp_queue_api->queue_destroy_multi(queue, num);
+}
+
odp_queue_t odp_queue_lookup(const char *name)
{
return _odp_queue_api->queue_lookup(name);
diff --git a/platform/linux-dpdk/odp_shared_memory.c b/platform/linux-dpdk/odp_shared_memory.c
index 871a22ed7..398771708 100644
--- a/platform/linux-dpdk/odp_shared_memory.c
+++ b/platform/linux-dpdk/odp_shared_memory.c
@@ -19,6 +19,7 @@
#include <odp_macros_internal.h>
#include <odp_shm_internal.h>
+#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/syscall.h>
@@ -550,6 +551,10 @@ void odp_shm_print_all(void)
}
odp_spinlock_unlock(&shm_tbl->lock);
+
+ _ODP_PRINT("\nDPDK memzones\n-------------\n");
+ rte_memzone_dump(stdout);
+ _ODP_PRINT("\n");
}
void odp_shm_print(odp_shm_t shm)
diff --git a/platform/linux-dpdk/odp_timer.c b/platform/linux-dpdk/odp_timer.c
index 4056018ae..aa841ae0f 100644
--- a/platform/linux-dpdk/odp_timer.c
+++ b/platform/linux-dpdk/odp_timer.c
@@ -36,6 +36,7 @@
#include <rte_timer.h>
#include <inttypes.h>
+#include <stdio.h>
#include <string.h>
/* One divided by one nanosecond in Hz */
@@ -1335,11 +1336,40 @@ odp_timeout_t odp_timeout_alloc(odp_pool_t pool_hdl)
return odp_timeout_from_event(event);
}
+int odp_timeout_alloc_multi(odp_pool_t pool_hdl, odp_timeout_t tmo[], int num)
+{
+ pool_t *pool;
+ int ret;
+
+ _ODP_ASSERT(pool_hdl != ODP_POOL_INVALID);
+ _ODP_ASSERT(tmo != NULL);
+ _ODP_ASSERT(num > 0);
+
+ pool = _odp_pool_entry(pool_hdl);
+
+ _ODP_ASSERT(pool->type == ODP_POOL_TIMEOUT);
+
+ ret = _odp_event_alloc_multi(pool, (_odp_event_hdr_t **)tmo, num);
+
+ for (int i = 0; i < ret; i++)
+ timeout_to_hdr(tmo[i])->timer = ODP_TIMER_INVALID;
+
+ return ret;
+}
+
void odp_timeout_free(odp_timeout_t tmo)
{
_odp_event_free(odp_timeout_to_event(tmo));
}
+void odp_timeout_free_multi(odp_timeout_t tmo[], int num)
+{
+ _ODP_ASSERT(tmo != NULL);
+ _ODP_ASSERT(num > 0);
+
+ _odp_event_free_multi((_odp_event_hdr_t **)(uintptr_t)tmo, num);
+}
+
void odp_timer_pool_print(odp_timer_pool_t timer_pool)
{
timer_pool_t *tp;
@@ -1368,6 +1398,13 @@ void odp_timer_pool_print(odp_timer_pool_t timer_pool)
str[len] = 0;
_ODP_PRINT("%s\n", str);
+
+ _ODP_PRINT("DPDK timer statistics\n---------------------\n");
+ if (timer_global->use_alternate)
+ rte_timer_alt_dump_stats(timer_global->data_id, stdout);
+ else
+ rte_timer_dump_stats(stdout);
+ _ODP_PRINT("\n");
}
void odp_timer_print(odp_timer_t timer_hdl)
diff --git a/platform/linux-dpdk/test/Makefile.am b/platform/linux-dpdk/test/Makefile.am
index 5758a2af7..c210edbdc 100644
--- a/platform/linux-dpdk/test/Makefile.am
+++ b/platform/linux-dpdk/test/Makefile.am
@@ -16,11 +16,13 @@ TESTS += validation/api/pktio/pktio_run.sh
test_SCRIPTS = $(dist_check_SCRIPTS)
SUBDIRS += validation/api/pktio \
- example
+ example \
+ performance
else
#performance tests refer to pktio_env
if test_perf
-SUBDIRS += validation/api/pktio
+SUBDIRS += validation/api/pktio \
+ performance
endif
endif
diff --git a/platform/linux-dpdk/test/alternate-timer.conf b/platform/linux-dpdk/test/default-timer.conf
index 9cc3a0fc2..d7930cf8d 100644
--- a/platform/linux-dpdk/test/alternate-timer.conf
+++ b/platform/linux-dpdk/test/default-timer.conf
@@ -3,6 +3,6 @@ odp_implementation = "linux-dpdk"
config_file_version = "0.1.24"
timer: {
- # Enable alternate DPDK timer implementation
- alternate = 1
+ # Use DPDK default timer API based implementation
+ alternate = 0
}
diff --git a/platform/linux-dpdk/test/performance/Makefile.am b/platform/linux-dpdk/test/performance/Makefile.am
new file mode 100644
index 000000000..4070f09f2
--- /dev/null
+++ b/platform/linux-dpdk/test/performance/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = dmafwd
diff --git a/platform/linux-dpdk/test/performance/dmafwd/Makefile.am b/platform/linux-dpdk/test/performance/dmafwd/Makefile.am
new file mode 100644
index 000000000..91d42cc74
--- /dev/null
+++ b/platform/linux-dpdk/test/performance/dmafwd/Makefile.am
@@ -0,0 +1,18 @@
+EXTRA_DIST = pktio_env
+
+all-local:
+ if [ "x$(srcdir)" != "x$(builddir)" ]; then \
+ for f in $(EXTRA_DIST); do \
+ if [ -e $(srcdir)/$$f ]; then \
+ mkdir -p $(builddir)/$$(dirname $$f); \
+ cp -f $(srcdir)/$$f $(builddir)/$$f; \
+ fi \
+ done \
+ fi
+
+clean-local:
+ if [ "x$(srcdir)" != "x$(builddir)" ]; then \
+ for f in $(EXTRA_DIST); do \
+ rm -f $(builddir)/$$f; \
+ done \
+ fi
diff --git a/platform/linux-dpdk/test/performance/dmafwd/pktio_env b/platform/linux-dpdk/test/performance/dmafwd/pktio_env
new file mode 100644
index 000000000..7135ca17d
--- /dev/null
+++ b/platform/linux-dpdk/test/performance/dmafwd/pktio_env
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2023 Nokia
+
+PCAP_IN=`find . ${TEST_DIR} $(dirname $0) -name udp64.pcap -print -quit`
+PCAP_OUT=dmafwd_out.pcap
+IF0=0
+DUMP=tcpdump
+
+export ODP_PLATFORM_PARAMS="--no-pci --vdev net_pcap0,rx_pcap=${PCAP_IN},tx_pcap=${PCAP_OUT}"
+
+if [ "$0" = "$BASH_SOURCE" ]; then
+ echo "ERROR: Platform specific env file has to be sourced."
+fi
+
+validate_result()
+{
+ local RET=0
+
+ if command -v ${DUMP}; then
+ local VALIN=valin
+ local VALOUT=valout
+
+ ${DUMP} -r ${PCAP_IN} -t -x > ${VALIN}
+ ${DUMP} -r ${PCAP_OUT} -t -x > ${VALOUT}
+ diff ${VALIN} ${VALOUT}
+ RET=$?
+ rm -f ${VALIN}
+ rm -f ${VALOUT}
+ else
+ echo "WARNING: No ${DUMP} available, using \"stat\" for diff"
+ local SZIN=$(stat -c %s ${PCAP_IN})
+ local SZOUT=$(stat -c %s ${PCAP_OUT})
+
+ if [ ${SZIN} -ne ${SZOUT} ]; then
+ RET=1
+ fi
+ fi
+
+ rm -f ${PCAP_OUT}
+
+ if [ $RET -ne 0 ]; then
+ echo "ERROR: Input and output captures do not match, exiting"
+ exit 1
+ fi
+
+ return 0
+}
+
+setup_interfaces()
+{
+ return 0
+}
+
+cleanup_interfaces()
+{
+ return 0
+}
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index 7afdbf620..92d87b441 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -353,7 +353,7 @@ noinst_HEADERS += arch/arm/odp_atomic.h \
endif
if ARCH_IS_AARCH64
__LIB__libodp_linux_la_SOURCES += arch/aarch64/odp_atomic.c \
- arch/default/odp_cpu_cycles.c \
+ arch/aarch64/odp_cpu_cycles.c \
arch/aarch64/cpu_flags.c \
arch/default/odp_hash_crc32.c \
arch/default/odp_random.c \
diff --git a/platform/linux-generic/arch/aarch64/cpu_flags.c b/platform/linux-generic/arch/aarch64/cpu_flags.c
index 9c2e9fa45..9923e9306 100644
--- a/platform/linux-generic/arch/aarch64/cpu_flags.c
+++ b/platform/linux-generic/arch/aarch64/cpu_flags.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2018, Linaro Limited
- * Copyright (c) 2020-2022, Nokia
+ * Copyright (c) 2020-2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -18,297 +18,270 @@
#include <sys/auxv.h>
typedef struct {
- const char *feat_flag;
- const unsigned int hwcap_field;
- bool valid;
+ const char *name;
+ const uint64_t bit_mask;
} hwcap_feat_flag_t;
+/* Linux HWCAP and HWCAP2 flags
+ *
+ * See https://docs.kernel.org/arch/arm64/elf_hwcaps.html for meaning of each flag.
+ */
static hwcap_feat_flag_t hwcap_flags[] = {
{
- /* Floating-point Extensions */
- .feat_flag = "FEAT_FP",
+ /* Floating-point support for single-precision and double-precision types */
+ .name = "FEAT_FP",
#ifdef HWCAP_FP
- .hwcap_field = HWCAP_FP,
- .valid = 1,
+ .bit_mask = HWCAP_FP,
#endif
},
{
- /* Floating-point Extensions */
- .feat_flag = "FEAT_FP",
+ /* Advanced SIMD support for:
+ * - integer byte, halfword, word and doubleword element operations
+ * - single-precision and double-precision floating-point arithmetic */
+ .name = "ASIMD",
#ifdef HWCAP_ASIMD
- .hwcap_field = HWCAP_ASIMD,
- .valid = 1,
+ .bit_mask = HWCAP_ASIMD,
#endif
},
{
/* Generic Timer is configured to generate events at approx. 10KHz */
- .feat_flag = "HWCAP_EVTSTRM",
+ .name = "EVTSTRM",
#ifdef HWCAP_EVTSTRM
- .hwcap_field = HWCAP_EVTSTRM,
- .valid = 1,
+ .bit_mask = HWCAP_EVTSTRM,
#endif
},
{
/* Advanced SIMD AES Instructions */
- .feat_flag = "FEAT_AES",
+ .name = "FEAT_AES",
#ifdef HWCAP_AES
- .hwcap_field = HWCAP_AES,
- .valid = 1,
+ .bit_mask = HWCAP_AES,
#endif
},
{
/* Advanced SIMD PMULL Instructions */
- .feat_flag = "FEAT_PMULL",
+ .name = "FEAT_PMULL",
#ifdef HWCAP_PMULL
- .hwcap_field = HWCAP_PMULL,
- .valid = 1,
+ .bit_mask = HWCAP_PMULL,
#endif
},
{
/* Advanced SIMD SHA1 Instructions */
- .feat_flag = "FEAT_SHA1",
+ .name = "FEAT_SHA1",
#ifdef HWCAP_SHA1
- .hwcap_field = HWCAP_SHA1,
- .valid = 1,
+ .bit_mask = HWCAP_SHA1,
#endif
},
{
/* Advanced SIMD SHA256 Instructions */
- .feat_flag = "FEAT_SHA256",
+ .name = "FEAT_SHA256",
#ifdef HWCAP_SHA2
- .hwcap_field = HWCAP_SHA2,
- .valid = 1,
+ .bit_mask = HWCAP_SHA2,
#endif
},
{
/* CRC32 Instructions */
- .feat_flag = "FEAT_CRC32",
+ .name = "FEAT_CRC32",
#ifdef HWCAP_CRC32
- .hwcap_field = HWCAP_CRC32,
- .valid = 1,
+ .bit_mask = HWCAP_CRC32,
#endif
},
{
/* Large System Extensions */
- .feat_flag = "FEAT_LSE",
+ .name = "FEAT_LSE",
#ifdef HWCAP_ATOMICS
- .hwcap_field = HWCAP_ATOMICS,
- .valid = 1,
+ .bit_mask = HWCAP_ATOMICS,
#endif
},
{
/* Half-precision Floating-point Data Processing Instructions */
- .feat_flag = "FEAT_FP16",
+ .name = "FEAT_FP16",
#ifdef HWCAP_FPHP
- .hwcap_field = HWCAP_FPHP,
- .valid = 1,
+ .bit_mask = HWCAP_FPHP,
#endif
},
{
- /* Half-precision Floating-point Data Processing Instructions */
- .feat_flag = "FEAT_FP16",
+ /* Advanced SIMD support with half-precision floating-point arithmetic */
+ .name = "ASIMDHP",
#ifdef HWCAP_ASIMDHP
- .hwcap_field = HWCAP_ASIMDHP,
- .valid = 1,
+ .bit_mask = HWCAP_ASIMDHP,
#endif
},
{
/* Availability of EL0 Access to certain ID Registers */
- .feat_flag = "HWCAP_CPUID",
+ .name = "CPUID",
#ifdef HWCAP_CPUID
- .hwcap_field = HWCAP_CPUID,
- .valid = 1,
+ .bit_mask = HWCAP_CPUID,
#endif
},
{
/* Rounding Double Multiply Accumulate Extensions */
- .feat_flag = "FEAT_RDM",
+ .name = "FEAT_RDM",
#ifdef HWCAP_ASIMDRDM
- .hwcap_field = HWCAP_ASIMDRDM,
- .valid = 1,
+ .bit_mask = HWCAP_ASIMDRDM,
#endif
},
{
/* JavaScript FJCVTS Conversion Instructions */
- .feat_flag = "FEAT_JSCVT",
+ .name = "FEAT_JSCVT",
#ifdef HWCAP_JSCVT
- .hwcap_field = HWCAP_JSCVT,
- .valid = 1,
+ .bit_mask = HWCAP_JSCVT,
#endif
},
{
/* Floating-point FCMLA and FCADD Instructions */
- .feat_flag = "FEAT_FCMA",
+ .name = "FEAT_FCMA",
#ifdef HWCAP_FCMA
- .hwcap_field = HWCAP_FCMA,
- .valid = 1,
+ .bit_mask = HWCAP_FCMA,
#endif
},
{
/* Load-acquire RCpc Instructions */
- .feat_flag = "FEAT_LRCPC",
+ .name = "FEAT_LRCPC",
#ifdef HWCAP_LRCPC
- .hwcap_field = HWCAP_LRCPC,
- .valid = 1,
+ .bit_mask = HWCAP_LRCPC,
#endif
},
{
/* DC CVAP Instructions */
- .feat_flag = "FEAT_DPB",
+ .name = "FEAT_DPB",
#ifdef HWCAP_DCPOP
- .hwcap_field = HWCAP_DCPOP,
- .valid = 1,
+ .bit_mask = HWCAP_DCPOP,
#endif
},
{
/* Advanced SIMD EOR3, RAX1, XAR, and BCAX Instructions */
- .feat_flag = "FEAT_SHA3",
+ .name = "FEAT_SHA3",
#ifdef HWCAP_SHA3
- .hwcap_field = HWCAP_SHA3,
- .valid = 1,
+ .bit_mask = HWCAP_SHA3,
#endif
},
{
/* Advanced SIMD SM3 Instructions */
- .feat_flag = "FEAT_SM3",
+ .name = "FEAT_SM3",
#ifdef HWCAP_SM3
- .hwcap_field = HWCAP_SM3,
- .valid = 1,
+ .bit_mask = HWCAP_SM3,
#endif
},
{
/* Advanced SIMD SM4 Instructions */
- .feat_flag = "FEAT_SM4",
+ .name = "FEAT_SM4",
#ifdef HWCAP_SM4
- .hwcap_field = HWCAP_SM4,
- .valid = 1,
+ .bit_mask = HWCAP_SM4,
#endif
},
{
/* Advanced SIMD Int8 Dot Product Instructions */
- .feat_flag = "FEAT_DotProd",
+ .name = "FEAT_DotProd",
#ifdef HWCAP_ASIMDDP
- .hwcap_field = HWCAP_ASIMDDP,
- .valid = 1,
+ .bit_mask = HWCAP_ASIMDDP,
#endif
},
{
/* Advanced SIMD SHA512 Instructions */
- .feat_flag = "FEAT_SHA512",
+ .name = "FEAT_SHA512",
#ifdef HWCAP_SHA512
- .hwcap_field = HWCAP_SHA512,
- .valid = 1,
+ .bit_mask = HWCAP_SHA512,
#endif
},
{
/* Scalable Vector Extensions */
- .feat_flag = "FEAT_SVE",
+ .name = "FEAT_SVE",
#ifdef HWCAP_SVE
- .hwcap_field = HWCAP_SVE,
- .valid = 1,
+ .bit_mask = HWCAP_SVE,
#endif
},
{
/* Half-precision Floating-point FMLAL Instructions */
- .feat_flag = "FEAT_FHM",
+ .name = "FEAT_FHM",
#ifdef HWCAP_ASIMDFHM
- .hwcap_field = HWCAP_ASIMDFHM,
- .valid = 1,
+ .bit_mask = HWCAP_ASIMDFHM,
#endif
},
{
/* Data Independent Timing Instructions */
- .feat_flag = "FEAT_DIT",
+ .name = "FEAT_DIT",
#ifdef HWCAP_DIT
- .hwcap_field = HWCAP_DIT,
- .valid = 1,
+ .bit_mask = HWCAP_DIT,
#endif
},
{
/* Large System Extensions Version 2 */
- .feat_flag = "FEAT_LSE2",
+ .name = "FEAT_LSE2",
#ifdef HWCAP_USCAT
- .hwcap_field = HWCAP_USCAT,
- .valid = 1,
+ .bit_mask = HWCAP_USCAT,
#endif
},
{
/* Load-acquire RCpc Instructions Version 2 */
- .feat_flag = "FEAT_LRCPC2",
+ .name = "FEAT_LRCPC2",
#ifdef HWCAP_ILRCPC
- .hwcap_field = HWCAP_ILRCPC,
- .valid = 1,
+ .bit_mask = HWCAP_ILRCPC,
#endif
},
{
/* Condition Flag Manipulation Extensions */
- .feat_flag = "FEAT_FlagM",
+ .name = "FEAT_FlagM",
#ifdef HWCAP_FLAGM
- .hwcap_field = HWCAP_FLAGM,
- .valid = 1,
+ .bit_mask = HWCAP_FLAGM,
#endif
},
{
/* Speculative Store Bypass Safe Instructions */
- .feat_flag = "FEAT_SSBS2",
+ .name = "FEAT_SSBS2",
#ifdef HWCAP_SSBS
- .hwcap_field = HWCAP_SSBS,
- .valid = 1,
+ .bit_mask = HWCAP_SSBS,
#endif
},
{
/* Speculation Barrier Instructions */
- .feat_flag = "FEAT_SB",
+ .name = "FEAT_SB",
#ifdef HWCAP_SB
- .hwcap_field = HWCAP_SB,
- .valid = 1,
+ .bit_mask = HWCAP_SB,
#endif
},
{
/* Pointer Authentication Extensions */
- .feat_flag = "FEAT_PAuth",
+ .name = "FEAT_PAuth",
#ifdef HWCAP_PACA
- .hwcap_field = HWCAP_PACA,
- .valid = 1,
+ .bit_mask = HWCAP_PACA,
#endif
},
{
/* Generic Authentication Extensions */
- .feat_flag = "HWCAP_PACG",
+ .name = "PACG",
#ifdef HWCAP_PACG
- .hwcap_field = HWCAP_PACG,
- .valid = 1,
+ .bit_mask = HWCAP_PACG,
#endif
}
};
@@ -316,174 +289,330 @@ static hwcap_feat_flag_t hwcap_flags[] = {
static hwcap_feat_flag_t hwcap2_flags[] = {
{
/* DC CVADP instructions */
- .feat_flag = "FEAT_DPB2",
+ .name = "FEAT_DPB2",
#ifdef HWCAP2_DCPODP
- .hwcap_field = HWCAP2_DCPODP,
- .valid = 1,
+ .bit_mask = HWCAP2_DCPODP,
#endif
},
{
/* Scalable Vector Extensions Version 2 */
- .feat_flag = "FEAT_SVE2",
+ .name = "FEAT_SVE2",
#ifdef HWCAP2_SVE2
- .hwcap_field = HWCAP2_SVE2,
- .valid = 1,
+ .bit_mask = HWCAP2_SVE2,
#endif
},
{
/* SVE AES Instructions */
- .feat_flag = "FEAT_SVE_AES",
+ .name = "FEAT_SVE_AES",
#ifdef HWCAP2_SVEAES
- .hwcap_field = HWCAP2_SVEAES,
- .valid = 1,
+ .bit_mask = HWCAP2_SVEAES,
#endif
},
{
/* SVE PMULL Instructions */
- .feat_flag = "FEAT_SVE_PMULL128",
+ .name = "FEAT_SVE_PMULL128",
#ifdef HWCAP2_SVEPMULL
- .hwcap_field = HWCAP2_SVEPMULL,
- .valid = 1,
+ .bit_mask = HWCAP2_SVEPMULL,
#endif
},
{
/* SVE Bit Permute Instructions */
- .feat_flag = "FEAT_SVE_BitPerm",
+ .name = "FEAT_SVE_BitPerm",
#ifdef HWCAP2_SVEBITPERM
- .hwcap_field = HWCAP2_SVEBITPERM,
- .valid = 1,
+ .bit_mask = HWCAP2_SVEBITPERM,
#endif
},
{
/* SVE SHA-3 Instructions */
- .feat_flag = "FEAT_SVE_SHA3",
+ .name = "FEAT_SVE_SHA3",
#ifdef HWCAP2_SVESHA3
- .hwcap_field = HWCAP2_SVESHA3,
- .valid = 1,
+ .bit_mask = HWCAP2_SVESHA3,
#endif
},
{
/* SVE SM4 Instructions */
- .feat_flag = "FEAT_SVE_SM4",
+ .name = "FEAT_SVE_SM4",
#ifdef HWCAP2_SVESM4
- .hwcap_field = HWCAP2_SVESM4,
- .valid = 1,
+ .bit_mask = HWCAP2_SVESM4,
#endif
},
{
/* Condition Flag Manipulation Extensions Version 2 */
- .feat_flag = "FEAT_FlagM2",
+ .name = "FEAT_FlagM2",
#ifdef HWCAP2_FLAGM2
- .hwcap_field = HWCAP2_FLAGM2,
- .valid = 1,
+ .bit_mask = HWCAP2_FLAGM2,
#endif
},
{
/* FRINT32Z, FRINT32X, FRINT64Z, and FRINT64X instructions */
- .feat_flag = "FEAT_FRINTTS",
+ .name = "FEAT_FRINTTS",
#ifdef HWCAP2_FRINT
- .hwcap_field = HWCAP2_FRINT,
- .valid = 1,
+ .bit_mask = HWCAP2_FRINT,
#endif
},
{
/* SVE Int8 Matrix Multiplication Instructions */
- .feat_flag = "FEAT_I8MM",
+ .name = "SVEI8MM",
#ifdef HWCAP2_SVEI8MM
- .hwcap_field = HWCAP2_SVEI8MM,
- .valid = 1,
+ .bit_mask = HWCAP2_SVEI8MM,
#endif
},
{
/* SVE Single-precision Floating-point Matrix Multiply Instructions */
- .feat_flag = "FEAT_F32MM",
+ .name = "FEAT_F32MM",
#ifdef HWCAP2_SVEF32MM
- .hwcap_field = HWCAP2_SVEF32MM,
- .valid = 1,
+ .bit_mask = HWCAP2_SVEF32MM,
#endif
},
{
/* SVE Double-precision Floating-point Matrix Multiply Instructions */
- .feat_flag = "FEAT_F64MM",
+ .name = "FEAT_F64MM",
#ifdef HWCAP2_SVEF64MM
- .hwcap_field = HWCAP2_SVEF64MM,
- .valid = 1,
+ .bit_mask = HWCAP2_SVEF64MM,
#endif
},
{
/* SVE BFloat16 Instructions */
- .feat_flag = "FEAT_BF16",
+ .name = "SVEBF16",
#ifdef HWCAP2_SVEBF16
- .hwcap_field = HWCAP2_SVEBF16,
- .valid = 1,
+ .bit_mask = HWCAP2_SVEBF16,
#endif
},
{
/* Advanced SIMD and Floating-point Int8 Matrix Multiplication Instructions */
- .feat_flag = "FEAT_I8MM",
+ .name = "FEAT_I8MM",
#ifdef HWCAP2_I8MM
- .hwcap_field = HWCAP2_I8MM,
- .valid = 1,
+ .bit_mask = HWCAP2_I8MM,
#endif
},
{
/* Advanced SIMD and Floating-point BFloat16 Instructions */
- .feat_flag = "FEAT_BF16",
+ .name = "FEAT_BF16",
#ifdef HWCAP2_BF16
- .hwcap_field = HWCAP2_BF16,
- .valid = 1,
+ .bit_mask = HWCAP2_BF16,
#endif
},
{
/* Data Gathering Hint Extensions */
- .feat_flag = "FEAT_DGH",
+ .name = "FEAT_DGH",
#ifdef HWCAP2_DGH
- .hwcap_field = HWCAP2_DGH,
- .valid = 1,
+ .bit_mask = HWCAP2_DGH,
#endif
},
{
/* Random Number Generation Extensions */
- .feat_flag = "FEAT_RNG",
+ .name = "FEAT_RNG",
#ifdef HWCAP2_RNG
- .hwcap_field = HWCAP2_RNG,
- .valid = 1,
+ .bit_mask = HWCAP2_RNG,
#endif
},
{
/* Branch Target Identification Extensions */
- .feat_flag = "FEAT_BTI",
+ .name = "FEAT_BTI",
#ifdef HWCAP2_BTI
- .hwcap_field = HWCAP2_BTI,
- .valid = 1,
+ .bit_mask = HWCAP2_BTI,
#endif
},
{
/* Full Memory Tagging Extensions */
- .feat_flag = "FEAT_MTE2",
+ .name = "FEAT_MTE2",
#ifdef HWCAP2_MTE
- .hwcap_field = HWCAP2_MTE,
- .valid = 1,
+ .bit_mask = HWCAP2_MTE,
#endif
- }
+ },
+
+ {
+ .name = "ECV",
+#ifdef HWCAP2_ECV
+ .bit_mask = HWCAP2_ECV,
+#endif
+ },
+
+ {
+ .name = "AFP",
+#ifdef HWCAP2_AFP
+ .bit_mask = HWCAP2_AFP,
+#endif
+ },
+
+ {
+ .name = "RPRES",
+#ifdef HWCAP2_RPRES
+ .bit_mask = HWCAP2_RPRES,
+#endif
+ },
+
+ {
+ .name = "MTE3",
+#ifdef HWCAP2_MTE3
+ .bit_mask = HWCAP2_MTE3,
+#endif
+ },
+
+ {
+ .name = "SME",
+#ifdef HWCAP2_SME
+ .bit_mask = HWCAP2_SME,
+#endif
+ },
+
+ {
+ .name = "SME_I16I64",
+#ifdef HWCAP2_SME_I16I64
+ .bit_mask = HWCAP2_SME_I16I64,
+#endif
+ },
+
+ {
+ .name = "SME_F64F64",
+#ifdef HWCAP2_SME_F64F64
+ .bit_mask = HWCAP2_SME_F64F64,
+#endif
+ },
+
+ {
+ .name = "SME_I8I32",
+#ifdef HWCAP2_SME_I8I32
+ .bit_mask = HWCAP2_SME_I8I32,
+#endif
+ },
+
+ {
+ .name = "SME_F16F32",
+#ifdef HWCAP2_SME_F16F32
+ .bit_mask = HWCAP2_SME_F16F32,
+#endif
+ },
+
+ {
+ .name = "SME_B16F32",
+#ifdef HWCAP2_SME_B16F32
+ .bit_mask = HWCAP2_SME_B16F32,
+#endif
+ },
+
+ {
+ .name = "SME_F32F32",
+#ifdef HWCAP2_SME_F32F32
+ .bit_mask = HWCAP2_SME_F32F32,
+#endif
+ },
+
+ {
+ .name = "SME_FA64",
+#ifdef HWCAP2_SME_FA64
+ .bit_mask = HWCAP2_SME_FA64,
+#endif
+ },
+
+ {
+ .name = "WFXT",
+#ifdef HWCAP2_WFXT
+ .bit_mask = HWCAP2_WFXT,
+#endif
+ },
+
+ {
+ .name = "EBF16",
+#ifdef HWCAP2_EBF16
+ .bit_mask = HWCAP2_EBF16,
+#endif
+ },
+
+ {
+ .name = "SVE_EBF16",
+#ifdef HWCAP2_SVE_EBF16
+ .bit_mask = HWCAP2_SVE_EBF16,
+#endif
+ },
+
+ {
+ .name = "CSSC",
+#ifdef HWCAP2_CSSC
+ .bit_mask = HWCAP2_CSSC,
+#endif
+ },
+
+ {
+ .name = "RPRFM",
+#ifdef HWCAP2_RPRFM
+ .bit_mask = HWCAP2_RPRFM,
+#endif
+ },
+
+ {
+ .name = "SVE2P1",
+#ifdef HWCAP2_SVE2P1
+ .bit_mask = HWCAP2_SVE2P1,
+#endif
+ },
+
+ {
+ .name = "SME2",
+#ifdef HWCAP2_SME2
+ .bit_mask = HWCAP2_SME2,
+#endif
+ },
+
+ {
+ .name = "SME2P1",
+#ifdef HWCAP2_SME2P1
+ .bit_mask = HWCAP2_SME2P1,
+#endif
+ },
+
+ {
+ .name = "SME_I16I32",
+#ifdef HWCAP2_SME_I16I32
+ .bit_mask = HWCAP2_SME_I16I32,
+#endif
+ },
+
+ {
+ .name = "SME_BI32I32",
+#ifdef HWCAP2_SME_BI32I32
+ .bit_mask = HWCAP2_SME_BI32I32,
+#endif
+ },
+
+ {
+ .name = "SME_B16B16",
+#ifdef HWCAP2_SME_B16B16
+ .bit_mask = HWCAP2_SME_B16B16,
+#endif
+ },
+
+ {
+ .name = "SME_F16F16",
+#ifdef HWCAP2_SME_F16F16
+ .bit_mask = HWCAP2_SME_F16F16,
+#endif
+ },
+
+ {
+ .name = "MOPS",
+#ifdef HWCAP2_MOPS
+ .bit_mask = HWCAP2_MOPS,
+#endif
+ },
};
static void _odp_sys_info_print_acle_flags(void)
@@ -868,106 +997,50 @@ static void _odp_sys_info_print_acle_flags(void)
_ODP_PRINT("\n");
}
-static int check_hwcap_duplicates(unsigned int hwcap_field)
-{
- int ret = 0;
-
- /* FP and AdvSIMD fields of the AArch64 Processor
- * Feature Register 0 must have the same value and are
- * defined by the same feature flag. Print the flag
- * only once. */
-#ifdef HWCAP_ASIMD
- if (hwcap_field == HWCAP_ASIMD)
- ret = 1;
-#endif
-#ifdef HWCAP_ASIMDHP
- if (hwcap_field == HWCAP_ASIMDHP)
- ret = 1;
-#endif
-
- return ret;
-}
-
static void _odp_sys_info_print_hwcap_flags(void)
{
- unsigned long hwcaps, hwcaps2;
- unsigned int size, size2;
+ uint64_t hwcap, hwcap2;
+ uint32_t size, size2, i;
- _ODP_PRINT("ARM FEATURES SUPPORTED BY HARDWARE:\n");
-
- /* Print supported hardware flags via AT_HWCAP entry of the hwcaps
- * auxiliary vector. */
- hwcaps = getauxval(AT_HWCAP);
- size = _ODP_ARRAY_SIZE(hwcap_flags);
- for (unsigned int i = 0; i < size; i++) {
- if (hwcap_flags[i].valid) {
- if (check_hwcap_duplicates(hwcap_flags[i].hwcap_field)) {
- hwcaps = hwcaps >> 1;
- continue;
- }
-
- if (hwcaps & 0x01)
- _ODP_PRINT("%s ", hwcap_flags[i].feat_flag);
- hwcaps = hwcaps >> 1;
- }
- }
+ hwcap = getauxval(AT_HWCAP);
+ hwcap2 = getauxval(AT_HWCAP2);
+ size = _ODP_ARRAY_SIZE(hwcap_flags);
+ size2 = _ODP_ARRAY_SIZE(hwcap2_flags);
- /* Print supported hardware flags via AT_HWCAP2 entry of the hwcaps
- * auxiliary vector. */
- hwcaps2 = getauxval(AT_HWCAP2);
- size2 = _ODP_ARRAY_SIZE(hwcap2_flags);
- for (unsigned long i = 0; i < size2; i++) {
- if (hwcap2_flags[i].valid) {
- if (hwcaps2 & 0x01)
- _ODP_PRINT("%s ", hwcap2_flags[i].feat_flag);
- hwcaps2 = hwcaps2 >> 1;
- }
- }
-
- _ODP_PRINT("\n");
-
- /* Re-initialize hwcaps and hwcaps2 */
- hwcaps = 0;
- hwcaps2 = 0;
-
- _ODP_PRINT("\nARM FEATURES NOT SUPPORTED BY HARDWARE:\n");
-
- hwcaps = getauxval(AT_HWCAP);
- for (unsigned long i = 0; i < size; i++) {
- if (hwcap_flags[i].valid) {
- if (check_hwcap_duplicates(hwcap_flags[i].hwcap_field)) {
- hwcaps = hwcaps >> 1;
- continue;
- }
-
- if (!(hwcaps & 0x01))
- _ODP_PRINT("%s ", hwcap_flags[i].feat_flag);
- hwcaps = hwcaps >> 1;
- }
- }
-
- hwcaps2 = getauxval(AT_HWCAP2);
- for (unsigned long i = 0; i < size2; i++) {
- if (hwcap2_flags[i].valid) {
- if (!(hwcaps2 & 0x01))
- _ODP_PRINT("%s ", hwcap2_flags[i].feat_flag);
- hwcaps2 = hwcaps2 >> 1;
- }
- }
-
- _ODP_PRINT("\n");
-
- _ODP_PRINT("\nARM FEATURES NOT SUPPORTED BY KERNEL:\n");
-
- for (unsigned long i = 0; i < size; i++) {
- if (!hwcap_flags[i].valid)
- _ODP_PRINT("%s ", hwcap_flags[i].feat_flag);
- }
+ _ODP_PRINT("ARM FEATURES SUPPORTED BY HARDWARE:\n");
- for (unsigned long i = 0; i < size2; i++) {
- if (!hwcap2_flags[i].valid)
- _ODP_PRINT("%s ", hwcap2_flags[i].feat_flag);
- }
+ /* Supported HWCAP flags */
+ for (i = 0; i < size; i++)
+ if (hwcap & hwcap_flags[i].bit_mask)
+ _ODP_PRINT("%s ", hwcap_flags[i].name);
+
+ /* Supported HWCAP2 flags */
+ for (i = 0; i < size2; i++)
+ if (hwcap2 & hwcap2_flags[i].bit_mask)
+ _ODP_PRINT("%s ", hwcap2_flags[i].name);
+
+ _ODP_PRINT("\n\nARM FEATURES NOT SUPPORTED BY HARDWARE:\n");
+
+ /* Unsupported HWCAP flags */
+ for (i = 0; i < size; i++)
+ if (hwcap_flags[i].bit_mask && (hwcap & hwcap_flags[i].bit_mask) == 0)
+ _ODP_PRINT("%s ", hwcap_flags[i].name);
+
+ /* Unsupported HWCAP2 flags */
+ for (i = 0; i < size2; i++)
+ if (hwcap2_flags[i].bit_mask && (hwcap2 & hwcap2_flags[i].bit_mask) == 0)
+ _ODP_PRINT("%s ", hwcap2_flags[i].name);
+
+ _ODP_PRINT("\n\nARM FEATURES UNKNOWN TO LINUX VERSION:\n");
+ /* Unknown HWCAP flags */
+ for (i = 0; i < size; i++)
+ if (hwcap_flags[i].bit_mask == 0)
+ _ODP_PRINT("%s ", hwcap_flags[i].name);
+
+ /* Unknown HWCAP2 flags */
+ for (i = 0; i < size2; i++)
+ if (hwcap2_flags[i].bit_mask == 0)
+ _ODP_PRINT("%s ", hwcap2_flags[i].name);
_ODP_PRINT("\n\n");
}
diff --git a/platform/linux-generic/arch/aarch64/odp/api/abi/cpu_inlines.h b/platform/linux-generic/arch/aarch64/odp/api/abi/cpu_inlines.h
index bf44806a0..a26908e66 100644
--- a/platform/linux-generic/arch/aarch64/odp/api/abi/cpu_inlines.h
+++ b/platform/linux-generic/arch/aarch64/odp/api/abi/cpu_inlines.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2016-2018, Linaro Limited
- * Copyright (c) 2021, Nokia
+ * Copyright (c) 2021-2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -12,6 +12,22 @@
extern "C" {
#endif
+#include <odp/api/abi/time_cpu.h>
+
+#include <stdint.h>
+
+/* CPU frequency is shifted to decrease integer division error */
+#define _ODP_CPU_FREQ_SHIFT 16
+
+typedef struct _odp_cpu_cycles_global_t {
+ uint64_t res;
+ uint64_t res_shifted;
+ uint64_t max;
+
+} _odp_cpu_cycles_global_t;
+
+extern _odp_cpu_cycles_global_t _odp_cpu_cycles_glob;
+
static inline void _odp_cpu_pause(void)
{
/* YIELD hints the CPU to switch to another thread if possible
@@ -22,8 +38,20 @@ static inline void _odp_cpu_pause(void)
__asm volatile("isb" ::: "memory");
}
-/* Use generic implementations for the rest of the functions */
-#include <odp/api/abi/cpu_generic.h>
+static inline uint64_t _odp_cpu_cycles(void)
+{
+ return (_odp_time_cpu_global() * _odp_cpu_cycles_glob.res_shifted) >> _ODP_CPU_FREQ_SHIFT;
+}
+
+static inline uint64_t _odp_cpu_cycles_resolution(void)
+{
+ return _odp_cpu_cycles_glob.res;
+}
+
+static inline uint64_t _odp_cpu_cycles_max(void)
+{
+ return _odp_cpu_cycles_glob.max;
+}
#ifdef __cplusplus
}
diff --git a/platform/linux-generic/arch/aarch64/odp_cpu_cycles.c b/platform/linux-generic/arch/aarch64/odp_cpu_cycles.c
new file mode 100644
index 000000000..fba263ee4
--- /dev/null
+++ b/platform/linux-generic/arch/aarch64/odp_cpu_cycles.c
@@ -0,0 +1,48 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
+ */
+
+#include <odp/api/cpu.h>
+
+#include <odp/api/abi/cpu_inlines.h>
+#include <odp/api/abi/time_cpu.h>
+
+#include <odp_debug_internal.h>
+#include <odp_init_internal.h>
+
+#include <string.h>
+
+#include <odp/visibility_begin.h>
+
+_odp_cpu_cycles_global_t _odp_cpu_cycles_glob;
+
+#include <odp/visibility_end.h>
+
+int _odp_cpu_cycles_init_global(void)
+{
+ uint64_t cpu_hz, cpu_time_hz;
+
+ memset(&_odp_cpu_cycles_glob, 0, sizeof(_odp_cpu_cycles_global_t));
+
+ cpu_time_hz = _odp_time_cpu_global_freq();
+ if (cpu_time_hz == 0) {
+ _ODP_ERR("CPU time counter frequency not available\n");
+ return -1;
+ }
+
+ cpu_hz = odp_cpu_hz_max_id(0);
+ if (cpu_hz == 0) {
+ _ODP_ERR("CPU frequency not available\n");
+ return -1;
+ }
+
+ _odp_cpu_cycles_glob.res_shifted = (cpu_hz << _ODP_CPU_FREQ_SHIFT) / cpu_time_hz;
+
+ _odp_cpu_cycles_glob.res = cpu_hz > cpu_time_hz ?
+ (_odp_cpu_cycles_glob.res_shifted >> _ODP_CPU_FREQ_SHIFT) : 1;
+
+ _odp_cpu_cycles_glob.max = (UINT64_MAX >> _ODP_CPU_FREQ_SHIFT) -
+ (UINT64_MAX % _odp_cpu_cycles_glob.res);
+
+ return 0;
+}
diff --git a/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c b/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c
index 2eefc6302..52936dacf 100644
--- a/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c
+++ b/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c
@@ -524,7 +524,18 @@ odp_crypto_session_create(const odp_crypto_session_param_t *param,
return -1;
}
- if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP) {
+ if (param->cipher_range_in_bits) {
+ *status = ODP_CRYPTO_SES_ERR_CIPHER;
+ *session_out = ODP_CRYPTO_SESSION_INVALID;
+ return -1;
+ }
+ if (param->auth_range_in_bits) {
+ *status = ODP_CRYPTO_SES_ERR_AUTH;
+ *session_out = ODP_CRYPTO_SESSION_INVALID;
+ return -1;
+ }
+ if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP ||
+ param->op_type == ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP) {
*status = ODP_CRYPTO_SES_ERR_PARAMS;
*session_out = ODP_CRYPTO_SESSION_INVALID;
return -1;
@@ -816,9 +827,14 @@ int crypto_int(odp_packet_t pkt_in,
return -1;
}
+ if (odp_unlikely(session->p.null_crypto_enable &&
+ param->null_crypto))
+ goto out;
+
/* Invoke the crypto function */
session->func(out_pkt, param, session);
+out:
packet_subtype_set(out_pkt, ODP_EVENT_PACKET_CRYPTO);
/* Synchronous, simply return results */
diff --git a/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c b/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c
index 352bee9e9..f242c845e 100644
--- a/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c
+++ b/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c
@@ -32,6 +32,9 @@ static void aarch64_impl_str(char *str, int maxlen, int implementer)
case 0x44:
snprintf(str, maxlen, "Digital Equipment Corporation");
return;
+ case 0x46:
+ snprintf(str, maxlen, "Fujitsu Ltd.");
+ return;
case 0x49:
snprintf(str, maxlen, "Infineon Technologies AG");
return;
@@ -53,6 +56,9 @@ static void aarch64_impl_str(char *str, int maxlen, int implementer)
case 0x69:
snprintf(str, maxlen, "Intel Corporation");
return;
+ case 0xc0:
+ snprintf(str, maxlen, "Ampere Computing");
+ return;
default:
break;
}
@@ -132,6 +138,10 @@ static void aarch64_part_info(char *str, int maxlen, odp_cpu_arch_arm_t *cpu_isa
snprintf(str, maxlen, "Cortex-A78AE");
*cpu_isa = ODP_CPU_ARCH_ARMV8_2;
return;
+ case 0xd44:
+ snprintf(str, maxlen, "Cortex-X1");
+ *cpu_isa = ODP_CPU_ARCH_ARMV8_2;
+ return;
case 0xd46:
snprintf(str, maxlen, "Cortex-A510");
*cpu_isa = ODP_CPU_ARCH_ARMV9_0;
@@ -140,6 +150,10 @@ static void aarch64_part_info(char *str, int maxlen, odp_cpu_arch_arm_t *cpu_isa
snprintf(str, maxlen, "Cortex-A710");
*cpu_isa = ODP_CPU_ARCH_ARMV9_0;
return;
+ case 0xd48:
+ snprintf(str, maxlen, "Cortex-X2");
+ *cpu_isa = ODP_CPU_ARCH_ARMV9_0;
+ return;
case 0xd49:
snprintf(str, maxlen, "Neoverse N2");
*cpu_isa = ODP_CPU_ARCH_ARMV9_0;
@@ -152,6 +166,18 @@ static void aarch64_part_info(char *str, int maxlen, odp_cpu_arch_arm_t *cpu_isa
snprintf(str, maxlen, "Cortex-A78C");
*cpu_isa = ODP_CPU_ARCH_ARMV8_2;
return;
+ case 0xd4d:
+ snprintf(str, maxlen, "Cortex-A715");
+ *cpu_isa = ODP_CPU_ARCH_ARMV9_0;
+ return;
+ case 0xd80:
+ snprintf(str, maxlen, "Cortex-A520");
+ *cpu_isa = ODP_CPU_ARCH_ARMV9_2;
+ return;
+ case 0xd81:
+ snprintf(str, maxlen, "Cortex-A720");
+ *cpu_isa = ODP_CPU_ARCH_ARMV9_2;
+ return;
default:
break;
}
@@ -207,6 +233,11 @@ static odp_cpu_arch_arm_t arm_isa_version(void)
#endif
}
+ if (__ARM_ARCH == 9) {
+ /* v9.0 or higher */
+ return ODP_CPU_ARCH_ARMV9_0;
+ }
+
if (__ARM_ARCH >= 800) {
/* ACLE 2018 defines that from v8.1 onwards the value includes
* the minor version number: __ARM_ARCH = X * 100 + Y
@@ -232,6 +263,10 @@ static odp_cpu_arch_arm_t arm_isa_version(void)
return ODP_CPU_ARCH_ARMV8_6;
case 7:
return ODP_CPU_ARCH_ARMV8_7;
+ case 8:
+ return ODP_CPU_ARCH_ARMV8_8;
+ case 9:
+ return ODP_CPU_ARCH_ARMV8_9;
default:
return ODP_CPU_ARCH_ARM_UNKNOWN;
}
@@ -243,6 +278,8 @@ static odp_cpu_arch_arm_t arm_isa_version(void)
return ODP_CPU_ARCH_ARMV9_1;
case 2:
return ODP_CPU_ARCH_ARMV9_2;
+ case 3:
+ return ODP_CPU_ARCH_ARMV9_3;
default:
return ODP_CPU_ARCH_ARM_UNKNOWN;
}
diff --git a/platform/linux-generic/include-abi/odp/api/abi/packet_io_types.h b/platform/linux-generic/include-abi/odp/api/abi/packet_io_types.h
index 1692e71b1..87e297f1d 100644
--- a/platform/linux-generic/include-abi/odp/api/abi/packet_io_types.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/packet_io_types.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2015-2018, Linaro Limited
- * Copyright (c) 2020-2022, Nokia
+ * Copyright (c) 2020-2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -43,6 +43,8 @@ typedef struct odp_pktout_queue_t {
#define ODP_PKTIO_INVALID _odp_cast_scalar(odp_pktio_t, 0)
#define ODP_LSO_PROFILE_INVALID _odp_cast_scalar(odp_lso_profile_t, 0)
+#define ODP_PKTIO_MAX_INDEX 63
+
#define ODP_PKTIO_MACADDR_MAXSIZE 16
#define ODP_PKTIN_NO_WAIT 0
diff --git a/platform/linux-generic/include/odp/api/plat/cpu_inlines.h b/platform/linux-generic/include/odp/api/plat/cpu_inlines.h
index 60c4bb920..bb1b89154 100644
--- a/platform/linux-generic/include/odp/api/plat/cpu_inlines.h
+++ b/platform/linux-generic/include/odp/api/plat/cpu_inlines.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2018, Linaro Limited
- * Copyright (c) 2021, Nokia
+ * Copyright (c) 2021-2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -53,7 +53,7 @@ _ODP_INLINE uint64_t odp_cpu_cycles_diff(uint64_t c2, uint64_t c1)
if (odp_likely(c2 >= c1))
return c2 - c1;
- return c2 + (odp_cpu_cycles_max() - c1) + 1;
+ return c2 + (odp_cpu_cycles_max() - c1) + _odp_cpu_cycles_resolution();
}
/** @endcond */
diff --git a/platform/linux-generic/include/odp/api/plat/packet_inline_types.h b/platform/linux-generic/include/odp/api/plat/packet_inline_types.h
index 5186efed0..eb20ca7d7 100644
--- a/platform/linux-generic/include/odp/api/plat/packet_inline_types.h
+++ b/platform/linux-generic/include/odp/api/plat/packet_inline_types.h
@@ -123,7 +123,7 @@ typedef union {
uint32_t all_flags;
struct {
- uint32_t reserved1: 5;
+ uint32_t reserved1: 4;
/*
* Init flags
@@ -141,7 +141,8 @@ typedef union {
uint32_t l4_chksum_set: 1; /* L4 chksum bit is valid */
uint32_t l4_chksum: 1; /* L4 chksum override */
uint32_t ts_set: 1; /* Set Tx timestamp */
- uint32_t tx_compl: 1; /* Tx completion event requested */
+ uint32_t tx_compl_ev: 1; /* Tx completion event requested */
+ uint32_t tx_compl_poll: 1; /* Tx completion poll requested */
uint32_t free_ctrl: 1; /* Don't free option */
uint32_t tx_aging: 1; /* Packet aging at Tx requested */
uint32_t shaper_len_adj: 8; /* Adjustment for traffic mgr */
@@ -160,8 +161,8 @@ typedef union {
/* Flag groups */
struct {
- uint32_t reserved2: 5;
- uint32_t other: 20; /* All other flags */
+ uint32_t reserved2: 4;
+ uint32_t other: 21; /* All other flags */
uint32_t error: 7; /* All error flags */
} all;
diff --git a/platform/linux-generic/include/odp/api/plat/queue_inline_types.h b/platform/linux-generic/include/odp/api/plat/queue_inline_types.h
index e957785c4..593942072 100644
--- a/platform/linux-generic/include/odp/api/plat/queue_inline_types.h
+++ b/platform/linux-generic/include/odp/api/plat/queue_inline_types.h
@@ -1,4 +1,5 @@
/* Copyright (c) 2018, Linaro Limited
+ * Copyright (c) 2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -32,7 +33,12 @@ typedef struct _odp_queue_inline_offset_t {
typedef struct {
odp_queue_t (*queue_create)(const char *name,
const odp_queue_param_t *param);
+ int (*queue_create_multi)(const char *name[],
+ const odp_queue_param_t param[],
+ odp_bool_t share_param, odp_queue_t queue[],
+ int num);
int (*queue_destroy)(odp_queue_t queue);
+ int (*queue_destroy_multi)(odp_queue_t queue[], int num);
odp_queue_t (*queue_lookup)(const char *name);
int (*queue_capability)(odp_queue_capability_t *capa);
int (*queue_context_set)(odp_queue_t queue, void *context,
diff --git a/platform/linux-generic/include/odp_classification_datamodel.h b/platform/linux-generic/include/odp_classification_datamodel.h
index daa783b07..376dbd1db 100644
--- a/platform/linux-generic/include/odp_classification_datamodel.h
+++ b/platform/linux-generic/include/odp_classification_datamodel.h
@@ -59,7 +59,7 @@ extern "C" {
ODP_STATIC_ASSERT(CLS_COS_MAX_ENTRY <= UINT16_MAX, "CoS_does_not_fit_16_bits");
typedef union {
- /* All proto fileds */
+ /* All proto fields */
uint32_t all;
struct {
diff --git a/platform/linux-generic/include/odp_config_internal.h b/platform/linux-generic/include/odp_config_internal.h
index e4f8d6d6d..279a43687 100644
--- a/platform/linux-generic/include/odp_config_internal.h
+++ b/platform/linux-generic/include/odp_config_internal.h
@@ -134,10 +134,11 @@ extern "C" {
/*
* Number of shared memory blocks reserved for implementation internal use.
*
- * Each pool requires three blocks (buffers, ring, user area), and 20 blocks
- * are reserved for per ODP module global data.
+ * Each pool requires three blocks (buffers, ring, user area), 20 blocks
+ * are reserved for per ODP module global data and one block per packet I/O is
+ * reserved for TX completion usage.
*/
-#define CONFIG_INTERNAL_SHM_BLOCKS ((ODP_CONFIG_POOLS * 3) + 20)
+#define CONFIG_INTERNAL_SHM_BLOCKS ((ODP_CONFIG_POOLS * 3) + 20 + ODP_CONFIG_PKTIO_ENTRIES)
/*
* Maximum number of shared memory blocks.
@@ -189,6 +190,9 @@ extern "C" {
*/
#define CONFIG_TIMER_128BIT_ATOMICS 1
+/* Enable timer scan performance benchmark. This works with inline enabled. */
+#define CONFIG_TIMER_PROFILE_INLINE 0
+
#ifdef __cplusplus
}
#endif
diff --git a/platform/linux-generic/include/odp_fdserver_internal.h b/platform/linux-generic/include/odp_fdserver_internal.h
index 8518a5b7e..0b0a9bb0e 100644
--- a/platform/linux-generic/include/odp_fdserver_internal.h
+++ b/platform/linux-generic/include/odp_fdserver_internal.h
@@ -12,7 +12,7 @@ extern "C" {
#endif
/*
- * the following enum defines the different contextes by which the
+ * the following enum defines the different contexts by which the
* FD server may be used: In the FD server, the keys used to store/retrieve
* a file descriptor are actually context based:
* Both the context and the key are stored at fd registration time,
diff --git a/platform/linux-generic/include/odp_global_data.h b/platform/linux-generic/include/odp_global_data.h
index 67b7572ef..f883cefd9 100644
--- a/platform/linux-generic/include/odp_global_data.h
+++ b/platform/linux-generic/include/odp_global_data.h
@@ -53,7 +53,7 @@ typedef struct {
* to enable process more support. */
typedef struct odp_global_data_ro_t {
odp_init_t init_param;
- /* directory for odp mmaped files */
+ /* directory for odp mapped files */
char *shm_dir;
/* overload default with env */
int shm_dir_from_env;
diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h
index a6a8c551c..eef0239f2 100644
--- a/platform/linux-generic/include/odp_packet_internal.h
+++ b/platform/linux-generic/include/odp_packet_internal.h
@@ -147,6 +147,9 @@ typedef struct ODP_ALIGNED_CACHE odp_packet_hdr_t {
* request + requested drop timeout). */
uint64_t tx_aging_ns;
+ /* Tx completion poll completion identifier */
+ uint32_t tx_compl_id;
+
/* LSO profile index */
uint8_t lso_profile_idx;
diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h
index 05dda9897..5490c3d01 100644
--- a/platform/linux-generic/include/odp_packet_io_internal.h
+++ b/platform/linux-generic/include/odp_packet_io_internal.h
@@ -142,6 +142,10 @@ typedef struct ODP_ALIGNED_CACHE {
/* Pool for Tx completion events */
odp_pool_t tx_compl_pool;
+ /* Status map SHM handle */
+ odp_shm_t tx_compl_status_shm;
+ /* Status map for Tx completion identifiers */
+ odp_atomic_u32_t *tx_compl_status;
/* Storage for queue handles
* Multi-queue support is pktio driver specific */
@@ -338,8 +342,8 @@ int _odp_lso_create_packets(odp_packet_t packet, const odp_packet_lso_opt_t *lso
uint32_t payload_len, uint32_t left_over_len,
odp_packet_t pkt_out[], int num_pkt);
-void _odp_pktio_allocate_and_send_tx_compl_events(const pktio_entry_t *entry,
- const odp_packet_t packets[], int num);
+void _odp_pktio_process_tx_compl(const pktio_entry_t *entry, const odp_packet_t packets[],
+ int num);
static inline int _odp_pktio_packet_to_pool(odp_packet_t *pkt,
odp_packet_hdr_t **pkt_hdr,
diff --git a/platform/linux-generic/include/odp_ring_mpmc_internal.h b/platform/linux-generic/include/odp_ring_mpmc_internal.h
index e35179267..3526b3866 100644
--- a/platform/linux-generic/include/odp_ring_mpmc_internal.h
+++ b/platform/linux-generic/include/odp_ring_mpmc_internal.h
@@ -22,20 +22,47 @@ extern "C" {
#include <odp_ring_common.h>
-/* Ring of uint32_t data
+/* Ring of uint32_t/uint64_t data
*
* Ring stores head and tail counters. Ring indexes are formed from these
* counters with a mask (mask = ring_size - 1), which requires that ring size
* must be a power of two.
*
+ * The following figures depict an example where a ring is being simultaneously
+ * enqueued to and dequeued from. Ring slots containing data are marked with
+ * letter D, empty slots with E, and slots being modified with X.
+ *
+ * Ring status before enq/deq operations.
+ *
* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
* +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
- * | E | E | | | | | | | | | | E | E | E | E | E |
+ * | E | E | D | D | D | D | D | D | E | E | E | E | E | E | E | E |
+ * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+ * ^ ^
+ * | |
+ * r_head w_head
+ * r_tail w_tail
+ *
+ * Ring status while being enqueued and dequeued.
+ *
+ * 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+ * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+ * | E | E | X | X | D | D | D | D | X | X | X | E | E | E | E | E |
* +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
* ^ ^ ^ ^
* | | | |
* r_tail r_head w_tail w_head
*
+ * Ring status after enq/deq operations.
+ *
+ * 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+ * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+ * | E | E | E | E | D | D | D | D | D | D | D | E | E | E | E | E |
+ * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+ * ^ ^
+ * | |
+ * r_head w_head
+ * r_tail w_tail
*/
struct ring_mpmc_common {
@@ -212,13 +239,17 @@ static inline uint32_t _RING_MPMC_ENQ_MULTI(_ring_mpmc_gen_t *ring,
uint32_t old_head, new_head, r_tail, num_free, i;
uint32_t size = ring_mask + 1;
- /* Load acquires ensure that w_head load happens after r_tail load,
- * and thus r_tail value is always behind or equal to w_head value.
- * When CAS operation succeeds, this thread owns data between old
- * and new w_head. */
+ /* The CAS operation guarantees that w_head value is up to date. Load
+ * acquire is used to ensure that r_tail is read after w_head. This
+ * guarantees that w_head - r_tail <= size. Any additional delay in
+ * reading r_tail makes the subtraction result only smaller. This
+ * avoids returning zero when the ring is not actually full.
+ *
+ * When CAS operation succeeds, this thread owns data between old and
+ * new w_head. */
do {
- r_tail = odp_atomic_load_acq_u32(&ring->r.r_tail);
old_head = odp_atomic_load_acq_u32(&ring->r.w_head);
+ r_tail = odp_atomic_load_acq_u32(&ring->r.r_tail);
num_free = size - (old_head - r_tail);
@@ -259,13 +290,17 @@ static inline uint32_t _RING_MPMC_ENQ_BATCH(_ring_mpmc_gen_t *ring,
uint32_t old_head, new_head, r_tail, num_free, i;
uint32_t size = ring_mask + 1;
- /* Load acquires ensure that w_head load happens after r_tail load,
- * and thus r_tail value is always behind or equal to w_head value.
- * When CAS operation succeeds, this thread owns data between old
- * and new w_head. */
+ /* The CAS operation guarantees that w_head value is up to date. Load
+ * acquire is used to ensure that r_tail is read after w_head. This
+ * guarantees that w_head - r_tail <= size. Any additional delay in
+ * reading r_tail makes the subtraction result only smaller. This
+ * avoids returning zero when the ring is not actually full.
+ *
+ * When CAS operation succeeds, this thread owns data between old and
+ * new w_head. */
do {
- r_tail = odp_atomic_load_acq_u32(&ring->r.r_tail);
old_head = odp_atomic_load_acq_u32(&ring->r.w_head);
+ r_tail = odp_atomic_load_acq_u32(&ring->r.r_tail);
num_free = size - (old_head - r_tail);
diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4
index a48d3e4dd..556f01c19 100644
--- a/platform/linux-generic/m4/configure.m4
+++ b/platform/linux-generic/m4/configure.m4
@@ -19,7 +19,9 @@ AC_ARG_WITH([pcap],
have_pcap=no
AS_IF([test "x$with_pcap" != xno],
[ODP_PCAP([with_pcap=yes]‚[with_pcap=no])])
+AC_CONFIG_COMMANDS_PRE([dnl
AM_CONDITIONAL([ODP_PKTIO_PCAP], [test x$have_pcap = xyes])
+])
m4_include([platform/linux-generic/m4/odp_libconfig.m4])
m4_include([platform/linux-generic/m4/odp_openssl.m4])
@@ -69,5 +71,7 @@ AC_CONFIG_FILES([platform/linux-generic/Makefile
platform/linux-generic/test/example/switch/Makefile
platform/linux-generic/test/validation/api/shmem/Makefile
platform/linux-generic/test/validation/api/pktio/Makefile
+ platform/linux-generic/test/performance/Makefile
+ platform/linux-generic/test/performance/dmafwd/Makefile
platform/linux-generic/test/pktio_ipc/Makefile])
])
diff --git a/platform/linux-generic/m4/odp_dpdk.m4 b/platform/linux-generic/m4/odp_dpdk.m4
index f61c38a8e..dc3c9610e 100644
--- a/platform/linux-generic/m4/odp_dpdk.m4
+++ b/platform/linux-generic/m4/odp_dpdk.m4
@@ -41,7 +41,7 @@ AC_ARG_ENABLE([dpdk-zero-copy],
# Check for DPDK availability
#
# DPDK pmd drivers are not linked unless the --whole-archive option is
-# used. No spaces are allowed between the --whole-arhive flags.
+# used. No spaces are allowed between the --whole-archive flags.
##########################################################################
if test x$pktio_dpdk_support = xyes
then
diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c
index 7c90ee8ac..eee64e78c 100644
--- a/platform/linux-generic/odp_classification.c
+++ b/platform/linux-generic/odp_classification.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2014-2018, Linaro Limited
- * Copyright (c) 2019-2022, Nokia
+ * Copyright (c) 2019-2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -7,17 +7,20 @@
#include <odp/api/classification.h>
#include <odp/api/align.h>
-#include <odp/api/queue.h>
#include <odp/api/debug.h>
+#include <odp/api/hints.h>
+#include <odp/api/packet_io.h>
#include <odp/api/pool.h>
+#include <odp/api/queue.h>
+#include <odp/api/shared_memory.h>
+#include <odp/api/spinlock.h>
+
#include <odp_init_internal.h>
#include <odp_debug_internal.h>
#include <odp_packet_internal.h>
-#include <odp/api/packet_io.h>
#include <odp_packet_io_internal.h>
#include <odp_classification_datamodel.h>
#include <odp_classification_internal.h>
-#include <odp/api/shared_memory.h>
#include <protocols/eth.h>
#include <protocols/ip.h>
#include <protocols/ipsec.h>
@@ -28,7 +31,6 @@
#include <errno.h>
#include <stdbool.h>
#include <inttypes.h>
-#include <odp/api/spinlock.h>
/* Debug level for per packet classification operations */
#define CLS_DBG 3
@@ -362,6 +364,26 @@ odp_cos_t odp_cls_cos_create(const char *name, const odp_cls_cos_param_t *param_
return ODP_COS_INVALID;
}
+int odp_cls_cos_create_multi(const char *name[], const odp_cls_cos_param_t param[],
+ odp_cos_t cos[], int num)
+{
+ int i;
+
+ _ODP_ASSERT(param != NULL);
+ _ODP_ASSERT(cos != NULL);
+
+ for (i = 0; i < num; i++) {
+ const char *cur_name = name != NULL ? name[i] : NULL;
+ odp_cos_t new_cos = odp_cls_cos_create(cur_name, &param[i]);
+
+ if (odp_unlikely(new_cos == ODP_COS_INVALID))
+ return (i == 0) ? -1 : i;
+
+ cos[i] = new_cos;
+ }
+ return i;
+}
+
/*
* Allocate an odp_pmr_t Handle
*/
@@ -426,6 +448,23 @@ int odp_cos_destroy(odp_cos_t cos_id)
return 0;
}
+int odp_cos_destroy_multi(odp_cos_t cos[], int num)
+{
+ int i;
+
+ _ODP_ASSERT(cos != NULL);
+ _ODP_ASSERT(num > 0);
+
+ for (i = 0; i < num; i++) {
+ int ret = odp_cos_destroy(cos[i]);
+
+ if (ret)
+ return (i == 0) ? ret : i;
+ }
+
+ return i;
+}
+
int odp_cos_queue_set(odp_cos_t cos_id, odp_queue_t queue_id)
{
cos_t *cos = get_cos_entry(cos_id);
@@ -785,6 +824,23 @@ no_rule:
return 0;
}
+int odp_cls_pmr_destroy_multi(odp_pmr_t pmr[], int num)
+{
+ int i;
+
+ _ODP_ASSERT(pmr != NULL);
+ _ODP_ASSERT(num > 0);
+
+ for (i = 0; i < num; i++) {
+ int ret = odp_cls_pmr_destroy(pmr[i]);
+
+ if (ret)
+ return (i == 0) ? ret : i;
+ }
+
+ return i;
+}
+
static odp_pmr_t cls_pmr_create(const odp_pmr_param_t *terms, int num_terms, uint16_t mark,
odp_cos_t src_cos, odp_cos_t dst_cos)
{
@@ -855,6 +911,27 @@ odp_pmr_t odp_cls_pmr_create_opt(const odp_pmr_create_opt_t *opt,
return cls_pmr_create(opt->terms, opt->num_terms, opt->mark, src_cos, dst_cos);
}
+int odp_cls_pmr_create_multi(const odp_pmr_create_opt_t opt[], odp_cos_t src_cos[],
+ odp_cos_t dst_cos[], odp_pmr_t pmr[], int num)
+{
+ int i;
+
+ _ODP_ASSERT(opt != NULL);
+ _ODP_ASSERT(src_cos != NULL);
+ _ODP_ASSERT(dst_cos != NULL);
+ _ODP_ASSERT(pmr != NULL);
+
+ for (i = 0; i < num; i++) {
+ odp_pmr_t new_pmr = odp_cls_pmr_create_opt(&opt[i], src_cos[i], dst_cos[i]);
+
+ if (odp_unlikely(new_pmr == ODP_PMR_INVALID))
+ return (i == 0) ? -1 : i;
+
+ pmr[i] = new_pmr;
+ }
+ return i;
+}
+
int odp_cls_cos_pool_set(odp_cos_t cos_id, odp_pool_t pool)
{
cos_t *cos;
diff --git a/platform/linux-generic/odp_crypto_ipsecmb.c b/platform/linux-generic/odp_crypto_ipsecmb.c
index 0b83adecc..e58844098 100644
--- a/platform/linux-generic/odp_crypto_ipsecmb.c
+++ b/platform/linux-generic/odp_crypto_ipsecmb.c
@@ -90,6 +90,7 @@ struct odp_crypto_generic_session_t {
odp_crypto_session_param_t p;
odp_bool_t do_cipher_first;
+ uint8_t null_crypto_enable :1;
struct {
union {
@@ -544,7 +545,18 @@ odp_crypto_session_create(const odp_crypto_session_param_t *param,
return -1;
}
- if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP) {
+ if (param->cipher_range_in_bits) {
+ *status = ODP_CRYPTO_SES_ERR_CIPHER;
+ *session_out = ODP_CRYPTO_SESSION_INVALID;
+ return -1;
+ }
+ if (param->auth_range_in_bits) {
+ *status = ODP_CRYPTO_SES_ERR_AUTH;
+ *session_out = ODP_CRYPTO_SESSION_INVALID;
+ return -1;
+ }
+ if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP ||
+ param->op_type == ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP) {
*status = ODP_CRYPTO_SES_ERR_PARAMS;
*session_out = ODP_CRYPTO_SESSION_INVALID;
return -1;
@@ -580,6 +592,10 @@ odp_crypto_session_create(const odp_crypto_session_param_t *param,
rc = -1;
}
+ if (param->null_crypto_enable && param->op_mode == ODP_CRYPTO_SYNC)
+ rc = -1;
+ session->null_crypto_enable = !!param->null_crypto_enable;
+
if (rc) {
*status = ODP_CRYPTO_SES_ERR_CIPHER;
goto err;
@@ -802,6 +818,9 @@ int crypto_int(odp_packet_t pkt_in,
return -1;
}
+ if (odp_unlikely(session->null_crypto_enable && param->null_crypto))
+ goto out;
+
/* Invoke the crypto function */
if (session->do_cipher_first) {
rc_cipher = session->cipher.func(out_pkt, param, session);
@@ -811,6 +830,7 @@ int crypto_int(odp_packet_t pkt_in,
rc_cipher = session->cipher.func(out_pkt, param, session);
}
+out:
packet_subtype_set(out_pkt, ODP_EVENT_PACKET_CRYPTO);
op_result = &packet_hdr(out_pkt)->crypto_op_result;
op_result->cipher_status.alg_err = rc_cipher;
diff --git a/platform/linux-generic/odp_crypto_null.c b/platform/linux-generic/odp_crypto_null.c
index c93691e92..6eda0f455 100644
--- a/platform/linux-generic/odp_crypto_null.c
+++ b/platform/linux-generic/odp_crypto_null.c
@@ -96,6 +96,9 @@ odp_crypto_generic_session_t *alloc_session(void)
}
odp_spinlock_unlock(&global->lock);
+ if (!session)
+ return NULL;
+
session->idx = session - global->sessions;
for (i = 0; i < ODP_THREAD_COUNT_MAX; i++)
@@ -206,7 +209,18 @@ odp_crypto_session_create(const odp_crypto_session_param_t *param,
return -1;
}
- if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP) {
+ if (param->cipher_range_in_bits) {
+ *status = ODP_CRYPTO_SES_ERR_CIPHER;
+ *session_out = ODP_CRYPTO_SESSION_INVALID;
+ return -1;
+ }
+ if (param->auth_range_in_bits) {
+ *status = ODP_CRYPTO_SES_ERR_AUTH;
+ *session_out = ODP_CRYPTO_SESSION_INVALID;
+ return -1;
+ }
+ if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP ||
+ param->op_type == ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP) {
*status = ODP_CRYPTO_SES_ERR_PARAMS;
*session_out = ODP_CRYPTO_SESSION_INVALID;
return -1;
diff --git a/platform/linux-generic/odp_crypto_openssl.c b/platform/linux-generic/odp_crypto_openssl.c
index 26c9ce7b7..879ce0b97 100644
--- a/platform/linux-generic/odp_crypto_openssl.c
+++ b/platform/linux-generic/odp_crypto_openssl.c
@@ -217,6 +217,7 @@ struct odp_crypto_generic_session_t {
uint8_t cipher_range_in_bits : 1;
uint8_t auth_range_in_bits : 1;
uint8_t auth_range_used : 1;
+ uint8_t null_crypto_enable : 1;
struct {
uint8_t key_data[EVP_MAX_KEY_LENGTH];
@@ -2058,6 +2059,12 @@ odp_crypto_session_create(const odp_crypto_session_param_t *param,
session->cipher_range_in_bits = !!param->cipher_range_in_bits;
session->auth_range_in_bits = !!param->auth_range_in_bits;
session->auth_range_used = 1;
+ session->null_crypto_enable = !!param->null_crypto_enable;
+
+ if (session->null_crypto_enable && param->op_mode == ODP_CRYPTO_SYNC) {
+ *status = ODP_CRYPTO_SES_ERR_CIPHER;
+ goto err;
+ }
if (session->p.cipher_iv_len > EVP_MAX_IV_LENGTH) {
_ODP_DBG("Maximum IV length exceeded\n");
@@ -2585,12 +2592,18 @@ int crypto_int(odp_packet_t pkt_in,
if (odp_likely(session->p.op_type == ODP_CRYPTO_OP_TYPE_BASIC)) {
out_pkt = pkt_in;
+ } else if (session->p.op_type == ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP &&
+ *pkt_out == ODP_PACKET_INVALID) {
+ out_pkt = pkt_in;
} else {
out_pkt = get_output_packet(session, pkt_in, *pkt_out);
if (odp_unlikely(out_pkt == ODP_PACKET_INVALID))
return -1;
}
+ if (odp_unlikely(session->null_crypto_enable && param->null_crypto))
+ goto out;
+
if (ODP_DEBUG) {
if (session->p.auth_alg != ODP_AUTH_ALG_NULL &&
param->hash_result_offset + session->p.auth_digest_len
@@ -2752,10 +2765,19 @@ int odp_crypto_op(const odp_packet_t pkt_in[],
session = (odp_crypto_generic_session_t *)(intptr_t)param[i].session;
_ODP_ASSERT(ODP_CRYPTO_SYNC == session->p.op_mode);
- if (odp_unlikely(session->p.op_type == ODP_CRYPTO_OP_TYPE_OOP))
+ if (odp_likely(session->p.op_type == ODP_CRYPTO_OP_TYPE_BASIC)) {
+ rc = crypto_int(pkt_in[i], &pkt_out[i], &param[i]);
+ } else if (session->p.op_type == ODP_CRYPTO_OP_TYPE_OOP) {
rc = crypto_int_oop(pkt_in[i], &pkt_out[i], &param[i]);
- else
+ } else if (session->p.op_type == ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP) {
+ if (pkt_out[i] == ODP_PACKET_INVALID) /* basic */
+ rc = crypto_int(pkt_in[i], &pkt_out[i], &param[i]);
+ else /* oop */
+ rc = crypto_int_oop(pkt_in[i], &pkt_out[i], &param[i]);
+ } else {
+ _ODP_ASSERT(session->p.op_type == ODP_CRYPTO_OP_TYPE_LEGACY);
rc = crypto_int(pkt_in[i], &pkt_out[i], &param[i]);
+ }
if (rc < 0)
break;
}
@@ -2778,13 +2800,22 @@ int odp_crypto_op_enq(const odp_packet_t pkt_in[],
_ODP_ASSERT(ODP_CRYPTO_ASYNC == session->p.op_mode);
_ODP_ASSERT(ODP_QUEUE_INVALID != session->p.compl_queue);
- if (session->p.op_type != ODP_CRYPTO_OP_TYPE_BASIC)
+ if (odp_likely(session->p.op_type == ODP_CRYPTO_OP_TYPE_BASIC)) {
+ rc = crypto_int(pkt_in[i], &pkt, &param[i]);
+ } else if (session->p.op_type == ODP_CRYPTO_OP_TYPE_OOP) {
pkt = pkt_out[i];
-
- if (odp_unlikely(session->p.op_type == ODP_CRYPTO_OP_TYPE_OOP))
rc = crypto_int_oop(pkt_in[i], &pkt, &param[i]);
- else
+ } else if (session->p.op_type == ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP) {
+ pkt = pkt_out[i];
+ if (pkt_out[i] == ODP_PACKET_INVALID) /* basic */
+ rc = crypto_int(pkt_in[i], &pkt, &param[i]);
+ else /* oop */
+ rc = crypto_int_oop(pkt_in[i], &pkt, &param[i]);
+ } else {
+ _ODP_ASSERT(session->p.op_type == ODP_CRYPTO_OP_TYPE_LEGACY);
+ pkt = pkt_out[i];
rc = crypto_int(pkt_in[i], &pkt, &param[i]);
+ }
if (rc < 0)
break;
diff --git a/platform/linux-generic/odp_dma.c b/platform/linux-generic/odp_dma.c
index 8ac18260c..82d737073 100644
--- a/platform/linux-generic/odp_dma.c
+++ b/platform/linux-generic/odp_dma.c
@@ -252,8 +252,10 @@ odp_dma_t odp_dma_create(const char *name, const odp_dma_param_t *param)
if (param->compl_mode_mask & ODP_DMA_COMPL_POLL) {
session->stash = create_stash();
- if (session->stash == ODP_STASH_INVALID)
+ if (session->stash == ODP_STASH_INVALID) {
+ session->active = 0;
return ODP_DMA_INVALID;
+ }
}
session->name[0] = 0;
diff --git a/platform/linux-generic/odp_fdserver.c b/platform/linux-generic/odp_fdserver.c
index af9c1b498..4995efb94 100644
--- a/platform/linux-generic/odp_fdserver.c
+++ b/platform/linux-generic/odp_fdserver.c
@@ -29,7 +29,7 @@
* _odp_fdserver_deregister_fd(context, key);
* _odp_fdserver_lookup_fd(context, key);
*
- * which are used to register/deregister or querry for file descriptor based
+ * which are used to register/deregister or query for file descriptor based
* on a context and key value couple, which has to be unique.
*
* Note again that the file descriptors stored here are local to this server
@@ -129,7 +129,7 @@ static int send_fdserver_msg(int sock, int command,
char ancillary_data[CMSG_SPACE(sizeof(int))];
- /* prepare the register request body (single framgent): */
+ /* prepare the register request body (single fragment): */
msg.command = command;
msg.context = context;
msg.key = key;
@@ -387,7 +387,7 @@ int _odp_fdserver_lookup_fd(fd_server_context_e context, uint64_t key)
}
/*
- * request server terminaison:
+ * request server termination:
*/
static int stop_server(void)
{
diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c
index e6ea8bc0c..05b693c94 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -26,8 +26,8 @@ enum init_stage {
NO_INIT = 0, /* No init stages completed */
LIBCONFIG_INIT,
CPUMASK_INIT,
- CPU_CYCLES_INIT,
SYSINFO_INIT,
+ CPU_CYCLES_INIT,
TIME_INIT,
ISHM_INIT,
FDSERVER_INIT,
@@ -299,6 +299,7 @@ static int term_global(enum init_stage stage)
}
/* Fall through */
+ case CPU_CYCLES_INIT:
case SYSINFO_INIT:
if (_odp_system_info_term()) {
_ODP_ERR("ODP system info term failed.\n");
@@ -306,8 +307,6 @@ static int term_global(enum init_stage stage)
}
/* Fall through */
- case CPU_CYCLES_INIT:
- /* Fall through */
case CPUMASK_INIT:
if (_odp_cpumask_term_global()) {
_ODP_ERR("ODP cpumask term failed.\n");
@@ -366,18 +365,18 @@ int odp_init_global(odp_instance_t *instance,
}
stage = CPUMASK_INIT;
- if (_odp_cpu_cycles_init_global()) {
- _ODP_ERR("ODP cpu cycle init failed.\n");
- goto init_failed;
- }
- stage = CPU_CYCLES_INIT;
-
if (_odp_system_info_init()) {
_ODP_ERR("ODP system_info init failed.\n");
goto init_failed;
}
stage = SYSINFO_INIT;
+ if (_odp_cpu_cycles_init_global()) {
+ _ODP_ERR("ODP cpu cycle init failed.\n");
+ goto init_failed;
+ }
+ stage = CPU_CYCLES_INIT;
+
if (_odp_time_init_global()) {
_ODP_ERR("ODP time init failed.\n");
goto init_failed;
diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c
index 861dc1337..8c97a0f55 100644
--- a/platform/linux-generic/odp_ipsec.c
+++ b/platform/linux-generic/odp_ipsec.c
@@ -2206,7 +2206,7 @@ static void ipsec_out_prepare(const odp_packet_t pkt_in[], odp_packet_t pkt_out[
opt_inc = (param->num_opt > 1) ? 1 : 0;
/* No need to do _odp_ipsec_sa_use() here since an ODP application is not allowed to do
* call IPsec output before SA creation has completed nor call odp_ipsec_sa_disable()
- * before IPsec output has completed. IOW, the needed sychronization between threads is
+ * before IPsec output has completed. IOW, the needed synchronization between threads is
* done by the application. */
*num_crypto = 0;
diff --git a/platform/linux-generic/odp_ipsec_sad.c b/platform/linux-generic/odp_ipsec_sad.c
index daa80c7e6..89cc8aef7 100644
--- a/platform/linux-generic/odp_ipsec_sad.c
+++ b/platform/linux-generic/odp_ipsec_sad.c
@@ -837,7 +837,7 @@ int odp_ipsec_sa_destroy(odp_ipsec_sa_t sa)
uint32_t state = odp_atomic_load_u32(&ipsec_sa->state);
if (IPSEC_SA_STATE_DISABLE != state) {
- _ODP_ERR("Distroying not disabled ipsec_sa: %u\n", ipsec_sa->ipsec_sa_idx);
+ _ODP_ERR("Destroying not disabled ipsec_sa: %u\n", ipsec_sa->ipsec_sa_idx);
return -1;
}
diff --git a/platform/linux-generic/odp_ishmpool.c b/platform/linux-generic/odp_ishmpool.c
index 5bcb2c2ea..9b6340d7e 100644
--- a/platform/linux-generic/odp_ishmpool.c
+++ b/platform/linux-generic/odp_ishmpool.c
@@ -32,7 +32,7 @@
* returned to this same queue when freed.
*
* The reason for not using malloc() is that malloc does not guarantee
- * memory sharability between ODP threads (regardless of their implememtation)
+ * memory sharability between ODP threads (regardless of their implementation)
* which ishm_reserve() can do. see the comments around
* _odp_ishmbud_pool_create() and ishm_reserve() for more details.
*
@@ -401,7 +401,7 @@ static int _odp_ishmbud_free(pool_t *bpool, void *addr)
/*merge: make sure we point at start of block: */
if (bblock > buddy)
bblock = buddy;
- /*merge: size of bloack has dubbled: increse order: */
+ /*merge: size of block has doubled: increase order: */
order++;
}
diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c
index cabb9fed5..96fcd928a 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -2218,8 +2218,26 @@ int odp_packet_tx_compl_request(odp_packet_t pkt, const odp_packet_tx_compl_opt_
{
odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt);
- pkt_hdr->p.flags.tx_compl = opt->mode == ODP_PACKET_TX_COMPL_EVENT ? 1 : 0;
- pkt_hdr->dst_queue = opt->queue;
+ switch (opt->mode) {
+ case ODP_PACKET_TX_COMPL_DISABLED:
+ pkt_hdr->p.flags.tx_compl_ev = 0;
+ pkt_hdr->p.flags.tx_compl_poll = 0;
+ break;
+ case ODP_PACKET_TX_COMPL_EVENT:
+ _ODP_ASSERT(opt->queue != ODP_QUEUE_INVALID);
+ pkt_hdr->p.flags.tx_compl_ev = 1;
+ pkt_hdr->p.flags.tx_compl_poll = 0;
+ pkt_hdr->dst_queue = opt->queue;
+ break;
+ case ODP_PACKET_TX_COMPL_POLL:
+ pkt_hdr->p.flags.tx_compl_ev = 0;
+ pkt_hdr->p.flags.tx_compl_poll = 1;
+ pkt_hdr->tx_compl_id = opt->compl_id;
+ break;
+ default:
+ _ODP_ERR("Bad TX completion mode: %i\n", opt->mode);
+ return -1;
+ }
return 0;
}
@@ -2228,7 +2246,7 @@ int odp_packet_has_tx_compl_request(odp_packet_t pkt)
{
odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt);
- return pkt_hdr->p.flags.tx_compl;
+ return pkt_hdr->p.flags.tx_compl_ev || pkt_hdr->p.flags.tx_compl_poll;
}
void odp_packet_tx_compl_free(odp_packet_tx_compl_t tx_compl)
@@ -2255,10 +2273,7 @@ void *odp_packet_tx_compl_user_ptr(odp_packet_tx_compl_t tx_compl)
int odp_packet_tx_compl_done(odp_pktio_t pktio, uint32_t compl_id)
{
- (void)pktio;
- (void)compl_id;
-
- return -1;
+ return odp_atomic_load_acq_u32(&get_pktio_entry(pktio)->tx_compl_status[compl_id]);
}
void odp_packet_free_ctrl_set(odp_packet_t pkt, odp_packet_free_ctrl_t ctrl)
diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c
index c4cd87afc..38c1c2b03 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -8,6 +8,7 @@
#include <odp_posix_extensions.h>
#include <odp/api/buffer.h>
+#include <odp/api/debug.h>
#include <odp/api/packet.h>
#include <odp/api/packet_io.h>
#include <odp/api/proto_stats.h>
@@ -56,9 +57,17 @@
#define MAX_TX_AGING_TMO_NS 3600000000000ULL
typedef struct {
- const void *user_ptr;
- odp_queue_t queue;
+ union {
+ struct {
+ odp_buffer_t buf;
+ const void *user_ptr;
+ odp_queue_t queue;
+ };
+
+ odp_atomic_u32_t *status;
+ };
uint16_t idx;
+ uint8_t mode;
} tx_compl_info_t;
/* Global variables */
@@ -266,6 +275,7 @@ static void init_pktio_entry(pktio_entry_t *entry)
entry->enabled.all_flags = 0;
entry->tx_compl_pool = ODP_POOL_INVALID;
+ entry->tx_compl_status_shm = ODP_SHM_INVALID;
odp_atomic_init_u64(&entry->stats_extra.in_discards, 0);
odp_atomic_init_u64(&entry->stats_extra.in_errors, 0);
@@ -514,13 +524,21 @@ int odp_pktio_close(odp_pktio_t hdl)
entry->num_out_queue = 0;
if (entry->tx_compl_pool != ODP_POOL_INVALID) {
- if (odp_pool_destroy(entry->tx_compl_pool)) {
+ if (odp_pool_destroy(entry->tx_compl_pool) == -1) {
unlock_entry(entry);
_ODP_ERR("Unable to destroy Tx event completion pool\n");
return -1;
}
}
+ if (entry->tx_compl_status_shm != ODP_SHM_INVALID) {
+ if (odp_shm_free(entry->tx_compl_status_shm) < 0) {
+ unlock_entry(entry);
+ _ODP_ERR("Unable to destroy Tx poll completion SHM\n");
+ return -1;
+ }
+ }
+
odp_spinlock_lock(&pktio_global->lock);
res = _pktio_close(entry);
odp_spinlock_unlock(&pktio_global->lock);
@@ -537,14 +555,13 @@ int odp_pktio_close(odp_pktio_t hdl)
static int configure_tx_event_compl(pktio_entry_t *entry)
{
odp_pool_param_t params;
- const char *name_base = "_odp_pktio_tx_compl_pool_";
+ const char *name_base = "_odp_pktio_tx_compl_";
char pool_name[ODP_POOL_NAME_LEN];
if (entry->tx_compl_pool != ODP_POOL_INVALID)
return 0;
- snprintf(pool_name, sizeof(pool_name), "%s%d", name_base,
- odp_pktio_index(entry->handle));
+ snprintf(pool_name, sizeof(pool_name), "%s%d", name_base, odp_pktio_index(entry->handle));
odp_pool_param_init(&params);
params.type = ODP_POOL_BUFFER;
@@ -558,6 +575,33 @@ static int configure_tx_event_compl(pktio_entry_t *entry)
return 0;
}
+static int configure_tx_poll_compl(pktio_entry_t *entry, uint32_t count)
+{
+ odp_shm_t shm;
+ const char *name_base = "_odp_pktio_tx_compl_";
+ char shm_name[ODP_SHM_NAME_LEN];
+
+ if (entry->tx_compl_status_shm != ODP_SHM_INVALID)
+ return 0;
+
+ snprintf(shm_name, sizeof(shm_name), "%s%d", name_base, odp_pktio_index(entry->handle));
+ shm = odp_shm_reserve(shm_name, sizeof(odp_atomic_u32_t) * count, ODP_CACHE_LINE_SIZE, 0);
+
+ if (shm == ODP_SHM_INVALID)
+ return -1;
+
+ entry->tx_compl_status_shm = shm;
+ entry->tx_compl_status = odp_shm_addr(shm);
+
+ if (entry->tx_compl_status == NULL)
+ return -1;
+
+ for (uint32_t i = 0; i < count; i++)
+ odp_atomic_init_u32(&entry->tx_compl_status[i], 0);
+
+ return 0;
+}
+
int odp_pktio_config(odp_pktio_t hdl, const odp_pktio_config_t *config)
{
pktio_entry_t *entry;
@@ -610,15 +654,26 @@ int odp_pktio_config(odp_pktio_t hdl, const odp_pktio_config_t *config)
entry->config = *config;
entry->enabled.tx_ts = config->pktout.bit.ts_ena;
- entry->enabled.tx_compl = (config->pktout.bit.tx_compl_ena || config->tx_compl.mode_event);
+ entry->enabled.tx_compl = (config->pktout.bit.tx_compl_ena ||
+ config->tx_compl.mode_event ||
+ config->tx_compl.mode_poll);
- if (entry->enabled.tx_compl)
- if (configure_tx_event_compl(entry)) {
+ if (entry->enabled.tx_compl) {
+ if ((config->pktout.bit.tx_compl_ena || config->tx_compl.mode_event) &&
+ configure_tx_event_compl(entry)) {
unlock_entry(entry);
_ODP_ERR("Unable to configure Tx event completion\n");
return -1;
}
+ if (config->tx_compl.mode_poll &&
+ configure_tx_poll_compl(entry, config->tx_compl.max_compl_id + 1)) {
+ unlock_entry(entry);
+ _ODP_ERR("Unable to configure Tx poll completion\n");
+ return -1;
+ }
+ }
+
entry->enabled.tx_aging = config->pktout.bit.aging_ena;
if (entry->ops->config)
@@ -825,104 +880,35 @@ static inline int pktin_recv_buf(pktio_entry_t *entry, int pktin_index,
return 1;
}
-static inline int packet_vector_send(odp_pktout_queue_t pktout_queue, odp_event_t event)
-{
- odp_packet_vector_t pktv = odp_packet_vector_from_event(event);
- odp_packet_t *pkt_tbl;
- int num, sent;
-
- num = odp_packet_vector_tbl(pktv, &pkt_tbl);
- _ODP_ASSERT(num > 0);
- sent = odp_pktout_send(pktout_queue, pkt_tbl, num);
-
- /* Return success if any packets were sent. Free the possible remaining
- packets in the vector and increase out_discards count accordingly. */
- if (odp_unlikely(sent <= 0)) {
- return -1;
- } else if (odp_unlikely(sent != num)) {
- pktio_entry_t *entry = get_pktio_entry(pktout_queue.pktio);
- int discards = num - sent;
-
- _ODP_ASSERT(entry != NULL);
-
- odp_atomic_add_u64(&entry->stats_extra.out_discards, discards);
-
- if (odp_unlikely(_odp_pktio_tx_compl_enabled(entry)))
- _odp_pktio_allocate_and_send_tx_compl_events(entry, &pkt_tbl[sent],
- discards);
-
- odp_packet_free_multi(&pkt_tbl[sent], discards);
- }
-
- odp_packet_vector_free(pktv);
-
- return 0;
-}
-
static int pktout_enqueue(odp_queue_t queue, _odp_event_hdr_t *event_hdr)
{
- odp_event_t event = _odp_event_from_hdr(event_hdr);
odp_packet_t pkt = packet_from_event_hdr(event_hdr);
- odp_pktout_queue_t pktout_queue;
- int len = 1;
int nbr;
- if (_odp_sched_fn->ord_enq_multi(queue, (void **)event_hdr, len, &nbr))
- return (nbr == len ? 0 : -1);
+ _ODP_ASSERT(odp_event_type(_odp_event_from_hdr(event_hdr)) == ODP_EVENT_PACKET);
- pktout_queue = _odp_queue_fn->get_pktout(queue);
+ if (_odp_sched_fn->ord_enq_multi(queue, (void **)event_hdr, 1, &nbr))
+ return (nbr == 1 ? 0 : -1);
- if (odp_event_type(event) == ODP_EVENT_PACKET_VECTOR)
- return packet_vector_send(pktout_queue, event);
-
- nbr = odp_pktout_send(pktout_queue, &pkt, len);
- return (nbr == len ? 0 : -1);
+ nbr = odp_pktout_send(_odp_queue_fn->get_pktout(queue), &pkt, 1);
+ return (nbr == 1 ? 0 : -1);
}
static int pktout_enq_multi(odp_queue_t queue, _odp_event_hdr_t *event_hdr[],
int num)
{
- odp_event_t event;
- odp_packet_t pkt_tbl[QUEUE_MULTI_MAX];
- odp_pktout_queue_t pktout_queue;
- int have_pktv = 0;
int nbr;
- int i;
-
- if (_odp_sched_fn->ord_enq_multi(queue, (void **)event_hdr, num, &nbr))
- return nbr;
- for (i = 0; i < num; ++i) {
- event = _odp_event_from_hdr(event_hdr[i]);
-
- if (odp_event_type(event) == ODP_EVENT_PACKET_VECTOR) {
- have_pktv = 1;
- break;
- }
-
- pkt_tbl[i] = packet_from_event_hdr(event_hdr[i]);
+ if (ODP_DEBUG) {
+ for (int i = 0; i < num; i++)
+ _ODP_ASSERT(odp_event_type(_odp_event_from_hdr(event_hdr[i])) ==
+ ODP_EVENT_PACKET);
}
- pktout_queue = _odp_queue_fn->get_pktout(queue);
-
- if (!have_pktv)
- return odp_pktout_send(pktout_queue, pkt_tbl, num);
-
- for (i = 0; i < num; ++i) {
- event = _odp_event_from_hdr(event_hdr[i]);
-
- if (odp_event_type(event) == ODP_EVENT_PACKET_VECTOR) {
- if (odp_unlikely(packet_vector_send(pktout_queue, event)))
- break;
- } else {
- odp_packet_t pkt = packet_from_event_hdr(event_hdr[i]);
+ if (_odp_sched_fn->ord_enq_multi(queue, (void **)event_hdr, num, &nbr))
+ return nbr;
- nbr = odp_pktout_send(pktout_queue, &pkt, 1);
- if (odp_unlikely(nbr != 1))
- break;
- }
- }
- return i;
+ return odp_pktout_send(_odp_queue_fn->get_pktout(queue), (odp_packet_t *)event_hdr, num);
}
static _odp_event_hdr_t *pktin_dequeue(odp_queue_t queue)
@@ -1612,14 +1598,9 @@ int odp_pktio_capability(odp_pktio_t pktio, odp_pktio_capability_t *capa)
capa->lso.proto.custom = 1;
capa->lso.mod_op.add_segment_num = 1;
- capa->config.pktout.bit.tx_compl_ena = 1;
capa->tx_compl.queue_type_sched = 1;
capa->tx_compl.queue_type_plain = 1;
- capa->tx_compl.mode_all = 1;
- capa->tx_compl.mode_event = 1;
- capa->tx_compl.mode_poll = 0;
- capa->tx_compl.max_compl_id = 0;
- capa->free_ctrl.dont_free = 0;
+ capa->tx_compl.max_compl_id = UINT32_MAX - 1;
capa->config.pktout.bit.aging_ena = 1;
capa->max_tx_aging_tmo_ns = MAX_TX_AGING_TMO_NS;
@@ -1645,6 +1626,9 @@ int odp_pktio_capability(odp_pktio_t pktio, odp_pktio_capability_t *capa)
return 0;
}
+ODP_STATIC_ASSERT(ODP_CONFIG_PKTIO_ENTRIES - 1 <= ODP_PKTIO_MAX_INDEX,
+ "ODP_CONFIG_PKTIO_ENTRIES larger than ODP_PKTIO_MAX_INDEX");
+
unsigned int odp_pktio_max_index(void)
{
return ODP_CONFIG_PKTIO_ENTRIES - 1;
@@ -2702,18 +2686,54 @@ uint64_t odp_pktin_wait_time(uint64_t nsec)
return (nsec / (1000)) + 1;
}
-static void check_tx_compl_ev(const odp_packet_hdr_t *hdr, int pkt_idx, tx_compl_info_t *info,
- uint16_t *num)
+static inline odp_bool_t check_tx_compl(const odp_packet_hdr_t *hdr, int pkt_idx,
+ tx_compl_info_t *info, odp_pool_t pool,
+ odp_atomic_u32_t *status_map, uint16_t *num)
{
- if (odp_unlikely(hdr->p.flags.tx_compl)) {
- info[*num].user_ptr = hdr->user_ptr;
- info[*num].queue = hdr->dst_queue;
- info[*num].idx = pkt_idx;
- (*num)++;
+ tx_compl_info_t *i;
+
+ if (odp_likely(hdr->p.flags.tx_compl_ev == 0 && hdr->p.flags.tx_compl_poll == 0))
+ return true;
+
+ i = &info[*num];
+ i->idx = pkt_idx;
+
+ if (hdr->p.flags.tx_compl_ev) {
+ i->buf = odp_buffer_alloc(pool);
+
+ if (i->buf == ODP_BUFFER_INVALID)
+ return false;
+
+ i->user_ptr = hdr->user_ptr;
+ i->queue = hdr->dst_queue;
+ i->mode = ODP_PACKET_TX_COMPL_EVENT;
+ } else {
+ i->status = &status_map[hdr->tx_compl_id];
+ odp_atomic_store_rel_u32(i->status, 0);
+ i->mode = ODP_PACKET_TX_COMPL_POLL;
}
+
+ (*num)++;
+
+ return true;
}
-static void send_tx_compl_event(odp_buffer_t buf, const void *user_ptr, odp_queue_t queue)
+static inline int prepare_tx_compl(const odp_packet_t packets[], int num, tx_compl_info_t *info,
+ odp_pool_t pool, odp_atomic_u32_t *status_map,
+ uint16_t *num_tx_c)
+{
+ int num_to_send = num;
+
+ for (int i = 0; i < num; i++)
+ if (!check_tx_compl(packet_hdr(packets[i]), i, info, pool, status_map, num_tx_c)) {
+ num_to_send = info[*num_tx_c].idx;
+ break;
+ }
+
+ return num_to_send;
+}
+
+static inline void send_tx_compl_event(odp_buffer_t buf, const void *user_ptr, odp_queue_t queue)
{
_odp_pktio_tx_compl_t *data;
odp_event_t ev;
@@ -2729,15 +2749,20 @@ static void send_tx_compl_event(odp_buffer_t buf, const void *user_ptr, odp_queu
}
}
-static void send_tx_compl_events(tx_compl_info_t *info, uint16_t num, odp_buffer_t bufs[],
- int num_sent)
+static inline void finish_tx_compl(tx_compl_info_t *info, uint16_t num, int num_sent)
{
- for (int i = 0; i < num; i++) {
- if (info[i].idx < num_sent) {
- send_tx_compl_event(bufs[i], info[i].user_ptr, info[i].queue);
- } else {
- odp_buffer_free_multi(&bufs[i], num - i);
- break;
+ tx_compl_info_t *i;
+
+ for (int j = 0; j < num; j++) {
+ i = &info[j];
+
+ if (i->idx < num_sent) {
+ if (i->mode == ODP_PACKET_TX_COMPL_EVENT)
+ send_tx_compl_event(i->buf, i->user_ptr, i->queue);
+ else
+ odp_atomic_store_rel_u32(i->status, 1);
+ } else if (i->mode == ODP_PACKET_TX_COMPL_EVENT) {
+ odp_buffer_free(i->buf);
}
}
}
@@ -2747,9 +2772,8 @@ int odp_pktout_send(odp_pktout_queue_t queue, const odp_packet_t packets[],
{
pktio_entry_t *entry;
odp_pktio_t pktio = queue.pktio;
- uint16_t num_tx_cevs = 0;
tx_compl_info_t tx_compl_info[num];
- odp_buffer_t bufs[num];
+ uint16_t num_tx_c = 0;
int num_to_send = num, num_sent;
entry = get_pktio_entry(pktio);
@@ -2765,27 +2789,17 @@ int odp_pktout_send(odp_pktout_queue_t queue, const odp_packet_t packets[],
_odp_pcapng_dump_pkts(entry, queue.index, packets, num);
if (odp_unlikely(_odp_pktio_tx_compl_enabled(entry))) {
- for (int i = 0; i < num; i++)
- check_tx_compl_ev(packet_hdr(packets[i]), i, tx_compl_info, &num_tx_cevs);
-
- if (odp_unlikely(num_tx_cevs)) {
- int num_alloc = odp_buffer_alloc_multi(entry->tx_compl_pool, bufs,
- num_tx_cevs);
+ odp_pool_t tx_compl_pool = entry->tx_compl_pool;
+ odp_atomic_u32_t *tx_compl_status = entry->tx_compl_status;
- if (odp_unlikely(num_alloc < num_tx_cevs)) {
- if (odp_unlikely(num_alloc < 0))
- num_alloc = 0;
-
- num_to_send = tx_compl_info[num_alloc].idx;
- num_tx_cevs = num_alloc;
- }
- }
+ num_to_send = prepare_tx_compl(packets, num, tx_compl_info, tx_compl_pool,
+ tx_compl_status, &num_tx_c);
}
num_sent = entry->ops->send(entry, queue.index, packets, num_to_send);
- if (odp_unlikely(num_tx_cevs))
- send_tx_compl_events(tx_compl_info, num_tx_cevs, bufs, num_sent);
+ if (odp_unlikely(num_tx_c))
+ finish_tx_compl(tx_compl_info, num_tx_c, num_sent);
return num_sent;
}
@@ -3297,24 +3311,28 @@ int odp_pktout_send_lso(odp_pktout_queue_t queue, const odp_packet_t packet[], i
return i;
}
-void _odp_pktio_allocate_and_send_tx_compl_events(const pktio_entry_t *entry,
- const odp_packet_t packets[], int num)
+void _odp_pktio_process_tx_compl(const pktio_entry_t *entry, const odp_packet_t packets[], int num)
{
- uint16_t num_tx_cevs = 0, num_alloc;
- int idx[num];
- odp_buffer_t bufs[num];
odp_packet_hdr_t *hdr;
+ odp_pool_t pool = entry->tx_compl_pool;
+ odp_buffer_t buf;
+ odp_atomic_u32_t *status_map = entry->tx_compl_status;
- for (int i = 0; i < num; i++)
- if (odp_unlikely(packet_hdr(packets[i])->p.flags.tx_compl))
- idx[num_tx_cevs++] = i;
+ for (int i = 0; i < num; i++) {
+ hdr = packet_hdr(packets[i]);
+
+ if (odp_likely(hdr->p.flags.tx_compl_ev == 0 && hdr->p.flags.tx_compl_poll == 0))
+ continue;
+
+ if (hdr->p.flags.tx_compl_ev) {
+ buf = odp_buffer_alloc(pool);
- if (odp_unlikely(num_tx_cevs)) {
- num_alloc = odp_buffer_alloc_multi(entry->tx_compl_pool, bufs, num_tx_cevs);
+ if (odp_unlikely(buf == ODP_BUFFER_INVALID))
+ continue;
- for (int i = 0; i < num_alloc; i++) {
- hdr = packet_hdr(packets[idx[i]]);
- send_tx_compl_event(bufs[i], hdr->user_ptr, hdr->dst_queue);
+ send_tx_compl_event(buf, hdr->user_ptr, hdr->dst_queue);
+ } else {
+ odp_atomic_store_rel_u32(&status_map[hdr->tx_compl_id], 1);
}
}
}
diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c
index e7b2398de..b3b6f9c40 100644
--- a/platform/linux-generic/odp_pool.c
+++ b/platform/linux-generic/odp_pool.c
@@ -1856,8 +1856,21 @@ int odp_pool_ext_capability(odp_pool_type_t type, odp_pool_ext_capability_t *cap
{
odp_pool_stats_opt_t supported_stats;
- if (type != ODP_POOL_PACKET)
+ _ODP_ASSERT(capa != NULL);
+
+ switch (type) {
+ case ODP_POOL_PACKET:
+ break;
+ case ODP_POOL_BUFFER:
+ case ODP_POOL_TIMEOUT:
+ case ODP_POOL_VECTOR:
+ case ODP_POOL_DMA_COMPL:
+ memset(capa, 0, sizeof(odp_pool_ext_capability_t));
+ return 0;
+ default:
+ _ODP_ERR("Invalid pool type: %d\n", type);
return -1;
+ }
supported_stats.all = 0;
diff --git a/platform/linux-generic/odp_queue_basic.c b/platform/linux-generic/odp_queue_basic.c
index 83694f84f..f9700742c 100644
--- a/platform/linux-generic/odp_queue_basic.c
+++ b/platform/linux-generic/odp_queue_basic.c
@@ -370,6 +370,29 @@ static odp_queue_t queue_create(const char *name,
return handle;
}
+static int queue_create_multi(const char *name[], const odp_queue_param_t param[],
+ odp_bool_t share_param, odp_queue_t queue[], int num)
+{
+ int i;
+
+ _ODP_ASSERT(param != NULL);
+ _ODP_ASSERT(queue != NULL);
+ _ODP_ASSERT(num > 0);
+
+ for (i = 0; i < num; i++) {
+ odp_queue_t cur_queue;
+ const char *cur_name = name != NULL ? name[i] : NULL;
+ const odp_queue_param_t *cur_param = share_param ? &param[0] : &param[i];
+
+ cur_queue = queue_create(cur_name, cur_param);
+ if (cur_queue == ODP_QUEUE_INVALID)
+ return (i == 0) ? -1 : i;
+
+ queue[i] = cur_queue;
+ }
+ return i;
+}
+
void _odp_sched_queue_set_status(uint32_t queue_index, int status)
{
queue_entry_t *queue = qentry_from_index(queue_index);
@@ -440,6 +463,23 @@ static int queue_destroy(odp_queue_t handle)
return 0;
}
+static int queue_destroy_multi(odp_queue_t handle[], int num)
+{
+ int i;
+
+ _ODP_ASSERT(handle != NULL);
+ _ODP_ASSERT(num > 0);
+
+ for (i = 0; i < num; i++) {
+ int ret = queue_destroy(handle[i]);
+
+ if (ret)
+ return (i == 0) ? ret : i;
+ }
+
+ return i;
+}
+
static int queue_context_set(odp_queue_t handle, void *context,
uint32_t len ODP_UNUSED)
{
@@ -1221,7 +1261,9 @@ static odp_event_t queue_api_deq(odp_queue_t handle)
/* API functions */
_odp_queue_api_fn_t _odp_queue_basic_api = {
.queue_create = queue_create,
+ .queue_create_multi = queue_create_multi,
.queue_destroy = queue_destroy,
+ .queue_destroy_multi = queue_destroy_multi,
.queue_lookup = queue_lookup,
.queue_capability = queue_capability,
.queue_context_set = queue_context_set,
diff --git a/platform/linux-generic/odp_queue_if.c b/platform/linux-generic/odp_queue_if.c
index b702e0105..cc6594afd 100644
--- a/platform/linux-generic/odp_queue_if.c
+++ b/platform/linux-generic/odp_queue_if.c
@@ -1,4 +1,5 @@
/* Copyright (c) 2017, ARM Limited
+ * Copyright (c) 2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -36,11 +37,23 @@ odp_queue_t odp_queue_create(const char *name, const odp_queue_param_t *param)
return _odp_queue_api->queue_create(name, param);
}
+int odp_queue_create_multi(const char *name[], const odp_queue_param_t param[],
+ odp_bool_t share_param, odp_queue_t queue[], int num)
+{
+ return _odp_queue_api->queue_create_multi(name, param, share_param,
+ queue, num);
+}
+
int odp_queue_destroy(odp_queue_t queue)
{
return _odp_queue_api->queue_destroy(queue);
}
+int odp_queue_destroy_multi(odp_queue_t queue[], int num)
+{
+ return _odp_queue_api->queue_destroy_multi(queue, num);
+}
+
odp_queue_t odp_queue_lookup(const char *name)
{
return _odp_queue_api->queue_lookup(name);
diff --git a/platform/linux-generic/odp_queue_scalable.c b/platform/linux-generic/odp_queue_scalable.c
index 4a4be1ecf..c7040dd3c 100644
--- a/platform/linux-generic/odp_queue_scalable.c
+++ b/platform/linux-generic/odp_queue_scalable.c
@@ -399,6 +399,29 @@ static odp_queue_t queue_create(const char *name,
return handle;
}
+static int queue_create_multi(const char *name[], const odp_queue_param_t param[],
+ odp_bool_t share_param, odp_queue_t queue[], int num)
+{
+ int i;
+
+ _ODP_ASSERT(param != NULL);
+ _ODP_ASSERT(queue != NULL);
+ _ODP_ASSERT(num > 0);
+
+ for (i = 0; i < num; i++) {
+ odp_queue_t cur_queue;
+ const char *cur_name = name != NULL ? name[i] : NULL;
+ const odp_queue_param_t *cur_param = share_param ? &param[0] : &param[i];
+
+ cur_queue = queue_create(cur_name, cur_param);
+ if (cur_queue == ODP_QUEUE_INVALID)
+ return (i == 0) ? -1 : i;
+
+ queue[i] = cur_queue;
+ }
+ return i;
+}
+
static int queue_destroy(odp_queue_t handle)
{
queue_entry_t *queue;
@@ -476,6 +499,23 @@ static int queue_destroy(odp_queue_t handle)
return 0;
}
+static int queue_destroy_multi(odp_queue_t handle[], int num)
+{
+ int i;
+
+ _ODP_ASSERT(handle != NULL);
+ _ODP_ASSERT(num > 0);
+
+ for (i = 0; i < num; i++) {
+ int ret = queue_destroy(handle[i]);
+
+ if (ret)
+ return (i == 0) ? ret : i;
+ }
+
+ return i;
+}
+
static int queue_context_set(odp_queue_t handle, void *context,
uint32_t len ODP_UNUSED)
{
@@ -1137,7 +1177,9 @@ static void queue_timer_rem(odp_queue_t handle)
/* API functions */
_odp_queue_api_fn_t _odp_queue_scalable_api = {
.queue_create = queue_create,
+ .queue_create_multi = queue_create_multi,
.queue_destroy = queue_destroy,
+ .queue_destroy_multi = queue_destroy_multi,
.queue_lookup = queue_lookup,
.queue_capability = queue_capability,
.queue_context_set = queue_context_set,
diff --git a/platform/linux-generic/odp_schedule_scalable.c b/platform/linux-generic/odp_schedule_scalable.c
index bca88e4b5..28245f66b 100644
--- a/platform/linux-generic/odp_schedule_scalable.c
+++ b/platform/linux-generic/odp_schedule_scalable.c
@@ -349,7 +349,7 @@ sched_update_deq(sched_elem_t *q,
if ((oss.numevts > 0 && nss.numevts <= 0) ||
oss.wrr_budget <= actual) {
/* If we have emptied parallel/ordered queue or
- * exchausted its WRR budget, we need a ticket
+ * exhausted its WRR budget, we need a ticket
* for a later pop.
*/
ticket = nss.nxt_ticket++;
diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c
index 7864a3d17..bb0eaa9b1 100644
--- a/platform/linux-generic/odp_system_info.c
+++ b/platform/linux-generic/odp_system_info.c
@@ -83,7 +83,7 @@ static uint64_t default_huge_page_size(void)
while (fgets(str, sizeof(str), file) != NULL) {
if (sscanf(str, "Hugepagesize: %8lu kB", &sz) == 1) {
- _ODP_DBG("defaut hp size is %lu kB\n", sz);
+ _ODP_DBG("default hp size is %lu kB\n", sz);
fclose(file);
return (uint64_t)sz * 1024;
}
@@ -611,5 +611,6 @@ void odp_sys_config_print(void)
_ODP_PRINT("CONFIG_POOL_MAX_NUM: %i\n", CONFIG_POOL_MAX_NUM);
_ODP_PRINT("CONFIG_POOL_CACHE_MAX_SIZE: %i\n", CONFIG_POOL_CACHE_MAX_SIZE);
_ODP_PRINT("CONFIG_TIMER_128BIT_ATOMICS: %i\n", CONFIG_TIMER_128BIT_ATOMICS);
+ _ODP_PRINT("CONFIG_TIMER_PROFILE_INLINE: %i\n", CONFIG_TIMER_PROFILE_INLINE);
_ODP_PRINT("\n");
}
diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c
index 8219c59a2..eaedcea8c 100644
--- a/platform/linux-generic/odp_timer.c
+++ b/platform/linux-generic/odp_timer.c
@@ -235,7 +235,8 @@ typedef struct timer_local_t {
odp_time_t last_run;
int run_cnt;
uint8_t poll_shared;
-
+ uint64_t prof_nsec;
+ uint64_t prof_rounds;
} timer_local_t;
/* Points to timer global data */
@@ -872,7 +873,17 @@ void _odp_timer_run_inline(int dec)
}
/* Check the timer pools. */
- timer_pool_scan_inline(num, now);
+ if (CONFIG_TIMER_PROFILE_INLINE) {
+ odp_time_t t1 = odp_time_local_strict();
+
+ timer_pool_scan_inline(num, now);
+ odp_time_t t2 = odp_time_local_strict();
+
+ timer_local.prof_nsec += odp_time_diff_ns(t2, t1);
+ timer_local.prof_rounds++;
+ } else {
+ timer_pool_scan_inline(num, now);
+ }
}
/******************************************************************************
@@ -1862,11 +1873,40 @@ odp_timeout_t odp_timeout_alloc(odp_pool_t pool_hdl)
return odp_timeout_from_event(event);
}
+int odp_timeout_alloc_multi(odp_pool_t pool_hdl, odp_timeout_t tmo[], int num)
+{
+ pool_t *pool;
+ int ret;
+
+ _ODP_ASSERT(pool_hdl != ODP_POOL_INVALID);
+ _ODP_ASSERT(tmo != NULL);
+ _ODP_ASSERT(num > 0);
+
+ pool = _odp_pool_entry(pool_hdl);
+
+ _ODP_ASSERT(pool->type == ODP_POOL_TIMEOUT);
+
+ ret = _odp_event_alloc_multi(pool, (_odp_event_hdr_t **)tmo, num);
+
+ for (int i = 0; i < ret; i++)
+ timeout_hdr(tmo[i])->timer = ODP_TIMER_INVALID;
+
+ return ret;
+}
+
void odp_timeout_free(odp_timeout_t tmo)
{
_odp_event_free(odp_timeout_to_event(tmo));
}
+void odp_timeout_free_multi(odp_timeout_t tmo[], int num)
+{
+ _ODP_ASSERT(tmo != NULL);
+ _ODP_ASSERT(num > 0);
+
+ _odp_event_free_multi((_odp_event_hdr_t **)(uintptr_t)tmo, num);
+}
+
void odp_timer_pool_print(odp_timer_pool_t timer_pool)
{
timer_pool_t *tp;
@@ -2119,6 +2159,8 @@ int _odp_timer_init_local(void)
timer_local.last_run = odp_time_global_from_ns(0);
timer_local.run_cnt = 1;
timer_local.poll_shared = 0;
+ timer_local.prof_nsec = 0;
+ timer_local.prof_rounds = 0;
/* Timer feature disabled */
if (timer_global == NULL)
@@ -2140,5 +2182,16 @@ int _odp_timer_init_local(void)
int _odp_timer_term_local(void)
{
+ if (CONFIG_TIMER_PROFILE_INLINE) {
+ if (timer_local.prof_rounds) {
+ _ODP_PRINT("\n"
+ "Inline timer profiling for thread %i:\n"
+ "scan rounds: %" PRIu64 "\n"
+ "ave scan nsec: %.1f\n",
+ odp_thread_id(), timer_local.prof_rounds,
+ (double)timer_local.prof_nsec / timer_local.prof_rounds);
+ }
+ }
+
return 0;
}
diff --git a/platform/linux-generic/odp_traffic_mngr.c b/platform/linux-generic/odp_traffic_mngr.c
index 82339361d..f0327fad0 100644
--- a/platform/linux-generic/odp_traffic_mngr.c
+++ b/platform/linux-generic/odp_traffic_mngr.c
@@ -2283,8 +2283,7 @@ static void tm_send_pkt(tm_system_t *tm_system, uint32_t max_sends)
ret = odp_pktout_send(tm_system->pktout, &odp_pkt, 1);
if (odp_unlikely(ret != 1)) {
if (odp_unlikely(_odp_pktio_tx_compl_enabled(pktio_entry)))
- _odp_pktio_allocate_and_send_tx_compl_events(pktio_entry,
- &odp_pkt, 1);
+ _odp_pktio_process_tx_compl(pktio_entry, &odp_pkt, 1);
odp_packet_free(odp_pkt);
if (odp_unlikely(ret < 0))
odp_atomic_inc_u64(&tm_queue_obj->stats.errors);
diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c
index 54c54ff10..3fa796007 100644
--- a/platform/linux-generic/pktio/dpdk.c
+++ b/platform/linux-generic/pktio/dpdk.c
@@ -1816,6 +1816,14 @@ static int dpdk_init_capability(pktio_entry_t *pktio_entry,
capa->config.pktout.bit.tcp_chksum;
capa->config.pktout.bit.ts_ena = 1;
+ if (!_ODP_DPDK_ZERO_COPY) {
+ capa->config.pktout.bit.tx_compl_ena = 1;
+ capa->tx_compl.mode_all = 1;
+ capa->tx_compl.mode_event = 1;
+ capa->tx_compl.mode_poll = 1;
+ capa->free_ctrl.dont_free = 1;
+ }
+
/* Copy for fast path access */
pkt_dpdk->pktout_capa = capa->config.pktout;
@@ -2098,7 +2106,7 @@ static int dpdk_start(pktio_entry_t *pktio_entry)
if (dpdk_setup_eth_rx(pktio_entry, pkt_dpdk, &dev_info))
return -1;
- /* Restore MTU value resetted by dpdk_setup_eth_rx() */
+ /* Restore MTU value reset by dpdk_setup_eth_rx() */
if (pkt_dpdk->mtu_set && pktio_entry->capa.set_op.op.maxlen) {
ret = dpdk_maxlen_set(pktio_entry, pkt_dpdk->mtu, 0);
if (ret) {
@@ -2251,13 +2259,36 @@ static int dpdk_send(pktio_entry_t *pktio_entry, int index,
}
}
} else {
+ int i;
+ int first = tx_pkts;
+
if (odp_unlikely(tx_pkts < mbufs)) {
- for (uint16_t i = tx_pkts; i < mbufs; i++)
+ for (i = tx_pkts; i < mbufs; i++)
rte_pktmbuf_free(tx_mbufs[i]);
}
- if (odp_likely(tx_pkts))
- odp_packet_free_multi(pkt_table, tx_pkts);
+ if (odp_unlikely(tx_pkts == 0))
+ return 0;
+
+ /* Find the first packet with (possible) don't free flag */
+ for (i = 0; i < tx_pkts; i++) {
+ if (odp_packet_free_ctrl(pkt_table[i]) == ODP_PACKET_FREE_CTRL_DONT_FREE) {
+ first = i;
+ break;
+ }
+ }
+
+ /* Free first N packets that don't have the flag */
+ if (odp_likely(first > 0))
+ odp_packet_free_multi(pkt_table, first);
+
+ /* Free rest of the packets (according to the flag) */
+ for (i = first; i < tx_pkts; i++) {
+ if (odp_packet_free_ctrl(pkt_table[i]) == ODP_PACKET_FREE_CTRL_DONT_FREE)
+ continue;
+
+ odp_packet_free(pkt_table[i]);
+ }
}
return tx_pkts;
diff --git a/platform/linux-generic/pktio/ipc.c b/platform/linux-generic/pktio/ipc.c
index 01d25e11d..dd286328a 100644
--- a/platform/linux-generic/pktio/ipc.c
+++ b/platform/linux-generic/pktio/ipc.c
@@ -709,7 +709,7 @@ static int ipc_pktio_recv_lockless(pktio_entry_t *pktio_entry,
pkt_table[i] = pkt;
}
- /* put back to rx ring dequed but not processed packets*/
+ /* put back to rx ring dequeued but not processed packets*/
if (pkts != i) {
ipcbufs_p = (void *)&offsets[i];
r_p = pktio_ipc->rx.cache;
@@ -923,6 +923,10 @@ static int ipc_capability(pktio_entry_t *pktio_entry ODP_UNUSED, odp_pktio_capab
capa->max_input_queues = 1;
capa->max_output_queues = 1;
+ capa->config.pktout.bit.tx_compl_ena = 1;
+ capa->tx_compl.mode_all = 1;
+ capa->tx_compl.mode_event = 1;
+ capa->tx_compl.mode_poll = 1;
return 0;
}
diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c
index 08459776b..ff48525a3 100644
--- a/platform/linux-generic/pktio/loop.c
+++ b/platform/linux-generic/pktio/loop.c
@@ -674,6 +674,10 @@ static int loopback_init_capability(pktio_entry_t *pktio_entry)
capa->config.pktout.bit.udp_chksum = 1;
capa->config.pktout.bit.sctp_chksum = 1;
capa->config.pktout.bit.ts_ena = 1;
+ capa->config.pktout.bit.tx_compl_ena = 1;
+ capa->tx_compl.mode_all = 1;
+ capa->tx_compl.mode_event = 1;
+ capa->tx_compl.mode_poll = 1;
if (odp_global_ro.disable.ipsec == 0) {
capa->config.inbound_ipsec = 1;
diff --git a/platform/linux-generic/pktio/null.c b/platform/linux-generic/pktio/null.c
index b067a68ec..00c45f84a 100644
--- a/platform/linux-generic/pktio/null.c
+++ b/platform/linux-generic/pktio/null.c
@@ -139,6 +139,10 @@ static int null_capability(pktio_entry_t *pktio_entry ODP_UNUSED,
capa->config.pktin.bit.ts_ptp = 1;
capa->config.pktout.bit.ts_ena = 1;
+ capa->config.pktout.bit.tx_compl_ena = 1;
+ capa->tx_compl.mode_all = 1;
+ capa->tx_compl.mode_event = 1;
+ capa->tx_compl.mode_poll = 1;
return 0;
}
diff --git a/platform/linux-generic/pktio/pcap.c b/platform/linux-generic/pktio/pcap.c
index 6f68e95a1..78b9876d7 100644
--- a/platform/linux-generic/pktio/pcap.c
+++ b/platform/linux-generic/pktio/pcap.c
@@ -505,6 +505,10 @@ static int pcapif_capability(pktio_entry_t *pktio_entry ODP_UNUSED,
capa->config.pktin.bit.ts_ptp = 1;
capa->config.pktout.bit.ts_ena = 1;
+ capa->config.pktout.bit.tx_compl_ena = 1;
+ capa->tx_compl.mode_all = 1;
+ capa->tx_compl.mode_event = 1;
+ capa->tx_compl.mode_poll = 1;
capa->stats.pktio.counter.in_octets = 1;
capa->stats.pktio.counter.in_packets = 1;
diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c
index 609a9351f..2a037e51f 100644
--- a/platform/linux-generic/pktio/socket.c
+++ b/platform/linux-generic/pktio/socket.c
@@ -587,6 +587,10 @@ static int sock_capability(pktio_entry_t *pktio_entry,
capa->config.pktin.bit.ts_ptp = 1;
capa->config.pktout.bit.ts_ena = 1;
+ capa->config.pktout.bit.tx_compl_ena = 1;
+ capa->tx_compl.mode_all = 1;
+ capa->tx_compl.mode_event = 1;
+ capa->tx_compl.mode_poll = 1;
/* Fill statistics capabilities */
_odp_sock_stats_capa(pktio_entry, capa);
diff --git a/platform/linux-generic/pktio/socket_mmap.c b/platform/linux-generic/pktio/socket_mmap.c
index 2ca150751..92bf8a4bf 100644
--- a/platform/linux-generic/pktio/socket_mmap.c
+++ b/platform/linux-generic/pktio/socket_mmap.c
@@ -891,6 +891,10 @@ static int sock_mmap_capability(pktio_entry_t *pktio_entry,
capa->config.pktin.bit.ts_ptp = 1;
capa->config.pktout.bit.ts_ena = 1;
+ capa->config.pktout.bit.tx_compl_ena = 1;
+ capa->tx_compl.mode_all = 1;
+ capa->tx_compl.mode_event = 1;
+ capa->tx_compl.mode_poll = 1;
/* Fill statistics capabilities */
_odp_sock_stats_capa(pktio_entry, capa);
diff --git a/platform/linux-generic/pktio/tap.c b/platform/linux-generic/pktio/tap.c
index 50d17e888..baac09646 100644
--- a/platform/linux-generic/pktio/tap.c
+++ b/platform/linux-generic/pktio/tap.c
@@ -536,6 +536,10 @@ static int tap_capability(pktio_entry_t *pktio_entry ODP_UNUSED,
capa->config.pktin.bit.ts_ptp = 1;
capa->config.pktout.bit.ts_ena = 1;
+ capa->config.pktout.bit.tx_compl_ena = 1;
+ capa->tx_compl.mode_all = 1;
+ capa->tx_compl.mode_event = 1;
+ capa->tx_compl.mode_poll = 1;
return 0;
}
diff --git a/platform/linux-generic/test/Makefile.am b/platform/linux-generic/test/Makefile.am
index 99d7199ad..30ef26078 100644
--- a/platform/linux-generic/test/Makefile.am
+++ b/platform/linux-generic/test/Makefile.am
@@ -15,10 +15,11 @@ TESTS += validation/api/pktio/pktio_run.sh \
validation/api/pktio/pktio_run_tap.sh \
validation/api/shmem/shmem_linux$(EXEEXT)
-SUBDIRS += validation/api/pktio\
- validation/api/shmem\
- pktio_ipc \
- example
+SUBDIRS += validation/api/pktio \
+ validation/api/shmem \
+ pktio_ipc \
+ example \
+ performance
if ODP_PKTIO_PCAP
TESTS += validation/api/pktio/pktio_run_pcap.sh
@@ -31,7 +32,8 @@ SUBDIRS += pktio_ipc
else
#performance tests refer to pktio_env
if test_perf
-SUBDIRS += validation/api/pktio
+SUBDIRS += validation/api/pktio \
+ performance
endif
endif
diff --git a/platform/linux-generic/test/performance/Makefile.am b/platform/linux-generic/test/performance/Makefile.am
new file mode 100644
index 000000000..4070f09f2
--- /dev/null
+++ b/platform/linux-generic/test/performance/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = dmafwd
diff --git a/platform/linux-generic/test/performance/dmafwd/Makefile.am b/platform/linux-generic/test/performance/dmafwd/Makefile.am
new file mode 100644
index 000000000..91d42cc74
--- /dev/null
+++ b/platform/linux-generic/test/performance/dmafwd/Makefile.am
@@ -0,0 +1,18 @@
+EXTRA_DIST = pktio_env
+
+all-local:
+ if [ "x$(srcdir)" != "x$(builddir)" ]; then \
+ for f in $(EXTRA_DIST); do \
+ if [ -e $(srcdir)/$$f ]; then \
+ mkdir -p $(builddir)/$$(dirname $$f); \
+ cp -f $(srcdir)/$$f $(builddir)/$$f; \
+ fi \
+ done \
+ fi
+
+clean-local:
+ if [ "x$(srcdir)" != "x$(builddir)" ]; then \
+ for f in $(EXTRA_DIST); do \
+ rm -f $(builddir)/$$f; \
+ done \
+ fi
diff --git a/platform/linux-generic/test/performance/dmafwd/pktio_env b/platform/linux-generic/test/performance/dmafwd/pktio_env
new file mode 100644
index 000000000..91075973e
--- /dev/null
+++ b/platform/linux-generic/test/performance/dmafwd/pktio_env
@@ -0,0 +1,57 @@
+#!/bin/sh
+#
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2023 Nokia
+
+PCAP_IN=`find . ${TEST_DIR} $(dirname $0) -name udp64.pcap -print -quit`
+PCAP_OUT=dmafwd_out.pcap
+IF0=pcap:in=${PCAP_IN}:out=${PCAP_OUT}
+DUMP=tcpdump
+
+if [ "$0" = "$BASH_SOURCE" ]; then
+ echo "ERROR: Platform specific env file has to be sourced."
+fi
+
+validate_result()
+{
+ local RET=0
+
+ if command -v ${DUMP}; then
+ local VALIN=valin
+ local VALOUT=valout
+
+ ${DUMP} -r ${PCAP_IN} -t -x > ${VALIN}
+ ${DUMP} -r ${PCAP_OUT} -t -x > ${VALOUT}
+ diff ${VALIN} ${VALOUT}
+ RET=$?
+ rm -f ${VALIN}
+ rm -f ${VALOUT}
+ else
+ echo "WARNING: No ${DUMP} available, using \"stat\" for diff"
+ local SZIN=$(stat -c %s ${PCAP_IN})
+ local SZOUT=$(stat -c %s ${PCAP_OUT})
+
+ if [ ${SZIN} -ne ${SZOUT} ]; then
+ RET=1
+ fi
+ fi
+
+ rm -f ${PCAP_OUT}
+
+ if [ $RET -ne 0 ]; then
+ echo "ERROR: Input and output captures do not match, exiting"
+ exit 1
+ fi
+
+ return 0
+}
+
+setup_interfaces()
+{
+ return 0
+}
+
+cleanup_interfaces()
+{
+ return 0
+}
diff --git a/platform/linux-generic/test/pktio_ipc/ipc_common.c b/platform/linux-generic/test/pktio_ipc/ipc_common.c
index 655cd80d5..d30aaf473 100644
--- a/platform/linux-generic/test/pktio_ipc/ipc_common.c
+++ b/platform/linux-generic/test/pktio_ipc/ipc_common.c
@@ -147,7 +147,7 @@ void print_info(char *progname)
}
/**
- * Prinf usage information
+ * Print usage information
*/
void usage(char *progname)
{
diff --git a/platform/linux-generic/test/validation/api/shmem/shmem_linux.c b/platform/linux-generic/test/validation/api/shmem/shmem_linux.c
index 43a640c49..03a9255f7 100644
--- a/platform/linux-generic/test/validation/api/shmem/shmem_linux.c
+++ b/platform/linux-generic/test/validation/api/shmem/shmem_linux.c
@@ -39,7 +39,7 @@
* exit with failure code. | -------------------
* |
* forks odp app2 process | ODP APP2 process
- * wait for child terminaison & status| (shmem_odp2.c)
+ * wait for child termination & status| (shmem_odp2.c)
* | lookup ODP_APP1 shared memory,
* | check if memory contents is OK
* | Exit(0) on success, exit(1) on fail
@@ -47,7 +47,7 @@
* exit with failure code. | -------------------
* |
* OK, write "S" in fifo, |
- * wait for child terminaison & status|
+ * wait for child termination & status|
* terminate with same status as child|
* | ODP APP1 process
* | (shmem_odp1.c)
@@ -56,7 +56,7 @@
* | read S(success) or F(fail) from fifo
* | report success or failure to C-Unit
* | Exit(0) on success, exit(1) on fail
- * wait for child terminaison & status |
+ * wait for child termination & status |
* terminate with same status as child |
* |
* \|/
@@ -91,25 +91,25 @@
#define MAX_FIFO_WAIT 30 /* Max time waiting for the fifo (sec) */
/*
- * read the attributes of a externaly shared mem object:
+ * read the attributes of an externally shared mem object:
* input: ext_odp_pid, blockname: the remote ODP instance and the exported
* block name to be searched.
- * Output: filename: the memory block underlaying file to be opened
+ * Output: filename: the memory block underlying file to be opened
* (the given buffer should be big enough i.e. at
* least ISHM_FILENAME_MAXLEN bytes)
* The 3 following parameters are really here for debug
- * as they are really meaningles in a non-odp process:
+ * as they are really meaningless in a non-odp process:
* len: the block real length (bytes, multiple of page sz)
* flags: the _ishm flags setting the block was created with
- * align: the alignement setting the block was created with
+ * align: the alignment setting the block was created with
*
* return 0 on success, non zero on error
*/
-static int read_shmem_attribues(uint64_t ext_odp_pid, const char *blockname,
- char *filename, uint64_t *len,
- uint32_t *flags, uint64_t *user_len,
- uint32_t *user_flags, uint32_t *align,
- uint64_t *offset)
+static int read_shmem_attributes(uint64_t ext_odp_pid, const char *blockname,
+ char *filename, uint64_t *len,
+ uint32_t *flags, uint64_t *user_len,
+ uint32_t *user_flags, uint32_t *align,
+ uint64_t *offset)
{
char shm_attr_filename[PATH_MAX];
FILE *export_file;
@@ -261,11 +261,11 @@ int main(int argc __attribute__((unused)), char *argv[])
* check to see if linux can see the created shared memory: */
/* read the shared memory attributes (includes the shm filename): */
- if (read_shmem_attribues(odp_app1, SHM_NAME,
- shm_filename, &len, &flags,
- &user_len, &user_flags, &align,
- &offset) != 0) {
- printf("error read_shmem_attribues\n");
+ if (read_shmem_attributes(odp_app1, SHM_NAME,
+ shm_filename, &len, &flags,
+ &user_len, &user_flags, &align,
+ &offset) != 0) {
+ printf("error read_shmem_attributes\n");
test_failure(fifo_name, fifo_fd, odp_app1);
}
@@ -279,7 +279,7 @@ int main(int argc __attribute__((unused)), char *argv[])
test_failure(fifo_name, fifo_fd, odp_app1); /* no return */
}
- /* linux ODP guarantees page size alignement. Larger alignment may
+ /* linux ODP guarantees page size alignment. Larger alignment may
* fail as 2 different processes will have fully unrelated
* virtual spaces.
*/
diff --git a/platform/linux-generic/test/validation/api/shmem/shmem_odp2.c b/platform/linux-generic/test/validation/api/shmem/shmem_odp2.c
index 1f2637a6a..14ad2d82e 100644
--- a/platform/linux-generic/test/validation/api/shmem/shmem_odp2.c
+++ b/platform/linux-generic/test/validation/api/shmem/shmem_odp2.c
@@ -23,7 +23,7 @@
#define TEST_SHARE_BAR (0xf0f0f0f)
/* The C unit test harness is run by ODP1 app which will be told the return
- * staus of this process. See top of shmem_linux.c for chart flow of events
+ * status of this process. See top of shmem_linux.c for chart flow of events
*/
int main(int argc, char *argv[])
{
@@ -100,6 +100,6 @@ int main(int argc, char *argv[])
return 1;
}
- printf("%s SUCSESS\n", __FILE__);
+ printf("%s SUCCESS\n", __FILE__);
return 0;
}
diff --git a/test/common/mask_common.c b/test/common/mask_common.c
index 3b6b44102..65c9c6629 100644
--- a/test/common/mask_common.c
+++ b/test/common/mask_common.c
@@ -5,6 +5,7 @@
*/
#include <odp_api.h>
+#include <odp/helper/odph_api.h>
#include "odp_cunit_common.h"
#include "mask_common.h"
@@ -457,7 +458,7 @@ MASK_TESTFUNC(next)
_odp_mask_from_str(&mask1, TEST_MASK_1_3);
- for (i = 0; i < sizeof(expected) / sizeof(int); i++)
+ for (i = 0; i < ODPH_ARRAY_SIZE(expected); i++)
CU_ASSERT(_odp_mask_next(&mask1, i) == expected[i]);
}
diff --git a/test/common/odp_cunit_common.c b/test/common/odp_cunit_common.c
index 60746164c..a5b9ff1ea 100644
--- a/test/common/odp_cunit_common.c
+++ b/test/common/odp_cunit_common.c
@@ -639,7 +639,7 @@ int odp_cunit_run(void)
CU_cleanup_registry();
- /* call test executable terminason hook, if any */
+ /* call test executable termination hook, if any */
if (global_init_term.global_term_ptr &&
((*global_init_term.global_term_ptr)(instance) != 0))
return -1;
@@ -704,7 +704,7 @@ int odp_cunit_register(odp_suiteinfo_t testsuites[])
}
/*
- * Parse command line options to extract options affectiong cunit_common.
+ * Parse command line options to extract options affecting cunit_common.
* (hence also helpers options as cunit_common uses the helpers)
* Options private to the test calling cunit_common are not parsed here.
*/
diff --git a/test/performance/.gitignore b/test/performance/.gitignore
index 087a163d8..08a4d5609 100644
--- a/test/performance/.gitignore
+++ b/test/performance/.gitignore
@@ -5,10 +5,12 @@ odp_atomic_perf
odp_bench_buffer
odp_bench_misc
odp_bench_packet
+odp_bench_pktio_sp
odp_bench_timer
odp_cpu_bench
odp_crc
odp_crypto
+odp_dmafwd
odp_dma_perf
odp_ipsec
odp_ipsecfwd
@@ -25,5 +27,6 @@ odp_sched_latency
odp_sched_perf
odp_sched_pktio
odp_scheduling
+odp_stash_perf
odp_stress
odp_timer_perf
diff --git a/test/performance/Makefile.am b/test/performance/Makefile.am
index 6e20ec07c..7b0adbe09 100644
--- a/test/performance/Makefile.am
+++ b/test/performance/Makefile.am
@@ -6,6 +6,7 @@ EXECUTABLES = odp_atomic_perf \
odp_bench_buffer \
odp_bench_misc \
odp_bench_packet \
+ odp_bench_pktio_sp \
odp_bench_timer \
odp_crc \
odp_lock_perf \
@@ -13,10 +14,13 @@ EXECUTABLES = odp_atomic_perf \
odp_pktio_perf \
odp_pool_perf \
odp_queue_perf \
- odp_random
+ odp_stash_perf \
+ odp_random \
+ odp_stress
COMPILE_ONLY = odp_cpu_bench \
odp_crypto \
+ odp_dmafwd \
odp_dma_perf \
odp_ipsec \
odp_l2fwd \
@@ -26,7 +30,6 @@ COMPILE_ONLY = odp_cpu_bench \
odp_sched_perf \
odp_sched_pktio \
odp_scheduling \
- odp_stress \
odp_timer_perf
if LIBCONFIG
@@ -46,7 +49,8 @@ TESTSCRIPTS = odp_cpu_bench_run.sh \
odp_timer_perf_run.sh
if ODP_PKTIO_PCAP
-TESTSCRIPTS += odp_pktio_ordered_run.sh
+TESTSCRIPTS += odp_dmafwd_run.sh \
+ odp_pktio_ordered_run.sh
endif
TEST_EXTENSIONS = .sh
@@ -58,13 +62,15 @@ endif
bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
odp_atomic_perf_SOURCES = odp_atomic_perf.c
-odp_bench_buffer_SOURCES = odp_bench_buffer.c
-odp_bench_misc_SOURCES = odp_bench_misc.c
-odp_bench_packet_SOURCES = odp_bench_packet.c
-odp_bench_timer_SOURCES = odp_bench_timer.c
+odp_bench_buffer_SOURCES = odp_bench_buffer.c bench_common.c bench_common.h
+odp_bench_misc_SOURCES = odp_bench_misc.c bench_common.c bench_common.h
+odp_bench_packet_SOURCES = odp_bench_packet.c bench_common.c bench_common.h
+odp_bench_pktio_sp_SOURCES = odp_bench_pktio_sp.c bench_common.c bench_common.h
+odp_bench_timer_SOURCES = odp_bench_timer.c bench_common.c bench_common.h
odp_cpu_bench_SOURCES = odp_cpu_bench.c
odp_crc_SOURCES = odp_crc.c
odp_crypto_SOURCES = odp_crypto.c
+odp_dmafwd_SOURCES = odp_dmafwd.c
odp_dma_perf_SOURCES = odp_dma_perf.c
odp_ipsec_SOURCES = odp_ipsec.c
odp_lock_perf_SOURCES = odp_lock_perf.c
diff --git a/test/performance/bench_common.c b/test/performance/bench_common.c
new file mode 100644
index 000000000..5a948c9c7
--- /dev/null
+++ b/test/performance/bench_common.c
@@ -0,0 +1,256 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
+ */
+
+#include <odp_api.h>
+#include <odp/helper/odph_api.h>
+
+#include "bench_common.h"
+
+#include <inttypes.h>
+#include <stdint.h>
+#include <string.h>
+
+void bench_suite_init(bench_suite_t *suite)
+{
+ memset(suite, 0, sizeof(bench_suite_t));
+
+ suite->measure_time = true;
+
+ odp_atomic_init_u32(&suite->exit_worker, 0);
+}
+
+void bench_run_indef(bench_info_t *info, odp_atomic_u32_t *exit_thread)
+{
+ const char *desc;
+
+ desc = info->desc != NULL ? info->desc : info->name;
+
+ printf("Running odp_%s test indefinitely\n", desc);
+
+ while (!odp_atomic_load_u32(exit_thread)) {
+ int ret;
+
+ if (info->init != NULL)
+ info->init();
+
+ ret = info->run();
+
+ if (info->term != NULL)
+ info->term();
+
+ if (!ret)
+ ODPH_ABORT("Benchmark %s failed\n", desc);
+ }
+}
+
+int bench_run(void *arg)
+{
+ uint64_t c1, c2;
+ odp_time_t t1, t2;
+ bench_suite_t *suite = arg;
+ const uint64_t repeat_count = suite->repeat_count;
+ const odp_bool_t meas_time = suite->measure_time;
+
+ printf("\nAverage %s per function call\n", meas_time ? "time (nsec)" : "CPU cycles");
+ printf("-------------------------------------------------\n");
+
+ /* Run each test twice. Results from the first warm-up round are ignored. */
+ for (int i = 0; i < 2; i++) {
+ uint64_t total = 0;
+ uint64_t round = 1;
+
+ for (int j = 0; j < suite->num_bench; round++) {
+ int ret;
+ const char *desc;
+ const bench_info_t *bench = &suite->bench[j];
+ uint64_t max_rounds = suite->rounds;
+
+ if (bench->max_rounds && bench->max_rounds < max_rounds)
+ max_rounds = bench->max_rounds;
+
+ /* Run selected test indefinitely */
+ if (suite->indef_idx) {
+ if ((j + 1) != suite->indef_idx) {
+ j++;
+ continue;
+ }
+ bench_run_indef(&suite->bench[j], &suite->exit_worker);
+ return 0;
+ }
+
+ desc = bench->desc != NULL ? bench->desc : bench->name;
+
+ if (bench->init != NULL)
+ bench->init();
+
+ if (meas_time)
+ t1 = odp_time_local_strict();
+ else
+ c1 = odp_cpu_cycles();
+
+ ret = bench->run();
+
+ if (meas_time)
+ t2 = odp_time_local_strict();
+ else
+ c2 = odp_cpu_cycles();
+
+ if (bench->term != NULL)
+ bench->term();
+
+ if (!ret) {
+ ODPH_ERR("Benchmark odp_%s failed\n", desc);
+ suite->retval = -1;
+ return -1;
+ }
+
+ if (meas_time)
+ total += odp_time_diff_ns(t2, t1);
+ else
+ total += odp_cpu_cycles_diff(c2, c1);
+
+ if (round >= max_rounds) {
+ double result;
+
+ /* Each benchmark runs internally 'repeat_count' times. */
+ result = ((double)total) / (max_rounds * repeat_count);
+
+ /* No print or results from warm-up round */
+ if (i > 0) {
+ printf("[%02d] odp_%-26s: %12.2f\n", j + 1, desc, result);
+
+ if (suite->result)
+ suite->result[j] = result;
+ }
+ j++;
+ total = 0;
+ round = 1;
+ }
+ }
+ }
+ printf("\n");
+ /* Print dummy result to prevent compiler to optimize it away*/
+ if (suite->dummy)
+ printf("(dummy result: 0x%" PRIx64 ")\n\n", suite->dummy);
+
+ return 0;
+}
+
+void bench_tm_suite_init(bench_tm_suite_t *suite)
+{
+ memset(suite, 0, sizeof(bench_tm_suite_t));
+
+ odp_atomic_init_u32(&suite->exit_worker, 0);
+}
+
+uint8_t bench_tm_func_register(bench_tm_result_t *res, const char *func_name)
+{
+ uint8_t num_func = res->num;
+
+ if (num_func >= BENCH_TM_MAX_FUNC)
+ ODPH_ABORT("Too many test functions (max %d)\n", BENCH_TM_MAX_FUNC);
+
+ res->func[num_func].name = func_name;
+ res->num++;
+
+ return num_func;
+}
+
+void bench_tm_func_record(odp_time_t t2, odp_time_t t1, bench_tm_result_t *res, uint8_t id)
+{
+ odp_time_t diff = odp_time_diff(t2, t1);
+
+ ODPH_ASSERT(id < BENCH_TM_MAX_FUNC);
+
+ res->func[id].tot = odp_time_sum(res->func[id].tot, diff);
+
+ if (odp_time_cmp(diff, res->func[id].min) < 0)
+ res->func[id].min = diff;
+
+ if (odp_time_cmp(diff, res->func[id].max) > 0)
+ res->func[id].max = diff;
+
+ res->func[id].num++;
+}
+
+static void init_result(bench_tm_result_t *res)
+{
+ memset(res, 0, sizeof(bench_tm_result_t));
+
+ for (int i = 0; i < BENCH_TM_MAX_FUNC; i++) {
+ res->func[i].tot = ODP_TIME_NULL;
+ res->func[i].min = odp_time_local_from_ns(ODP_TIME_HOUR_IN_NS);
+ res->func[i].max = ODP_TIME_NULL;
+ }
+}
+
+static void print_results(bench_tm_result_t *res)
+{
+ for (uint8_t i = 0; i < res->num; i++) {
+ uint64_t num = res->func[i].num ? res->func[i].num : 1;
+
+ printf(" %-38s %-12" PRIu64 " %-12" PRIu64 " %-12" PRIu64 "\n",
+ res->func[i].name,
+ odp_time_to_ns(res->func[i].min),
+ odp_time_to_ns(res->func[i].tot) / num,
+ odp_time_to_ns(res->func[i].max));
+ }
+}
+
+int bench_tm_run(void *arg)
+{
+ bench_tm_suite_t *suite = arg;
+
+ printf("\nLatency (nsec) per function call min avg max\n");
+ printf("------------------------------------------------------------------------------\n");
+
+ /* Run each test twice. Results from the first warm-up round are ignored. */
+ for (uint32_t i = 0; i < 2; i++) {
+ for (uint32_t j = 0; j < suite->num_bench; j++) {
+ const bench_tm_info_t *bench = &suite->bench[j];
+ uint64_t rounds = suite->rounds;
+ bench_tm_result_t res;
+
+ if (odp_atomic_load_u32(&suite->exit_worker))
+ return 0;
+
+ /* Run only selected test case */
+ if (suite->bench_idx && (j + 1) != suite->bench_idx)
+ continue;
+
+ if (bench->max_rounds && bench->max_rounds < rounds)
+ rounds = bench->max_rounds;
+
+ if (bench->cond != NULL && !bench->cond()) {
+ if (i > 0)
+ printf("[%02d] %-41s n/a n/a n/a\n",
+ j + 1, bench->name);
+ continue;
+ }
+
+ init_result(&res);
+
+ if (bench->init != NULL)
+ bench->init();
+
+ if (bench->run(&res, rounds)) {
+ ODPH_ERR("Benchmark %s failed\n", bench->name);
+ suite->retval = -1;
+ return -1;
+ }
+
+ if (bench->term != NULL)
+ bench->term();
+
+ /* No print or results from warm-up round */
+ if (i > 0) {
+ printf("[%02d] %-26s\n", j + 1, bench->name);
+ print_results(&res);
+ }
+ }
+ }
+ printf("\n");
+
+ return 0;
+}
diff --git a/test/performance/bench_common.h b/test/performance/bench_common.h
new file mode 100644
index 000000000..bd611878d
--- /dev/null
+++ b/test/performance/bench_common.h
@@ -0,0 +1,237 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
+ */
+
+#ifndef BENCH_COMMON_H
+#define BENCH_COMMON_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp_api.h>
+#include <odp/helper/odph_api.h>
+
+#include <stdint.h>
+
+/**
+ * Check benchmark preconditions
+ *
+ * Returns !0 if benchmark precondition is met.
+ */
+typedef int (*bench_cond_fn_t)(void);
+
+/**
+ * Initialize benchmark resources
+ */
+typedef void (*bench_init_fn_t)(void);
+
+/**
+ * Run benchmark
+ *
+ * Returns >0 on success.
+ */
+typedef int (*bench_run_fn_t)(void);
+
+/**
+ * Release benchmark resources
+ */
+typedef void (*bench_term_fn_t)(void);
+
+/* Benchmark test data */
+typedef struct {
+ /* Default test name */
+ const char *name;
+
+ /* Optional alternate test description */
+ const char *desc;
+
+ /* Optional precondition to run test */
+ bench_cond_fn_t cond;
+
+ /* Optional test initializer function */
+ bench_init_fn_t init;
+
+ /* Test function to run */
+ bench_run_fn_t run;
+
+ /* Optional test terminate function */
+ bench_term_fn_t term;
+
+ /* Optional test specific limit for rounds (tuning for slow implementations) */
+ uint32_t max_rounds;
+
+} bench_info_t;
+
+/* Benchmark suite data */
+typedef struct {
+ /* Array of benchmark functions */
+ bench_info_t *bench;
+
+ /* Number of benchmark functions */
+ int num_bench;
+
+ /* Optional benchmark index to run indefinitely (1...num_bench) */
+ int indef_idx;
+
+ /* Suite exit value output */
+ int retval;
+
+ /* Measure time vs. CPU cycles */
+ odp_bool_t measure_time;
+
+ /* Break worker loop if set to 1 */
+ odp_atomic_u32_t exit_worker;
+
+ /* Number of API function calls per test case */
+ uint64_t repeat_count;
+
+ /* Number of rounds per test case */
+ uint64_t rounds;
+
+ /* Dummy test result output */
+ uint64_t dummy;
+
+ /* Optional test result output array */
+ double *result;
+
+} bench_suite_t;
+
+/**
+ * Initialize benchmark suite parameters
+ */
+void bench_suite_init(bench_suite_t *suite);
+
+/**
+ * Run selected test indefinitely
+ */
+void bench_run_indef(bench_info_t *info, odp_atomic_u32_t *exit_thread);
+
+/**
+ * Run test suite and print results
+ *
+ * The argument is of type 'bench_suite_t *'. Returns 0 on success and <0 on failure.
+ */
+int bench_run(void *arg);
+
+/*
+ * Timed benchmark framework
+ *
+ * The main difference compared to the standard benchmark suite is that all
+ * latency measurements are performed inside the test cases.
+ */
+
+/* Maximum number of benchmarked functions per test case */
+#define BENCH_TM_MAX_FUNC 8
+
+/* Timed benchmark results */
+typedef struct bench_tm_results_s {
+ /* Results per function */
+ struct {
+ /* Name of function */
+ const char *name;
+
+ /* Total duration of all function calls */
+ odp_time_t tot;
+
+ /* Minimum duration */
+ odp_time_t min;
+
+ /* Maximum duration */
+ odp_time_t max;
+
+ /* Number of measurements */
+ uint64_t num;
+
+ } func[BENCH_TM_MAX_FUNC];
+
+ /* Number of registered test functions */
+ uint8_t num;
+
+} bench_tm_result_t;
+
+/**
+ * Timed benchmark test case
+ *
+ * Returns 0 on success and <0 on failure.
+ */
+typedef int (*bench_tm_run_fn_t)(bench_tm_result_t *res, int repeat_count);
+
+/* Timed benchmark test case */
+typedef struct {
+ /* Test case name */
+ const char *name;
+
+ /* Optional precondition to run test */
+ bench_cond_fn_t cond;
+
+ /* Optional test initializer function */
+ bench_init_fn_t init;
+
+ /* Test function to run */
+ bench_tm_run_fn_t run;
+
+ /* Optional test termination function */
+ bench_term_fn_t term;
+
+ /* Optional test specific limit for rounds (tuning for slow implementations) */
+ uint32_t max_rounds;
+
+} bench_tm_info_t;
+
+/* Timed benchmark suite data */
+typedef struct {
+ /* Array of benchmark test cases */
+ bench_tm_info_t *bench;
+
+ /* Number of benchmark test cases */
+ uint32_t num_bench;
+
+ /* Optional benchmark index to run (1...num_bench) */
+ uint32_t bench_idx;
+
+ /* Suite exit value output */
+ int retval;
+
+ /* Number of rounds per test case */
+ uint64_t rounds;
+
+ /* Break worker loop if set to 1 */
+ odp_atomic_u32_t exit_worker;
+
+} bench_tm_suite_t;
+
+/**
+ * Initialize benchmark suite data
+ */
+void bench_tm_suite_init(bench_tm_suite_t *suite);
+
+/**
+ * Register function for benchmarking
+ *
+ * Called by each test case to register benchmarked functions. Returns function
+ * ID for recording benchmark results. At most BENCH_TM_MAX_FUNC functions can
+ * be registered per test case.
+ */
+uint8_t bench_tm_func_register(bench_tm_result_t *res, const char *func_name);
+
+/**
+ * Record results for previously registered function
+ *
+ * Test case must call this function every test round for each registered
+ * function.
+ */
+void bench_tm_func_record(odp_time_t t2, odp_time_t t1, bench_tm_result_t *res, uint8_t id);
+
+/**
+ * Run timed test suite and print results
+ *
+ * The argument is of type 'bench_tm_suite_t *'. Returns 0 on success and <0 on failure.
+ */
+int bench_tm_run(void *arg);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/test/performance/odp_atomic_perf.c b/test/performance/odp_atomic_perf.c
index 5eeba8442..28217f5d7 100644
--- a/test/performance/odp_atomic_perf.c
+++ b/test/performance/odp_atomic_perf.c
@@ -1354,7 +1354,7 @@ int main(int argc, char **argv)
print_info(&test_global->test_options);
/* Loop all test cases */
- num_tests = sizeof(test_suite) / sizeof(test_suite[0]);
+ num_tests = ODPH_ARRAY_SIZE(test_suite);
for (i = 0; i < num_tests; i++) {
/* Initialize test variables */
diff --git a/test/performance/odp_bench_buffer.c b/test/performance/odp_bench_buffer.c
index e0e7c85cd..8b041eee0 100644
--- a/test/performance/odp_bench_buffer.c
+++ b/test/performance/odp_bench_buffer.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2017-2018, Linaro Limited
- * Copyright (c) 2022, Nokia
+ * Copyright (c) 2022-2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -8,6 +8,8 @@
#include <odp_api.h>
#include <odp/helper/odph_api.h>
+#include "bench_common.h"
+
#include <getopt.h>
#include <inttypes.h>
#include <signal.h>
@@ -20,11 +22,11 @@
/** Default pool user area size in bytes */
#define TEST_UAREA_SIZE 8
-/** Number of function calls per test cycle */
+/** Number of API function calls per test case */
#define TEST_REPEAT_COUNT 1000
-/** Default number of test cycles */
-#define TEST_CYCLES 1000
+/** Default number of rounds per test case */
+#define TEST_ROUNDS 1000u
/** Maximum burst size for *_multi operations */
#define TEST_MAX_BURST 64
@@ -36,11 +38,12 @@
#define NO_PATH(file_name) (strrchr((file_name), '/') ? \
strrchr((file_name), '/') + 1 : (file_name))
-#define BENCH_INFO(run, init, term, name) \
- {#run, run, init, term, name, NULL}
+#define BENCH_INFO(run_fn, init_fn, term_fn, alt_name) \
+ {.name = #run_fn, .run = run_fn, .init = init_fn, .term = term_fn, .desc = alt_name}
-#define BENCH_INFO_COND(run, init, term, name, cond) \
- {#run, run, init, term, name, cond}
+#define BENCH_INFO_COND(run_fn, init_fn, term_fn, alt_name, cond_fn) \
+ {.name = #run_fn, .run = run_fn, .init = init_fn, .term = term_fn, .desc = alt_name, \
+ .cond = cond_fn}
/**
* Parsed command line arguments
@@ -49,65 +52,26 @@ typedef struct {
int bench_idx; /** Benchmark index to run indefinitely */
int burst_size; /** Burst size for *_multi operations */
int cache_size; /** Pool cache size */
- int test_cycles; /** Test cycles per tested function */
+ int time; /** Measure time vs. CPU cycles */
+ uint32_t rounds; /** Rounds per test case */
} appl_args_t;
/**
- * Initialize benchmark resources
- */
-typedef void (*bench_init_fn_t)(void);
-
-/**
- * Run benchmark
- *
- * @retval >0 on success
- * */
-typedef int (*bench_run_fn_t)(void);
-
-/**
- * Release benchmark resources
- */
-typedef void (*bench_term_fn_t)(void);
-
-/**
- * Check benchmark preconditions
- *
- * @retval !0 test enabled
- * */
-typedef int (*bench_cond_fn_t)(void);
-
-/**
- * Benchmark data
- */
-typedef struct {
- const char *name;
- bench_run_fn_t run;
- bench_init_fn_t init;
- bench_term_fn_t term;
- const char *desc;
- bench_cond_fn_t cond;
-} bench_info_t;
-
-/**
* Grouping of all global data
*/
typedef struct {
/** Application (parsed) arguments */
appl_args_t appl;
+ /** Common benchmark suite data */
+ bench_suite_t suite;
/** Buffer pool */
odp_pool_t pool;
- /** Benchmark functions */
- bench_info_t *bench;
- /** Number of benchmark functions */
- int num_bench;
/** Buffer size */
uint32_t buf_size;
/** Buffer user area size */
uint32_t uarea_size;
/** Max flow id */
uint32_t max_flow_id;
- /** Break worker loop if set to 1 */
- odp_atomic_u32_t exit_thread;
/** Array for storing test buffers */
odp_buffer_t buf_tbl[TEST_REPEAT_COUNT * TEST_MAX_BURST];
/** Array for storing test event */
@@ -120,8 +84,6 @@ typedef struct {
odp_event_type_t event_type_tbl[TEST_REPEAT_COUNT];
/** Array for storing test event subtypes */
odp_event_subtype_t event_subtype_tbl[TEST_REPEAT_COUNT];
- /** Benchmark run failed */
- uint8_t bench_failed;
/** CPU mask as string */
char cpumask_str[ODP_CPUMASK_STR_SIZE];
} args_t;
@@ -133,117 +95,7 @@ static void sig_handler(int signo ODP_UNUSED)
{
if (gbl_args == NULL)
return;
- odp_atomic_store_u32(&gbl_args->exit_thread, 1);
-}
-
-/**
- * Run given benchmark indefinitely
- */
-static void run_indef(args_t *args, int idx)
-{
- const char *desc;
-
- desc = args->bench[idx].desc != NULL ?
- args->bench[idx].desc : args->bench[idx].name;
-
- printf("Running odp_%s test indefinitely\n", desc);
-
- while (!odp_atomic_load_u32(&gbl_args->exit_thread)) {
- int ret;
-
- if (args->bench[idx].init != NULL)
- args->bench[idx].init();
-
- ret = args->bench[idx].run();
-
- if (args->bench[idx].term != NULL)
- args->bench[idx].term();
-
- if (!ret)
- ODPH_ABORT("Benchmark %s failed\n", desc);
- }
-}
-
-static int run_benchmarks(void *arg)
-{
- int i, j, k;
- args_t *args = arg;
-
- printf("\nAverage CPU cycles per function call\n"
- "---------------------------------------------\n");
-
- /* Run each test twice. Results from the first warm-up round are ignored. */
- for (i = 0; i < 2; i++) {
- uint64_t tot_cycles = 0;
-
- for (j = 0, k = 1; j < gbl_args->num_bench; k++) {
- int ret;
- uint64_t c1, c2;
- const char *desc;
-
- /* Run selected test indefinitely */
- if (args->appl.bench_idx &&
- (j + 1) != args->appl.bench_idx) {
- j++;
- continue;
- } else if (args->appl.bench_idx &&
- (j + 1) == args->appl.bench_idx) {
- run_indef(args, j);
- return 0;
- }
-
- desc = args->bench[j].desc != NULL ?
- args->bench[j].desc :
- args->bench[j].name;
-
- /* Skip unsupported tests */
- if (args->bench[j].cond != NULL && !args->bench[j].cond()) {
- j++;
- k = 1;
- if (i > 0)
- printf("[%02d] odp_%-26s: n/a\n", j, desc);
- continue;
- }
-
- if (args->bench[j].init != NULL)
- args->bench[j].init();
-
- c1 = odp_cpu_cycles();
- ret = args->bench[j].run();
- c2 = odp_cpu_cycles();
-
- if (args->bench[j].term != NULL)
- args->bench[j].term();
-
- if (!ret) {
- ODPH_ERR("Benchmark odp_%s failed\n", desc);
- args->bench_failed = 1;
- return -1;
- }
-
- tot_cycles += odp_cpu_cycles_diff(c2, c1);
-
- if (k >= args->appl.test_cycles) {
- double cycles;
-
- /** Each benchmark runs internally TEST_REPEAT_COUNT times. */
- cycles = ((double)tot_cycles) /
- (args->appl.test_cycles *
- TEST_REPEAT_COUNT);
-
- /* No print from warm-up round */
- if (i > 0)
- printf("[%02d] odp_%-26s: %8.1f\n", j + 1, desc, cycles);
-
- j++;
- k = 1;
- tot_cycles = 0;
- }
- }
- }
- printf("\n");
-
- return 0;
+ odp_atomic_store_u32(&gbl_args->suite.exit_worker, 1);
}
static void allocate_test_buffers(odp_buffer_t buf[], int num)
@@ -612,9 +464,10 @@ static void usage(char *progname)
" -b, --burst <num> Test burst size.\n"
" -c, --cache_size <num> Pool cache size.\n"
" -i, --index <idx> Benchmark index to run indefinitely.\n"
- " -t, --test_cycles <num> Run each test 'num' times (default %d).\n"
+ " -r, --rounds <num> Run each test case 'num' times (default %u).\n"
+ " -t, --time <opt> Time measurement. 0: measure CPU cycles (default), 1: measure time\n"
" -h, --help Display help and exit.\n\n"
- "\n", NO_PATH(progname), NO_PATH(progname), TEST_CYCLES);
+ "\n", NO_PATH(progname), NO_PATH(progname), TEST_ROUNDS);
}
/**
@@ -632,17 +485,19 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
{"burst", required_argument, NULL, 'b'},
{"cache_size", required_argument, NULL, 'c'},
{"index", required_argument, NULL, 'i'},
- {"test_cycles", required_argument, NULL, 't'},
+ {"rounds", required_argument, NULL, 'r'},
+ {"time", required_argument, NULL, 't'},
{"help", no_argument, NULL, 'h'},
{NULL, 0, NULL, 0}
};
- static const char *shortopts = "c:b:i:t:h";
+ static const char *shortopts = "c:b:i:r:t:h";
appl_args->bench_idx = 0; /* Run all benchmarks */
appl_args->burst_size = TEST_DEF_BURST;
appl_args->cache_size = -1;
- appl_args->test_cycles = TEST_CYCLES;
+ appl_args->rounds = TEST_ROUNDS;
+ appl_args->time = 0;
while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
@@ -664,8 +519,11 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
case 'i':
appl_args->bench_idx = atoi(optarg);
break;
+ case 'r':
+ appl_args->rounds = atoi(optarg);
+ break;
case 't':
- appl_args->test_cycles = atoi(optarg);
+ appl_args->time = atoi(optarg);
break;
default:
break;
@@ -678,8 +536,8 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
exit(EXIT_FAILURE);
}
- if (appl_args->test_cycles < 1) {
- printf("Invalid test cycle repeat count: %d\n", appl_args->test_cycles);
+ if (appl_args->rounds < 1) {
+ printf("Invalid number test rounds: %d\n", appl_args->rounds);
exit(EXIT_FAILURE);
}
@@ -697,14 +555,15 @@ static void print_info(void)
"odp_bench_buffer options\n"
"------------------------\n");
- printf("Burst size: %d\n", gbl_args->appl.burst_size);
- printf("Buffer size: %d\n", gbl_args->buf_size);
- printf("CPU mask: %s\n", gbl_args->cpumask_str);
+ printf("Burst size: %d\n", gbl_args->appl.burst_size);
+ printf("Buffer size: %d\n", gbl_args->buf_size);
+ printf("CPU mask: %s\n", gbl_args->cpumask_str);
if (gbl_args->appl.cache_size < 0)
- printf("Pool cache size: default\n");
+ printf("Pool cache size: default\n");
else
- printf("Pool cache size: %d\n", gbl_args->appl.cache_size);
- printf("Test cycles: %d\n", gbl_args->appl.test_cycles);
+ printf("Pool cache size: %d\n", gbl_args->appl.cache_size);
+ printf("Measurement unit: %s\n", gbl_args->appl.time ? "nsec" : "CPU cycles");
+ printf("Test rounds: %u\n", gbl_args->appl.rounds);
printf("\n");
}
@@ -793,14 +652,18 @@ int main(int argc, char *argv[])
}
memset(gbl_args, 0, sizeof(args_t));
- odp_atomic_init_u32(&gbl_args->exit_thread, 0);
-
- gbl_args->bench = test_suite;
- gbl_args->num_bench = sizeof(test_suite) / sizeof(test_suite[0]);
/* Parse and store the application arguments */
parse_args(argc, argv, &gbl_args->appl);
+ bench_suite_init(&gbl_args->suite);
+ gbl_args->suite.bench = test_suite;
+ gbl_args->suite.num_bench = ODPH_ARRAY_SIZE(test_suite);
+ gbl_args->suite.indef_idx = gbl_args->appl.bench_idx;
+ gbl_args->suite.rounds = gbl_args->appl.rounds;
+ gbl_args->suite.repeat_count = TEST_REPEAT_COUNT;
+ gbl_args->suite.measure_time = !!gbl_args->appl.time;
+
/* Get default worker cpumask */
if (odp_cpumask_default_worker(&default_mask, 1) != 1) {
ODPH_ERR("Error: unable to allocate worker thread\n");
@@ -886,15 +749,15 @@ int main(int argc, char *argv[])
thr_common.share_param = 1;
odph_thread_param_init(&thr_param);
- thr_param.start = run_benchmarks;
- thr_param.arg = gbl_args;
+ thr_param.start = bench_run;
+ thr_param.arg = &gbl_args->suite;
thr_param.thr_type = ODP_THREAD_WORKER;
odph_thread_create(&worker_thread, &thr_common, &thr_param, 1);
odph_thread_join(&worker_thread, 1);
- ret = gbl_args->bench_failed;
+ ret = gbl_args->suite.retval;
if (odp_pool_destroy(gbl_args->pool)) {
ODPH_ERR("Error: pool destroy\n");
diff --git a/test/performance/odp_bench_misc.c b/test/performance/odp_bench_misc.c
index 8b9e27bf2..e21208ff2 100644
--- a/test/performance/odp_bench_misc.c
+++ b/test/performance/odp_bench_misc.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2022, Nokia
+/* Copyright (c) 2022-2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -11,6 +11,8 @@
#include <odp_api.h>
#include <odp/helper/odph_api.h>
+#include "bench_common.h"
+
#include <getopt.h>
#include <inttypes.h>
#include <signal.h>
@@ -23,8 +25,8 @@
/* Default number of rounds per test case */
#define ROUNDS 1000u
-#define BENCH_INFO(run, init, max, name) \
- {#run, run, init, max, name}
+#define BENCH_INFO(run_fn, init_fn, max, alt_name) \
+ {.name = #run_fn, .run = run_fn, .init = init_fn, .max_rounds = max, .desc = alt_name}
typedef struct {
/* Measure time vs CPU cycles */
@@ -38,43 +40,12 @@ typedef struct {
} appl_args_t;
-/* Initialize benchmark resources */
-typedef void (*bench_init_fn_t)(void);
-
-/* Run benchmark, returns >0 on success */
-typedef int (*bench_run_fn_t)(void);
-
-/* Benchmark data */
-typedef struct {
- /* Default test name */
- const char *name;
-
- /* Test function to run */
- bench_run_fn_t run;
-
- /* Test init function */
- bench_init_fn_t init;
-
- /* Test specific limit for rounds (tuning for slow implementation) */
- uint32_t max_rounds;
-
- /* Override default test name */
- const char *desc;
-
-} bench_info_t;
-
/* Global data */
typedef struct {
appl_args_t appl;
- /* Benchmark functions */
- bench_info_t *bench;
-
- /* Number of benchmark functions */
- int num_bench;
-
- /* Break worker loop if set to 1 */
- odp_atomic_u32_t exit_thread;
+ /* Common benchmark suite data */
+ bench_suite_t suite;
/* Test case input / output data */
odp_time_t t1[REPEAT_COUNT];
@@ -87,12 +58,6 @@ typedef struct {
uint16_t c1[REPEAT_COUNT];
uint16_t c2[REPEAT_COUNT];
- /* Dummy result */
- uint64_t dummy;
-
- /* Benchmark run failed */
- int bench_failed;
-
/* CPU mask as string */
char cpumask_str[ODP_CPUMASK_STR_SIZE];
@@ -104,7 +69,7 @@ static void sig_handler(int signo ODP_UNUSED)
{
if (gbl_args == NULL)
return;
- odp_atomic_store_u32(&gbl_args->exit_thread, 1);
+ odp_atomic_store_u32(&gbl_args->suite.exit_worker, 1);
}
static int setup_sig_handler(void)
@@ -125,118 +90,6 @@ static int setup_sig_handler(void)
return 0;
}
-/* Run given benchmark indefinitely */
-static void run_indef(gbl_args_t *args, int idx)
-{
- const char *desc;
- const bench_info_t *bench = &args->bench[idx];
-
- desc = bench->desc != NULL ? bench->desc : bench->name;
-
- printf("Running odp_%s test indefinitely\n", desc);
-
- while (!odp_atomic_load_u32(&gbl_args->exit_thread)) {
- int ret;
-
- if (bench->init != NULL)
- bench->init();
-
- ret = bench->run();
-
- if (!ret)
- ODPH_ABORT("Benchmark %s failed\n", desc);
- }
-}
-
-static int run_benchmarks(void *arg)
-{
- int i, j;
- uint64_t c1, c2;
- odp_time_t t1, t2;
- gbl_args_t *args = arg;
- const int meas_time = args->appl.time;
-
- printf("\nAverage %s per function call\n", meas_time ? "time (nsec)" : "CPU cycles");
- printf("-------------------------------------------------\n");
-
- /* Run each test twice. Results from the first warm-up round are ignored. */
- for (i = 0; i < 2; i++) {
- uint64_t total = 0;
- uint32_t round = 1;
-
- for (j = 0; j < gbl_args->num_bench; round++) {
- int ret;
- const char *desc;
- const bench_info_t *bench = &args->bench[j];
- uint32_t max_rounds = args->appl.rounds;
-
- if (bench->max_rounds && max_rounds > bench->max_rounds)
- max_rounds = bench->max_rounds;
-
- /* Run selected test indefinitely */
- if (args->appl.bench_idx) {
- if ((j + 1) != args->appl.bench_idx) {
- j++;
- continue;
- }
-
- run_indef(args, j);
- return 0;
- }
-
- desc = bench->desc != NULL ? bench->desc : bench->name;
-
- if (bench->init != NULL)
- bench->init();
-
- if (meas_time)
- t1 = odp_time_local();
- else
- c1 = odp_cpu_cycles();
-
- ret = bench->run();
-
- if (meas_time)
- t2 = odp_time_local();
- else
- c2 = odp_cpu_cycles();
-
- if (!ret) {
- ODPH_ERR("Benchmark odp_%s failed\n", desc);
- args->bench_failed = -1;
- return -1;
- }
-
- if (meas_time)
- total += odp_time_diff_ns(t2, t1);
- else
- total += odp_cpu_cycles_diff(c2, c1);
-
- if (round >= max_rounds) {
- double result;
-
- /* Each benchmark runs internally REPEAT_COUNT times. */
- result = ((double)total) / (max_rounds * REPEAT_COUNT);
-
- /* No print from warm-up round */
- if (i > 0)
- printf("[%02d] odp_%-26s: %12.2f\n", j + 1, desc, result);
-
- j++;
- total = 0;
- round = 1;
- }
- }
- }
-
- /* Print dummy result to prevent compiler to optimize it away*/
- printf("\n(dummy result: 0x%" PRIx64 ")\n", args->dummy);
-
- printf("\n");
-
- return 0;
-}
-
static void init_time_global(void)
{
int i;
@@ -395,7 +248,7 @@ static int time_diff_ns(void)
for (i = 0; i < REPEAT_COUNT; i++)
res += odp_time_diff_ns(t2[i], t1[i]);
- gbl_args->dummy += res;
+ gbl_args->suite.dummy += res;
return i;
}
@@ -422,7 +275,7 @@ static int time_to_ns(void)
for (i = 0; i < REPEAT_COUNT; i++)
res += odp_time_to_ns(t1[i]);
- gbl_args->dummy += res;
+ gbl_args->suite.dummy += res;
return i;
}
@@ -461,7 +314,7 @@ static int time_cmp(void)
for (i = 0; i < REPEAT_COUNT; i++)
res += odp_time_cmp(t1[i], t2[i]);
- gbl_args->dummy += res;
+ gbl_args->suite.dummy += res;
return i;
}
@@ -521,6 +374,18 @@ static int cpu_hz(void)
return i;
}
+static int cpu_hz_id(void)
+{
+ int i;
+ const int id = odp_cpu_id();
+ uint64_t *a1 = gbl_args->a1;
+
+ for (i = 0; i < REPEAT_COUNT; i++)
+ a1[i] = odp_cpu_hz_id(id);
+
+ return i;
+}
+
static int cpu_hz_max(void)
{
int i;
@@ -532,6 +397,18 @@ static int cpu_hz_max(void)
return i;
}
+static int cpu_hz_max_id(void)
+{
+ int i;
+ const int id = odp_cpu_id();
+ uint64_t *a1 = gbl_args->a1;
+
+ for (i = 0; i < REPEAT_COUNT; i++)
+ a1[i] = odp_cpu_hz_max_id(id);
+
+ return i;
+}
+
static int cpu_cycles(void)
{
int i;
@@ -553,7 +430,7 @@ static int cpu_cycles_diff(void)
for (i = 0; i < REPEAT_COUNT; i++)
res += odp_cpu_cycles_diff(a2[i], a1[i]);
- gbl_args->dummy += res;
+ gbl_args->suite.dummy += res;
return i;
}
@@ -569,6 +446,17 @@ static int cpu_cycles_max(void)
return i;
}
+static int cpu_cycles_resolution(void)
+{
+ int i;
+ uint64_t *a1 = gbl_args->a1;
+
+ for (i = 0; i < REPEAT_COUNT; i++)
+ a1[i] = odp_cpu_cycles_resolution();
+
+ return i;
+}
+
static int cpu_pause(void)
{
int i;
@@ -819,10 +707,13 @@ bench_info_t test_suite[] = {
BENCH_INFO(cpu_id, NULL, 0, NULL),
BENCH_INFO(cpu_count, NULL, 0, NULL),
BENCH_INFO(cpu_hz, NULL, 1, NULL),
+ BENCH_INFO(cpu_hz_id, NULL, 1, NULL),
BENCH_INFO(cpu_hz_max, NULL, 0, NULL),
+ BENCH_INFO(cpu_hz_max_id, NULL, 0, NULL),
BENCH_INFO(cpu_cycles, NULL, 0, NULL),
BENCH_INFO(cpu_cycles_diff, init_cpu_cycles, 0, NULL),
BENCH_INFO(cpu_cycles_max, NULL, 0, NULL),
+ BENCH_INFO(cpu_cycles_resolution, NULL, 0, NULL),
BENCH_INFO(cpu_pause, NULL, 0, NULL),
BENCH_INFO(thread_id, NULL, 0, NULL),
BENCH_INFO(thread_count, NULL, 0, NULL),
@@ -909,7 +800,7 @@ static int parse_args(int argc, char *argv[])
return -1;
}
- if (appl_args->bench_idx < 0 || appl_args->bench_idx > gbl_args->num_bench) {
+ if (appl_args->bench_idx < 0 || appl_args->bench_idx > (int)ODPH_ARRAY_SIZE(test_suite)) {
ODPH_ERR("Bad bench index %i\n", appl_args->bench_idx);
return -1;
}
@@ -988,10 +879,6 @@ int main(int argc, char *argv[])
}
memset(gbl_args, 0, sizeof(gbl_args_t));
- odp_atomic_init_u32(&gbl_args->exit_thread, 0);
-
- gbl_args->bench = test_suite;
- gbl_args->num_bench = sizeof(test_suite) / sizeof(test_suite[0]);
for (i = 0; i < REPEAT_COUNT; i++) {
gbl_args->t1[i] = ODP_TIME_NULL;
@@ -1010,6 +897,14 @@ int main(int argc, char *argv[])
if (ret)
goto exit;
+ bench_suite_init(&gbl_args->suite);
+ gbl_args->suite.bench = test_suite;
+ gbl_args->suite.num_bench = ODPH_ARRAY_SIZE(test_suite);
+ gbl_args->suite.measure_time = !!gbl_args->appl.time;
+ gbl_args->suite.indef_idx = gbl_args->appl.bench_idx;
+ gbl_args->suite.rounds = gbl_args->appl.rounds;
+ gbl_args->suite.repeat_count = REPEAT_COUNT;
+
/* Get default worker cpumask */
if (odp_cpumask_default_worker(&default_mask, 1) != 1) {
ODPH_ERR("Unable to allocate worker thread\n");
@@ -1036,15 +931,15 @@ int main(int argc, char *argv[])
thr_common.share_param = 1;
odph_thread_param_init(&thr_param);
- thr_param.start = run_benchmarks;
- thr_param.arg = gbl_args;
+ thr_param.start = bench_run;
+ thr_param.arg = &gbl_args->suite;
thr_param.thr_type = ODP_THREAD_WORKER;
odph_thread_create(&worker_thread, &thr_common, &thr_param, 1);
odph_thread_join(&worker_thread, 1);
- ret = gbl_args->bench_failed;
+ ret = gbl_args->suite.retval;
exit:
if (odp_shm_free(shm)) {
diff --git a/test/performance/odp_bench_packet.c b/test/performance/odp_bench_packet.c
index aaf725b57..67b6b9cfc 100644
--- a/test/performance/odp_bench_packet.c
+++ b/test/performance/odp_bench_packet.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2017-2018, Linaro Limited
- * Copyright (c) 2022, Nokia
+ * Copyright (c) 2022-2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -24,8 +24,7 @@
#include <odp_api.h>
#include <odp/helper/odph_api.h>
-/** Minimum number of packet data bytes in the first segment */
-#define PKT_POOL_SEG_LEN 128
+#include "bench_common.h"
/** Packet user area size in bytes */
#define PKT_POOL_UAREA_SIZE 8
@@ -36,11 +35,11 @@
/** Maximum test packet size */
#define TEST_MAX_PKT_SIZE 2048
-/** Number of test runs per individual benchmark */
+/** Number of API function calls per test case */
#define TEST_REPEAT_COUNT 1000
-/** Number of times to run tests for each packet size */
-#define TEST_SIZE_RUN_COUNT 10
+/** Number of rounds per test case */
+#define TEST_ROUNDS 10u
/** Maximum burst size for *_multi operations */
#define TEST_MAX_BURST 64
@@ -66,17 +65,14 @@
#define NO_PATH(file_name) (strrchr((file_name), '/') ? \
strrchr((file_name), '/') + 1 : (file_name))
-#define BENCH_INFO(run, init, term, name) \
- {#run, run, init, term, name}
+#define BENCH_INFO(run_fn, init_fn, term_fn, alt_name) \
+ {.name = #run_fn, .run = run_fn, .init = init_fn, .term = term_fn, .desc = alt_name}
ODP_STATIC_ASSERT((TEST_ALIGN_OFFSET + TEST_ALIGN_LEN) <= TEST_MIN_PKT_SIZE,
"Invalid_alignment");
-/** Warm up round packet size */
-#define WARM_UP TEST_MIN_PKT_SIZE
-
/** Test packet sizes */
-const uint32_t test_packet_len[] = {WARM_UP, TEST_MIN_PKT_SIZE, 128, 256, 512,
+const uint32_t test_packet_len[] = {TEST_MIN_PKT_SIZE, 128, 256, 512,
1024, 1518, TEST_MAX_PKT_SIZE};
/**
@@ -86,50 +82,20 @@ typedef struct {
int bench_idx; /** Benchmark index to run indefinitely */
int burst_size; /** Burst size for *_multi operations */
int cache_size; /** Pool cache size */
+ int time; /** Measure time vs. CPU cycles */
+ uint32_t rounds; /** Rounds per test case */
} appl_args_t;
/**
- * Initialize benchmark resources
- */
-typedef void (*bench_init_fn_t)(void);
-
-/**
- * Run benchmark
- *
- * @retval >0 on success
- * */
-typedef int (*bench_run_fn_t)(void);
-
-/**
- * Release benchmark resources
- */
-typedef void (*bench_term_fn_t)(void);
-
-/**
- * Benchmark data
- */
-typedef struct {
- const char *name;
- bench_run_fn_t run;
- bench_init_fn_t init;
- bench_term_fn_t term;
- const char *desc;
-} bench_info_t;
-
-/**
* Grouping of all global data
*/
typedef struct {
/** Application (parsed) arguments */
appl_args_t appl;
+ /** Common benchmark suite data */
+ bench_suite_t suite;
/** Packet pool */
odp_pool_t pool;
- /** Benchmark functions */
- bench_info_t *bench;
- /** Number of benchmark functions */
- int num_bench;
- /** Break worker loop if set to 1 */
- odp_atomic_u32_t exit_thread;
struct {
/** Test packet length */
uint32_t len;
@@ -160,8 +126,6 @@ typedef struct {
odp_time_t ts_tbl[TEST_REPEAT_COUNT];
/** Array for storing test data */
uint8_t data_tbl[TEST_REPEAT_COUNT][TEST_MAX_PKT_SIZE];
- /** Benchmark run failed */
- uint8_t bench_failed;
} args_t;
/** Global pointer to args */
@@ -171,35 +135,7 @@ static void sig_handler(int signo ODP_UNUSED)
{
if (gbl_args == NULL)
return;
- odp_atomic_store_u32(&gbl_args->exit_thread, 1);
-}
-
-/**
- * Run given benchmark indefinitely
- */
-static void run_indef(args_t *args, int idx)
-{
- const char *desc;
-
- desc = args->bench[idx].desc != NULL ?
- args->bench[idx].desc : args->bench[idx].name;
-
- printf("Running odp_%s test indefinitely\n", desc);
-
- while (!odp_atomic_load_u32(&gbl_args->exit_thread)) {
- int ret;
-
- if (args->bench[idx].init != NULL)
- args->bench[idx].init();
-
- ret = args->bench[idx].run();
-
- if (args->bench[idx].term != NULL)
- args->bench[idx].term();
-
- if (!ret)
- ODPH_ABORT("Benchmark %s failed\n", desc);
- }
+ odp_atomic_store_u32(&gbl_args->suite.exit_worker, 1);
}
/**
@@ -207,96 +143,38 @@ static void run_indef(args_t *args, int idx)
*/
static int run_benchmarks(void *arg)
{
- int i, j, k;
+ int i;
args_t *args = arg;
- int num_sizes = sizeof(test_packet_len) / sizeof(test_packet_len[0]);
- double results[gbl_args->num_bench][num_sizes];
+ bench_suite_t *suite = &args->suite;
+ int num_sizes = ODPH_ARRAY_SIZE(test_packet_len);
+ double results[num_sizes][suite->num_bench];
memset(results, 0, sizeof(results));
- printf("\nRunning benchmarks (cycles per call)\n"
- "------------------------------------\n");
-
for (i = 0; i < num_sizes; i++) {
- uint64_t tot_cycles = 0;
-
- printf("\nPacket length: %6d bytes\n"
- "---------------------------\n", test_packet_len[i]);
+ printf("Packet length: %6d bytes", test_packet_len[i]);
gbl_args->pkt.len = test_packet_len[i];
- for (j = 0, k = 1; j < gbl_args->num_bench; k++) {
- int ret;
- uint64_t c1, c2;
- const char *desc;
-
- if (args->appl.bench_idx &&
- (j + 1) != args->appl.bench_idx) {
- j++;
- continue;
- } else if (args->appl.bench_idx &&
- (j + 1) == args->appl.bench_idx) {
- run_indef(args, j);
- return 0;
- }
-
- desc = args->bench[j].desc != NULL ?
- args->bench[j].desc :
- args->bench[j].name;
-
- if (args->bench[j].init != NULL)
- args->bench[j].init();
-
- c1 = odp_cpu_cycles();
- ret = args->bench[j].run();
- c2 = odp_cpu_cycles();
-
- if (args->bench[j].term != NULL)
- args->bench[j].term();
-
- if (!ret) {
- ODPH_ERR("Benchmark %s failed\n", desc);
- args->bench_failed = 1;
- return -1;
- }
-
- tot_cycles += odp_cpu_cycles_diff(c2, c1);
-
- if (k >= TEST_SIZE_RUN_COUNT) {
- double cycles;
-
- /** Each benchmark runs internally
- * TEST_REPEAT_COUNT times. */
- cycles = ((double)tot_cycles) /
- (TEST_SIZE_RUN_COUNT *
- TEST_REPEAT_COUNT);
- results[j][i] = cycles;
-
- printf("odp_%-26s: %8.1f\n", desc, cycles);
-
- j++;
- k = 1;
- tot_cycles = 0;
- }
- }
- }
- printf("\n%-30s", "Benchmark / packet_size [B]");
- for (i = 0; i < num_sizes; i++) {
- if (i == 0)
- printf(" WARM UP ");
- else
- printf("%8.1d ", test_packet_len[i]);
+ suite->result = results[i];
+
+ bench_run(suite);
}
+
+ printf("\n%-35s", "Benchmark / packet_size [B]");
+ for (i = 0; i < num_sizes; i++)
+ printf("%8.1d ", test_packet_len[i]);
+
printf("\n---------------------------------");
for (i = 0; i < num_sizes; i++)
printf("----------");
- for (i = 0; i < gbl_args->num_bench; i++) {
- printf("\n[%02d] odp_%-26s", i + 1, args->bench[i].desc != NULL ?
- args->bench[i].desc : args->bench[i].name);
+ for (i = 0; i < suite->num_bench; i++) {
+ printf("\n[%02d] odp_%-26s", i + 1, suite->bench[i].desc != NULL ?
+ suite->bench[i].desc : suite->bench[i].name);
- for (j = 0; j < num_sizes; j++)
- printf("%8.1f ", results[i][j]);
+ for (int j = 0; j < num_sizes; j++)
+ printf("%8.1f ", results[j][i]);
}
printf("\n\n");
return 0;
@@ -1466,7 +1344,7 @@ static int packet_parse_multi(void)
}
/**
- * Prinf usage information
+ * Print usage information
*/
static void usage(char *progname)
{
@@ -1480,8 +1358,10 @@ static void usage(char *progname)
" -b, --burst <num> Test packet burst size.\n"
" -c, --cache_size <num> Pool cache size.\n"
" -i, --index <idx> Benchmark index to run indefinitely.\n"
+ " -r, --rounds <num> Run each test case 'num' times (default %u).\n"
+ " -t, --time <opt> Time measurement. 0: measure CPU cycles (default), 1: measure time\n"
" -h, --help Display help and exit.\n\n"
- "\n", NO_PATH(progname), NO_PATH(progname));
+ "\n", NO_PATH(progname), NO_PATH(progname), TEST_ROUNDS);
}
/**
@@ -1498,16 +1378,20 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
static const struct option longopts[] = {
{"burst", required_argument, NULL, 'b'},
{"cache_size", required_argument, NULL, 'c'},
- {"help", no_argument, NULL, 'h'},
{"index", required_argument, NULL, 'i'},
+ {"rounds", required_argument, NULL, 'r'},
+ {"time", required_argument, NULL, 't'},
+ {"help", no_argument, NULL, 'h'},
{NULL, 0, NULL, 0}
};
- static const char *shortopts = "c:b:i:h";
+ static const char *shortopts = "c:b:i:r:t:h";
appl_args->bench_idx = 0; /* Run all benchmarks */
appl_args->burst_size = TEST_DEF_BURST;
appl_args->cache_size = -1;
+ appl_args->rounds = TEST_ROUNDS;
+ appl_args->time = 0;
while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
@@ -1522,15 +1406,22 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
case 'b':
appl_args->burst_size = atoi(optarg);
break;
+ case 'i':
+ appl_args->bench_idx = atoi(optarg);
+ break;
+ case 'r':
+ appl_args->rounds = atoi(optarg);
+ break;
+ case 't':
+ appl_args->time = atoi(optarg);
+ break;
case 'h':
usage(argv[0]);
exit(EXIT_SUCCESS);
break;
- case 'i':
- appl_args->bench_idx = atoi(optarg);
- break;
default:
- break;
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
}
}
@@ -1540,6 +1431,11 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
exit(EXIT_FAILURE);
}
+ if (appl_args->rounds < 1) {
+ printf("Invalid number test rounds: %d\n", appl_args->rounds);
+ exit(EXIT_FAILURE);
+ }
+
optind = 1; /* Reset 'extern optind' from the getopt lib */
}
@@ -1669,7 +1565,7 @@ int main(int argc, char *argv[])
odp_pool_param_t params;
odp_instance_t instance;
odp_init_t init_param;
- uint32_t pkt_num;
+ uint32_t pkt_num, seg_len;
uint8_t ret;
/* Let helper collect its own arguments (e.g. --odph_proc) */
@@ -1711,14 +1607,18 @@ int main(int argc, char *argv[])
}
memset(gbl_args, 0, sizeof(args_t));
- odp_atomic_init_u32(&gbl_args->exit_thread, 0);
-
- gbl_args->bench = test_suite;
- gbl_args->num_bench = sizeof(test_suite) / sizeof(test_suite[0]);
/* Parse and store the application arguments */
parse_args(argc, argv, &gbl_args->appl);
+ bench_suite_init(&gbl_args->suite);
+ gbl_args->suite.bench = test_suite;
+ gbl_args->suite.num_bench = ODPH_ARRAY_SIZE(test_suite);
+ gbl_args->suite.indef_idx = gbl_args->appl.bench_idx;
+ gbl_args->suite.rounds = gbl_args->appl.rounds;
+ gbl_args->suite.repeat_count = TEST_REPEAT_COUNT;
+ gbl_args->suite.measure_time = !!gbl_args->appl.time;
+
/* Print both system and application information */
print_info(NO_PATH(argv[0]), &gbl_args->appl);
@@ -1749,10 +1649,6 @@ int main(int argc, char *argv[])
capa.pkt.max_len < 2 * TEST_MAX_PKT_SIZE) {
ODPH_ERR("Error: packet length not supported.\n");
exit(EXIT_FAILURE);
- } else if (capa.pkt.max_seg_len &&
- capa.pkt.max_seg_len < PKT_POOL_SEG_LEN) {
- ODPH_ERR("Error: segment length not supported.\n");
- exit(EXIT_FAILURE);
} else if (capa.pkt.max_uarea_size &&
capa.pkt.max_uarea_size < PKT_POOL_UAREA_SIZE) {
ODPH_ERR("Error: user area size not supported.\n");
@@ -1763,9 +1659,16 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
+ seg_len = TEST_MAX_PKT_SIZE;
+ if (capa.pkt.max_seg_len && capa.pkt.max_seg_len < seg_len) {
+ seg_len = capa.pkt.max_seg_len;
+ printf("\nWarn: allocated packets may be segmented (min seg_len=%" PRIu32 ")\n\n",
+ seg_len);
+ }
+
/* Create packet pool */
odp_pool_param_init(&params);
- params.pkt.seg_len = PKT_POOL_SEG_LEN;
+ params.pkt.seg_len = seg_len;
/* Using packet length as twice the TEST_MAX_PKT_SIZE as some
* test cases (packet_ref_pkt) might allocate a bigger
* packet than TEST_MAX_PKT_SIZE.
@@ -1784,14 +1687,16 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
- printf("CPU: %i\n", odp_cpumask_first(&cpumask));
- printf("CPU mask: %s\n", cpumaskstr);
- printf("Burst size: %d\n", gbl_args->appl.burst_size);
- printf("Bench repeat: %d\n", TEST_REPEAT_COUNT);
+ printf("CPU: %i\n", odp_cpumask_first(&cpumask));
+ printf("CPU mask: %s\n", cpumaskstr);
+ printf("Burst size: %d\n", gbl_args->appl.burst_size);
+ printf("Bench repeat: %d\n", TEST_REPEAT_COUNT);
+ printf("Measurement unit: %s\n", gbl_args->appl.time ? "nsec" : "CPU cycles");
+ printf("Test rounds: %u\n", gbl_args->appl.rounds);
if (gbl_args->appl.cache_size < 0)
- printf("Pool cache size: default\n");
+ printf("Pool cache size: default\n");
else
- printf("Pool cache size: %d\n", gbl_args->appl.cache_size);
+ printf("Pool cache size: %d\n", gbl_args->appl.cache_size);
odp_pool_print(gbl_args->pool);
@@ -1821,7 +1726,7 @@ int main(int argc, char *argv[])
odph_thread_join(&worker_thread, 1);
- ret = gbl_args->bench_failed;
+ ret = gbl_args->suite.retval;
if (odp_pool_destroy(gbl_args->pool)) {
ODPH_ERR("Error: pool destroy\n");
diff --git a/test/performance/odp_bench_pktio_sp.c b/test/performance/odp_bench_pktio_sp.c
new file mode 100644
index 000000000..65d85a062
--- /dev/null
+++ b/test/performance/odp_bench_pktio_sp.c
@@ -0,0 +1,1132 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
+ */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE /* Needed for sigaction */
+#endif
+
+#include <odp_api.h>
+#include <odp/helper/odph_api.h>
+
+#include "bench_common.h"
+
+#include <getopt.h>
+#include <inttypes.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+/* Default number of rounds per test case */
+#define ROUNDS 100u
+
+/* Maximum interface name length */
+#define MAX_NAME_LEN 128
+
+#define BENCH_INFO(run_fn, init_fn, term_fn, cond_fn, rounds) \
+ {.name = #run_fn, .run = run_fn, .init = init_fn, .term = term_fn, .cond = cond_fn,\
+ .max_rounds = rounds}
+
+typedef struct {
+ /* Command line options */
+ struct {
+ /* Rounds per test case */
+ uint32_t rounds;
+
+ /* Test case index to run */
+ uint32_t case_idx;
+
+ /* Interface name */
+ char name[MAX_NAME_LEN];
+
+ /* Packet input mode */
+ odp_pktin_mode_t in_mode;
+
+ /* Packet output mode */
+ odp_pktout_mode_t out_mode;
+
+ /* Number of packet input queues */
+ uint32_t num_input_queues;
+
+ /* Number of packet output queues */
+ uint32_t num_output_queues;
+
+ /* Number of PMRs */
+ uint32_t num_pmr;
+ } opt;
+
+ /* Packet IO device */
+ odp_pktio_t pktio;
+
+ /* Packet IO capability*/
+ odp_pktio_capability_t capa;
+
+ /* Packet pool */
+ odp_pool_t pool;
+
+ /* Packet IO statistics */
+ odp_pktio_stats_t stats;
+
+ /* Input queue statistics */
+ odp_pktin_queue_stats_t pktin_queue_stats;
+
+ /* Output queue statistics */
+ odp_pktout_queue_stats_t pktout_queue_stats;
+
+ /* Data for cls_pmr_create() test */
+ struct {
+ /* Term used to create PMRs */
+ odp_cls_pmr_term_t term;
+
+ /* Is test enabled */
+ odp_bool_t enabled;
+
+ } cls_pmr_create;
+
+ /* Common benchmark suite data */
+ bench_tm_suite_t suite;
+
+ /* CPU mask as string */
+ char cpumask_str[ODP_CPUMASK_STR_SIZE];
+
+} appl_args_t;
+
+static appl_args_t *gbl_args;
+
+static void sig_handler(int signo ODP_UNUSED)
+{
+ if (gbl_args == NULL)
+ return;
+ odp_atomic_store_u32(&gbl_args->suite.exit_worker, 1);
+}
+
+static int setup_sig_handler(void)
+{
+ struct sigaction action;
+
+ memset(&action, 0, sizeof(action));
+ action.sa_handler = sig_handler;
+
+ /* No additional signals blocked. By default, the signal which triggered
+ * the handler is blocked. */
+ if (sigemptyset(&action.sa_mask))
+ return -1;
+
+ if (sigaction(SIGINT, &action, NULL))
+ return -1;
+
+ return 0;
+}
+
+static void clean_pending_events(void)
+{
+ while (1) {
+ odp_event_t event = odp_schedule(NULL, odp_schedule_wait_time(ODP_TIME_MSEC_IN_NS));
+
+ if (event != ODP_EVENT_INVALID) {
+ odp_event_free(event);
+ continue;
+ }
+ break;
+ };
+}
+
+static odp_pool_t create_packet_pool(void)
+{
+ odp_pool_capability_t capa;
+ odp_pool_param_t param;
+ odp_pool_t pool;
+
+ if (odp_pool_capability(&capa))
+ ODPH_ABORT("Reading pool capabilities failed\n");
+
+ odp_pool_param_init(&param);
+ param.type = ODP_POOL_PACKET;
+ param.pkt.num = 512;
+ param.pkt.len = 2048;
+
+ if (capa.pkt.max_num && capa.pkt.max_num < param.pkt.num)
+ param.pkt.num = capa.pkt.max_num;
+
+ if (capa.pkt.max_len && capa.pkt.max_len < param.pkt.len)
+ param.pkt.len = capa.pkt.max_len;
+
+ pool = odp_pool_create("pktio_pool", &param);
+ if (pool == ODP_POOL_INVALID)
+ ODPH_ABORT("Creating packet pool failed\n");
+
+ return pool;
+}
+
+static void pktio_setup_param(odp_pktin_mode_t in_mode, odp_pktout_mode_t out_mode, odp_bool_t cls)
+{
+ appl_args_t *appl_args = gbl_args;
+ odp_pktio_param_t param;
+ odp_pktin_queue_param_t pktin_param;
+ odp_pktout_queue_param_t pktout_param;
+ odp_pktio_t pktio;
+ odp_pool_t pool;
+ int ret;
+
+ pool = create_packet_pool();
+
+ odp_pktio_param_init(&param);
+ param.in_mode = in_mode;
+ param.out_mode = out_mode;
+
+ pktio = odp_pktio_open(appl_args->opt.name, pool, &param);
+ if (pktio == ODP_PKTIO_INVALID)
+ ODPH_ABORT("Opening pktio failed\n");
+
+ odp_pktin_queue_param_init(&pktin_param);
+ pktin_param.num_queues = appl_args->opt.num_input_queues;
+
+ if (cls) {
+ pktin_param.classifier_enable = true;
+ } else {
+ if (pktin_param.num_queues > 1) {
+ pktin_param.hash_enable = true;
+ pktin_param.hash_proto.proto.ipv4_udp = 1;
+ }
+ }
+
+ odp_pktout_queue_param_init(&pktout_param);
+ pktout_param.num_queues = appl_args->opt.num_output_queues;
+
+ ret = odp_pktin_queue_config(pktio, &pktin_param);
+ if (ret)
+ ODPH_ABORT("Configuring packet input queues failed: %d\n", ret);
+
+ ret = odp_pktout_queue_config(pktio, &pktout_param);
+ if (ret)
+ ODPH_ABORT("Configuring packet output queues failed: %d\n", ret);
+
+ ret = odp_pktio_start(pktio);
+ if (ret)
+ ODPH_ABORT("Starting pktio failed: %d\n", ret);
+
+ appl_args->pool = pool;
+ appl_args->pktio = pktio;
+}
+
+static void pktio_setup(void)
+{
+ pktio_setup_param(gbl_args->opt.in_mode, gbl_args->opt.out_mode, false);
+}
+
+static void pktio_setup_direct_rx(void)
+{
+ pktio_setup_param(ODP_PKTIN_MODE_DIRECT, gbl_args->opt.out_mode, false);
+}
+
+static void pktio_setup_sched_rx(void)
+{
+ pktio_setup_param(ODP_PKTIN_MODE_SCHED, gbl_args->opt.out_mode, false);
+}
+
+static void pktio_setup_cls(void)
+{
+ pktio_setup_param(ODP_PKTIN_MODE_SCHED, gbl_args->opt.out_mode, true);
+}
+
+static void pktio_setup_direct_tx(void)
+{
+ pktio_setup_param(gbl_args->opt.in_mode, ODP_PKTOUT_MODE_DIRECT, false);
+}
+
+static void pktio_setup_queue_tx(void)
+{
+ pktio_setup_param(gbl_args->opt.in_mode, ODP_PKTOUT_MODE_QUEUE, false);
+}
+
+static void pktio_clean_param(odp_pktin_mode_t in_mode)
+{
+ appl_args_t *appl_args = gbl_args;
+ int ret;
+
+ ret = odp_pktio_stop(appl_args->pktio);
+ if (ret)
+ ODPH_ABORT("Stopping pktio failed: %d\n", ret);
+
+ /* Clean possible pre-scheduled packets */
+ if (in_mode == ODP_PKTIN_MODE_SCHED)
+ clean_pending_events();
+
+ ret = odp_pktio_close(appl_args->pktio);
+ if (ret)
+ ODPH_ABORT("Closing pktio failed: %d\n", ret);
+
+ ret = odp_pool_destroy(appl_args->pool);
+ if (ret)
+ ODPH_ABORT("Destroying pktio pool failed: %d\n", ret);
+}
+
+static void pktio_clean(void)
+{
+ pktio_clean_param(gbl_args->opt.in_mode);
+}
+
+static void pktio_clean_direct_rx(void)
+{
+ pktio_clean_param(ODP_PKTIN_MODE_DIRECT);
+}
+
+static void pktio_clean_sched_rx(void)
+{
+ pktio_clean_param(ODP_PKTIN_MODE_SCHED);
+}
+
+static int pktio_capability(bench_tm_result_t *res, int repeat_count)
+{
+ appl_args_t *appl_args = gbl_args;
+ odp_pktio_capability_t *capa = &appl_args->capa;
+ odp_pktio_t pktio = appl_args->pktio;
+ odp_time_t t1, t2;
+ int ret;
+ uint8_t id1 = bench_tm_func_register(res, "odp_pktio_capability()");
+
+ for (int i = 0; i < repeat_count; i++) {
+ t1 = odp_time_local_strict();
+ ret = odp_pktio_capability(pktio, capa);
+ t2 = odp_time_local_strict();
+
+ if (ret) {
+ ODPH_ERR("Reading pktio capa failed: %d\n", ret);
+ return -1;
+ }
+
+ bench_tm_func_record(t2, t1, res, id1);
+ }
+ return 0;
+}
+
+static int pktio_lookup(bench_tm_result_t *res, int repeat_count)
+{
+ appl_args_t *appl_args = gbl_args;
+ const char *name = appl_args->opt.name;
+ odp_pktio_t pktio;
+ odp_time_t t1, t2;
+ uint8_t id1 = bench_tm_func_register(res, "odp_pktio_lookup()");
+
+ for (int i = 0; i < repeat_count; i++) {
+ t1 = odp_time_local_strict();
+ pktio = odp_pktio_lookup(name);
+ t2 = odp_time_local_strict();
+
+ if (pktio == ODP_PKTIO_INVALID) {
+ ODPH_ERR("Pktio lookup failed\n");
+ return -1;
+ }
+
+ bench_tm_func_record(t2, t1, res, id1);
+ }
+ return 0;
+}
+
+static int pktio_open_start_stop_close(bench_tm_result_t *res, int repeat_count)
+{
+ appl_args_t *appl_args = gbl_args;
+ odp_pktio_param_t param;
+ odp_pktin_queue_param_t pktin_param;
+ odp_pktout_queue_param_t pktout_param;
+ odp_pktio_t pktio;
+ odp_pool_t pool;
+ odp_time_t t1, t2, t3, t4, t5, t6, t7, t8;
+ int ret;
+ uint8_t id1 = bench_tm_func_register(res, "odp_pktio_open()");
+ uint8_t id2 = bench_tm_func_register(res, "odp_pktin_queue_config()");
+ uint8_t id3 = bench_tm_func_register(res, "odp_pktout_queue_config()");
+ uint8_t id4 = bench_tm_func_register(res, "odp_pktio_start()");
+ uint8_t id5 = bench_tm_func_register(res, "odp_pktio_stop()");
+ uint8_t id6 = bench_tm_func_register(res, "odp_pktio_close()");
+
+ pool = create_packet_pool();
+
+ odp_pktio_param_init(&param);
+ param.in_mode = appl_args->opt.in_mode;
+ param.out_mode = appl_args->opt.out_mode;
+
+ odp_pktin_queue_param_init(&pktin_param);
+ pktin_param.num_queues = appl_args->opt.num_input_queues;
+ if (pktin_param.num_queues > 1) {
+ pktin_param.hash_enable = true;
+ pktin_param.hash_proto.proto.ipv4_udp = 1;
+ }
+
+ odp_pktout_queue_param_init(&pktout_param);
+ pktout_param.num_queues = appl_args->opt.num_output_queues;
+
+ for (int i = 0; i < repeat_count; i++) {
+ t1 = odp_time_local_strict();
+ pktio = odp_pktio_open(appl_args->opt.name, pool, &param);
+ t2 = odp_time_local_strict();
+
+ if (pktio == ODP_PKTIO_INVALID) {
+ ODPH_ERR("Opening pktio failed\n");
+ return -1;
+ }
+
+ ret = odp_pktin_queue_config(pktio, &pktin_param);
+ t3 = odp_time_local_strict();
+
+ if (ret) {
+ ODPH_ERR("Configuring packet input queues failed: %d\n", ret);
+ return -1;
+ }
+
+ ret = odp_pktout_queue_config(pktio, &pktout_param);
+ t4 = odp_time_local_strict();
+
+ if (ret) {
+ ODPH_ERR("Configuring packet output queues failed: %d\n", ret);
+ return -1;
+ }
+
+ ret = odp_pktio_start(pktio);
+ t5 = odp_time_local_strict();
+
+ if (ret) {
+ ODPH_ERR("Starting pktio failed: %d\n", ret);
+ return -1;
+ }
+
+ ret = odp_pktio_stop(pktio);
+ t6 = odp_time_local_strict();
+
+ if (ret) {
+ ODPH_ERR("Stopping pktio failed: %d\n", ret);
+ return -1;
+ }
+
+ /* Clean possible pre-scheduled packets */
+ if (appl_args->opt.in_mode == ODP_PKTIN_MODE_SCHED)
+ clean_pending_events();
+
+ t7 = odp_time_local_strict();
+ ret = odp_pktio_close(pktio);
+ t8 = odp_time_local_strict();
+ if (ret) {
+ ODPH_ERR("Closing pktio failed: %d\n", ret);
+ return -1;
+ }
+
+ bench_tm_func_record(t2, t1, res, id1);
+ bench_tm_func_record(t3, t2, res, id2);
+ bench_tm_func_record(t4, t3, res, id3);
+ bench_tm_func_record(t5, t4, res, id4);
+ bench_tm_func_record(t6, t5, res, id5);
+ bench_tm_func_record(t8, t7, res, id6);
+ }
+
+ ret = odp_pool_destroy(pool);
+ if (ret) {
+ ODPH_ERR("Destroying pktio pool failed: %d\n", ret);
+ return -1;
+ }
+ return 0;
+}
+
+static int pktio_stats(bench_tm_result_t *res, int repeat_count)
+{
+ appl_args_t *appl_args = gbl_args;
+ odp_pktio_stats_t *stats = &appl_args->stats;
+ odp_pktio_t pktio = appl_args->pktio;
+ odp_time_t t1, t2;
+ int ret;
+ uint8_t id1 = bench_tm_func_register(res, "odp_pktio_stats()");
+
+ for (int i = 0; i < repeat_count; i++) {
+ t1 = odp_time_local_strict();
+ ret = odp_pktio_stats(pktio, stats);
+ t2 = odp_time_local_strict();
+
+ if (ret) {
+ ODPH_ERR("Reading pktio stats failed\n");
+ return -1;
+ }
+
+ bench_tm_func_record(t2, t1, res, id1);
+ }
+ return 0;
+}
+
+static int pktio_stats_reset(bench_tm_result_t *res, int repeat_count)
+{
+ appl_args_t *appl_args = gbl_args;
+ odp_pktio_t pktio = appl_args->pktio;
+ odp_time_t t1, t2;
+ int ret;
+ int id1 = bench_tm_func_register(res, "odp_pktio_stats_reset()");
+
+ for (int i = 0; i < repeat_count; i++) {
+ t1 = odp_time_local_strict();
+ ret = odp_pktio_stats_reset(pktio);
+ t2 = odp_time_local_strict();
+
+ if (ret) {
+ ODPH_ERR("Resetting pktio stats failed\n");
+ return -1;
+ }
+
+ bench_tm_func_record(t2, t1, res, id1);
+ }
+ return 0;
+}
+
+static int pktin_queue_stats(bench_tm_result_t *res, int repeat_count)
+{
+ appl_args_t *appl_args = gbl_args;
+ odp_pktin_queue_stats_t *stats = &appl_args->pktin_queue_stats;
+ odp_pktio_t pktio = appl_args->pktio;
+ odp_pktin_queue_t queue;
+ odp_time_t t1, t2;
+ int ret;
+ uint8_t id1 = bench_tm_func_register(res, "odp_pktin_queue_stats()");
+
+ ret = odp_pktin_queue(pktio, &queue, 1);
+ if (ret < 1) {
+ ODPH_ERR("Reading pktio input queue failed\n");
+ return -1;
+ }
+
+ for (int i = 0; i < repeat_count; i++) {
+ t1 = odp_time_local_strict();
+ ret = odp_pktin_queue_stats(queue, stats);
+ t2 = odp_time_local_strict();
+
+ if (ret) {
+ ODPH_ERR("Reading pktio stats failed\n");
+ return -1;
+ }
+
+ bench_tm_func_record(t2, t1, res, id1);
+ }
+ return 0;
+}
+
+static int pktin_event_queue_stats(bench_tm_result_t *res, int repeat_count)
+{
+ appl_args_t *appl_args = gbl_args;
+ odp_pktin_queue_stats_t *stats = &appl_args->pktin_queue_stats;
+ odp_pktio_t pktio = appl_args->pktio;
+ odp_queue_t queue;
+ odp_time_t t1, t2;
+ int ret;
+ uint8_t id1 = bench_tm_func_register(res, "odp_pktin_event_queue_stats()");
+
+ ret = odp_pktin_event_queue(pktio, &queue, 1);
+ if (ret < 1) {
+ ODPH_ERR("Reading pktio input queue failed\n");
+ return -1;
+ }
+
+ for (int i = 0; i < repeat_count; i++) {
+ t1 = odp_time_local_strict();
+ ret = odp_pktin_event_queue_stats(pktio, queue, stats);
+ t2 = odp_time_local_strict();
+
+ if (ret) {
+ ODPH_ERR("Reading pktio stats failed\n");
+ return -1;
+ }
+
+ bench_tm_func_record(t2, t1, res, id1);
+ }
+ return 0;
+}
+
+static int pktout_queue_stats(bench_tm_result_t *res, int repeat_count)
+{
+ appl_args_t *appl_args = gbl_args;
+ odp_pktout_queue_stats_t *stats = &appl_args->pktout_queue_stats;
+ odp_pktio_t pktio = appl_args->pktio;
+ odp_pktout_queue_t queue;
+ odp_time_t t1, t2;
+ int ret;
+ uint8_t id1 = bench_tm_func_register(res, "odp_pktout_queue_stats()");
+
+ ret = odp_pktout_queue(pktio, &queue, 1);
+ if (ret < 1) {
+ ODPH_ERR("Reading pktio input queue failed\n");
+ return -1;
+ }
+
+ for (int i = 0; i < repeat_count; i++) {
+ t1 = odp_time_local_strict();
+ ret = odp_pktout_queue_stats(queue, stats);
+ t2 = odp_time_local_strict();
+
+ if (ret) {
+ ODPH_ERR("Reading pktio stats failed\n");
+ return -1;
+ }
+
+ bench_tm_func_record(t2, t1, res, id1);
+ }
+ return 0;
+}
+
+static int pktout_event_queue_stats(bench_tm_result_t *res, int repeat_count)
+{
+ appl_args_t *appl_args = gbl_args;
+ odp_pktout_queue_stats_t *stats = &appl_args->pktout_queue_stats;
+ odp_pktio_t pktio = appl_args->pktio;
+ odp_queue_t queue;
+ odp_time_t t1, t2;
+ int ret;
+ uint8_t id1 = bench_tm_func_register(res, "odp_pktout_event_queue_stats()");
+
+ ret = odp_pktout_event_queue(pktio, &queue, 1);
+ if (ret < 1) {
+ ODPH_ERR("Reading pktio input queue failed\n");
+ return -1;
+ }
+
+ for (int i = 0; i < repeat_count; i++) {
+ t1 = odp_time_local_strict();
+ ret = odp_pktout_event_queue_stats(pktio, queue, stats);
+ t2 = odp_time_local_strict();
+
+ if (ret) {
+ ODPH_ERR("Reading pktio stats failed\n");
+ return -1;
+ }
+
+ bench_tm_func_record(t2, t1, res, id1);
+ }
+ return 0;
+}
+
+static int find_first_supported_l3_pmr(const odp_cls_capability_t *capa, odp_cls_pmr_term_t *term)
+{
+ *term = ODP_PMR_TCP_DPORT;
+
+ if (capa->supported_terms.bit.udp_sport)
+ *term = ODP_PMR_UDP_SPORT;
+ else if (capa->supported_terms.bit.udp_dport)
+ *term = ODP_PMR_UDP_DPORT;
+ else if (capa->supported_terms.bit.tcp_sport)
+ *term = ODP_PMR_TCP_SPORT;
+ else if (capa->supported_terms.bit.tcp_dport)
+ *term = ODP_PMR_TCP_DPORT;
+ else
+ return 0;
+
+ return 1;
+}
+
+/* Capabilities required for cls_pmr_create() test */
+static int check_cls_capa(void)
+{
+ appl_args_t *appl_args = gbl_args;
+ odp_cls_capability_t cls_capa;
+ odp_schedule_capability_t sched_capa;
+ int ret;
+
+ ret = odp_cls_capability(&cls_capa);
+ if (ret) {
+ ODPH_ERR("Reading classifier capa failed: %d\n", ret);
+ return -1;
+ }
+
+ ret = odp_schedule_capability(&sched_capa);
+ if (ret) {
+ ODPH_ERR("Reading scheduler capa failed: %d\n", ret);
+ return -1;
+ }
+
+ if (!find_first_supported_l3_pmr(&cls_capa, &appl_args->cls_pmr_create.term)) {
+ ODPH_ERR("Implementations doesn't support any TCP/UDP PMRs\n");
+ return 0;
+ }
+
+ /* One extra CoS and queue required for the default CoS */
+ if (appl_args->opt.num_pmr + 1 > cls_capa.max_cos) {
+ ODPH_ERR("Not enough CoSes supported for PMR test: %u/%u\n",
+ appl_args->opt.num_pmr + 1, cls_capa.max_cos);
+ return 0;
+ }
+
+ if (appl_args->opt.num_pmr + 1 > sched_capa.max_queues) {
+ ODPH_ERR("Not enough queues supported for PMR test: %u/%u\n",
+ appl_args->opt.num_pmr + 1, sched_capa.max_queues);
+ return 0;
+ }
+
+ appl_args->cls_pmr_create.enabled = true;
+
+ return 1;
+}
+
+static int check_cls_cond(void)
+{
+ return gbl_args->cls_pmr_create.enabled;
+}
+
+static int cls_pmr_create(bench_tm_result_t *res, int repeat_count)
+{
+ appl_args_t *appl_args = gbl_args;
+ odp_pktio_t pktio = appl_args->pktio;
+ odp_cls_cos_param_t cos_param;
+ odp_queue_param_t queue_param;
+ odp_pmr_param_t pmr_param;
+ odp_cos_t default_cos;
+ uint32_t num_cos = appl_args->opt.num_pmr + 1;
+ uint32_t num_pmr = num_cos - 1;
+ uint32_t cos_created = 0;
+ uint32_t queue_created = 0;
+ uint16_t val = 1024;
+ uint16_t mask = 0xffff;
+ int ret = 0;
+ odp_time_t t1, t2;
+ odp_cos_t cos[num_cos];
+ odp_queue_t queue[num_cos];
+ odp_pmr_t pmr[num_pmr];
+ uint8_t id1 = bench_tm_func_register(res, "odp_cls_pmr_create()");
+ uint8_t id2 = bench_tm_func_register(res, "odp_cls_pmr_destroy()");
+
+ odp_queue_param_init(&queue_param);
+ queue_param.type = ODP_QUEUE_TYPE_SCHED;
+
+ odp_cls_cos_param_init(&cos_param);
+
+ for (uint32_t i = 0; i < num_cos; i++) {
+ queue[i] = odp_queue_create(NULL, &queue_param);
+ if (queue[i] == ODP_QUEUE_INVALID) {
+ ODPH_ERR("odp_queue_create() failed %u / %u\n", i + 1, num_cos);
+ break;
+ }
+
+ cos_param.queue = queue[i];
+ queue_created++;
+
+ cos[i] = odp_cls_cos_create(NULL, &cos_param);
+ if (cos[i] == ODP_COS_INVALID) {
+ ODPH_ERR("odp_cls_cos_create() failed %u / %u\n", i + 1, num_cos);
+ break;
+ }
+ cos_created++;
+ }
+
+ if (queue_created != num_cos)
+ ODPH_ERR("Unable to create all queues: %u/%u\n", queue_created, num_cos);
+
+ if (cos_created != num_cos) {
+ ODPH_ERR("Unable to create all CoSes: %u/%u\n", cos_created, num_cos);
+ goto destroy_cos;
+ }
+
+ default_cos = cos[0];
+
+ ret = odp_pktio_default_cos_set(pktio, default_cos);
+ if (ret) {
+ ODPH_ERR("Setting default CoS failed: %d\n", ret);
+ goto destroy_cos;
+ }
+
+ odp_cls_pmr_param_init(&pmr_param);
+ pmr_param.term = appl_args->cls_pmr_create.term;
+ pmr_param.match.value = &val;
+ pmr_param.match.mask = &mask;
+ pmr_param.val_sz = sizeof(val);
+
+ for (uint32_t i = 0; i < (uint32_t)repeat_count; i++) {
+ uint32_t pmr_created = 0;
+
+ for (uint32_t j = 0; j < num_pmr; j++) {
+ t1 = odp_time_local_strict();
+ pmr[j] = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos[j + 1]);
+ t2 = odp_time_local_strict();
+
+ if (pmr[j] == ODP_PMR_INVALID)
+ break;
+ bench_tm_func_record(t2, t1, res, id1);
+
+ val++;
+ pmr_created++;
+ }
+
+ for (uint32_t j = 0; j < pmr_created; j++) {
+ t1 = odp_time_local_strict();
+ ret = odp_cls_pmr_destroy(pmr[j]);
+ t2 = odp_time_local_strict();
+
+ if (ret)
+ ODPH_ABORT("Destroying PMR failed: %d\n", ret);
+
+ bench_tm_func_record(t2, t1, res, id2);
+ }
+
+ if (i == 0)
+ ODPH_DBG("Created %u PMRs\n", pmr_created);
+ }
+
+ ret = odp_pktio_default_cos_set(pktio, ODP_COS_INVALID);
+
+destroy_cos:
+ for (uint32_t i = 0; i < cos_created; i++)
+ ret = odp_cos_destroy(cos[i]);
+
+ for (uint32_t i = 0; i < queue_created; i++)
+ ret = odp_queue_destroy(queue[i]);
+
+ return ret;
+}
+
+bench_tm_info_t test_suite[] = {
+ BENCH_INFO(pktio_capability, pktio_setup, pktio_clean, NULL, 0),
+ BENCH_INFO(pktio_lookup, pktio_setup, pktio_clean, NULL, 0),
+ BENCH_INFO(pktio_open_start_stop_close, NULL, NULL, NULL, 0),
+ BENCH_INFO(pktio_stats, pktio_setup, pktio_clean, NULL, 0),
+ BENCH_INFO(pktin_queue_stats, pktio_setup_direct_rx, pktio_clean_direct_rx, NULL, 0),
+ BENCH_INFO(pktin_event_queue_stats, pktio_setup_sched_rx, pktio_clean_sched_rx, NULL, 0),
+ BENCH_INFO(pktout_queue_stats, pktio_setup_direct_tx, pktio_clean, NULL, 0),
+ BENCH_INFO(pktout_event_queue_stats, pktio_setup_queue_tx, pktio_clean, NULL, 0),
+ BENCH_INFO(pktio_stats_reset, pktio_setup, pktio_clean, NULL, 0),
+ BENCH_INFO(cls_pmr_create, pktio_setup_cls, pktio_clean_sched_rx, check_cls_cond, 0)
+};
+
+/* Print usage information */
+static void usage(void)
+{
+ printf("\n"
+ "ODP pktio API slow path micro benchmarks\n"
+ "\n"
+ "Options:\n"
+ " -i, --interface <name> Ethernet interface name (default loop).\n"
+ " -m, --in_mode <arg> Packet input mode\n"
+ " 0: Direct mode: PKTIN_MODE_DIRECT (default)\n"
+ " 1: Scheduler mode with parallel queues:\n"
+ " PKTIN_MODE_SCHED + SCHED_SYNC_PARALLEL\n"
+ " -o, --out_mode <arg> Packet output mode\n"
+ " 0: Direct mode: PKTOUT_MODE_DIRECT (default)\n"
+ " 1: Queue mode: PKTOUT_MODE_QUEUE\n"
+ " -p, --pmr <num> Number of PMRs to create/destroy per round (default 1)\n"
+ " -q, --rx_queues <num> Number of packet input queues (default 1)\n"
+ " -t, --tx_queues <num> Number of packet output queues (default 1)\n"
+ " -r, --rounds <num> Run each test case 'num' times (default %u).\n"
+ " -s, --select <idx> Run only selected test case.\n"
+ " -h, --help Display help and exit.\n\n"
+ "\n", ROUNDS);
+}
+
+static int parse_interface(appl_args_t *appl_args, const char *optarg)
+{
+ if (strlen(optarg) + 1 > MAX_NAME_LEN) {
+ ODPH_ERR("Unable to store interface name (MAX_NAME_LEN=%d)\n", MAX_NAME_LEN);
+ return -1;
+ }
+ strncpy(appl_args->opt.name, optarg, MAX_NAME_LEN);
+ return 0;
+}
+
+/* Parse command line arguments */
+static int parse_args(int argc, char *argv[])
+{
+ int i;
+ int opt;
+ int long_index;
+ static const struct option longopts[] = {
+ {"interface", required_argument, NULL, 'i'},
+ {"in_mode", required_argument, NULL, 'm'},
+ {"out_mode", required_argument, NULL, 'o'},
+ {"pmr", required_argument, NULL, 'p'},
+ {"rx_queues", required_argument, NULL, 'q'},
+ {"tx_queues", required_argument, NULL, 't'},
+ {"rounds", required_argument, NULL, 'r'},
+ {"select", required_argument, NULL, 's'},
+ {"help", no_argument, NULL, 'h'},
+ {NULL, 0, NULL, 0}
+ };
+
+ static const char *shortopts = "i:m:o:p:q:r:s:t:h";
+
+ strncpy(gbl_args->opt.name, "loop", MAX_NAME_LEN);
+ gbl_args->opt.rounds = ROUNDS;
+ gbl_args->opt.in_mode = ODP_PKTIN_MODE_DIRECT;
+ gbl_args->opt.out_mode = ODP_PKTOUT_MODE_DIRECT;
+ gbl_args->opt.num_input_queues = 1;
+ gbl_args->opt.num_output_queues = 1;
+ gbl_args->opt.num_pmr = 1;
+
+ while (1) {
+ opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
+
+ if (opt == -1)
+ break; /* No more options */
+
+ switch (opt) {
+ case 'i':
+ if (parse_interface(gbl_args, optarg))
+ return -1;
+ break;
+ case 'm':
+ i = atoi(optarg);
+ if (i == 1)
+ gbl_args->opt.in_mode = ODP_PKTIN_MODE_SCHED;
+ else
+ gbl_args->opt.in_mode = ODP_PKTIN_MODE_DIRECT;
+ break;
+ case 'o':
+ i = atoi(optarg);
+ if (i == 1)
+ gbl_args->opt.out_mode = ODP_PKTOUT_MODE_QUEUE;
+ else
+ gbl_args->opt.out_mode = ODP_PKTOUT_MODE_DIRECT;
+ break;
+ case 'p':
+ gbl_args->opt.num_pmr = atoi(optarg);
+ break;
+ case 'q':
+ gbl_args->opt.num_input_queues = atoi(optarg);
+ break;
+ case 'r':
+ gbl_args->opt.rounds = atoi(optarg);
+ break;
+ case 's':
+ gbl_args->opt.case_idx = atoi(optarg);
+ break;
+ case 't':
+ gbl_args->opt.num_output_queues = atoi(optarg);
+ break;
+ case 'h':
+ usage();
+ return 1;
+ default:
+ ODPH_ERR("Bad option. Use -h for help.\n");
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+static int check_args(appl_args_t *appl_args)
+{
+ odp_pktio_param_t param;
+ odp_pktio_capability_t capa;
+ odp_pktio_t pktio;
+ odp_pool_t pool;
+ int ret;
+
+ if (gbl_args->opt.rounds < 1) {
+ ODPH_ERR("Invalid test repeat count: %u\n", gbl_args->opt.rounds);
+ return -1;
+ }
+
+ if (gbl_args->opt.case_idx > ODPH_ARRAY_SIZE(test_suite)) {
+ ODPH_ERR("Invalid test case index: %u\n", gbl_args->opt.case_idx);
+ return -1;
+ }
+
+ pool = create_packet_pool();
+
+ odp_pktio_param_init(&param);
+ param.in_mode = appl_args->opt.in_mode;
+ param.out_mode = appl_args->opt.out_mode;
+
+ pktio = odp_pktio_open(appl_args->opt.name, pool, &param);
+ if (pktio == ODP_PKTIO_INVALID) {
+ ODPH_ERR("Opening pktio failed\n");
+ return -1;
+ }
+
+ ret = odp_pktio_capability(pktio, &capa);
+ if (ret) {
+ ODPH_ERR("Reading pktio capa failed: %d\n", ret);
+ return -1;
+ }
+
+ if (appl_args->opt.num_input_queues > capa.max_input_queues) {
+ ODPH_ERR("Too many input queues: %u/%u\n", appl_args->opt.num_input_queues,
+ capa.max_input_queues);
+ return -1;
+ }
+
+ if (appl_args->opt.num_output_queues > capa.max_output_queues) {
+ ODPH_ERR("Too many output queues: %u/%u\n", appl_args->opt.num_output_queues,
+ capa.max_output_queues);
+ return -1;
+ }
+
+ ret = odp_pktio_close(pktio);
+ if (ret) {
+ ODPH_ERR("Closing pktio failed: %d\n", ret);
+ return -1;
+ }
+
+ ret = odp_pool_destroy(pool);
+ if (ret) {
+ ODPH_ERR("Destroying pktio pool failed: %d\n", ret);
+ return -1;
+ }
+
+ if (check_cls_capa() < 0)
+ return -1;
+
+ return 0;
+}
+
+/* Print application info */
+static void print_info(appl_args_t *appl_args)
+{
+ odp_sys_info_print();
+
+ printf("\n"
+ "odp_bench_pktio_sp options\n"
+ "--------------------------\n");
+
+ printf("CPU mask: %s\n", gbl_args->cpumask_str);
+ printf("Interface: %s\n", gbl_args->opt.name);
+
+ printf("Input mode: ");
+ if (appl_args->opt.in_mode == ODP_PKTIN_MODE_SCHED)
+ printf("sched\n");
+ else
+ printf("direct\n");
+
+ printf("Output mode: ");
+ if (appl_args->opt.out_mode == ODP_PKTOUT_MODE_QUEUE)
+ printf("plain\n");
+ else
+ printf("direct\n");
+
+ printf("Input queues: %u\n", gbl_args->opt.num_input_queues);
+ printf("Output queues: %u\n", gbl_args->opt.num_output_queues);
+ printf("PMRs: %u\n", gbl_args->opt.num_pmr);
+ printf("Test rounds: %d\n", gbl_args->opt.rounds);
+ printf("\n");
+}
+
+int main(int argc, char *argv[])
+{
+ odph_helper_options_t helper_options;
+ odph_thread_t worker_thread;
+ odph_thread_common_param_t thr_common;
+ odph_thread_param_t thr_param;
+ odp_shm_t shm;
+ odp_cpumask_t cpumask, default_mask;
+ odp_instance_t instance;
+ odp_init_t init_param;
+ int cpu;
+ int ret;
+
+ /* Let helper collect its own arguments (e.g. --odph_proc) */
+ argc = odph_parse_options(argc, argv);
+ if (odph_options(&helper_options)) {
+ ODPH_ERR("Reading ODP helper options failed\n");
+ exit(EXIT_FAILURE);
+ }
+
+ odp_init_param_init(&init_param);
+ init_param.mem_model = helper_options.mem_model;
+
+ /* Init ODP before calling anything else */
+ if (odp_init_global(&instance, &init_param, NULL)) {
+ ODPH_ERR("Global init failed\n");
+ exit(EXIT_FAILURE);
+ }
+
+ /* Init this thread */
+ if (odp_init_local(instance, ODP_THREAD_CONTROL)) {
+ ODPH_ERR("Local init failed\n");
+ exit(EXIT_FAILURE);
+ }
+
+ ret = odp_schedule_config(NULL);
+ if (ret) {
+ ODPH_ERR("Schedule config failed: %d\n", ret);
+ exit(EXIT_FAILURE);
+ }
+
+ if (setup_sig_handler()) {
+ ODPH_ERR("Signal handler setup failed\n");
+ exit(EXIT_FAILURE);
+ }
+
+ /* Reserve memory for args from shared mem */
+ shm = odp_shm_reserve("shm_args", sizeof(appl_args_t), ODP_CACHE_LINE_SIZE, 0);
+ if (shm == ODP_SHM_INVALID) {
+ ODPH_ERR("Shared mem reserve failed\n");
+ exit(EXIT_FAILURE);
+ }
+
+ gbl_args = odp_shm_addr(shm);
+ if (gbl_args == NULL) {
+ ODPH_ERR("Shared mem alloc failed\n");
+ exit(EXIT_FAILURE);
+ }
+
+ memset(gbl_args, 0, sizeof(appl_args_t));
+
+ /* Parse and store the application arguments */
+ ret = parse_args(argc, argv);
+ if (ret)
+ goto exit;
+
+ if (check_args(gbl_args))
+ goto exit;
+
+ bench_tm_suite_init(&gbl_args->suite);
+ gbl_args->suite.bench = test_suite;
+ gbl_args->suite.num_bench = ODPH_ARRAY_SIZE(test_suite);
+ gbl_args->suite.rounds = gbl_args->opt.rounds;
+ gbl_args->suite.bench_idx = gbl_args->opt.case_idx;
+
+ /* Get default worker cpumask */
+ if (odp_cpumask_default_worker(&default_mask, 1) != 1) {
+ ODPH_ERR("Unable to allocate worker thread\n");
+ ret = -1;
+ goto exit;
+ }
+
+ (void)odp_cpumask_to_str(&default_mask, gbl_args->cpumask_str,
+ sizeof(gbl_args->cpumask_str));
+
+ print_info(gbl_args);
+
+ memset(&worker_thread, 0, sizeof(odph_thread_t));
+
+ /* Create worker thread */
+ cpu = odp_cpumask_first(&default_mask);
+
+ odp_cpumask_zero(&cpumask);
+ odp_cpumask_set(&cpumask, cpu);
+
+ odph_thread_common_param_init(&thr_common);
+ thr_common.instance = instance;
+ thr_common.cpumask = &cpumask;
+ thr_common.share_param = 1;
+
+ odph_thread_param_init(&thr_param);
+ thr_param.start = bench_tm_run;
+ thr_param.arg = &gbl_args->suite;
+ thr_param.thr_type = ODP_THREAD_WORKER;
+
+ odph_thread_create(&worker_thread, &thr_common, &thr_param, 1);
+
+ odph_thread_join(&worker_thread, 1);
+
+ ret = gbl_args->suite.retval;
+
+exit:
+ if (odp_shm_free(shm)) {
+ ODPH_ERR("Shared mem free failed\n");
+ exit(EXIT_FAILURE);
+ }
+
+ if (odp_term_local()) {
+ ODPH_ERR("Local term failed\n");
+ exit(EXIT_FAILURE);
+ }
+
+ if (odp_term_global(instance)) {
+ ODPH_ERR("Global term failed\n");
+ exit(EXIT_FAILURE);
+ }
+
+ if (ret < 0)
+ return EXIT_FAILURE;
+
+ return EXIT_SUCCESS;
+}
diff --git a/test/performance/odp_bench_timer.c b/test/performance/odp_bench_timer.c
index 918d19e5d..b1c43c178 100644
--- a/test/performance/odp_bench_timer.c
+++ b/test/performance/odp_bench_timer.c
@@ -11,6 +11,8 @@
#include <odp_api.h>
#include <odp/helper/odph_api.h>
+#include "bench_common.h"
+
#include <getopt.h>
#include <inttypes.h>
#include <signal.h>
@@ -29,27 +31,8 @@
/** Timer duration in nsec */
#define TIMER_NSEC 50000000
-#define BENCH_INFO(run, max, name) \
- {#run, run, max, name}
-
-/* Run benchmark, returns >0 on success */
-typedef int (*bench_run_fn_t)(void);
-
-/* Benchmark data */
-typedef struct {
- /* Default test name */
- const char *name;
-
- /* Test function to run */
- bench_run_fn_t run;
-
- /* Test specific limit for rounds (tuning for slow implementation) */
- uint32_t max_rounds;
-
- /* Override default test name */
- const char *desc;
-
-} bench_info_t;
+#define BENCH_INFO(run_fn, max, alt_name) \
+ {.name = #run_fn, .run = run_fn, .max_rounds = max, .desc = alt_name}
typedef struct {
/* Command line options */
@@ -68,6 +51,9 @@ typedef struct {
} opt;
+ /* Common benchmark suite data */
+ bench_suite_t suite;
+
odp_timer_pool_t timer_pool;
odp_timer_t timer;
odp_queue_t queue;
@@ -80,27 +66,12 @@ typedef struct {
double tick_hz;
int plain_queue;
- /* Benchmark functions */
- bench_info_t *bench;
-
- /* Number of benchmark functions */
- int num_bench;
-
- /* Break worker loop if set to 1 */
- odp_atomic_u32_t exit_thread;
-
/* Test case input / output data */
uint64_t a1[REPEAT_COUNT];
odp_event_t ev[REPEAT_COUNT];
odp_timeout_t tmo[REPEAT_COUNT];
odp_timer_t tim[REPEAT_COUNT];
- /* Dummy result */
- uint64_t dummy;
-
- /* Benchmark run failed */
- int bench_failed;
-
/* CPU mask as string */
char cpumask_str[ODP_CPUMASK_STR_SIZE];
@@ -112,7 +83,7 @@ static void sig_handler(int signo ODP_UNUSED)
{
if (gbl_args == NULL)
return;
- odp_atomic_store_u32(&gbl_args->exit_thread, 1);
+ odp_atomic_store_u32(&gbl_args->suite.exit_worker, 1);
}
static int setup_sig_handler(void)
@@ -133,113 +104,6 @@ static int setup_sig_handler(void)
return 0;
}
-/* Run given benchmark indefinitely */
-static void run_indef(gbl_args_t *args, int idx)
-{
- const char *desc;
- const bench_info_t *bench = &args->bench[idx];
-
- desc = bench->desc != NULL ? bench->desc : bench->name;
-
- printf("Running odp_%s test indefinitely\n", desc);
-
- while (!odp_atomic_load_u32(&gbl_args->exit_thread)) {
- int ret;
-
- ret = bench->run();
-
- if (!ret)
- ODPH_ABORT("Benchmark %s failed\n", desc);
- }
-}
-
-static int run_benchmarks(void *arg)
-{
- int i, j;
- uint64_t c1, c2;
- odp_time_t t1, t2;
- gbl_args_t *args = arg;
- const int meas_time = args->opt.time;
-
- printf("\nAverage %s per function call\n", meas_time ? "time (nsec)" : "CPU cycles");
- printf("-------------------------------------------------\n");
-
- /* Run each test twice. Results from the first warm-up round are ignored. */
- for (i = 0; i < 2; i++) {
- uint64_t total = 0;
- uint32_t round = 1;
-
- for (j = 0; j < gbl_args->num_bench; round++) {
- int ret;
- const char *desc;
- const bench_info_t *bench = &args->bench[j];
- uint32_t max_rounds = args->opt.rounds;
-
- if (bench->max_rounds && max_rounds > bench->max_rounds)
- max_rounds = bench->max_rounds;
-
- /* Run selected test indefinitely */
- if (args->opt.bench_idx) {
- if ((j + 1) != args->opt.bench_idx) {
- j++;
- continue;
- }
-
- run_indef(args, j);
- return 0;
- }
-
- desc = bench->desc != NULL ? bench->desc : bench->name;
-
- if (meas_time)
- t1 = odp_time_local();
- else
- c1 = odp_cpu_cycles();
-
- ret = bench->run();
-
- if (meas_time)
- t2 = odp_time_local();
- else
- c2 = odp_cpu_cycles();
-
- if (!ret) {
- ODPH_ERR("Benchmark odp_%s failed\n", desc);
- args->bench_failed = -1;
- return -1;
- }
-
- if (meas_time)
- total += odp_time_diff_ns(t2, t1);
- else
- total += odp_cpu_cycles_diff(c2, c1);
-
- for (i = 0; i < REPEAT_COUNT; i++)
- args->dummy += args->a1[i];
-
- if (round >= max_rounds) {
- double result;
-
- /* Each benchmark runs internally REPEAT_COUNT times. */
- result = ((double)total) / (max_rounds * REPEAT_COUNT);
-
- /* No print from warm-up round */
- if (i > 0)
- printf("[%02d] odp_%-26s: %12.2f\n", j + 1, desc, result);
-
- j++;
- total = 0;
- round = 1;
- }
- }
- }
-
- /* Print dummy result to prevent compiler to optimize it away*/
- printf("\n(dummy result: 0x%" PRIx64 ")\n\n", args->dummy);
-
- return 0;
-}
-
static int timer_current_tick(void)
{
int i;
@@ -287,7 +151,7 @@ static int timeout_to_event(void)
for (i = 0; i < REPEAT_COUNT; i++)
ev[i] = odp_timeout_to_event(timeout);
- gbl_args->dummy += odp_event_to_u64(ev[0]);
+ gbl_args->suite.dummy += odp_event_to_u64(ev[0]);
return i;
}
@@ -301,7 +165,7 @@ static int timeout_from_event(void)
for (i = 0; i < REPEAT_COUNT; i++)
tmo[i] = odp_timeout_from_event(ev);
- gbl_args->dummy += odp_timeout_to_u64(tmo[0]);
+ gbl_args->suite.dummy += odp_timeout_to_u64(tmo[0]);
return i;
}
@@ -327,7 +191,7 @@ static int timeout_timer(void)
for (i = 0; i < REPEAT_COUNT; i++)
tim[i] = odp_timeout_timer(timeout);
- gbl_args->dummy += odp_timer_to_u64(tim[0]);
+ gbl_args->suite.dummy += odp_timer_to_u64(tim[0]);
return i;
}
@@ -491,7 +355,8 @@ static int parse_args(int argc, char *argv[])
return -1;
}
- if (gbl_args->opt.bench_idx < 0 || gbl_args->opt.bench_idx > gbl_args->num_bench) {
+ if (gbl_args->opt.bench_idx < 0 ||
+ gbl_args->opt.bench_idx > (int)ODPH_ARRAY_SIZE(test_suite)) {
ODPH_ERR("Bad bench index %i\n", gbl_args->opt.bench_idx);
return -1;
}
@@ -760,16 +625,12 @@ int main(int argc, char *argv[])
}
memset(gbl_args, 0, sizeof(gbl_args_t));
- odp_atomic_init_u32(&gbl_args->exit_thread, 0);
gbl_args->timer_pool = ODP_TIMER_POOL_INVALID;
gbl_args->timer = ODP_TIMER_INVALID;
gbl_args->queue = ODP_QUEUE_INVALID;
gbl_args->pool = ODP_POOL_INVALID;
gbl_args->timeout = ODP_TIMEOUT_INVALID;
- gbl_args->bench = test_suite;
- gbl_args->num_bench = sizeof(test_suite) / sizeof(test_suite[0]);
-
for (i = 0; i < REPEAT_COUNT; i++) {
gbl_args->a1[i] = i;
gbl_args->ev[i] = ODP_EVENT_INVALID;
@@ -782,6 +643,14 @@ int main(int argc, char *argv[])
if (ret)
goto exit;
+ bench_suite_init(&gbl_args->suite);
+ gbl_args->suite.bench = test_suite;
+ gbl_args->suite.num_bench = ODPH_ARRAY_SIZE(test_suite);
+ gbl_args->suite.measure_time = !!gbl_args->opt.time;
+ gbl_args->suite.indef_idx = gbl_args->opt.bench_idx;
+ gbl_args->suite.rounds = gbl_args->opt.rounds;
+ gbl_args->suite.repeat_count = REPEAT_COUNT;
+
/* Get default worker cpumask */
if (odp_cpumask_default_worker(&default_mask, 1) != 1) {
ODPH_ERR("Unable to allocate worker thread\n");
@@ -819,15 +688,15 @@ int main(int argc, char *argv[])
thr_common.share_param = 1;
odph_thread_param_init(&thr_param);
- thr_param.start = run_benchmarks;
- thr_param.arg = gbl_args;
+ thr_param.start = bench_run;
+ thr_param.arg = &gbl_args->suite;
thr_param.thr_type = ODP_THREAD_WORKER;
odph_thread_create(&worker_thread, &thr_common, &thr_param, 1);
odph_thread_join(&worker_thread, 1);
- ret = gbl_args->bench_failed;
+ ret = gbl_args->suite.retval;
exit:
if (gbl_args->timeout != ODP_TIMEOUT_INVALID)
diff --git a/test/performance/odp_cpu_bench.c b/test/performance/odp_cpu_bench.c
index e912e167d..7ef12dc30 100644
--- a/test/performance/odp_cpu_bench.c
+++ b/test/performance/odp_cpu_bench.c
@@ -339,7 +339,7 @@ static int run_thread(void *arg)
}
/*
- * Prinf usage information
+ * Print usage information
*/
static void usage(char *progname)
{
diff --git a/test/performance/odp_crypto.c b/test/performance/odp_crypto.c
index fed3ebad8..93315ce05 100644
--- a/test/performance/odp_crypto.c
+++ b/test/performance/odp_crypto.c
@@ -505,8 +505,7 @@ find_config_by_name(const char *name) {
unsigned int i;
crypto_alg_config_t *ret = NULL;
- for (i = 0; i < (sizeof(algs_config) / sizeof(crypto_alg_config_t));
- i++) {
+ for (i = 0; i < ODPH_ARRAY_SIZE(algs_config); i++) {
if (strcmp(algs_config[i].name, name) == 0) {
ret = algs_config + i;
break;
@@ -523,10 +522,8 @@ static void
print_config_names(const char *prefix) {
unsigned int i;
- for (i = 0; i < (sizeof(algs_config) / sizeof(crypto_alg_config_t));
- i++) {
+ for (i = 0; i < ODPH_ARRAY_SIZE(algs_config); i++)
printf("%s %s\n", prefix, algs_config[i].name);
- }
}
/**
@@ -1287,7 +1284,7 @@ int main(int argc, char *argv[])
max_seg_len = pool_capa.pkt.max_seg_len;
- for (i = 0; i < sizeof(payloads) / sizeof(unsigned int); i++) {
+ for (i = 0; i < ODPH_ARRAY_SIZE(payloads); i++) {
if (payloads[i] + MAX_AUTH_DIGEST_LEN > max_seg_len)
break;
}
@@ -1371,9 +1368,7 @@ int main(int argc, char *argv[])
} else {
unsigned int i;
- for (i = 0;
- i < (sizeof(algs_config) / sizeof(crypto_alg_config_t));
- i++) {
+ for (i = 0; i < ODPH_ARRAY_SIZE(algs_config); i++) {
test_run_arg.crypto_alg_config = algs_config + i;
run_measure_one_config(&test_run_arg);
}
diff --git a/test/performance/odp_dma_perf.c b/test/performance/odp_dma_perf.c
index be23f27ca..7e9d489df 100644
--- a/test/performance/odp_dma_perf.c
+++ b/test/performance/odp_dma_perf.c
@@ -54,9 +54,6 @@ enum {
#define MAX_SEGS 1024U
#define MAX_WORKERS 24
-#define MIN(a, b) (((a) < (b)) ? (a) : (b))
-#define MAX(a, b) (((a) < (b)) ? (b) : (a))
-
#define GIGAS 1000000000
#define MEGAS 1000000
#define KILOS 1000
@@ -156,7 +153,7 @@ typedef struct {
/* Wait and handle finished transfer. */
void (*wait_fn)(sd_t *sd, stats_t *stats);
/* Handle all unfinished transfers after main test has been stopped. */
- void (*drain_fn)(void);
+ void (*drain_fn)(sd_t *sd);
/* Free any resources that might have been allocated during setup phase. */
void (*free_fn)(const sd_t *sd);
} test_api_t;
@@ -250,48 +247,46 @@ static void print_usage(void)
printf("\n"
"DMA performance test. Load DMA subsystem from several workers.\n"
"\n"
- "Examples:\n"
- " " PROG_NAME "\n"
- " " PROG_NAME " -s 10240\n"
- " " PROG_NAME " -t 0 -i 1 -o 1 -s 51200 -S 1 -f 64 -T 10\n"
- " " PROG_NAME " -t 1 -i 10 -o 10 -s 4096 -S 0 -m 1 -f 10 -c 4 -p 1\n"
+ "Usage: " PROG_NAME " [OPTIONS]\n"
+ "\n"
+ " E.g. " PROG_NAME "\n"
+ " " PROG_NAME " -s 10240\n"
+ " " PROG_NAME " -t 0 -i 1 -o 1 -s 51200 -S 1 -f 64 -T 10\n"
+ " " PROG_NAME " -t 1 -i 10 -o 10 -s 4096 -S 0 -m 1 -f 10 -c 4 -p 1\n"
"\n"
- "Usage: " PROG_NAME " [options]\n"
+ "Optional OPTIONS:\n"
"\n"
- " -t, --trs_type Transfer type for test data. %u by default.\n"
- " Types:\n"
- " 0: synchronous\n"
- " 1: asynchronous\n"
- " -i, --num_in_seg Number of input segments to transfer. 0 means the\n"
- " maximum count supported by the implementation. %u by\n"
- " default.\n"
- " -o, --num_out_seg Number of output segments to transfer to. 0 means\n"
- " the maximum count supported by the implementation.\n"
- " %u by default.\n"
- " -s, --in_seg_len Input segment length in bytes. 0 length means\n"
- " maximum segment length supported by implementation.\n"
- " The actual maximum might be limited by what type of\n"
- " data is transferred (packet/memory).\n"
- " %u by default.\n"
- " -S, --in_seg_type Input segment data type. %u by default.\n"
- " Types:\n"
- " 0: packet\n"
- " 1: memory\n"
- " -m, --compl_mode Completion mode for transfers. %u by default.\n"
- " Modes:\n"
- " 0: poll\n"
- " 1: event\n"
- " -f, --max_in_flight Max transfers in-flight per session. 0 means the\n"
- " maximum supported by tester/implementation. %u by\n"
- " default.\n"
- " -T, --time_sec Time in seconds to run. 0 means infinite. %u by\n"
- " default.\n"
- " -c, --worker_count Amount of workers. %u by default.\n"
- " -p, --policy DMA session policy. %u by default.\n"
- " Policies:\n"
- " 0: One session shared by workers\n"
- " 1: One session per worker\n"
- " -h, --help This help.\n"
+ " -t, --trs_type Transfer type for test data. %u by default.\n"
+ " Types:\n"
+ " 0: synchronous\n"
+ " 1: asynchronous\n"
+ " -i, --num_in_seg Number of input segments to transfer. 0 means the maximum\n"
+ " count supported by the implementation. %u by default.\n"
+ " -o, --num_out_seg Number of output segments to transfer to. 0 means the\n"
+ " maximum count supported by the implementation. %u by\n"
+ " default.\n"
+ " -s, --in_seg_len Input segment length in bytes. 0 length means the maximum\n"
+ " segment length supported by the implementation. The actual\n"
+ " maximum might be limited by what type of data is\n"
+ " transferred (packet/memory). %u by default.\n"
+ " -S, --in_seg_type Input segment data type. %u by default.\n"
+ " Types:\n"
+ " 0: packet\n"
+ " 1: memory\n"
+ " -m, --compl_mode Completion mode for transfers. %u by default.\n"
+ " Modes:\n"
+ " 0: poll\n"
+ " 1: event\n"
+ " -f, --max_in_flight Maximum transfers in-flight per session. 0 means the\n"
+ " maximum supported by the tester/implementation. %u by\n"
+ " default.\n"
+ " -T, --time_sec Time in seconds to run. 0 means infinite. %u by default.\n"
+ " -c, --worker_count Amount of workers. %u by default.\n"
+ " -p, --policy DMA session policy. %u by default.\n"
+ " Policies:\n"
+ " 0: One session shared by workers\n"
+ " 1: One session per worker\n"
+ " -h, --help This help.\n"
"\n", DEF_TRS_TYPE, DEF_SEG_CNT, DEF_SEG_CNT, DEF_LEN, DEF_SEG_TYPE, DEF_MODE,
DEF_INFLIGHT, DEF_TIME, DEF_WORKERS, DEF_POLICY);
}
@@ -316,7 +311,7 @@ static parse_result_t check_options(prog_config_t *config)
return PRS_NOK;
}
- max_workers = MIN(odp_thread_count_max() - 1, MAX_WORKERS);
+ max_workers = ODPH_MIN(odp_thread_count_max() - 1, MAX_WORKERS);
if (config->num_workers <= 0 || config->num_workers > max_workers) {
ODPH_ERR("Invalid thread count: %d (min: 1, max: %d)\n", config->num_workers,
@@ -366,7 +361,7 @@ static parse_result_t check_options(prog_config_t *config)
config->num_out_segs + config->src_seg_len *
config->num_in_segs % config->num_out_segs;
- max_seg_len = MAX(config->src_seg_len, config->dst_seg_len);
+ max_seg_len = ODPH_MAX(config->src_seg_len, config->dst_seg_len);
if (max_seg_len > dma_capa.max_seg_len) {
ODPH_ERR("Unsupported total DMA segment length: %u (max: %u)\n", max_seg_len,
@@ -424,7 +419,7 @@ static parse_result_t check_options(prog_config_t *config)
config->compl_mode_mask |= mode_map[config->compl_mode];
}
- max_trs = MIN(dma_capa.max_transfers, MAX_SEGS);
+ max_trs = ODPH_MIN(dma_capa.max_transfers, MAX_SEGS);
if (config->num_inflight == 0U)
config->num_inflight = max_trs;
@@ -437,7 +432,7 @@ static parse_result_t check_options(prog_config_t *config)
max_in = config->num_in_segs * config->num_inflight;
max_out = config->num_out_segs * config->num_inflight;
- max_segs = MAX(max_in, max_out);
+ max_segs = ODPH_MAX(max_in, max_out);
if (max_segs > MAX_SEGS) {
ODPH_ERR("Unsupported input/output * inflight segment combination: %u (max: %u)\n",
@@ -692,7 +687,7 @@ static void configure_packet_dma_transfer(sd_t *sd)
seg = &start_dst_seg[j];
seg->packet = pkt;
seg->offset = 0U;
- seg->len = MIN(len, sd->dma.dst_seg_len);
+ seg->len = ODPH_MIN(len, sd->dma.dst_seg_len);
len -= sd->dma.dst_seg_len;
}
@@ -771,7 +766,7 @@ static void configure_address_dma_transfer(sd_t *sd)
for (uint32_t j = 0U; j < sd->dma.num_out_segs; ++j, ++z) {
seg = &start_dst_seg[j];
seg->addr = (uint8_t *)sd->seg.dst + z * sd->dma.dst_seg_len;
- seg->len = MIN(len, sd->dma.dst_seg_len);
+ seg->len = ODPH_MIN(len, sd->dma.dst_seg_len);
len -= sd->dma.dst_seg_len;
}
@@ -811,17 +806,17 @@ static void run_transfer(odp_dma_t handle, trs_info_t *info, stats_t *stats)
++stats->start_errs;
} else {
trs_tm = end_tm - start_tm;
- stats->max_trs_tm = MAX(trs_tm, stats->max_trs_tm);
- stats->min_trs_tm = MIN(trs_tm, stats->min_trs_tm);
+ stats->max_trs_tm = ODPH_MAX(trs_tm, stats->max_trs_tm);
+ stats->min_trs_tm = ODPH_MIN(trs_tm, stats->min_trs_tm);
stats->trs_tm += trs_tm;
trs_cc = odp_cpu_cycles_diff(end_cc, start_cc);
- stats->max_trs_cc = MAX(trs_cc, stats->max_trs_cc);
- stats->min_trs_cc = MIN(trs_cc, stats->min_trs_cc);
+ stats->max_trs_cc = ODPH_MAX(trs_cc, stats->max_trs_cc);
+ stats->min_trs_cc = ODPH_MIN(trs_cc, stats->min_trs_cc);
stats->trs_cc += trs_cc;
++stats->trs_cnt;
start_cc_diff = odp_cpu_cycles_diff(end_cc, start_cc);
- stats->max_start_cc = MAX(start_cc_diff, stats->max_start_cc);
- stats->min_start_cc = MIN(start_cc_diff, stats->min_start_cc);
+ stats->max_start_cc = ODPH_MAX(start_cc_diff, stats->max_start_cc);
+ stats->min_start_cc = ODPH_MIN(start_cc_diff, stats->min_start_cc);
stats->start_cc += start_cc_diff;
++stats->start_cnt;
@@ -896,8 +891,8 @@ static void poll_transfer(odp_dma_t handle, trs_info_t *info, stats_t *stats)
++info->trs_poll_cnt;
wait_cc = odp_cpu_cycles_diff(end_cc, start_cc);
- stats->max_wait_cc = MAX(wait_cc, stats->max_wait_cc);
- stats->min_wait_cc = MIN(wait_cc, stats->min_wait_cc);
+ stats->max_wait_cc = ODPH_MAX(wait_cc, stats->max_wait_cc);
+ stats->min_wait_cc = ODPH_MIN(wait_cc, stats->min_wait_cc);
stats->wait_cc += wait_cc;
++stats->wait_cnt;
@@ -905,12 +900,12 @@ static void poll_transfer(odp_dma_t handle, trs_info_t *info, stats_t *stats)
return;
trs_tm = odp_time_global_strict_ns() - info->trs_start_tm;
- stats->max_trs_tm = MAX(trs_tm, stats->max_trs_tm);
- stats->min_trs_tm = MIN(trs_tm, stats->min_trs_tm);
+ stats->max_trs_tm = ODPH_MAX(trs_tm, stats->max_trs_tm);
+ stats->min_trs_tm = ODPH_MIN(trs_tm, stats->min_trs_tm);
stats->trs_tm += trs_tm;
trs_cc = odp_cpu_cycles_diff(odp_cpu_cycles(), info->trs_start_cc);
- stats->max_trs_cc = MAX(trs_cc, stats->max_trs_cc);
- stats->min_trs_cc = MIN(trs_cc, stats->min_trs_cc);
+ stats->max_trs_cc = ODPH_MAX(trs_cc, stats->max_trs_cc);
+ stats->min_trs_cc = ODPH_MIN(trs_cc, stats->min_trs_cc);
stats->trs_cc += trs_cc;
stats->trs_poll_cnt += info->trs_poll_cnt;
++stats->trs_cnt;
@@ -934,8 +929,8 @@ static void poll_transfer(odp_dma_t handle, trs_info_t *info, stats_t *stats)
info->trs_start_cc = start_cc;
info->trs_poll_cnt = 0U;
start_cc_diff = odp_cpu_cycles_diff(end_cc, start_cc);
- stats->max_start_cc = MAX(start_cc_diff, stats->max_start_cc);
- stats->min_start_cc = MIN(start_cc_diff, stats->min_start_cc);
+ stats->max_start_cc = ODPH_MAX(start_cc_diff, stats->max_start_cc);
+ stats->min_start_cc = ODPH_MIN(start_cc_diff, stats->min_start_cc);
stats->start_cc += start_cc_diff;
++stats->start_cnt;
info->is_running = true;
@@ -1076,17 +1071,17 @@ static void wait_compl_event(sd_t *sd, stats_t *stats)
odp_dma_compl_result(odp_dma_compl_from_event(ev), &res);
info = res.user_ptr;
trs_tm = odp_time_global_strict_ns() - info->trs_start_tm;
- stats->max_trs_tm = MAX(trs_tm, stats->max_trs_tm);
- stats->min_trs_tm = MIN(trs_tm, stats->min_trs_tm);
+ stats->max_trs_tm = ODPH_MAX(trs_tm, stats->max_trs_tm);
+ stats->min_trs_tm = ODPH_MIN(trs_tm, stats->min_trs_tm);
stats->trs_tm += trs_tm;
trs_cc = odp_cpu_cycles_diff(odp_cpu_cycles(), info->trs_start_cc);
- stats->max_trs_cc = MAX(trs_cc, stats->max_trs_cc);
- stats->min_trs_cc = MIN(trs_cc, stats->min_trs_cc);
+ stats->max_trs_cc = ODPH_MAX(trs_cc, stats->max_trs_cc);
+ stats->min_trs_cc = ODPH_MIN(trs_cc, stats->min_trs_cc);
stats->trs_cc += trs_cc;
++stats->trs_cnt;
wait_cc = odp_cpu_cycles_diff(end_cc, start_cc);
- stats->max_wait_cc = MAX(wait_cc, stats->max_wait_cc);
- stats->min_wait_cc = MIN(wait_cc, stats->min_wait_cc);
+ stats->max_wait_cc = ODPH_MAX(wait_cc, stats->max_wait_cc);
+ stats->min_wait_cc = ODPH_MIN(wait_cc, stats->min_wait_cc);
stats->wait_cc += wait_cc;
++stats->wait_cnt;
@@ -1106,14 +1101,14 @@ static void wait_compl_event(sd_t *sd, stats_t *stats)
info->trs_start_tm = start_tm;
info->trs_start_cc = start_cc;
start_cc_diff = odp_cpu_cycles_diff(end_cc, start_cc);
- stats->max_start_cc = MAX(start_cc_diff, stats->max_start_cc);
- stats->min_start_cc = MIN(start_cc_diff, stats->min_start_cc);
+ stats->max_start_cc = ODPH_MAX(start_cc_diff, stats->max_start_cc);
+ stats->min_start_cc = ODPH_MIN(start_cc_diff, stats->min_start_cc);
stats->start_cc += start_cc_diff;
++stats->start_cnt;
}
}
-static void drain_compl_events(void)
+static void drain_compl_events(ODP_UNUSED sd_t *sd)
{
odp_event_t ev;
@@ -1125,6 +1120,25 @@ static void drain_compl_events(void)
}
}
+static void drain_poll_transfers(sd_t *sd)
+{
+ const uint32_t count = sd->dma.num_inflight;
+ trs_info_t *infos = sd->dma.infos, *info;
+ odp_dma_t handle = sd->dma.handle;
+ int rc;
+
+ for (uint32_t i = 0U; i < count; ++i) {
+ info = &infos[i];
+
+ if (info->is_running) {
+ do {
+ rc = odp_dma_transfer_done(handle, info->compl_param.transfer_id,
+ NULL);
+ } while (rc == 0);
+ }
+ }
+}
+
static void setup_api(prog_config_t *config)
{
if (config->seg_type == PACKET) {
@@ -1149,7 +1163,7 @@ static void setup_api(prog_config_t *config)
config->api.bootstrap_fn = NULL;
config->api.wait_fn = config->num_workers == 1 || config->policy == MANY ?
poll_transfers_mt_unsafe : poll_transfers_mt_safe;
- config->api.drain_fn = NULL;
+ config->api.drain_fn = drain_poll_transfers;
} else {
config->api.session_cfg_fn = configure_event_compl_session;
config->api.compl_fn = configure_event_compl;
@@ -1247,7 +1261,7 @@ static int transfer(void *args)
thr_config->stats.tot_tm = end_tm - start_tm;
if (api->drain_fn != NULL)
- api->drain_fn();
+ api->drain_fn(sd);
out:
odp_barrier_wait(&prog_config->term_barrier);
@@ -1401,10 +1415,10 @@ static void print_stats(const prog_config_t *config)
tot_trs_tm += stats->trs_tm;
tot_trs_cc += stats->trs_cc;
tot_trs_cnt += stats->trs_cnt;
- tot_min_tm = MIN(tot_min_tm, stats->min_trs_tm);
- tot_max_tm = MAX(tot_max_tm, stats->max_trs_tm);
- tot_min_cc = MIN(tot_min_cc, stats->min_trs_cc);
- tot_max_cc = MAX(tot_max_cc, stats->max_trs_cc);
+ tot_min_tm = ODPH_MIN(tot_min_tm, stats->min_trs_tm);
+ tot_max_tm = ODPH_MAX(tot_max_tm, stats->max_trs_tm);
+ tot_min_cc = ODPH_MIN(tot_min_cc, stats->min_trs_cc);
+ tot_max_cc = ODPH_MAX(tot_max_cc, stats->max_trs_cc);
printf(" worker %d:\n", i);
printf(" successful transfers: %" PRIu64 "\n"
diff --git a/test/performance/odp_dmafwd.c b/test/performance/odp_dmafwd.c
new file mode 100644
index 000000000..188a8e358
--- /dev/null
+++ b/test/performance/odp_dmafwd.c
@@ -0,0 +1,1468 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Nokia
+ */
+
+/**
+ * DMA forwarder
+ *
+ * This tester application can be used to profile the performance of an ODP DMA implementation.
+ * Tester workflow consists of packet reception, copy and forwarding steps. Packets are first
+ * received from configured interfaces after which packets are copied, either with plain SW memory
+ * copy or with DMA offload copy. Finally, copied packets are echoed back to the sender(s).
+ */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include <odp_api.h>
+#include <odp/helper/odph_api.h>
+
+#define EXIT_NOT_SUP 2
+#define PROG_NAME "odp_dmafwd"
+#define DELIMITER ","
+
+enum {
+ SW_COPY = 0U,
+ DMA_COPY_EV,
+ DMA_COPY_POLL
+};
+
+#define DEF_CPY_TYPE SW_COPY
+#define DEF_CNT 32768U
+#define DEF_LEN 1024U
+#define DEF_WORKERS 1U
+#define DEF_TIME 0U
+
+#define MAX_IFS 2U
+#define MAX_OUT_QS 32U
+#define MAX_BURST 32U
+#define MAX_WORKERS (ODP_THREAD_COUNT_MAX - 1)
+
+#define DIV_IF(a, b) ((b) > 0U ? ((a) / (b)) : 0U)
+
+ODP_STATIC_ASSERT(MAX_IFS < UINT8_MAX, "Too large maximum interface count");
+ODP_STATIC_ASSERT(MAX_OUT_QS < UINT8_MAX, "Too large maximum output queue count");
+
+typedef struct {
+ uint32_t burst_size;
+ uint32_t num_pkts;
+ uint32_t pkt_len;
+ uint32_t cache_size;
+} dynamic_defs_t;
+
+typedef enum {
+ PRS_OK,
+ PRS_NOK,
+ PRS_TERM,
+ PRS_NOT_SUP
+} parse_result_t;
+
+typedef struct prog_config_s prog_config_t;
+
+typedef struct {
+ uint64_t copy_errs;
+ uint64_t trs;
+ uint64_t start_errs;
+ uint64_t trs_errs;
+ uint64_t buf_alloc_errs;
+ uint64_t compl_alloc_errs;
+ uint64_t pkt_alloc_errs;
+ uint64_t trs_poll_errs;
+ uint64_t trs_polled;
+ uint64_t fwd_pkts;
+ uint64_t discards;
+ uint64_t sched_cc;
+ uint64_t tot_cc;
+ uint64_t sched_rounds;
+} stats_t;
+
+typedef struct ODP_ALIGNED_CACHE {
+ prog_config_t *prog_config;
+ odp_dma_t dma_handle;
+ odp_pool_t compl_pool;
+ odp_pool_t copy_pool;
+ odp_pool_t trs_pool;
+ odp_queue_t compl_q;
+ odp_stash_t inflight_stash;
+ stats_t stats;
+ int thr_idx;
+} thread_config_t;
+
+typedef struct pktio_s {
+ odp_pktout_queue_t out_qs[MAX_OUT_QS];
+ char *name;
+ odp_pktio_t handle;
+ uint8_t num_out_qs;
+} pktio_t;
+
+typedef struct {
+ odp_packet_t src_pkts[MAX_BURST];
+ odp_packet_t dst_pkts[MAX_BURST];
+ pktio_t *pktio;
+ int num;
+} transfer_t;
+
+/* Function for initializing transfer structures */
+typedef transfer_t *(*init_fn_t)(odp_dma_transfer_param_t *trs_param,
+ odp_dma_compl_param_t *compl_param, odp_dma_seg_t *src_segs,
+ odp_dma_seg_t *dst_segs, pktio_t *pktio, thread_config_t *config);
+/* Function for starting transfers */
+typedef odp_bool_t (*start_fn_t)(odp_dma_transfer_param_t *trs_param,
+ odp_dma_compl_param_t *compl_param, thread_config_t *config);
+/* Function for setting up packets for copy */
+typedef void (*pkt_fn_t)(odp_packet_t pkts[], int num, pktio_t *pktio, init_fn_t init_fn,
+ start_fn_t start_fn, thread_config_t *config);
+/* Function for draining and tearing down inflight operations */
+typedef void (*drain_fn_t)(thread_config_t *config);
+
+typedef struct prog_config_s {
+ uint8_t pktio_idx_map[ODP_PKTIO_MAX_INDEX + 1];
+ odph_thread_t thread_tbl[MAX_WORKERS];
+ thread_config_t thread_config[MAX_WORKERS];
+ pktio_t pktios[MAX_IFS];
+ dynamic_defs_t dyn_defs;
+ odp_instance_t odp_instance;
+ odp_barrier_t init_barrier;
+ odp_barrier_t term_barrier;
+ odp_atomic_u32_t is_running;
+ odp_pool_t pktio_pool;
+ odp_pool_t copy_pool;
+ odp_pool_t trs_pool;
+
+ struct {
+ init_fn_t init_fn;
+ start_fn_t start_fn;
+ pkt_fn_t pkt_fn;
+ drain_fn_t drain_fn;
+ };
+
+ uint64_t inflight_obj_size;
+ uint32_t burst_size;
+ uint32_t num_pkts;
+ uint32_t pkt_len;
+ uint32_t cache_size;
+ uint32_t num_inflight;
+ uint32_t trs_cache_size;
+ uint32_t compl_cache_size;
+ uint32_t stash_cache_size;
+ uint32_t time_sec;
+ odp_stash_type_t stash_type;
+ int num_thrs;
+ uint8_t num_ifs;
+ uint8_t copy_type;
+} prog_config_t;
+
+typedef struct {
+ odp_packet_t pkts[MAX_BURST * 2U];
+ pktio_t *pktio;
+ int num;
+} pkt_vec_t;
+
+static prog_config_t *prog_conf;
+
+static void terminate(int signal ODP_UNUSED)
+{
+ odp_atomic_store_u32(&prog_conf->is_running, 0U);
+}
+
+static void init_config(prog_config_t *config)
+{
+ odp_dma_capability_t dma_capa;
+ uint32_t burst_size;
+ odp_pool_capability_t pool_capa;
+ odp_pool_param_t pool_param;
+ thread_config_t *thr;
+
+ memset(config, 0, sizeof(*config));
+
+ if (odp_dma_capability(&dma_capa) == 0) {
+ burst_size = ODPH_MIN(dma_capa.max_src_segs, dma_capa.max_dst_segs);
+ burst_size = ODPH_MIN(burst_size, MAX_BURST);
+ config->dyn_defs.burst_size = burst_size;
+ }
+
+ if (odp_pool_capability(&pool_capa) == 0) {
+ config->dyn_defs.num_pkts = pool_capa.pkt.max_num > 0U ?
+ ODPH_MIN(pool_capa.pkt.max_num, DEF_CNT) : DEF_CNT;
+ config->dyn_defs.pkt_len = pool_capa.pkt.max_len > 0U ?
+ ODPH_MIN(pool_capa.pkt.max_len, DEF_LEN) : DEF_LEN;
+ odp_pool_param_init(&pool_param);
+ config->dyn_defs.cache_size = pool_param.pkt.cache_size;
+ }
+
+ config->pktio_pool = ODP_POOL_INVALID;
+ config->copy_pool = ODP_POOL_INVALID;
+ config->trs_pool = ODP_POOL_INVALID;
+ config->burst_size = config->dyn_defs.burst_size;
+ config->num_pkts = config->dyn_defs.num_pkts;
+ config->pkt_len = config->dyn_defs.pkt_len;
+ config->cache_size = config->dyn_defs.cache_size;
+ config->time_sec = DEF_TIME;
+ config->num_thrs = DEF_WORKERS;
+ config->copy_type = DEF_CPY_TYPE;
+
+ for (int i = 0; i < MAX_WORKERS; ++i) {
+ thr = &config->thread_config[i];
+ thr->dma_handle = ODP_DMA_INVALID;
+ thr->compl_pool = ODP_POOL_INVALID;
+ thr->compl_q = ODP_QUEUE_INVALID;
+ thr->inflight_stash = ODP_STASH_INVALID;
+ }
+
+ for (uint32_t i = 0U; i < MAX_IFS; ++i)
+ config->pktios[i].handle = ODP_PKTIO_INVALID;
+}
+
+static void print_usage(dynamic_defs_t *dyn_defs)
+{
+ printf("\n"
+ "DMA performance tester with packet I/O. Receive and forward packets after\n"
+ "software copy or DMA offload copy.\n"
+ "\n"
+ "Usage: " PROG_NAME " OPTIONS\n"
+ "\n"
+ " E.g. " PROG_NAME " -i eth0\n"
+ " " PROG_NAME " -i eth0 -t 0\n"
+ " " PROG_NAME " -i eth0 -t 1 -b 15 -l 4096 -c 5\n"
+ "\n"
+ "Mandatory OPTIONS:\n"
+ "\n"
+ " -i, --interfaces Ethernet interfaces for packet I/O, comma-separated, no\n"
+ " spaces.\n"
+ "\n"
+ "Optional OPTIONS:\n"
+ "\n"
+ " -t, --copy_type Type of copy. %u by default.\n"
+ " 0: SW\n"
+ " 1: DMA with event completion\n"
+ " 2: DMA with poll completion\n"
+ " -b, --burst_size Copy burst size. This many packets are accumulated before\n"
+ " copy. %u by default.\n"
+ " -n, --num_pkts Number of packet buffers allocated for packet I/O pool.\n"
+ " %u by default.\n"
+ " -l, --pkt_len Maximum size of packet buffers in packet I/O pool. %u by\n"
+ " default.\n"
+ " -c, --worker_count Amount of workers. %u by default.\n"
+ " -C, --cache_size Maximum cache size for pools. %u by default.\n"
+ " -T, --time_sec Time in seconds to run. 0 means infinite. %u by default.\n"
+ " -h, --help This help.\n"
+ "\n", DEF_CPY_TYPE, dyn_defs->burst_size, dyn_defs->num_pkts, dyn_defs->pkt_len,
+ DEF_WORKERS, dyn_defs->cache_size, DEF_TIME);
+}
+
+static void parse_interfaces(prog_config_t *config, const char *optarg)
+{
+ char *tmp_str = strdup(optarg), *tmp;
+
+ if (tmp_str == NULL)
+ return;
+
+ tmp = strtok(tmp_str, DELIMITER);
+
+ while (tmp && config->num_ifs < MAX_IFS) {
+ config->pktios[config->num_ifs].name = strdup(tmp);
+
+ if (config->pktios[config->num_ifs].name != NULL)
+ ++config->num_ifs;
+
+ tmp = strtok(NULL, DELIMITER);
+ }
+
+ free(tmp_str);
+}
+
+static odp_bool_t get_stash_capa(odp_stash_capability_t *stash_capa, odp_stash_type_t *stash_type)
+{
+ if (odp_stash_capability(stash_capa, ODP_STASH_TYPE_FIFO) == 0) {
+ *stash_type = ODP_STASH_TYPE_FIFO;
+ return true;
+ }
+
+ if (odp_stash_capability(stash_capa, ODP_STASH_TYPE_DEFAULT) == 0) {
+ *stash_type = ODP_STASH_TYPE_DEFAULT;
+ return true;
+ }
+
+ return false;
+}
+
+static parse_result_t check_options(prog_config_t *config)
+{
+ odp_dma_capability_t dma_capa;
+ uint32_t burst_size;
+ odp_stash_capability_t stash_capa;
+ const uint64_t obj_size = sizeof(odp_dma_transfer_id_t);
+ uint64_t max_num;
+ odp_pool_capability_t pool_capa;
+
+ if (config->num_ifs == 0U) {
+ ODPH_ERR("Invalid number of interfaces: %u (min: 1, max: %u)\n", config->num_ifs,
+ MAX_IFS);
+ return PRS_NOK;
+ }
+
+ if (config->copy_type != SW_COPY && config->copy_type != DMA_COPY_EV &&
+ config->copy_type != DMA_COPY_POLL) {
+ ODPH_ERR("Invalid copy type: %u\n", config->copy_type);
+ return PRS_NOK;
+ }
+
+ if (config->num_thrs <= 0 || config->num_thrs > MAX_WORKERS) {
+ ODPH_ERR("Invalid worker count: %d (min: 1, max: %d)\n", config->num_thrs,
+ MAX_WORKERS);
+ return PRS_NOK;
+ }
+
+ if (odp_dma_capability(&dma_capa) < 0) {
+ ODPH_ERR("Error querying DMA capabilities\n");
+ return PRS_NOK;
+ }
+
+ if ((uint32_t)config->num_thrs > dma_capa.max_sessions) {
+ ODPH_ERR("Unsupported DMA session count: %d (max: %u)\n", config->num_thrs,
+ dma_capa.max_sessions);
+ return PRS_NOT_SUP;
+ }
+
+ burst_size = ODPH_MIN(dma_capa.max_src_segs, dma_capa.max_dst_segs);
+ burst_size = ODPH_MIN(burst_size, MAX_BURST);
+
+ if (config->burst_size == 0U || config->burst_size > burst_size) {
+ ODPH_ERR("Invalid segment count for DMA: %u (min: 1, max: %u)\n",
+ config->burst_size, burst_size);
+ return PRS_NOK;
+ }
+
+ if (config->pkt_len > dma_capa.max_seg_len) {
+ ODPH_ERR("Invalid packet length for DMA: %u (max: %u)\n", config->pkt_len,
+ dma_capa.max_seg_len);
+ return PRS_NOK;
+ }
+
+ config->num_inflight = dma_capa.max_transfers;
+
+ if (odp_pool_capability(&pool_capa) < 0) {
+ ODPH_ERR("Error querying pool capabilities\n");
+ return PRS_NOK;
+ }
+
+ if (config->cache_size < pool_capa.pkt.min_cache_size ||
+ config->cache_size > pool_capa.pkt.max_cache_size) {
+ ODPH_ERR("Invalid pool cache size: %u (min: %u, max: %u)\n", config->cache_size,
+ pool_capa.pkt.min_cache_size, pool_capa.pkt.max_cache_size);
+ return PRS_NOK;
+ }
+
+ if (config->copy_type != SW_COPY)
+ config->trs_cache_size = ODPH_MIN(ODPH_MAX(config->cache_size,
+ pool_capa.buf.min_cache_size),
+ pool_capa.buf.max_cache_size);
+
+ if (config->copy_type == DMA_COPY_EV) {
+ if ((dma_capa.compl_mode_mask & ODP_DMA_COMPL_EVENT) == 0U ||
+ !dma_capa.queue_type_sched) {
+ ODPH_ERR("Unsupported DMA completion mode: event (mode support: %x, "
+ "scheduled queue support: %u)\n", dma_capa.compl_mode_mask,
+ dma_capa.queue_type_sched);
+ return PRS_NOT_SUP;
+ }
+
+ if ((uint32_t)config->num_thrs > dma_capa.pool.max_pools) {
+ ODPH_ERR("Invalid amount of DMA completion pools: %d (max: %u)\n",
+ config->num_thrs, dma_capa.pool.max_pools);
+ return PRS_NOK;
+ }
+
+ if (config->num_inflight > dma_capa.pool.max_num) {
+ ODPH_ERR("Invalid amount of DMA completion events: %u (max: %u)\n",
+ config->num_inflight, dma_capa.pool.max_num);
+ return PRS_NOK;
+ }
+
+ config->compl_cache_size = ODPH_MIN(ODPH_MAX(config->cache_size,
+ dma_capa.pool.min_cache_size),
+ dma_capa.pool.max_cache_size);
+ } else if (config->copy_type == DMA_COPY_POLL) {
+ if ((dma_capa.compl_mode_mask & ODP_DMA_COMPL_POLL) == 0U) {
+ ODPH_ERR("Unsupported DMA completion mode: poll (mode support: %x)\n",
+ dma_capa.compl_mode_mask);
+ return PRS_NOT_SUP;
+ }
+
+ if (!get_stash_capa(&stash_capa, &config->stash_type)) {
+ ODPH_ERR("Error querying stash capabilities\n");
+ return PRS_NOK;
+ }
+
+ if ((uint32_t)config->num_thrs > stash_capa.max_stashes) {
+ ODPH_ERR("Invalid amount of stashes: %d (max: %u)\n", config->num_thrs,
+ stash_capa.max_stashes);
+ return PRS_NOK;
+ }
+
+ if (obj_size == sizeof(uint8_t)) {
+ max_num = stash_capa.max_num.u8;
+ } else if (obj_size == sizeof(uint16_t)) {
+ max_num = stash_capa.max_num.u16;
+ } else if (obj_size <= sizeof(uint32_t)) {
+ max_num = stash_capa.max_num.u32;
+ } else if (obj_size <= sizeof(uint64_t)) {
+ max_num = stash_capa.max_num.u64;
+ } else if (obj_size <= sizeof(odp_u128_t)) {
+ max_num = stash_capa.max_num.u128;
+ } else {
+ ODPH_ERR("Invalid stash object size: %" PRIu64 "\n", obj_size);
+ return PRS_NOK;
+ }
+
+ if (config->num_inflight > max_num) {
+ ODPH_ERR("Invalid stash size: %u (max: %" PRIu64 ")\n",
+ config->num_inflight, max_num);
+ return PRS_NOK;
+ }
+
+ config->inflight_obj_size = obj_size;
+ config->stash_cache_size = ODPH_MIN(config->cache_size, stash_capa.max_cache_size);
+ }
+
+ if (config->num_pkts == 0U ||
+ (pool_capa.pkt.max_num > 0U && config->num_pkts > pool_capa.pkt.max_num)) {
+ ODPH_ERR("Invalid pool packet count: %u (min: 1, max: %u)\n", config->num_pkts,
+ pool_capa.pkt.max_num);
+ return PRS_NOK;
+ }
+
+ if (config->pkt_len == 0U ||
+ (pool_capa.pkt.max_len > 0U && config->pkt_len > pool_capa.pkt.max_len)) {
+ ODPH_ERR("Invalid pool packet length: %u (min: 1, max: %u)\n", config->pkt_len,
+ pool_capa.pkt.max_len);
+ return PRS_NOK;
+ }
+
+ if (config->num_inflight > pool_capa.buf.max_num) {
+ ODPH_ERR("Invalid pool buffer count: %u (max: %u)\n", config->num_inflight,
+ pool_capa.buf.max_num);
+ return PRS_NOK;
+ }
+
+ return PRS_OK;
+}
+
+static parse_result_t parse_options(int argc, char **argv, prog_config_t *config)
+{
+ int opt, long_index;
+
+ static const struct option longopts[] = {
+ { "interfaces", required_argument, NULL, 'i' },
+ { "copy_type", required_argument, NULL, 't' },
+ { "burst_size", required_argument, NULL, 'b' },
+ { "num_pkts", required_argument, NULL, 'n' },
+ { "pkt_len", required_argument, NULL, 'l' },
+ { "worker_count", required_argument, NULL, 'c' },
+ { "cache_size", required_argument, NULL, 'C' },
+ { "time_sec", required_argument, NULL, 'T' },
+ { "help", no_argument, NULL, 'h' },
+ { NULL, 0, NULL, 0 }
+ };
+
+ static const char *shortopts = "i:t:b:n:l:c:C:T:h";
+
+ init_config(config);
+
+ while (1) {
+ opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
+
+ if (opt == -1)
+ break;
+
+ switch (opt) {
+ case 'i':
+ parse_interfaces(config, optarg);
+ break;
+ case 't':
+ config->copy_type = atoi(optarg);
+ break;
+ case 'b':
+ config->burst_size = atoi(optarg);
+ break;
+ case 'n':
+ config->num_pkts = atoi(optarg);
+ break;
+ case 'l':
+ config->pkt_len = atoi(optarg);
+ break;
+ case 'c':
+ config->num_thrs = atoi(optarg);
+ break;
+ case 'C':
+ config->cache_size = atoi(optarg);
+ break;
+ case 'T':
+ config->time_sec = atoi(optarg);
+ break;
+ case 'h':
+ print_usage(&config->dyn_defs);
+ return PRS_TERM;
+ case '?':
+ default:
+ print_usage(&config->dyn_defs);
+ return PRS_NOK;
+ }
+ }
+
+ return check_options(config);
+}
+
+static parse_result_t setup_program(int argc, char **argv, prog_config_t *config)
+{
+ struct sigaction action = { .sa_handler = terminate };
+
+ if (sigemptyset(&action.sa_mask) == -1 || sigaddset(&action.sa_mask, SIGINT) == -1 ||
+ sigaddset(&action.sa_mask, SIGTERM) == -1 ||
+ sigaddset(&action.sa_mask, SIGHUP) == -1 || sigaction(SIGINT, &action, NULL) == -1 ||
+ sigaction(SIGTERM, &action, NULL) == -1 || sigaction(SIGHUP, &action, NULL) == -1) {
+ ODPH_ERR("Error installing signal handler\n");
+ return PRS_NOK;
+ }
+
+ return parse_options(argc, argv, config);
+}
+
+static inline int send_packets(odp_pktout_queue_t queue, odp_packet_t pkts[], int num)
+{
+ int ret = odp_pktout_send(queue, pkts, num);
+
+ if (odp_unlikely(ret < num)) {
+ ret = ret < 0 ? 0 : ret;
+ odp_packet_free_multi(&pkts[ret], num - ret);
+ }
+
+ return ret;
+}
+
+static void sw_copy_and_send_packets(odp_packet_t pkts[], int num, pktio_t *pktio,
+ init_fn_t init_fn ODP_UNUSED, start_fn_t start_fn ODP_UNUSED,
+ thread_config_t *config)
+{
+ odp_packet_t old_pkt, new_pkt;
+ odp_pool_t copy_pool = config->copy_pool;
+ odp_packet_t out_pkts[num];
+ int num_out_pkts = 0, num_sent;
+ stats_t *stats = &config->stats;
+
+ for (int i = 0; i < num; ++i) {
+ old_pkt = pkts[i];
+ new_pkt = odp_packet_copy(old_pkt, copy_pool);
+
+ if (new_pkt != ODP_PACKET_INVALID)
+ out_pkts[num_out_pkts++] = new_pkt;
+ else
+ ++stats->copy_errs;
+
+ odp_packet_free(old_pkt);
+ }
+
+ if (num_out_pkts > 0) {
+ num_sent = send_packets(pktio->out_qs[config->thr_idx % pktio->num_out_qs],
+ out_pkts, num_out_pkts);
+ stats->fwd_pkts += num_sent;
+ stats->discards += num_out_pkts - num_sent;
+ }
+}
+
+static transfer_t *init_dma_ev_trs(odp_dma_transfer_param_t *trs_param,
+ odp_dma_compl_param_t *compl_param, odp_dma_seg_t *src_segs,
+ odp_dma_seg_t *dst_segs, pktio_t *pktio,
+ thread_config_t *config)
+{
+ odp_buffer_t buf;
+ stats_t *stats = &config->stats;
+ transfer_t *trs;
+ odp_dma_compl_t c_ev;
+
+ buf = odp_buffer_alloc(config->trs_pool);
+
+ if (odp_unlikely(buf == ODP_BUFFER_INVALID)) {
+ ++stats->buf_alloc_errs;
+ return NULL;
+ }
+
+ trs = (transfer_t *)odp_buffer_addr(buf);
+ trs->num = 0;
+ trs->pktio = pktio;
+ trs_param->src_format = ODP_DMA_FORMAT_PACKET;
+ trs_param->dst_format = ODP_DMA_FORMAT_PACKET;
+ trs_param->num_src = 0U;
+ trs_param->num_dst = 0U;
+ trs_param->src_seg = src_segs;
+ trs_param->dst_seg = dst_segs;
+ compl_param->compl_mode = ODP_DMA_COMPL_EVENT;
+ c_ev = odp_dma_compl_alloc(config->compl_pool);
+
+ if (odp_unlikely(c_ev == ODP_DMA_COMPL_INVALID)) {
+ odp_buffer_free(buf);
+ ++stats->compl_alloc_errs;
+ return NULL;
+ }
+
+ compl_param->event = odp_dma_compl_to_event(c_ev);
+ compl_param->queue = config->compl_q;
+ compl_param->user_ptr = buf;
+ memset(src_segs, 0, sizeof(*src_segs) * MAX_BURST);
+ memset(dst_segs, 0, sizeof(*dst_segs) * MAX_BURST);
+
+ return trs;
+}
+
+static transfer_t *init_dma_poll_trs(odp_dma_transfer_param_t *trs_param,
+ odp_dma_compl_param_t *compl_param, odp_dma_seg_t *src_segs,
+ odp_dma_seg_t *dst_segs, pktio_t *pktio,
+ thread_config_t *config)
+{
+ odp_buffer_t buf;
+ stats_t *stats = &config->stats;
+ transfer_t *trs;
+
+ buf = odp_buffer_alloc(config->trs_pool);
+
+ if (odp_unlikely(buf == ODP_BUFFER_INVALID)) {
+ ++stats->buf_alloc_errs;
+ return NULL;
+ }
+
+ trs = (transfer_t *)odp_buffer_addr(buf);
+ trs->num = 0;
+ trs->pktio = pktio;
+ trs_param->src_format = ODP_DMA_FORMAT_PACKET;
+ trs_param->dst_format = ODP_DMA_FORMAT_PACKET;
+ trs_param->num_src = 0U;
+ trs_param->num_dst = 0U;
+ trs_param->src_seg = src_segs;
+ trs_param->dst_seg = dst_segs;
+ compl_param->compl_mode = ODP_DMA_COMPL_POLL;
+ compl_param->transfer_id = odp_dma_transfer_id_alloc(config->dma_handle);
+
+ if (odp_unlikely(compl_param->transfer_id == ODP_DMA_TRANSFER_ID_INVALID)) {
+ odp_buffer_free(buf);
+ ++stats->compl_alloc_errs;
+ return NULL;
+ }
+
+ compl_param->user_ptr = buf;
+ memset(src_segs, 0, sizeof(*src_segs) * MAX_BURST);
+ memset(dst_segs, 0, sizeof(*dst_segs) * MAX_BURST);
+
+ return trs;
+}
+
+static odp_bool_t start_dma_ev_trs(odp_dma_transfer_param_t *trs_param,
+ odp_dma_compl_param_t *compl_param, thread_config_t *config)
+{
+ const int ret = odp_dma_transfer_start(config->dma_handle, trs_param, compl_param);
+
+ if (odp_unlikely(ret <= 0)) {
+ odp_buffer_free(compl_param->user_ptr);
+ odp_event_free(compl_param->event);
+ return false;
+ }
+
+ return true;
+}
+
+static odp_bool_t start_dma_poll_trs(odp_dma_transfer_param_t *trs_param,
+ odp_dma_compl_param_t *compl_param, thread_config_t *config)
+{
+ const int ret = odp_dma_transfer_start(config->dma_handle, trs_param, compl_param);
+
+ if (odp_unlikely(ret <= 0)) {
+ odp_buffer_free(compl_param->user_ptr);
+ odp_dma_transfer_id_free(config->dma_handle, compl_param->transfer_id);
+ return false;
+ }
+
+ if (odp_unlikely(odp_stash_put(config->inflight_stash, &compl_param->transfer_id, 1) != 1))
+ /* Should not happen, but make it visible if it somehow does */
+ ODPH_ABORT("DMA inflight transfer stash overflow, aborting");
+
+ return true;
+}
+
+static void dma_copy(odp_packet_t pkts[], int num, pktio_t *pktio, init_fn_t init_fn,
+ start_fn_t start_fn, thread_config_t *config)
+{
+ odp_dma_transfer_param_t trs_param;
+ odp_dma_compl_param_t compl_param;
+ odp_packet_t pkt;
+ transfer_t *trs = NULL;
+ odp_dma_seg_t src_segs[MAX_BURST], dst_segs[MAX_BURST];
+ uint32_t num_segs = 0U, pkt_len;
+ odp_pool_t copy_pool = config->copy_pool;
+ stats_t *stats = &config->stats;
+
+ odp_dma_transfer_param_init(&trs_param);
+ odp_dma_compl_param_init(&compl_param);
+
+ for (int i = 0; i < num; ++i) {
+ pkt = pkts[i];
+
+ if (odp_unlikely(trs == NULL)) {
+ trs = init_fn(&trs_param, &compl_param, src_segs, dst_segs, pktio, config);
+
+ if (trs == NULL) {
+ odp_packet_free(pkt);
+ continue;
+ }
+ }
+
+ pkt_len = odp_packet_len(pkt);
+ src_segs[num_segs].packet = pkt;
+ src_segs[num_segs].len = pkt_len;
+ dst_segs[num_segs].packet = odp_packet_alloc(copy_pool, pkt_len);
+
+ if (odp_unlikely(dst_segs[num_segs].packet == ODP_PACKET_INVALID)) {
+ odp_packet_free(pkt);
+ ++stats->pkt_alloc_errs;
+ continue;
+ }
+
+ dst_segs[num_segs].len = pkt_len;
+ trs->src_pkts[num_segs] = src_segs[num_segs].packet;
+ trs->dst_pkts[num_segs] = dst_segs[num_segs].packet;
+ ++trs->num;
+ ++trs_param.num_src;
+ ++trs_param.num_dst;
+ ++num_segs;
+ }
+
+ if (num_segs > 0U)
+ if (odp_unlikely(!start_fn(&trs_param, &compl_param, config))) {
+ odp_packet_free_multi(trs->src_pkts, trs->num);
+ odp_packet_free_multi(trs->dst_pkts, trs->num);
+ ++stats->start_errs;
+ }
+}
+
+static void drain_events(thread_config_t *config ODP_UNUSED)
+{
+ odp_event_t ev;
+ odp_event_type_t type;
+ odp_dma_result_t res;
+ odp_buffer_t buf;
+ transfer_t *trs;
+
+ while (true) {
+ ev = odp_schedule(NULL, odp_schedule_wait_time(ODP_TIME_SEC_IN_NS * 2U));
+
+ if (ev == ODP_EVENT_INVALID)
+ break;
+
+ type = odp_event_type(ev);
+
+ if (type == ODP_EVENT_DMA_COMPL) {
+ memset(&res, 0, sizeof(res));
+ odp_dma_compl_result(odp_dma_compl_from_event(ev), &res);
+ buf = (odp_buffer_t)res.user_ptr;
+ trs = (transfer_t *)odp_buffer_addr(buf);
+ odp_packet_free_multi(trs->src_pkts, trs->num);
+ odp_packet_free_multi(trs->dst_pkts, trs->num);
+ odp_buffer_free(buf);
+ }
+
+ odp_event_free(ev);
+ }
+}
+
+static void drain_polled(thread_config_t *config)
+{
+ odp_dma_transfer_id_t id;
+ odp_dma_result_t res;
+ int ret;
+ odp_buffer_t buf;
+ transfer_t *trs;
+
+ while (true) {
+ if (odp_stash_get(config->inflight_stash, &id, 1) != 1)
+ break;
+
+ memset(&res, 0, sizeof(res));
+
+ do {
+ ret = odp_dma_transfer_done(config->dma_handle, id, &res);
+ } while (ret == 0);
+
+ odp_dma_transfer_id_free(config->dma_handle, id);
+
+ if (ret < 0)
+ continue;
+
+ buf = (odp_buffer_t)res.user_ptr;
+ trs = (transfer_t *)odp_buffer_addr(buf);
+ odp_packet_free_multi(trs->src_pkts, trs->num);
+ odp_packet_free_multi(trs->dst_pkts, trs->num);
+ odp_buffer_free(buf);
+ }
+}
+
+static odp_bool_t setup_copy(prog_config_t *config)
+{
+ odp_pool_param_t pool_param;
+ thread_config_t *thr;
+ const odp_dma_param_t dma_param = {
+ .direction = ODP_DMA_MAIN_TO_MAIN,
+ .type = ODP_DMA_TYPE_COPY,
+ .compl_mode_mask = ODP_DMA_COMPL_EVENT | ODP_DMA_COMPL_POLL,
+ .mt_mode = ODP_DMA_MT_SERIAL,
+ .order = ODP_DMA_ORDER_NONE };
+ odp_dma_pool_param_t compl_pool_param;
+ odp_queue_param_t queue_param;
+ odp_stash_param_t stash_param;
+
+ odp_pool_param_init(&pool_param);
+ pool_param.pkt.seg_len = config->pkt_len;
+ pool_param.pkt.len = config->pkt_len;
+ pool_param.pkt.num = config->num_pkts;
+ pool_param.pkt.cache_size = config->cache_size;
+ pool_param.type = ODP_POOL_PACKET;
+ config->copy_pool = odp_pool_create(PROG_NAME "_copy", &pool_param);
+
+ if (config->copy_pool == ODP_POOL_INVALID) {
+ ODPH_ERR("Error creating packet copy pool\n");
+ return false;
+ }
+
+ if (config->copy_type == SW_COPY) {
+ config->pkt_fn = sw_copy_and_send_packets;
+
+ for (int i = 0; i < config->num_thrs; ++i)
+ config->thread_config[i].copy_pool = config->copy_pool;
+
+ return true;
+ }
+
+ pool_param.buf.num = config->num_inflight;
+ pool_param.buf.size = sizeof(transfer_t);
+ pool_param.buf.cache_size = config->trs_cache_size;
+ pool_param.type = ODP_POOL_BUFFER;
+ config->trs_pool = odp_pool_create(PROG_NAME "_dma_trs", &pool_param);
+
+ if (config->trs_pool == ODP_POOL_INVALID) {
+ ODPH_ERR("Error creating DMA transfer tracking pool\n");
+ return false;
+ }
+
+ for (int i = 0; i < config->num_thrs; ++i) {
+ thr = &config->thread_config[i];
+ thr->copy_pool = config->copy_pool;
+ thr->trs_pool = config->trs_pool;
+ thr->dma_handle = odp_dma_create(PROG_NAME "_dma", &dma_param);
+
+ if (thr->dma_handle == ODP_DMA_INVALID) {
+ ODPH_ERR("Error creating DMA session\n");
+ return false;
+ }
+
+ if (config->copy_type == DMA_COPY_EV) {
+ odp_dma_pool_param_init(&compl_pool_param);
+ compl_pool_param.num = config->num_inflight;
+ compl_pool_param.cache_size = config->compl_cache_size;
+ thr->compl_pool = odp_dma_pool_create(PROG_NAME "_dma_compl",
+ &compl_pool_param);
+
+ if (thr->compl_pool == ODP_POOL_INVALID) {
+ ODPH_ERR("Error creating DMA event completion pool\n");
+ return false;
+ }
+
+ odp_queue_param_init(&queue_param);
+ queue_param.type = ODP_QUEUE_TYPE_SCHED;
+ queue_param.sched.sync = ODP_SCHED_SYNC_PARALLEL;
+ queue_param.sched.prio = odp_schedule_max_prio();
+ thr->compl_q = odp_queue_create(PROG_NAME "_dma_compl", &queue_param);
+
+ if (thr->compl_q == ODP_QUEUE_INVALID) {
+ ODPH_ERR("Error creating DMA completion queue\n");
+ return false;
+ }
+
+ config->init_fn = init_dma_ev_trs;
+ config->start_fn = start_dma_ev_trs;
+ config->drain_fn = drain_events;
+ } else {
+ odp_stash_param_init(&stash_param);
+ stash_param.type = config->stash_type;
+ stash_param.put_mode = ODP_STASH_OP_LOCAL;
+ stash_param.get_mode = ODP_STASH_OP_LOCAL;
+ stash_param.num_obj = config->num_inflight;
+ stash_param.obj_size = config->inflight_obj_size;
+ stash_param.cache_size = config->stash_cache_size;
+ thr->inflight_stash = odp_stash_create("_dma_inflight", &stash_param);
+
+ if (thr->inflight_stash == ODP_STASH_INVALID) {
+ ODPH_ERR("Error creating DMA inflight transfer stash\n");
+ return false;
+ }
+
+ config->init_fn = init_dma_poll_trs;
+ config->start_fn = start_dma_poll_trs;
+ config->drain_fn = drain_polled;
+ }
+ }
+
+ config->pkt_fn = dma_copy;
+
+ return true;
+}
+
+static odp_bool_t setup_pktios(prog_config_t *config)
+{
+ odp_pool_param_t pool_param;
+ pktio_t *pktio;
+ odp_pktio_param_t pktio_param;
+ odp_pktio_capability_t capa;
+ uint32_t num_input_qs, num_output_qs;
+ odp_pktin_queue_param_t pktin_param;
+ odp_pktout_queue_param_t pktout_param;
+
+ odp_pool_param_init(&pool_param);
+ pool_param.pkt.seg_len = config->pkt_len;
+ pool_param.pkt.len = config->pkt_len;
+ pool_param.pkt.num = config->num_pkts;
+ pool_param.pkt.cache_size = config->cache_size;
+ pool_param.type = ODP_POOL_PACKET;
+ config->pktio_pool = odp_pool_create(PROG_NAME, &pool_param);
+
+ if (config->pktio_pool == ODP_POOL_INVALID) {
+ ODPH_ERR("Error creating packet I/O pool\n");
+ return false;
+ }
+
+ for (uint32_t i = 0U; i < config->num_ifs; ++i) {
+ pktio = &config->pktios[i];
+ odp_pktio_param_init(&pktio_param);
+ pktio_param.in_mode = ODP_PKTIN_MODE_SCHED;
+ pktio_param.out_mode = ODP_PKTOUT_MODE_DIRECT;
+ pktio->handle = odp_pktio_open(pktio->name, config->pktio_pool, &pktio_param);
+
+ if (pktio->handle == ODP_PKTIO_INVALID) {
+ ODPH_ERR("Error opening packet I/O (%s)\n", pktio->name);
+ return false;
+ }
+
+ config->pktio_idx_map[odp_pktio_index(pktio->handle)] = i;
+
+ if (odp_pktio_capability(pktio->handle, &capa) < 0) {
+ ODPH_ERR("Error querying packet I/O capabilities (%s)\n", pktio->name);
+ return false;
+ }
+
+ num_input_qs = ODPH_MIN((uint32_t)config->num_thrs, capa.max_input_queues);
+ num_output_qs = ODPH_MIN((uint32_t)config->num_thrs, capa.max_output_queues);
+ num_output_qs = ODPH_MIN(num_output_qs, MAX_OUT_QS);
+ odp_pktin_queue_param_init(&pktin_param);
+
+ if (num_input_qs > 1) {
+ pktin_param.hash_enable = true;
+ pktin_param.hash_proto.proto.ipv4 = 1U;
+ }
+
+ pktin_param.num_queues = num_input_qs;
+ pktin_param.queue_param.sched.prio = odp_schedule_default_prio();
+
+ if (odp_pktin_queue_config(pktio->handle, &pktin_param) < 0) {
+ ODPH_ERR("Error configuring packet I/O input queues (%s)\n", pktio->name);
+ return false;
+ }
+
+ odp_pktout_queue_param_init(&pktout_param);
+
+ if (num_output_qs == (uint32_t)config->num_thrs)
+ pktout_param.op_mode = ODP_PKTIO_OP_MT_UNSAFE;
+
+ pktout_param.num_queues = num_output_qs;
+ pktio->num_out_qs = num_output_qs;
+
+ if (odp_pktout_queue_config(pktio->handle, &pktout_param) < 0) {
+ ODPH_ERR("Error configuring packet I/O output queues (%s)\n", pktio->name);
+ return false;
+ }
+
+ if (odp_pktout_queue(pktio->handle, pktio->out_qs, num_output_qs) !=
+ (int)num_output_qs) {
+ ODPH_ERR("Error querying packet I/O output queues (%s)\n", pktio->name);
+ return false;
+ }
+
+ if (odp_pktio_start(pktio->handle) < 0) {
+ ODPH_ERR("Error starting packet I/O (%s)\n", pktio->name);
+ return false;
+ }
+ }
+
+ return true;
+}
+
+static inline void send_dma_poll_trs_pkts(int burst_size, thread_config_t *config)
+{
+ odp_stash_t stash_handle = config->inflight_stash;
+ odp_dma_transfer_id_t ids[burst_size], id;
+ int32_t num;
+ odp_dma_t dma_handle = config->dma_handle;
+ odp_dma_result_t res;
+ int ret;
+ odp_buffer_t buf;
+ transfer_t *trs;
+ pktio_t *pktio;
+ int num_sent;
+ stats_t *stats = &config->stats;
+
+ while (true) {
+ num = odp_stash_get(stash_handle, &ids, burst_size);
+
+ if (num <= 0)
+ break;
+
+ for (int32_t i = 0; i < num; ++i) {
+ id = ids[i];
+ ret = odp_dma_transfer_done(dma_handle, id, &res);
+
+ if (ret == 0) {
+ if (odp_unlikely(odp_stash_put(stash_handle, &id, 1) != 1))
+ /* Should not happen, but make it visible if it somehow
+ * does */
+ ODPH_ABORT("DMA inflight transfer stash overflow,"
+ " aborting");
+
+ ++stats->trs_polled;
+ continue;
+ }
+
+ odp_dma_transfer_id_free(dma_handle, id);
+
+ if (ret < 0) {
+ ++stats->trs_poll_errs;
+ continue;
+ }
+
+ buf = (odp_buffer_t)res.user_ptr;
+ trs = (transfer_t *)odp_buffer_addr(buf);
+
+ if (res.success) {
+ pktio = trs->pktio;
+ num_sent = send_packets(pktio->out_qs[config->thr_idx %
+ pktio->num_out_qs],
+ trs->dst_pkts, trs->num);
+ ++stats->trs;
+ stats->fwd_pkts += num_sent;
+ stats->discards += trs->num - num_sent;
+ } else {
+ odp_packet_free_multi(trs->dst_pkts, trs->num);
+ ++stats->trs_errs;
+ }
+
+ odp_packet_free_multi(trs->src_pkts, trs->num);
+ odp_buffer_free(buf);
+ }
+ }
+}
+
+static inline void send_dma_ev_trs_pkts(odp_dma_compl_t compl_ev, thread_config_t *config)
+{
+ odp_dma_result_t res;
+ odp_buffer_t buf;
+ transfer_t *trs;
+ pktio_t *pktio;
+ int num_sent;
+ stats_t *stats = &config->stats;
+
+ memset(&res, 0, sizeof(res));
+ odp_dma_compl_result(compl_ev, &res);
+ buf = (odp_buffer_t)res.user_ptr;
+ trs = (transfer_t *)odp_buffer_addr(buf);
+
+ if (res.success) {
+ pktio = trs->pktio;
+ num_sent = send_packets(pktio->out_qs[config->thr_idx % pktio->num_out_qs],
+ trs->dst_pkts, trs->num);
+ ++stats->trs;
+ stats->fwd_pkts += num_sent;
+ stats->discards += trs->num - num_sent;
+ } else {
+ odp_packet_free_multi(trs->dst_pkts, trs->num);
+ ++stats->trs_errs;
+ }
+
+ odp_packet_free_multi(trs->src_pkts, trs->num);
+ odp_buffer_free(buf);
+ odp_dma_compl_free(compl_ev);
+}
+
+static inline void push_packet(odp_packet_t pkt, pkt_vec_t pkt_vecs[], uint8_t *pktio_idx_map)
+{
+ uint8_t idx = pktio_idx_map[odp_packet_input_index(pkt)];
+ pkt_vec_t *pkt_vec = &pkt_vecs[idx];
+
+ pkt_vec->pkts[pkt_vec->num++] = pkt;
+}
+
+static inline void pop_packets(pkt_vec_t *pkt_vec, int num_procd)
+{
+ pkt_vec->num -= num_procd;
+
+ for (int i = 0, j = num_procd; i < pkt_vec->num; ++i, ++j)
+ pkt_vec->pkts[i] = pkt_vec->pkts[j];
+}
+
+static void free_pending_packets(pkt_vec_t pkt_vecs[], uint32_t num_ifs)
+{
+ for (uint32_t i = 0U; i < num_ifs; ++i)
+ odp_packet_free_multi(pkt_vecs[i].pkts, pkt_vecs[i].num);
+}
+
+static int process_packets(void *args)
+{
+ thread_config_t *config = args;
+ const uint8_t num_ifs = config->prog_config->num_ifs;
+ pkt_vec_t pkt_vecs[num_ifs], *pkt_vec;
+ odp_atomic_u32_t *is_running = &config->prog_config->is_running;
+ uint64_t c1, c2, c3, c4, cdiff = 0U, rounds = 0U;
+ const uint8_t copy_type = config->prog_config->copy_type;
+ const int burst_size = config->prog_config->burst_size;
+ odp_event_t evs[burst_size];
+ int num_evs;
+ odp_event_t ev;
+ odp_event_type_t type;
+ uint8_t *pktio_map = config->prog_config->pktio_idx_map;
+ stats_t *stats = &config->stats;
+ init_fn_t init_fn = config->prog_config->init_fn;
+ start_fn_t start_fn = config->prog_config->start_fn;
+ pkt_fn_t pkt_fn = config->prog_config->pkt_fn;
+
+ for (uint32_t i = 0U; i < num_ifs; ++i) {
+ pkt_vecs[i].pktio = &config->prog_config->pktios[i];
+ pkt_vecs[i].num = 0;
+ }
+
+ config->thr_idx = odp_thread_id();
+ odp_barrier_wait(&config->prog_config->init_barrier);
+ c1 = odp_cpu_cycles();
+
+ while (odp_atomic_load_u32(is_running)) {
+ c3 = odp_cpu_cycles();
+ num_evs = odp_schedule_multi_no_wait(NULL, evs, burst_size);
+ c4 = odp_cpu_cycles();
+ cdiff += odp_cpu_cycles_diff(c4, c3);
+ ++rounds;
+
+ if (copy_type == DMA_COPY_POLL)
+ send_dma_poll_trs_pkts(burst_size, config);
+
+ if (num_evs == 0)
+ continue;
+
+ for (int i = 0; i < num_evs; ++i) {
+ ev = evs[i];
+ type = odp_event_type(ev);
+
+ if (type == ODP_EVENT_DMA_COMPL) {
+ send_dma_ev_trs_pkts(odp_dma_compl_from_event(ev), config);
+ } else if (type == ODP_EVENT_PACKET) {
+ push_packet(odp_packet_from_event(ev), pkt_vecs, pktio_map);
+ } else {
+ odp_event_free(ev);
+ ++stats->discards;
+ }
+ }
+
+ for (uint32_t i = 0U; i < num_ifs; ++i) {
+ pkt_vec = &pkt_vecs[i];
+
+ if (pkt_vec->num >= burst_size) {
+ pkt_fn(pkt_vec->pkts, burst_size, pkt_vec->pktio, init_fn,
+ start_fn, config);
+ pop_packets(pkt_vec, burst_size);
+ }
+ }
+ }
+
+ c2 = odp_cpu_cycles();
+ stats->sched_cc = cdiff;
+ stats->tot_cc = odp_cpu_cycles_diff(c2, c1);
+ stats->sched_rounds = rounds;
+ free_pending_packets(pkt_vecs, num_ifs);
+ odp_barrier_wait(&config->prog_config->term_barrier);
+
+ if (config->prog_config->drain_fn)
+ config->prog_config->drain_fn(config);
+
+ return 0;
+}
+
+static odp_bool_t setup_workers(prog_config_t *config)
+{
+ odp_cpumask_t cpumask;
+ int num_workers;
+ odph_thread_common_param_t thr_common;
+ odph_thread_param_t thr_param[config->num_thrs];
+
+ num_workers = odp_cpumask_default_worker(&cpumask, config->num_thrs);
+ odph_thread_common_param_init(&thr_common);
+ thr_common.instance = config->odp_instance;
+ thr_common.cpumask = &cpumask;
+
+ for (int i = 0; i < config->num_thrs; ++i) {
+ odph_thread_param_init(&thr_param[i]);
+ thr_param[i].start = process_packets;
+ thr_param[i].thr_type = ODP_THREAD_WORKER;
+ config->thread_config[i].prog_config = config;
+ thr_param[i].arg = &config->thread_config[i];
+ }
+
+ num_workers = odph_thread_create(config->thread_tbl, &thr_common, thr_param, num_workers);
+
+ if (num_workers != config->num_thrs) {
+ ODPH_ERR("Error configuring worker threads\n");
+ return false;
+ }
+
+ return true;
+}
+
+static odp_bool_t setup_test(prog_config_t *config)
+{
+ odp_barrier_init(&config->init_barrier, config->num_thrs + 1);
+ odp_barrier_init(&config->term_barrier, config->num_thrs + 1);
+
+ if (!setup_copy(config))
+ return false;
+
+ if (!setup_pktios(config))
+ return false;
+
+ if (!setup_workers(config))
+ return false;
+
+ odp_barrier_wait(&config->init_barrier);
+
+ return true;
+}
+
+static void stop_test(prog_config_t *config)
+{
+ for (uint32_t i = 0U; i < config->num_ifs; ++i)
+ if (config->pktios[i].handle != ODP_PKTIO_INVALID)
+ (void)odp_pktio_stop(config->pktios[i].handle);
+
+ odp_barrier_wait(&config->term_barrier);
+ (void)odph_thread_join(config->thread_tbl, config->num_thrs);
+}
+
+static void teardown(prog_config_t *config)
+{
+ thread_config_t *thr;
+
+ for (uint32_t i = 0U; i < config->num_ifs; ++i) {
+ free(config->pktios[i].name);
+
+ if (config->pktios[i].handle != ODP_PKTIO_INVALID)
+ (void)odp_pktio_close(config->pktios[i].handle);
+ }
+
+ if (config->pktio_pool != ODP_POOL_INVALID)
+ (void)odp_pool_destroy(config->pktio_pool);
+
+ for (int i = 0; i < config->num_thrs; ++i) {
+ thr = &config->thread_config[i];
+
+ if (thr->inflight_stash != ODP_STASH_INVALID)
+ (void)odp_stash_destroy(thr->inflight_stash);
+
+ if (thr->compl_q != ODP_QUEUE_INVALID)
+ (void)odp_queue_destroy(thr->compl_q);
+
+ if (thr->compl_pool != ODP_POOL_INVALID)
+ (void)odp_pool_destroy(thr->compl_pool);
+
+ if (thr->dma_handle != ODP_DMA_INVALID)
+ (void)odp_dma_destroy(thr->dma_handle);
+ }
+
+ if (config->copy_pool != ODP_POOL_INVALID)
+ (void)odp_pool_destroy(config->copy_pool);
+
+ if (config->trs_pool != ODP_POOL_INVALID)
+ (void)odp_pool_destroy(config->trs_pool);
+}
+
+static void print_stats(const prog_config_t *config)
+{
+ const stats_t *stats;
+ const char *align1 = config->copy_type == DMA_COPY_EV ? " " : "";
+ const char *align2 = config->copy_type == SW_COPY ? " " :
+ config->copy_type == DMA_COPY_EV ? " " :
+ " ";
+
+ printf("\n==================\n\n"
+ "DMA forwarder done\n\n"
+ " copy mode: %s\n"
+ " burst size: %u\n"
+ " packet length: %u\n"
+ " max cache size: %u\n", config->copy_type == SW_COPY ? "SW" :
+ config->copy_type == DMA_COPY_EV ? "DMA-event" : "DMA-poll",
+ config->burst_size, config->pkt_len, config->cache_size);
+
+ for (int i = 0; i < config->num_thrs; ++i) {
+ stats = &config->thread_config[i].stats;
+
+ printf("\n worker %d:\n", i);
+
+ if (config->copy_type == SW_COPY) {
+ printf(" packet copy errors: %" PRIu64 "\n",
+ stats->copy_errs);
+ } else {
+ printf(" successful DMA transfers: %s%" PRIu64 "\n"
+ " DMA transfer start errors: %s%" PRIu64 "\n"
+ " DMA transfer errors: %s%" PRIu64 "\n"
+ " transfer buffer allocation errors: %s%" PRIu64 "\n"
+ " copy packet allocation errors: %s%" PRIu64 "\n",
+ align1, stats->trs, align1, stats->start_errs, align1,
+ stats->trs_errs, align1, stats->buf_alloc_errs, align1,
+ stats->pkt_alloc_errs);
+
+ if (config->copy_type == DMA_COPY_EV)
+ printf(" completion event allocation errors: %" PRIu64 "\n",
+ stats->compl_alloc_errs);
+ else
+ printf(" transfer ID allocation errors: %" PRIu64 "\n"
+ " transfer poll errors: %" PRIu64 "\n"
+ " transfers polled: %" PRIu64 "\n",
+ stats->compl_alloc_errs, stats->trs_poll_errs,
+ stats->trs_polled);
+ }
+
+ printf(" packets forwarded:%s%" PRIu64 "\n"
+ " packets dropped: %s%" PRIu64 "\n"
+ " call cycles per schedule round:\n"
+ " total: %" PRIu64 "\n"
+ " schedule: %" PRIu64 "\n"
+ " rounds: %" PRIu64 "\n", align2, stats->fwd_pkts, align2,
+ stats->discards, DIV_IF(stats->tot_cc, stats->sched_rounds),
+ DIV_IF(stats->sched_cc, stats->sched_rounds), stats->sched_rounds);
+ }
+
+ printf("\n==================\n");
+}
+
+int main(int argc, char **argv)
+{
+ odph_helper_options_t odph_opts;
+ odp_init_t init_param;
+ odp_instance_t odp_instance;
+ odp_shm_t shm_cfg = ODP_SHM_INVALID;
+ int ret = EXIT_SUCCESS;
+ parse_result_t parse_res;
+
+ argc = odph_parse_options(argc, argv);
+
+ if (odph_options(&odph_opts) == -1) {
+ ODPH_ERR("Error while reading ODP helper options, exiting\n");
+ exit(EXIT_FAILURE);
+ }
+
+ odp_init_param_init(&init_param);
+ init_param.mem_model = odph_opts.mem_model;
+
+ if (odp_init_global(&odp_instance, NULL, NULL)) {
+ ODPH_ERR("ODP global init failed, exiting\n");
+ exit(EXIT_FAILURE);
+ }
+
+ if (odp_init_local(odp_instance, ODP_THREAD_CONTROL)) {
+ ODPH_ERR("ODP local init failed, exiting\n");
+ exit(EXIT_FAILURE);
+ }
+
+ shm_cfg = odp_shm_reserve(PROG_NAME "_cfg", sizeof(prog_config_t), ODP_CACHE_LINE_SIZE,
+ 0U);
+
+ if (shm_cfg == ODP_SHM_INVALID) {
+ ODPH_ERR("Error reserving shared memory\n");
+ ret = EXIT_FAILURE;
+ goto out;
+ }
+
+ prog_conf = odp_shm_addr(shm_cfg);
+
+ if (prog_conf == NULL) {
+ ODPH_ERR("Error resolving shared memory address\n");
+ ret = EXIT_FAILURE;
+ goto out;
+ }
+
+ parse_res = setup_program(argc, argv, prog_conf);
+
+ if (parse_res == PRS_NOK) {
+ ret = EXIT_FAILURE;
+ goto out_test;
+ }
+
+ if (parse_res == PRS_TERM) {
+ ret = EXIT_SUCCESS;
+ goto out_test;
+ }
+
+ if (parse_res == PRS_NOT_SUP) {
+ ret = EXIT_NOT_SUP;
+ goto out_test;
+ }
+
+ if (odp_schedule_config(NULL) < 0) {
+ ODPH_ERR("Error configuring scheduler\n");
+ ret = EXIT_FAILURE;
+ goto out_test;
+ }
+
+ prog_conf->odp_instance = odp_instance;
+ odp_atomic_init_u32(&prog_conf->is_running, 1U);
+
+ if (!setup_test(prog_conf)) {
+ ret = EXIT_FAILURE;
+ goto out_test;
+ }
+
+ if (prog_conf->time_sec) {
+ sleep(prog_conf->time_sec);
+ odp_atomic_store_u32(&prog_conf->is_running, 0U);
+ } else {
+ while (odp_atomic_load_u32(&prog_conf->is_running))
+ sleep(1U);
+ }
+
+ stop_test(prog_conf);
+ print_stats(prog_conf);
+
+out_test:
+ teardown(prog_conf);
+
+out:
+ if (shm_cfg != ODP_SHM_INVALID)
+ (void)odp_shm_free(shm_cfg);
+
+ if (odp_term_local()) {
+ ODPH_ERR("ODP local terminate failed, exiting\n");
+ exit(EXIT_FAILURE);
+ }
+
+ if (odp_term_global(odp_instance)) {
+ ODPH_ERR("ODP global terminate failed, exiting\n");
+ exit(EXIT_FAILURE);
+ }
+
+ return ret;
+}
diff --git a/test/performance/odp_dmafwd_run.sh b/test/performance/odp_dmafwd_run.sh
new file mode 100755
index 000000000..fa629bd0c
--- /dev/null
+++ b/test/performance/odp_dmafwd_run.sh
@@ -0,0 +1,72 @@
+#!/bin/bash
+#
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2023 Nokia
+
+TEST_DIR="${TEST_DIR:-$PWD}"
+TEST_SRC_DIR=$(dirname $0)
+PERF_TEST_DIR=platform/${ODP_PLATFORM}/test/performance
+PERF_TEST_DIR=${TEST_SRC_DIR}/../../${PERF_TEST_DIR}
+
+BIN_NAME=odp_dmafwd
+BATCH=10
+TIME=2
+TESTS_RUN=0
+
+check_env()
+{
+ if [ -f "./pktio_env" ]; then
+ . ./pktio_env
+ elif [ "${ODP_PLATFORM}" = "" ]; then
+ echo "$0: ERROR: ODP_PLATFORM must be defined"
+ exit 1
+ elif [ -f ${PERF_TEST_DIR}/dmafwd/pktio_env ]; then
+ . ${PERF_TEST_DIR}/dmafwd/pktio_env
+ else
+ echo "ERROR: unable to find pktio_env"
+ echo "pktio_env has to be in current directory or in platform/\$ODP_PLATFORM/test/"
+ echo "ODP_PLATFORM=\"${ODP_PLATFORM}\""
+ exit 1
+ fi
+}
+
+check_result()
+{
+ if [ $1 -eq 0 ]; then
+ TESTS_RUN=`expr $TESTS_RUN + 1`
+ elif [ $1 -eq 1 ]; then
+ echo "Test FAILED, exiting"
+ exit 1
+ else
+ echo "Test SKIPPED"
+ return 0
+ fi
+
+ validate_result
+}
+
+check_exit()
+{
+ if [ $TESTS_RUN -eq 0 ]; then
+ exit 77
+ fi
+
+ exit 0
+}
+
+check_env
+setup_interfaces
+echo "${BIN_NAME}: SW copy"
+echo "==================="
+./${BIN_NAME}${EXEEXT} -i ${IF0} -b ${BATCH} -T ${TIME} -t 0
+check_result $?
+echo "${BIN_NAME}: DMA copy event"
+echo "===================="
+./${BIN_NAME}${EXEEXT} -i ${IF0} -b ${BATCH} -T ${TIME} -t 1
+check_result $?
+echo "${BIN_NAME}: DMA copy poll"
+echo "===================="
+./${BIN_NAME}${EXEEXT} -i ${IF0} -b ${BATCH} -T ${TIME} -t 2
+check_result $?
+cleanup_interfaces
+check_exit
diff --git a/test/performance/odp_ipsec.c b/test/performance/odp_ipsec.c
index 677e7762f..8a0bc2989 100644
--- a/test/performance/odp_ipsec.c
+++ b/test/performance/odp_ipsec.c
@@ -413,8 +413,7 @@ find_config_by_name(const char *name)
unsigned int i;
ipsec_alg_config_t *ret = NULL;
- for (i = 0; i < (sizeof(algs_config) / sizeof(ipsec_alg_config_t));
- i++) {
+ for (i = 0; i < ODPH_ARRAY_SIZE(algs_config); i++) {
if (strcmp(algs_config[i].name, name) == 0) {
ret = algs_config + i;
break;
@@ -432,10 +431,8 @@ print_config_names(const char *prefix)
{
unsigned int i;
- for (i = 0; i < (sizeof(algs_config) / sizeof(ipsec_alg_config_t));
- i++) {
+ for (i = 0; i < ODPH_ARRAY_SIZE(algs_config); i++)
printf("%s %s\n", prefix, algs_config[i].name);
- }
}
/**
@@ -1022,7 +1019,7 @@ static int run_thr_func(void *arg)
}
/**
- * Prinf usage information
+ * Print usage information
*/
static void usage(char *progname)
{
@@ -1223,7 +1220,7 @@ int main(int argc, char *argv[])
max_seg_len = capa.pkt.max_seg_len;
- for (i = 0; i < sizeof(global_payloads) / sizeof(unsigned int); i++) {
+ for (i = 0; i < ODPH_ARRAY_SIZE(global_payloads); i++) {
if (global_payloads[i] > max_seg_len)
break;
}
@@ -1380,9 +1377,7 @@ int main(int argc, char *argv[])
} else {
unsigned int i;
- for (i = 0;
- i < (sizeof(algs_config) / sizeof(ipsec_alg_config_t));
- i++) {
+ for (i = 0; i < ODPH_ARRAY_SIZE(algs_config); i++) {
if (cargs.ah &&
algs_config[i].crypto.cipher_alg !=
ODP_CIPHER_ALG_NULL)
diff --git a/test/performance/odp_ipsecfwd.c b/test/performance/odp_ipsecfwd.c
index 16c745afa..33525a4d2 100644
--- a/test/performance/odp_ipsecfwd.c
+++ b/test/performance/odp_ipsecfwd.c
@@ -1,8 +1,5 @@
-/* Copyright (c) 2022, Nokia
- *
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2022-2023 Nokia
*/
#ifndef _GNU_SOURCE
@@ -25,8 +22,6 @@
#define SHORT_PROG_NAME "ipsfwd"
#define DELIMITER ","
-#define MIN(a, b) (((a) <= (b)) ? (a) : (b))
-
#define MAX_IFS 2U
#define MAX_SAS 4000U
#define MAX_FWDS 64U
@@ -254,7 +249,7 @@ static void parse_interfaces(prog_config_t *config, const char *optarg)
static void print_supported_algos(const odp_ipsec_capability_t *ipsec_capa)
{
int c_cnt, a_cnt;
- const size_t len = sizeof(exposed_algs) / sizeof(exposed_algs[0]);
+ const size_t len = ODPH_ARRAY_SIZE(exposed_algs);
printf(" Cipher algorithms:\n");
@@ -326,66 +321,59 @@ static void print_usage(void)
}
printf("\n"
- "Simple IPsec performance tester. Forward and process plain and ipsec packets.\n"
+ "Simple IPsec performance tester. Forward and process plain and IPsec packets.\n"
+ "\n"
+ "Usage: %s OPTIONS\n"
"\n"
- "Examples:\n"
- " %s -i ens9f1 -C /etc/odp/ipsecfwd.conf\n"
+ " E.g. %s -i ens9f1 -C /etc/odp/ipsecfwd.conf\n"
"\n"
- " With ipsecfwd.conf containing, for example:\n"
- " default: {\n"
- " dir = 1\n"
- " proto = 0\n"
- " mode = 0\n"
- " crypto: {\n"
- " cipher_alg = 4\n"
- " cipher_key = \"jWnZr4t7w!zwC*F-\"\n"
- " auth_alg = 2\n"
- " auth_key = \"n2r5u7x!A%%D*\"\n"
- " icv_len = 12\n"
- " };\n"
- " };\n"
+ " With ipsecfwd.conf containing, for example:\n"
+ " default: {\n"
+ " dir = 1\n"
+ " proto = 0\n"
+ " mode = 0\n"
+ " crypto: {\n"
+ " cipher_alg = 4\n"
+ " cipher_key = \"jWnZr4t7w!zwC*F-\"\n"
+ " auth_alg = 2\n"
+ " auth_key = \"n2r5u7x!A%%D*\"\n"
+ " icv_len = 12\n"
+ " };\n"
+ " };\n"
"\n"
- " sa: (\n"
- " {\n"
- " spi = 1337\n"
- " outbound: {\n"
- " tunnel: {\n"
- " src_addr = \"192.168.1.10\"\n"
- " dst_addr = \"192.168.1.16\"\n"
- " };\n"
- " };\n"
- " },\n"
- " {\n"
- " spi = 1338\n"
- " outbound: {\n"
- " tunnel: {\n"
- " src_addr = \"192.168.3.110\"\n"
- " dst_addr = \"192.168.3.116\"\n"
- " };\n"
- " };\n"
- " }\n"
- " );\n"
+ " sa: (\n"
+ " {\n"
+ " spi = 1337\n"
+ " outbound: {\n"
+ " tunnel: {\n"
+ " src_addr = \"192.168.1.10\"\n"
+ " dst_addr = \"192.168.1.16\"\n"
+ " };\n"
+ " };\n"
+ " },\n"
+ " {\n"
+ " spi = 1338\n"
+ " outbound: {\n"
+ " tunnel: {\n"
+ " src_addr = \"192.168.3.110\"\n"
+ " dst_addr = \"192.168.3.116\"\n"
+ " };\n"
+ " };\n"
+ " }\n"
+ " );\n"
"\n"
- " fwd: (\n"
- " {\n"
- " prefix: \"192.168.1.0/24\"\n"
- " if: \"ens9f1\"\n"
- " dst_mac: \"00:00:05:00:07:00\"\n"
- " }\n"
- " );\n"
+ " fwd: (\n"
+ " {\n"
+ " prefix: \"192.168.1.0/24\"\n"
+ " if: \"ens9f1\"\n"
+ " dst_mac: \"00:00:05:00:07:00\"\n"
+ " }\n"
+ " );\n"
"\n"
- "Usage: %s [options]\n"
+ "Mandatory OPTIONS:\n"
"\n"
" -i, --interfaces Ethernet interfaces for packet I/O, comma-separated,\n"
" no spaces.\n"
- " -n, --num_pkts Number of packet buffers allocated for packet I/O pool.\n"
- " %u by default.\n"
- " -l, --pkt_len Maximum size of packet buffers in packet I/O pool. %u by\n"
- " default.\n"
- " -c, --count Worker thread count, 1 by default.\n"
- " -m, --mode Queueing mode.\n"
- " 0: ordered (default)\n"
- " 1: parallel\n"
" -C, --conf Configuration file. 'libconfig' syntax is expected.\n"
" SA configuration supports default fallback, i.e.\n"
" individual SA configuration blocks may omit some\n"
@@ -405,10 +393,20 @@ static void print_usage(void)
" potential SA and forwarding configuration.\n"
"\n"
" Supported cipher and authentication algorithms for SAs:\n",
- PROG_NAME, PROG_NAME, MIN(pool_capa.pkt.max_num, PKT_CNT),
- MIN(pool_capa.pkt.max_len, PKT_SIZE));
+ PROG_NAME, PROG_NAME);
print_supported_algos(&ipsec_capa);
- printf(" -I, --num_input_qs Input queue count. 1 by default.\n"
+ printf("\n"
+ "Optional OPTIONS:\n"
+ "\n"
+ " -n, --num_pkts Number of packet buffers allocated for packet I/O pool.\n"
+ " %u by default.\n"
+ " -l, --pkt_len Maximum size of packet buffers in packet I/O pool. %u by\n"
+ " default.\n"
+ " -c, --count Worker thread count. 1 by default.\n"
+ " -m, --mode Queueing mode.\n"
+ " 0: ordered (default)\n"
+ " 1: parallel\n"
+ " -I, --num_input_qs Input queue count. 1 by default.\n"
" -S, --num_sa_qs SA queue count. 1 by default.\n"
" -O, --num_output_qs Output queue count. 1 by default.\n"
" -d, --direct_rx Use direct RX. Interfaces will be polled by workers\n"
@@ -416,7 +414,9 @@ static void print_usage(void)
" options are ignored, input and output queue counts will\n"
" match worker count.\n"
" -h, --help This help.\n"
- "\n");
+ "\n", pool_capa.pkt.max_num > 0U ? ODPH_MIN(pool_capa.pkt.max_num, PKT_CNT) :
+ PKT_CNT, pool_capa.pkt.max_len > 0U ? ODPH_MIN(pool_capa.pkt.max_len, PKT_SIZE) :
+ PKT_SIZE);
}
static inline odp_ipsec_sa_t *get_in_sa(odp_packet_t pkt)
@@ -964,7 +964,7 @@ static odp_bool_t create_sa_dest_queues(odp_ipsec_capability_t *ipsec_capa,
prog_config_t *config)
{
odp_queue_param_t q_param;
- const uint32_t max_sa_qs = MIN(MAX_SA_QUEUES, ipsec_capa->max_queues);
+ const uint32_t max_sa_qs = ODPH_MIN(MAX_SA_QUEUES, ipsec_capa->max_queues);
if (config->num_sa_qs == 0U || config->num_sa_qs > max_sa_qs) {
ODPH_ERR("Invalid number of SA queues: %u (min: 1, max: %u)\n", config->num_sa_qs,
@@ -1275,7 +1275,7 @@ static void parse_sas(config_t *cfg, prog_config_t *config)
if (!config->is_dir_rx && !create_sa_dest_queues(&ipsec_capa, config))
return;
- max_num_sa = MIN(MAX_SAS, ipsec_capa.max_num_sa);
+ max_num_sa = ODPH_MIN(MAX_SAS, ipsec_capa.max_num_sa);
parse_and_create_sa_entries(cfg, config, max_num_sa);
}
@@ -1391,23 +1391,25 @@ static parse_result_t check_options(prog_config_t *config)
return PRS_NOK;
}
- if (config->num_pkts > pool_capa.pkt.max_num) {
+ if (pool_capa.pkt.max_num > 0U && config->num_pkts > pool_capa.pkt.max_num) {
ODPH_ERR("Invalid pool packet count: %u (max: %u)\n", config->num_pkts,
pool_capa.pkt.max_num);
return PRS_NOK;
}
if (config->num_pkts == 0U)
- config->num_pkts = MIN(pool_capa.pkt.max_num, PKT_CNT);
+ config->num_pkts = pool_capa.pkt.max_num > 0U ?
+ ODPH_MIN(pool_capa.pkt.max_num, PKT_CNT) : PKT_CNT;
- if (config->pkt_len > pool_capa.pkt.max_len) {
+ if (pool_capa.pkt.max_len > 0U && config->pkt_len > pool_capa.pkt.max_len) {
ODPH_ERR("Invalid pool packet length: %u (max: %u)\n", config->pkt_len,
pool_capa.pkt.max_len);
return PRS_NOK;
}
if (config->pkt_len == 0U)
- config->pkt_len = MIN(pool_capa.pkt.max_len, PKT_SIZE);
+ config->pkt_len = pool_capa.pkt.max_len > 0U ?
+ ODPH_MIN(pool_capa.pkt.max_len, PKT_SIZE) : PKT_SIZE;
if (config->num_thrs <= 0 || config->num_thrs > MAX_WORKERS) {
ODPH_ERR("Invalid thread count: %d (min: 1, max: %d)\n", config->num_thrs,
@@ -1617,7 +1619,7 @@ static odp_bool_t setup_pktios(prog_config_t *config)
return false;
}
- max_output_qs = MIN(MAX_QUEUES, capa.max_output_queues);
+ max_output_qs = ODPH_MIN(MAX_QUEUES, capa.max_output_queues);
if (config->num_output_qs == 0U || config->num_output_qs > max_output_qs) {
ODPH_ERR("Invalid number of output queues for packet I/O: %u (min: 1, "
@@ -1863,6 +1865,40 @@ static void stop_test(prog_config_t *config)
(void)odph_thread_join(config->thread_tbl, config->num_thrs);
}
+static void print_stats(const prog_config_t *config)
+{
+ const stats_t *stats;
+
+ printf("\n====================\n\n"
+ "IPsec forwarder done\n\n"
+ " configuration file: %s\n"
+ " queuing mode: %s\n"
+ " input queue count: %u\n"
+ " SA queue count: %u\n"
+ " output queue count: %u\n"
+ " RX mode: %s\n", config->conf_file,
+ config->mode == ORDERED ? "ordered" : "parallel", config->num_input_qs,
+ config->num_sa_qs, config->num_output_qs,
+ config->is_dir_rx ? "direct" : "scheduled");
+
+ for (int i = 0; i < config->num_thrs; ++i) {
+ stats = &config->thread_config[i].stats;
+
+ printf("\n worker %d:\n"
+ " IPsec in packets: %" PRIu64 "\n"
+ " IPsec out packets: %" PRIu64 "\n"
+ " IPsec in packet errors: %" PRIu64 "\n"
+ " IPsec out packet errors: %" PRIu64 "\n"
+ " IPsec status errors: %" PRIu64 "\n"
+ " packets forwarded: %" PRIu64 "\n"
+ " packets dropped: %" PRIu64 "\n", i, stats->ipsec_in_pkts,
+ stats->ipsec_out_pkts, stats->ipsec_in_errs, stats->ipsec_out_errs,
+ stats->status_errs, stats->fwd_pkts, stats->discards);
+ }
+
+ printf("\n====================\n");
+}
+
static void wait_sas_disabled(uint32_t num_sas)
{
uint32_t num_sas_dis = 0U;
@@ -1896,11 +1932,12 @@ static void teardown_test(const prog_config_t *config)
{
(void)odph_iplookup_table_destroy(config->fwd_tbl);
- for (uint32_t i = 0U; i < config->num_ifs; ++i)
- if (config->pktios[i].handle != ODP_PKTIO_INVALID) {
+ for (uint32_t i = 0U; i < config->num_ifs; ++i) {
+ free(config->pktios[i].name);
+
+ if (config->pktios[i].handle != ODP_PKTIO_INVALID)
(void)odp_pktio_close(config->pktios[i].handle);
- free(config->pktios[i].name);
- }
+ }
if (config->pktio_pool != ODP_POOL_INVALID)
(void)odp_pool_destroy(config->pktio_pool);
@@ -1924,28 +1961,6 @@ static void teardown_test(const prog_config_t *config)
free(config->conf_file);
}
-static void print_stats(const prog_config_t *config)
-{
- const stats_t *stats;
-
- printf("\nProgram finished:\n");
-
- for (int i = 0; i < config->num_thrs; ++i) {
- stats = &config->thread_config[i].stats;
-
- printf("\n Worker %d:\n"
- " IPsec in packets: %" PRIu64 "\n"
- " IPsec out packets: %" PRIu64 "\n"
- " IPsec in packet errors: %" PRIu64 "\n"
- " IPsec out packet errors: %" PRIu64 "\n"
- " IPsec status errors: %" PRIu64 "\n"
- " Packets forwarded: %" PRIu64 "\n"
- " Packets dropped: %" PRIu64 "\n", i, stats->ipsec_in_pkts,
- stats->ipsec_out_pkts, stats->ipsec_in_errs, stats->ipsec_out_errs,
- stats->status_errs, stats->fwd_pkts, stats->discards);
- }
-}
-
int main(int argc, char **argv)
{
odph_helper_options_t odph_opts;
diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c
index 27b8d4821..6080fa8eb 100644
--- a/test/performance/odp_l2fwd.c
+++ b/test/performance/odp_l2fwd.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2014-2018, Linaro Limited
- * Copyright (c) 2019-2022, Nokia
+ * Copyright (c) 2019-2023, Nokia
* Copyright (c) 2020-2021, Marvell
* All rights reserved.
*
@@ -42,9 +42,6 @@
/* Maximum number of pktio interfaces */
#define MAX_PKTIOS 8
-/* Maximum pktio index table size */
-#define MAX_PKTIO_INDEXES 1024
-
/* Default vector size */
#define DEFAULT_VEC_SIZE MAX_PKT_BURST
@@ -200,7 +197,7 @@ typedef struct {
/* Destination port lookup table.
* Table index is pktio_index of the API. This is used by the sched
* mode. */
- uint8_t dst_port_from_idx[MAX_PKTIO_INDEXES];
+ uint8_t dst_port_from_idx[ODP_PKTIO_MAX_INDEX + 1];
/* Break workers loop if set to 1 */
odp_atomic_u32_t exit_threads;
@@ -1411,8 +1408,10 @@ static void init_port_lookup_tbl(void)
int pktio_idx = odp_pktio_index(pktio);
int dst_port = find_dest_port(rx_idx);
- if (pktio_idx < 0 || pktio_idx >= MAX_PKTIO_INDEXES) {
- ODPH_ERR("Bad pktio index %i\n", pktio_idx);
+ if (pktio_idx < 0) {
+ ODPH_ERR("Reading pktio (%s) index failed: %i\n",
+ gbl_args->appl.if_names[rx_idx], pktio_idx);
+
exit(EXIT_FAILURE);
}
@@ -1421,7 +1420,7 @@ static void init_port_lookup_tbl(void)
}
/*
- * Prinf usage information
+ * Print usage information
*/
static void usage(char *progname)
{
@@ -2216,10 +2215,6 @@ int main(int argc, char *argv[])
}
}
- if (odp_pktio_max_index() >= MAX_PKTIO_INDEXES)
- ODPH_DBG("Warning: max pktio index (%u) is too large\n",
- odp_pktio_max_index());
-
bind_workers();
odp_schedule_config_init(&sched_config);
@@ -2431,7 +2426,14 @@ int main(int argc, char *argv[])
}
for (i = 0; i < if_count; ++i) {
- if (odp_pktio_close(gbl_args->pktios[i].pktio)) {
+ odp_pktio_t pktio = gbl_args->pktios[i].pktio;
+
+ if (gbl_args->appl.verbose && odp_pktio_extra_stat_info(pktio, NULL, 0) > 0) {
+ printf("Pktio %s extra statistics:\n", gbl_args->appl.if_names[i]);
+ odp_pktio_extra_stats_print(pktio);
+ }
+
+ if (odp_pktio_close(pktio)) {
ODPH_ERR("Pktio close failed: %s\n", gbl_args->appl.if_names[i]);
exit(EXIT_FAILURE);
}
diff --git a/test/performance/odp_l2fwd_run.sh b/test/performance/odp_l2fwd_run.sh
index b8d766df6..cd750ca35 100755
--- a/test/performance/odp_l2fwd_run.sh
+++ b/test/performance/odp_l2fwd_run.sh
@@ -93,7 +93,7 @@ run_l2fwd()
--vdev net_pcap2,iface=$IF2"
# Max 2 workers
- $STDBUF odp_l2fwd${EXEEXT} -i 0,1 -m 0 -t 30 -c 2 | tee $LOG
+ $STDBUF odp_l2fwd${EXEEXT} -i 0,1 -m 0 -t 5 -c 2 | tee $LOG
ret=${PIPESTATUS[0]}
kill -2 ${GEN_PID}
diff --git a/test/performance/odp_lock_perf.c b/test/performance/odp_lock_perf.c
index e1c0c039e..c12f8c950 100644
--- a/test/performance/odp_lock_perf.c
+++ b/test/performance/odp_lock_perf.c
@@ -634,7 +634,7 @@ int main(int argc, char **argv)
print_info(&test_global->test_options);
/* Loop all test cases */
- num_tests = sizeof(test_suite) / sizeof(test_suite[0]);
+ num_tests = ODPH_ARRAY_SIZE(test_suite);
while (1) {
for (i = 0; i < num_tests; i++) {
diff --git a/test/performance/odp_packet_gen.c b/test/performance/odp_packet_gen.c
index 85b0c740b..247ea2eb6 100644
--- a/test/performance/odp_packet_gen.c
+++ b/test/performance/odp_packet_gen.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2020-2022, Nokia
+/* Copyright (c) 2020-2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -21,7 +21,25 @@
#include <odp_api.h>
#include <odp/helper/odph_api.h>
-#define MAX_PKTIOS 32
+#if ODP_THREAD_COUNT_MAX > 33
+/* One control thread, even number of workers */
+#define MAX_THREADS 33
+#else
+#define MAX_THREADS ODP_THREAD_COUNT_MAX
+#endif
+
+#define MAX_WORKERS (MAX_THREADS - 1)
+
+/* At least one control and two worker threads */
+ODP_STATIC_ASSERT(MAX_WORKERS >= 2, "Too few threads");
+
+/* Maximum number of packet IO interfaces */
+#define MAX_PKTIOS 16
+/* Maximum number of packets to be allocated for
+ * one transmit round: bursts * burst_size * bins */
+#define MAX_ALLOC_PACKETS (64 * 1024)
+/* Maximum number of packet length bins */
+#define MAX_BINS 1024
#define MAX_PKTIO_NAME 255
#define RX_THREAD 1
#define TX_THREAD 2
@@ -30,8 +48,11 @@
#define RAND_16BIT_WORDS 128
/* Max retries to generate random data */
#define MAX_RAND_RETRIES 1000
-/* Maximum pktio index table size */
-#define MAX_PKTIO_INDEXES 1024
+
+/* Used don't free */
+#define TX_MODE_DF 0
+/* Use static references */
+#define TX_MODE_REF 1
/* Minimum number of packets to receive in CI test */
#define MIN_RX_PACKETS_CI 800
@@ -67,7 +88,7 @@ typedef struct test_options_t {
uint32_t wait_sec;
uint32_t wait_start_sec;
uint32_t mtu;
- odp_bool_t use_refs;
+ int tx_mode;
odp_bool_t promisc_mode;
odp_bool_t calc_latency;
odp_bool_t calc_cs;
@@ -99,6 +120,9 @@ typedef struct thread_arg_t {
/* In direct_rx mode, pktin queue per pktio interface (per thread) */
odp_pktin_queue_t pktin[MAX_PKTIOS];
+ /* Pre-built packets for TX thread */
+ odp_packet_t packet[MAX_PKTIOS][MAX_ALLOC_PACKETS];
+
} thread_arg_t;
typedef struct ODP_ALIGNED_CACHE thread_stat_t {
@@ -133,22 +157,26 @@ typedef struct test_global_t {
odp_cpumask_t cpumask;
odp_pool_t pool;
uint64_t drained;
- odph_thread_t thread_tbl[ODP_THREAD_COUNT_MAX];
- thread_stat_t stat[ODP_THREAD_COUNT_MAX];
- thread_arg_t thread_arg[ODP_THREAD_COUNT_MAX];
+ odph_thread_t thread_tbl[MAX_THREADS];
+ thread_stat_t stat[MAX_THREADS];
+ thread_arg_t thread_arg[MAX_THREADS];
struct {
odph_ethaddr_t eth_src;
odph_ethaddr_t eth_dst;
odp_pktio_t pktio;
- odp_pktout_queue_t pktout[ODP_THREAD_COUNT_MAX];
- odp_pktin_queue_t pktin[ODP_THREAD_COUNT_MAX];
+ odp_pktout_queue_t pktout[MAX_THREADS];
+ odp_pktin_queue_t pktin[MAX_THREADS];
int started;
} pktio[MAX_PKTIOS];
/* Interface lookup table. Table index is pktio_index of the API. */
- uint8_t if_from_pktio_idx[MAX_PKTIO_INDEXES];
+ uint8_t if_from_pktio_idx[ODP_PKTIO_MAX_INDEX + 1];
+
+ uint32_t num_tx_pkt;
+ uint32_t num_bins;
+ uint32_t len_bin[MAX_BINS];
} test_global_t;
@@ -196,17 +224,18 @@ static void print_usage(void)
" Random packet length. Specify the minimum and maximum\n"
" packet lengths and the number of bins. To reduce pool size\n"
" requirement the length range can be divided into even sized\n"
- " bins. Min and max size packets are always used and included\n"
+ " bins (max %u). Min and max size packets are always used and included\n"
" into the number of bins (bins >= 2). Bin value of 0 means\n"
" that each packet length is used. Comma-separated (no spaces).\n"
" Overrides standard packet length option.\n"
" -D, --direct_rx Direct input mode (default: 0)\n"
" 0: Use scheduler for packet input\n"
- " 1: Poll packet input in direct mode\n");
- printf(" -R, --no_pkt_refs Do not use packet references. Always allocate a\n"
- " fresh set of packets for a transmit burst. Some\n"
- " features may be available only with references\n"
- " disabled.\n"
+ " 1: Poll packet input in direct mode\n", MAX_BINS);
+ printf(" -m, --tx_mode Transmit mode (default 1):\n"
+ " 0: Re-send packets with don't free option\n"
+ " 1: Send static packet references. Some features may\n"
+ " not be available with references.\n"
+ " 2: Send copies of packets\n"
" -M, --mtu <len> Interface MTU in bytes.\n"
" -b, --burst_size Transmit burst size. Default: 8\n"
" -x, --bursts Number of bursts per one transmit round. Default: 1\n"
@@ -218,8 +247,8 @@ static void print_usage(void)
" -o, --udp_src UDP source port. Default: 10000\n"
" -p, --udp_dst UDP destination port. Default: 20000\n"
" -P, --promisc_mode Enable promiscuous mode.\n"
- " -a, --latency Calculate latency. Disables packet references (see\n"
- " \"--no_pkt_refs\").\n"
+ " -a, --latency Calculate latency. Cannot be used with packet\n"
+ " references (see \"--tx_mode\").\n"
" -c, --c_mode <counts> Counter mode for incrementing UDP port numbers.\n"
" Specify the number of port numbers used starting from\n"
" udp_src/udp_dst. Comma-separated (no spaces) list of\n"
@@ -280,15 +309,49 @@ static int parse_vlan(const char *str, test_global_t *global)
return num_vlan;
}
+static int init_bins(test_global_t *global)
+{
+ uint32_t i, bin_size;
+ test_options_t *test_options = &global->test_options;
+ uint32_t num_bins = test_options->rand_pkt_len_bins;
+ uint32_t len_min = test_options->rand_pkt_len_min;
+ uint32_t len_max = test_options->rand_pkt_len_max;
+ uint32_t num_bytes = len_max - len_min + 1;
+
+ if (len_max <= len_min) {
+ ODPH_ERR("Error: Bad max packet length\n");
+ return -1;
+ }
+
+ if (num_bins == 0)
+ num_bins = num_bytes;
+
+ if (num_bins == 1 || num_bins > MAX_BINS || num_bins > num_bytes) {
+ ODPH_ERR("Error: Bad number of packet length bins: %u\n", num_bins);
+ return -1;
+ }
+
+ bin_size = (len_max - len_min + 1) / (num_bins - 1);
+
+ /* Min length is the first bin */
+ for (i = 0; i < num_bins - 1; i++)
+ global->len_bin[i] = len_min + (i * bin_size);
+
+ /* Max length is the last bin */
+ global->len_bin[i] = len_max;
+ global->num_bins = num_bins;
+
+ return 0;
+}
+
static int parse_options(int argc, char *argv[], test_global_t *global)
{
int opt, i, len, str_len, long_index, udp_port;
unsigned long int count;
- uint32_t min_packets, num_tx_pkt, pkt_len, val;
+ uint32_t min_packets, num_tx_pkt, num_tx_alloc, pkt_len, val, bins;
char *name, *str, *end;
test_options_t *test_options = &global->test_options;
int ret = 0;
- int help = 0;
uint8_t default_eth_dst[6] = {0x02, 0x00, 0x00, 0xa0, 0xb0, 0xc0};
static const struct option longopts[] = {
@@ -300,7 +363,7 @@ static int parse_options(int argc, char *argv[], test_global_t *global)
{"len", required_argument, NULL, 'l'},
{"len_range", required_argument, NULL, 'L'},
{"direct_rx", required_argument, NULL, 'D'},
- {"no_pkt_refs", no_argument, NULL, 'R'},
+ {"tx_mode", required_argument, NULL, 'm'},
{"burst_size", required_argument, NULL, 'b'},
{"bursts", required_argument, NULL, 'x'},
{"gap", required_argument, NULL, 'g'},
@@ -323,7 +386,7 @@ static int parse_options(int argc, char *argv[], test_global_t *global)
{NULL, 0, NULL, 0}
};
- static const char *shortopts = "+i:e:r:t:n:l:L:D:RM:b:x:g:v:s:d:o:p:c:CAq:u:w:W:Pah";
+ static const char *shortopts = "+i:e:r:t:n:l:L:D:m:M:b:x:g:v:s:d:o:p:c:CAq:u:w:W:Pah";
test_options->num_pktio = 0;
test_options->num_rx = 1;
@@ -332,7 +395,7 @@ static int parse_options(int argc, char *argv[], test_global_t *global)
test_options->pkt_len = 512;
test_options->use_rand_pkt_len = 0;
test_options->direct_rx = 0;
- test_options->use_refs = 1;
+ test_options->tx_mode = TX_MODE_REF;
test_options->burst_size = 8;
test_options->bursts = 1;
test_options->gap_nsec = 1000000;
@@ -482,8 +545,8 @@ static int parse_options(int argc, char *argv[], test_global_t *global)
case 'D':
test_options->direct_rx = atoi(optarg);
break;
- case 'R':
- test_options->use_refs = 0;
+ case 'm':
+ test_options->tx_mode = atoi(optarg);
break;
case 'M':
test_options->mtu = atoi(optarg);
@@ -551,69 +614,68 @@ static int parse_options(int argc, char *argv[], test_global_t *global)
case 'h':
/* fall through */
default:
- help = 1;
print_usage();
ret = -1;
break;
}
}
- if (help == 0 && test_options->num_pktio == 0) {
+ if (ret)
+ return -1;
+
+ if (test_options->num_pktio == 0) {
ODPH_ERR("Error: At least one packet IO interface is needed.\n");
ODPH_ERR(" Use -i <name> to specify interfaces.\n");
- ret = -1;
+ return -1;
}
if (test_options->num_rx < 1 || test_options->num_tx < 1) {
ODPH_ERR("Error: At least one rx and tx thread needed.\n");
- ret = -1;
+ return -1;
}
test_options->num_cpu = test_options->num_rx + test_options->num_tx;
- num_tx_pkt = test_options->burst_size * test_options->bursts;
- if (test_options->use_rand_pkt_len) {
- uint32_t pkt_sizes = test_options->rand_pkt_len_max -
- test_options->rand_pkt_len_min + 1;
- uint32_t pkt_bins = test_options->rand_pkt_len_bins;
- uint32_t req_pkts;
+ if (test_options->num_cpu > MAX_WORKERS) {
+ ODPH_ERR("Error: Too many worker threads\n");
+ return -1;
+ }
- if (test_options->rand_pkt_len_max <= test_options->rand_pkt_len_min) {
- ODPH_ERR("Error: Bad max packet length\n");
- ret = -1;
- }
- if (pkt_bins == 1) {
- ODPH_ERR("Error: Invalid bins value\n");
- ret = -1;
- }
- if (pkt_sizes < pkt_bins) {
- ODPH_ERR("Error: Not enough packet sizes for %" PRIu32 " bins\n", pkt_bins);
- ret = -1;
- }
- if (pkt_bins && num_tx_pkt > pkt_bins && num_tx_pkt % pkt_bins)
- ODPH_ERR("\nWARNING: Transmit packet count is not evenly divisible into packet length bins.\n\n");
- else if (!pkt_bins && num_tx_pkt > pkt_sizes && num_tx_pkt % pkt_sizes)
- ODPH_ERR("\nWARNING: Transmit packet count is not evenly divisible into packet lengths.\n\n");
+ num_tx_pkt = test_options->burst_size * test_options->bursts;
+ global->num_tx_pkt = num_tx_pkt;
+
+ if (num_tx_pkt == 0) {
+ ODPH_ERR("Error: Bad number of tx packets: %u\n", num_tx_pkt);
+ return -1;
+ }
- req_pkts = pkt_bins ? pkt_bins : pkt_sizes;
- if (req_pkts > num_tx_pkt)
- num_tx_pkt = req_pkts;
+ if (test_options->use_rand_pkt_len) {
+ if (init_bins(global))
+ return -1;
+ }
+
+ bins = global->num_bins ? global->num_bins : 1;
+ num_tx_alloc = num_tx_pkt * bins;
+ if (num_tx_alloc > MAX_ALLOC_PACKETS) {
+ ODPH_ERR("Error: Too many tx packets: %u\n", num_tx_alloc);
+ return -1;
}
- /* Pool needs to have enough packets for all tx side bursts and
- * one rx side burst */
- min_packets = (test_options->num_pktio * test_options->num_tx *
- num_tx_pkt) +
- (test_options->num_pktio * test_options->num_rx *
- test_options->burst_size);
+ /* Pool needs to have enough packets for all TX side pre-allocated packets and
+ * a burst per thread (for packet copies). RX side needs one burst per thread per pktio. */
+ min_packets = test_options->num_pktio * test_options->num_tx * num_tx_alloc;
+ min_packets += test_options->num_tx * test_options->burst_size;
+ min_packets += test_options->num_pktio * test_options->num_rx * test_options->burst_size;
if (test_options->num_pkt < min_packets) {
ODPH_ERR("Error: Pool needs to have at least %u packets\n", min_packets);
- ret = -1;
+ return -1;
}
- if (test_options->calc_latency)
- test_options->use_refs = 0;
+ if (test_options->calc_latency && test_options->tx_mode == TX_MODE_REF) {
+ ODPH_ERR("Error: Latency test is not supported with packet references (--tx_mode 1)\n");
+ return -1;
+ }
if (test_options->gap_nsec) {
double gap_hz = 1000000000.0 / test_options->gap_nsec;
@@ -624,6 +686,14 @@ static int parse_options(int argc, char *argv[], test_global_t *global)
}
}
+ if (global->num_bins) {
+ if (num_tx_pkt > global->num_bins && num_tx_pkt % global->num_bins)
+ ODPH_ERR("\nWARNING: Transmit packet count is not evenly divisible into packet length bins.\n\n");
+
+ if (num_tx_pkt < global->num_bins)
+ ODPH_ERR("\nWARNING: Not enough packets for every packet length bin.\n\n");
+ }
+
if (test_options->c_mode.udp_dst &&
num_tx_pkt % test_options->c_mode.udp_dst)
ODPH_ERR("\nWARNING: Transmit packet count is not evenly divisible by UDP destination port count.\n\n");
@@ -640,10 +710,10 @@ static int parse_options(int argc, char *argv[], test_global_t *global)
test_options->rand_pkt_len_min : test_options->pkt_len;
if (test_options->hdr_len >= pkt_len) {
ODPH_ERR("Error: Headers do not fit into packet length %" PRIu32 "\n", pkt_len);
- ret = -1;
+ return -1;
}
- return ret;
+ return 0;
}
static int set_num_cpu(test_global_t *global)
@@ -652,13 +722,6 @@ static int set_num_cpu(test_global_t *global)
test_options_t *test_options = &global->test_options;
int num_cpu = test_options->num_cpu;
- /* One thread used for the main thread */
- if (num_cpu > ODP_THREAD_COUNT_MAX - 1) {
- ODPH_ERR("Error: Too many threads. API supports max %i.\n",
- ODP_THREAD_COUNT_MAX - 1);
- return -1;
- }
-
ret = odp_cpumask_default_worker(&global->cpumask, num_cpu);
if (ret != num_cpu) {
@@ -736,7 +799,7 @@ static int open_pktios(test_global_t *global)
printf("interface default\n");
printf(" packet input mode: %s\n", test_options->direct_rx ? "direct" : "scheduler");
printf(" promisc mode: %s\n", test_options->promisc_mode ? "enabled" : "disabled");
- printf(" packet references: %s\n", test_options->use_refs ? "enabled" : "disabled");
+ printf(" transmit mode: %i\n", test_options->tx_mode);
printf(" measure latency: %s\n", test_options->calc_latency ? "enabled" : "disabled");
printf(" UDP checksum: %s\n", test_options->calc_cs ? "enabled" : "disabled");
printf(" payload filling: %s\n", test_options->fill_pl ? "enabled" : "disabled");
@@ -818,9 +881,6 @@ static int open_pktios(test_global_t *global)
global->pool = pool;
- if (odp_pktio_max_index() >= MAX_PKTIO_INDEXES)
- ODPH_ERR("Warning: max pktio index (%u) is too large\n", odp_pktio_max_index());
-
odp_pktio_param_init(&pktio_param);
if (test_options->direct_rx)
@@ -848,8 +908,8 @@ static int open_pktios(test_global_t *global)
odp_pktio_print(pktio);
pktio_idx = odp_pktio_index(pktio);
- if (pktio_idx < 0 || pktio_idx >= MAX_PKTIO_INDEXES) {
- ODPH_ERR("Error (%s): Bad pktio index: %i\n", name, pktio_idx);
+ if (pktio_idx < 0) {
+ ODPH_ERR("Error (%s): Reading pktio index failed: %i\n", name, pktio_idx);
return -1;
}
global->if_from_pktio_idx[pktio_idx] = i;
@@ -913,6 +973,11 @@ static int open_pktios(test_global_t *global)
}
}
+ if (test_options->tx_mode == TX_MODE_DF && pktio_capa.free_ctrl.dont_free == 0) {
+ ODPH_ERR("Error (%s): Don't free mode not supported\n", name);
+ return -1;
+ }
+
odp_pktio_config_init(&pktio_config);
pktio_config.parser.layer = ODP_PROTO_LAYER_ALL;
@@ -1464,166 +1529,132 @@ static inline void set_timestamp(odp_packet_t pkt, uint32_t ts_off, odp_bool_t c
udp->chksum = calc_cs ? odph_ipv4_udp_chksum(pkt) : 0;
}
-static inline int send_burst(odp_pktout_queue_t pktout, odp_packet_t pkt[],
- int burst_size, odp_bool_t use_rand_len, odp_bool_t use_refs,
- odp_bool_t calc_cs, uint32_t ts_off, uint32_t pkts_per_pktio,
- uint64_t *sent_bytes) {
- int i;
- int ret = 0;
- int num = burst_size;
- odp_packet_t out_pkt[burst_size];
+static int alloc_packets(odp_pool_t pool, odp_packet_t *pkt_tbl, uint32_t num,
+ test_global_t *global)
+{
+ uint32_t i, pkt_len;
+ test_options_t *test_options = &global->test_options;
+ uint32_t num_bins = global->num_bins;
+
+ pkt_len = test_options->pkt_len;
+
+ for (i = 0; i < num; i++) {
+ if (num_bins)
+ pkt_len = global->len_bin[i % num_bins];
+
+ pkt_tbl[i] = odp_packet_alloc(pool, pkt_len);
+ if (pkt_tbl[i] == ODP_PACKET_INVALID) {
+ ODPH_ERR("Error: Alloc of %uB packet failed\n", pkt_len);
+ break;
+ }
+ }
+
+ if (i == 0)
+ return -1;
+
+ if (i != num) {
+ odp_packet_free_multi(pkt_tbl, i);
+ return -1;
+ }
+
+ return 0;
+}
+
+static inline uint32_t form_burst(odp_packet_t out_pkt[], uint32_t burst_size, uint32_t num_bins,
+ uint32_t burst, odp_packet_t *pkt_tbl, odp_pool_t pool,
+ int tx_mode, uint32_t ts_off, odp_bool_t calc_cs,
+ uint64_t *total_bytes)
+{
+ uint32_t i, idx;
+ odp_packet_t pkt;
static __thread int rand_idx = RAND_16BIT_WORDS;
static __thread uint16_t rand_data[RAND_16BIT_WORDS];
- uint64_t bytes_total = 0;
+ uint64_t bytes = 0;
+
+ idx = burst * burst_size;
+ if (num_bins)
+ idx = burst * burst_size * num_bins;
for (i = 0; i < burst_size; i++) {
- int idx = i;
+ if (num_bins) {
+ uint32_t bin;
- if (use_rand_len) {
if (rand_idx >= RAND_16BIT_WORDS) {
if (odp_unlikely(update_rand_data((uint8_t *)rand_data,
- RAND_16BIT_WORDS * 2))) {
- num = i;
- ret = -1;
+ RAND_16BIT_WORDS * 2)))
break;
- }
rand_idx = 0;
}
- idx = rand_data[rand_idx++] % pkts_per_pktio;
+ /* Select random length bin */
+ bin = rand_data[rand_idx++] % num_bins;
+ pkt = pkt_tbl[idx + bin];
+ idx += num_bins;
+ } else {
+ pkt = pkt_tbl[idx];
+ idx++;
}
- if (use_refs) {
- out_pkt[i] = odp_packet_ref_static(pkt[idx]);
- if (odp_unlikely(out_pkt[i] == ODP_PACKET_INVALID)) {
- num = i;
+ if (tx_mode == TX_MODE_DF) {
+ out_pkt[i] = pkt;
+ } else if (tx_mode == TX_MODE_REF) {
+ out_pkt[i] = odp_packet_ref_static(pkt);
+
+ if (odp_unlikely(out_pkt[i] == ODP_PACKET_INVALID))
break;
- }
} else {
- out_pkt[i] = pkt[idx];
- pkt[idx] = ODP_PACKET_INVALID;
+ out_pkt[i] = odp_packet_copy(pkt, pool);
+
+ if (odp_unlikely(out_pkt[i] == ODP_PACKET_INVALID))
+ break;
if (ts_off)
set_timestamp(out_pkt[i], ts_off, calc_cs);
}
- bytes_total += odp_packet_len(out_pkt[i]);
- }
-
- if (odp_unlikely(num < burst_size)) {
- if (!use_refs)
- for (int i = 0; i < burst_size; i++)
- if (pkt[i] != ODP_PACKET_INVALID)
- odp_packet_free(pkt[i]);
- if (num == 0) {
- *sent_bytes = 0;
- return ret;
- }
+ bytes += odp_packet_len(out_pkt[i]);
}
- ret = odp_pktout_send(pktout, out_pkt, num);
-
- if (odp_unlikely(ret < 0))
- ret = 0;
-
- if (odp_unlikely(ret != num)) {
- uint32_t num_drop = num - ret;
-
- for (i = ret; i < num; i++)
- bytes_total -= odp_packet_len(out_pkt[i]);
- odp_packet_free_multi(&out_pkt[ret], num_drop);
- }
+ *total_bytes = bytes;
- *sent_bytes = bytes_total;
- return ret;
+ return i;
}
-static int alloc_test_packets(odp_pool_t pool, odp_packet_t *pkt_tbl, int num_pkt,
- int pkts_per_pktio, test_options_t *test_options)
+static inline uint32_t send_burst(odp_pktout_queue_t pktout, odp_packet_t pkt[],
+ uint32_t num, int tx_mode, uint64_t *drop_bytes)
{
- int num_alloc = 0;
+ int ret;
+ uint32_t sent;
+ uint64_t bytes = 0;
- if (test_options->use_rand_pkt_len) {
- int i, j;
- int num_pktio = test_options->num_pktio;
- uint32_t pkt_bins = test_options->rand_pkt_len_bins;
- uint32_t pkt_len_min = test_options->rand_pkt_len_min;
- uint32_t pkt_len_max = test_options->rand_pkt_len_max;
- uint32_t bin_size = 1;
+ ret = odp_pktout_send(pktout, pkt, num);
- if (pkt_bins)
- bin_size = (pkt_len_max - pkt_len_min + 1) / (pkt_bins - 1);
+ sent = ret;
+ if (odp_unlikely(ret < 0))
+ sent = 0;
- for (i = 0; i < num_pktio; i++) {
- uint32_t cur_bin = 0;
- uint32_t pkt_len = pkt_len_min;
-
- for (j = 0; j < pkts_per_pktio; j++) {
- if (pkt_bins) {
- if (cur_bin + 1 < pkt_bins) {
- pkt_len = pkt_len_min + (cur_bin * bin_size);
- cur_bin++;
- } else {
- cur_bin = 0;
- pkt_len = pkt_len_max;
- }
- }
+ if (odp_unlikely(sent != num)) {
+ uint32_t i;
+ uint32_t num_drop = num - sent;
- pkt_tbl[num_alloc] = odp_packet_alloc(pool, pkt_len);
- if (pkt_tbl[num_alloc] == ODP_PACKET_INVALID) {
- ODPH_ERR("Error: Alloc of %dB packet failed\n", pkt_len);
- break;
- }
- num_alloc++;
+ for (i = sent; i < num; i++)
+ bytes += odp_packet_len(pkt[i]);
- if (!pkt_bins) {
- pkt_len++;
- if (pkt_len > pkt_len_max)
- pkt_len = pkt_len_min;
- }
- }
- }
- return num_alloc;
+ if (tx_mode != TX_MODE_DF)
+ odp_packet_free_multi(&pkt[sent], num_drop);
}
- num_alloc = odp_packet_alloc_multi(pool, test_options->pkt_len, pkt_tbl, num_pkt);
- if (num_alloc != num_pkt)
- ODPH_ERR("Error: Alloc of %u packets failed\n", num_pkt);
-
- return num_alloc;
-}
-
-static int allocate_and_init_packets(odp_pool_t pool, odp_packet_t *pkt_tbl, int num_pkt,
- int pkts_per_pktio, test_options_t *test_options,
- test_global_t *global)
-{
- int num_alloc, num_pktio = test_options->num_pktio;
- num_alloc = alloc_test_packets(pool, pkt_tbl, num_pkt, pkts_per_pktio, test_options);
+ *drop_bytes = bytes;
- if (num_alloc != num_pkt)
- goto err;
-
- for (int i = 0; i < num_pktio; i++) {
- int f = i * pkts_per_pktio;
-
- if (init_packets(global, i, &pkt_tbl[f], pkts_per_pktio, f))
- goto err;
- }
-
- return 0;
-
-err:
- if (num_alloc > 0)
- odp_packet_free_multi(pkt_tbl, num_alloc);
-
- return -1;
+ return sent;
}
static int tx_thread(void *arg)
{
int i, thr, tx_thr;
- uint32_t exit_test;
+ uint32_t exit_test, num_alloc, j;
odp_time_t t1, t2, next_tmo;
uint64_t diff_ns, t1_nsec;
+ odp_packet_t *pkt_tbl;
thread_arg_t *thread_arg = arg;
test_global_t *global = thread_arg->global;
test_options_t *test_options = &global->test_options;
@@ -1636,44 +1667,49 @@ static int tx_thread(void *arg)
uint64_t tx_packets = 0;
uint64_t tx_drops = 0;
int ret = 0;
- int burst_size = test_options->burst_size;
- int bursts = test_options->bursts;
- uint32_t num_tx = test_options->num_tx;
- odp_bool_t use_rand_len = test_options->use_rand_pkt_len;
- odp_bool_t use_refs = test_options->use_refs;
- odp_bool_t is_allocd = false;
+ const uint32_t burst_size = test_options->burst_size;
+ const uint32_t bursts = test_options->bursts;
+ const uint32_t num_tx = test_options->num_tx;
+ const int tx_mode = test_options->tx_mode;
odp_bool_t calc_cs = test_options->calc_cs;
int num_pktio = test_options->num_pktio;
- int num_pkt;
odp_pktout_queue_t pktout[num_pktio];
- uint32_t pkts_per_pktio = bursts * burst_size;
uint32_t ts_off = test_options->calc_latency ? test_options->hdr_len : 0;
-
- if (use_rand_len) {
- uint32_t pkt_sizes = test_options->rand_pkt_len_max -
- test_options->rand_pkt_len_min + 1;
-
- if (test_options->rand_pkt_len_bins)
- pkt_sizes = test_options->rand_pkt_len_bins;
- if (pkt_sizes > pkts_per_pktio)
- pkts_per_pktio = pkt_sizes;
- }
- num_pkt = num_pktio * pkts_per_pktio;
-
- odp_packet_t pkt[num_pkt];
-
+ uint32_t tot_packets = 0;
+ uint32_t num_bins = global->num_bins;
thr = odp_thread_id();
tx_thr = thread_arg->tx_thr;
global->stat[thr].thread_type = TX_THREAD;
- for (i = 0; i < num_pktio; i++)
+ num_alloc = global->num_tx_pkt;
+ if (num_bins)
+ num_alloc = global->num_tx_pkt * num_bins;
+
+ for (i = 0; i < num_pktio; i++) {
+ int seq = i * num_alloc;
+
pktout[i] = thread_arg->pktout[i];
+ pkt_tbl = thread_arg->packet[i];
+
+ if (alloc_packets(pool, pkt_tbl, num_alloc, global)) {
+ ret = -1;
+ break;
+ }
+
+ tot_packets += num_alloc;
- if (use_refs) {
- ret = allocate_and_init_packets(pool, pkt, num_pkt, pkts_per_pktio, test_options,
- global);
- is_allocd = !ret;
+ if (init_packets(global, i, pkt_tbl, num_alloc, seq)) {
+ ret = -1;
+ break;
+ }
+
+ if (tx_mode == TX_MODE_DF) {
+ for (j = 0; j < num_alloc; j++)
+ odp_packet_free_ctrl_set(pkt_tbl[j],
+ ODP_PACKET_FREE_CTRL_DONT_FREE);
+ }
}
+
/* Start all workers at the same time */
odp_barrier_wait(&global->barrier);
@@ -1700,32 +1736,33 @@ static int tx_thread(void *arg)
}
tx_timeouts++;
- if (!use_refs) {
- if (odp_unlikely(allocate_and_init_packets(pool, pkt, num_pkt,
- pkts_per_pktio, test_options,
- global) < 0)) {
- ret = -1;
- break;
- }
- }
/* Send bursts to each pktio */
for (i = 0; i < num_pktio; i++) {
- int sent, j;
- int first = i * bursts * pkts_per_pktio;
- uint64_t sent_bytes;
+ uint32_t num, sent;
+ uint64_t total_bytes, drop_bytes;
+ odp_packet_t pkt[burst_size];
+
+ pkt_tbl = thread_arg->packet[i];
for (j = 0; j < bursts; j++) {
- sent = send_burst(pktout[i], &pkt[first + j * burst_size],
- burst_size, use_rand_len, use_refs, calc_cs,
- ts_off, pkts_per_pktio, &sent_bytes);
+ num = form_burst(pkt, burst_size, num_bins, j, pkt_tbl, pool,
+ tx_mode, ts_off, calc_cs, &total_bytes);
+
+ if (odp_unlikely(num == 0)) {
+ ret = -1;
+ tx_drops += burst_size;
+ break;
+ }
- if (odp_unlikely(sent < 0)) {
+ sent = send_burst(pktout[i], pkt, num, tx_mode, &drop_bytes);
+
+ if (odp_unlikely(sent == 0)) {
ret = -1;
tx_drops += burst_size;
break;
}
- tx_bytes += sent_bytes;
+ tx_bytes += total_bytes - drop_bytes;
tx_packets += sent;
if (odp_unlikely(sent < burst_size))
tx_drops += burst_size - sent;
@@ -1740,8 +1777,15 @@ static int tx_thread(void *arg)
t2 = odp_time_local();
diff_ns = odp_time_diff_ns(t2, t1);
- if (is_allocd)
- odp_packet_free_multi(pkt, num_pkt);
+ for (i = 0; i < num_pktio; i++) {
+ pkt_tbl = thread_arg->packet[i];
+
+ if (tot_packets == 0)
+ break;
+
+ odp_packet_free_multi(pkt_tbl, num_alloc);
+ tot_packets -= num_alloc;
+ }
/* Update stats */
global->stat[thr].time_nsec = diff_ns;
@@ -1825,7 +1869,7 @@ static void print_periodic_stat(test_global_t *global, uint64_t nsec)
num_tx[i] = 0;
num_rx[i] = 0;
- for (j = 0; j < ODP_THREAD_COUNT_MAX; j++) {
+ for (j = 0; j < MAX_THREADS; j++) {
if (global->stat[j].thread_type == RX_THREAD)
num_rx[i] += global->stat[j].pktio[i].rx_packets;
else if (global->stat[j].thread_type == TX_THREAD)
@@ -1929,7 +1973,7 @@ static int print_final_stat(test_global_t *global)
printf(" ");
num_thr = 0;
- for (i = 0; i < ODP_THREAD_COUNT_MAX; i++) {
+ for (i = 0; i < MAX_THREADS; i++) {
if (global->stat[i].thread_type != RX_THREAD)
continue;
@@ -1948,7 +1992,7 @@ static int print_final_stat(test_global_t *global)
printf(" ");
num_thr = 0;
- for (i = 0; i < ODP_THREAD_COUNT_MAX; i++) {
+ for (i = 0; i < MAX_THREADS; i++) {
if (global->stat[i].thread_type != TX_THREAD)
continue;
@@ -1961,7 +2005,7 @@ static int print_final_stat(test_global_t *global)
printf("\n\n");
- for (i = 0; i < ODP_THREAD_COUNT_MAX; i++) {
+ for (i = 0; i < MAX_THREADS; i++) {
if (global->stat[i].thread_type == RX_THREAD) {
rx_tmo_sum += global->stat[i].rx_timeouts;
rx_pkt_sum += global->stat[i].rx_packets;
@@ -2113,7 +2157,7 @@ int main(int argc, char **argv)
memset(global, 0, sizeof(test_global_t));
odp_atomic_init_u32(&global->exit_test, 0);
- for (i = 0; i < ODP_THREAD_COUNT_MAX; i++)
+ for (i = 0; i < MAX_THREADS; i++)
global->thread_arg[i].global = global;
if (parse_options(argc, argv, global)) {
diff --git a/test/performance/odp_packet_gen_run.sh b/test/performance/odp_packet_gen_run.sh
index f7dc0aa09..af272f619 100755
--- a/test/performance/odp_packet_gen_run.sh
+++ b/test/performance/odp_packet_gen_run.sh
@@ -46,9 +46,8 @@ run_packet_gen()
exit $TEST_SKIPPED
fi
- export ODP_PLATFORM_PARAMS="-m 256 --file-prefix="l2fwd" \
---proc-type auto --no-pci --vdev net_pcap1,iface=$IF0 \
---vdev net_pcap2,iface=$IF1"
+ export ODP_PLATFORM_PARAMS="--no-pci \
+--vdev net_pcap1,iface=$IF0 --vdev net_pcap2,iface=$IF1"
# Runs 500 * 10ms = 5 sec
# Sends 500 packets through both interfaces => total 1000 packets
diff --git a/test/performance/odp_pktio_ordered.c b/test/performance/odp_pktio_ordered.c
index 2ad1e67be..bd43ad53d 100644
--- a/test/performance/odp_pktio_ordered.c
+++ b/test/performance/odp_pktio_ordered.c
@@ -809,7 +809,7 @@ static void init_forwarding_tbl(void)
}
/**
- * Prinf usage information
+ * Print usage information
*/
static void usage(char *progname)
{
diff --git a/test/performance/odp_queue_perf.c b/test/performance/odp_queue_perf.c
index 320f2f35a..4e4446610 100644
--- a/test/performance/odp_queue_perf.c
+++ b/test/performance/odp_queue_perf.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2018, Linaro Limited
- * Copyright (c) 2021, Nokia
+ * Copyright (c) 2021-2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -34,6 +34,7 @@ typedef struct test_stat_t {
uint64_t nsec;
uint64_t cycles;
uint64_t deq_retry;
+ uint64_t enq_retry;
} test_stat_t;
@@ -364,7 +365,8 @@ static int run_test(void *arg)
test_global_t *global = arg;
test_options_t *test_options = &global->options;
odp_queue_t queue;
- uint64_t num_retry = 0;
+ uint64_t num_deq_retry = 0;
+ uint64_t num_enq_retry = 0;
uint64_t events = 0;
uint32_t num_queue = test_options->num_queue;
uint32_t num_round = test_options->num_round;
@@ -383,6 +385,8 @@ static int run_test(void *arg)
c1 = odp_cpu_cycles();
for (rounds = 0; rounds < num_round; rounds++) {
+ int num_enq = 0;
+
do {
queue = global->queue[i++];
@@ -391,17 +395,25 @@ static int run_test(void *arg)
num_ev = odp_queue_deq_multi(queue, ev, max_burst);
- if (odp_unlikely(num_ev <= 0))
- num_retry++;
+ if (odp_unlikely(num_ev < 0))
+ ODPH_ABORT("odp_queue_deq_multi() failed\n");
- } while (num_ev <= 0);
+ if (odp_unlikely(num_ev == 0))
+ num_deq_retry++;
- if (odp_queue_enq_multi(queue, ev, num_ev) != num_ev) {
- printf("Error: Queue enq failed %u\n", i);
- ret = -1;
- goto error;
- }
+ } while (num_ev == 0);
+
+ while (num_enq < num_ev) {
+ int num = odp_queue_enq_multi(queue, &ev[num_enq], num_ev - num_enq);
+ if (odp_unlikely(num < 0))
+ ODPH_ABORT("odp_queue_enq_multi() failed\n");
+
+ num_enq += num;
+
+ if (odp_unlikely(num_enq != num_ev))
+ num_enq_retry++;
+ }
events += num_ev;
}
@@ -415,9 +427,9 @@ static int run_test(void *arg)
stat->events = events;
stat->nsec = nsec;
stat->cycles = cycles;
- stat->deq_retry = num_retry;
+ stat->deq_retry = num_deq_retry;
+ stat->enq_retry = num_enq_retry;
-error:
return ret;
}
@@ -467,14 +479,15 @@ static int start_workers(test_global_t *global)
static void print_stat(test_global_t *global)
{
int i, num;
- double rounds_ave, events_ave, nsec_ave, cycles_ave, retry_ave;
+ double rounds_ave, events_ave, nsec_ave, cycles_ave;
test_options_t *test_options = &global->options;
int num_cpu = test_options->num_cpu;
uint64_t rounds_sum = 0;
uint64_t events_sum = 0;
uint64_t nsec_sum = 0;
uint64_t cycles_sum = 0;
- uint64_t retry_sum = 0;
+ uint64_t deq_retry_sum = 0;
+ uint64_t enq_retry_sum = 0;
/* Averages */
for (i = 0; i < ODP_THREAD_COUNT_MAX; i++) {
@@ -482,7 +495,8 @@ static void print_stat(test_global_t *global)
events_sum += global->stat[i].events;
nsec_sum += global->stat[i].nsec;
cycles_sum += global->stat[i].cycles;
- retry_sum += global->stat[i].deq_retry;
+ deq_retry_sum += global->stat[i].deq_retry;
+ enq_retry_sum += global->stat[i].enq_retry;
}
if (rounds_sum == 0) {
@@ -494,7 +508,6 @@ static void print_stat(test_global_t *global)
events_ave = events_sum / num_cpu;
nsec_ave = nsec_sum / num_cpu;
cycles_ave = cycles_sum / num_cpu;
- retry_ave = retry_sum / num_cpu;
num = 0;
printf("RESULTS - per thread (Million events per sec):\n");
@@ -521,8 +534,8 @@ static void print_stat(test_global_t *global)
events_ave / rounds_ave);
printf(" cycles per event: %.3f\n",
cycles_ave / events_ave);
- printf(" deq retries per sec: %.3f k\n",
- (1000000.0 * retry_ave) / nsec_ave);
+ printf(" dequeue retries: %" PRIu64 "\n", deq_retry_sum);
+ printf(" enqueue retries: %" PRIu64 "\n", enq_retry_sum);
printf(" events per sec: %.3f M\n\n",
(1000.0 * events_ave) / nsec_ave);
diff --git a/test/performance/odp_sched_perf.c b/test/performance/odp_sched_perf.c
index a97686c12..f89705576 100644
--- a/test/performance/odp_sched_perf.c
+++ b/test/performance/odp_sched_perf.c
@@ -1148,7 +1148,7 @@ static int start_workers(test_global_t *global, odp_instance_t instance)
if (num_group > 0 && num_join) {
/* Each thread joins only num_join groups, starting
- * from this group index and wraping around the group
+ * from this group index and wrapping around the group
* table. */
int first_group = (i * num_join) % num_group;
diff --git a/test/performance/odp_sched_pktio.c b/test/performance/odp_sched_pktio.c
index 1333e66e4..927d35cbd 100644
--- a/test/performance/odp_sched_pktio.c
+++ b/test/performance/odp_sched_pktio.c
@@ -16,7 +16,7 @@
#define DEBUG_PRINT 0
#define MAX_WORKERS 64
-#define MAX_PKTIOS 32
+#define MAX_PKTIOS (ODP_PKTIO_MAX_INDEX + 1)
#define MAX_PKTIO_NAME 31
#define MAX_PKTIO_QUEUES MAX_WORKERS
#define MAX_PIPE_STAGES 64
@@ -26,7 +26,6 @@
#define MIN_PKT_SEG_LEN 64
#define CHECK_PERIOD 10000
#define TEST_PASSED_LIMIT 5000
-#define TIMEOUT_OFFSET_NS 1000000
#define SCHED_MODE_PARAL 1
#define SCHED_MODE_ATOMIC 2
#define SCHED_MODE_ORDER 3
@@ -1337,10 +1336,6 @@ static int start_timers(test_global_t *test_global)
if (test_global->opt.timeout_us == 0)
return 0;
- /* Delay the first timeout so that workers have time to startup */
- timeout_tick += odp_timer_ns_to_tick(test_global->timer.timer_pool,
- TIMEOUT_OFFSET_NS);
-
start_param.tick_type = ODP_TIMER_TICK_REL;
start_param.tick = timeout_tick;
@@ -1532,9 +1527,6 @@ int main(int argc, char *argv[])
if (create_timers(test_global))
goto quit;
- if (start_timers(test_global))
- goto quit;
-
if (start_pktios(test_global))
goto quit;
@@ -1543,6 +1535,11 @@ int main(int argc, char *argv[])
start_workers(thread, test_global);
+ if (start_timers(test_global)) {
+ test_global->stop_workers = 1;
+ odp_mb_full();
+ }
+
/* Synchronize pktio configuration with workers. Worker are now ready
* to process packets. */
odp_barrier_wait(&test_global->worker_start);
diff --git a/test/performance/odp_stash_perf.c b/test/performance/odp_stash_perf.c
new file mode 100644
index 000000000..ffbc92b4b
--- /dev/null
+++ b/test/performance/odp_stash_perf.c
@@ -0,0 +1,515 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018 Linaro Limited
+ * Copyright (c) 2021 Nokia
+ * Copyright (c) 2023 Arm
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <getopt.h>
+
+#include <odp_api.h>
+#include <odp/helper/odph_api.h>
+
+#define MAX_STASHES (32)
+
+typedef struct test_options_t {
+ uint32_t num_stash;
+ uint32_t num_round;
+ uint32_t max_burst;
+ uint32_t stash_size;
+ int strict;
+ int num_cpu;
+
+} test_options_t;
+
+typedef struct test_stat_t {
+ uint64_t rounds;
+ uint64_t ops;
+ uint64_t nsec;
+ uint64_t cycles;
+ uint64_t num_retry;
+
+} test_stat_t;
+
+typedef struct test_global_t {
+ odp_barrier_t barrier;
+ test_options_t options;
+ odp_instance_t instance;
+ odp_shm_t shm;
+ odp_pool_t pool;
+ odp_stash_t stash[MAX_STASHES];
+ odph_thread_t thread_tbl[ODP_THREAD_COUNT_MAX];
+ test_stat_t stat[ODP_THREAD_COUNT_MAX];
+
+} test_global_t;
+
+static void print_usage(void)
+{
+ printf("\n"
+ "Stash performance test\n"
+ "\n"
+ "Usage: odp_stash_perf [options]\n"
+ "\n"
+ " -c, --num_cpu <num> Number of worker threads. Default: 1\n"
+ " -n, --num_stash <num> Number of stashes. Default: 1\n"
+ " -b, --burst_size <num> Max number of objects per stash call. Default: 1\n"
+ " -s, --stash_size <num> Stash size. Default: 1000\n"
+ " -r, --num_round <num> Number of rounds. Default: 1000\n"
+ " -m, --strict Strict size stash\n"
+ " -h, --help This help\n"
+ "\n");
+}
+
+static int parse_options(int argc, char *argv[], test_options_t *test_options)
+{
+ int opt;
+ int long_index;
+ int ret = 0;
+
+ static const struct option longopts[] = {
+ { "num_cpu", required_argument, NULL, 'c' },
+ { "num_stash", required_argument, NULL, 'n' },
+ { "burst_size", required_argument, NULL, 'b' },
+ { "stash_size", required_argument, NULL, 's' },
+ { "num_round", required_argument, NULL, 'r' },
+ { "strict", no_argument, NULL, 'm' },
+ { "help", no_argument, NULL, 'h' },
+ { NULL, 0, NULL, 0 }
+ };
+
+ static const char *shortopts = "+c:n:b:s:r:mh";
+
+ test_options->num_cpu = 1;
+ test_options->num_stash = 1;
+ test_options->max_burst = 1;
+ test_options->stash_size = 1000;
+ test_options->num_round = 1000;
+ test_options->strict = 0;
+
+ while (1) {
+ opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
+
+ if (opt == -1)
+ break;
+
+ switch (opt) {
+ case 'c':
+ test_options->num_cpu = atoi(optarg);
+ break;
+ case 'n':
+ test_options->num_stash = atoi(optarg);
+ break;
+ case 'b':
+ test_options->max_burst = atoi(optarg);
+ break;
+ case 's':
+ test_options->stash_size = atoi(optarg);
+ break;
+ case 'r':
+ test_options->num_round = atoi(optarg);
+ break;
+ case 'm':
+ test_options->strict = 1;
+ break;
+ case 'h':
+ /* fall through */
+ default:
+ print_usage();
+ ret = -1;
+ break;
+ }
+ }
+
+ if (test_options->num_stash > MAX_STASHES) {
+ ODPH_ERR("Too many stashes %u. Test maximum %u.\n",
+ test_options->num_stash, MAX_STASHES);
+ return -1;
+ }
+
+ return ret;
+}
+
+static int create_stashes(test_global_t *global)
+{
+ uint32_t i;
+ uint32_t tmp = 0;
+ test_options_t *test_options = &global->options;
+
+ uint32_t num_stash = test_options->num_stash;
+ uint32_t num_round = test_options->num_round;
+ int num_stored;
+ uint32_t num_remain;
+ odp_stash_t *stash = global->stash;
+ odp_stash_capability_t stash_capa;
+
+ printf("\nTesting %s stashes\n",
+ test_options->strict == 0 ? "NORMAL" : "STRICT_SIZE");
+ printf(" num rounds %u\n", num_round);
+ printf(" num stashes %u\n", num_stash);
+ printf(" stash size %u\n", test_options->stash_size);
+ printf(" max burst size %u\n", test_options->max_burst);
+
+ if (odp_stash_capability(&stash_capa, ODP_STASH_TYPE_DEFAULT)) {
+ ODPH_ERR("Get stash capability failed\n");
+ return -1;
+ }
+
+ if (test_options->stash_size > stash_capa.max_num_obj) {
+ ODPH_ERR("Max stash size supported %" PRIu64 "\n",
+ stash_capa.max_num_obj);
+ return -1;
+ }
+
+ if (test_options->num_stash > stash_capa.max_stashes) {
+ ODPH_ERR("Max stash supported %u\n", stash_capa.max_stashes);
+ return -1;
+ }
+
+ for (i = 0; i < num_stash; i++) {
+ odp_stash_param_t stash_param;
+
+ odp_stash_param_init(&stash_param);
+ stash_param.num_obj = test_options->stash_size;
+ stash_param.obj_size = sizeof(uint32_t);
+ stash_param.strict_size = test_options->strict;
+
+ stash[i] = odp_stash_create("test_stash_u32", &stash_param);
+ if (stash[i] == ODP_STASH_INVALID) {
+ ODPH_ERR("Stash create failed\n");
+ return -1;
+ }
+
+ num_remain = test_options->stash_size;
+ do {
+ num_stored = odp_stash_put_u32(stash[i], &tmp, 1);
+ if (num_stored < 0) {
+ ODPH_ERR("Error: Stash put failed\n");
+ return -1;
+ }
+ num_remain -= num_stored;
+ } while (num_remain);
+ }
+
+ return 0;
+}
+
+static int destroy_stashes(test_global_t *global)
+{
+ odp_stash_t *stash = global->stash;
+ test_options_t *test_options = &global->options;
+ uint32_t num_stash = test_options->num_stash;
+ uint32_t tmp;
+ int num;
+
+ for (uint32_t i = 0; i < num_stash; i++) {
+ do {
+ num = odp_stash_get_u32(stash[i], &tmp, 1);
+ if (num < 0) {
+ ODPH_ERR("Error: Stash get failed %u\n", i);
+ return -1;
+ }
+ } while (num);
+
+ if (odp_stash_destroy(stash[i])) {
+ ODPH_ERR("Stash destroy failed\n");
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+static int run_test(void *arg)
+{
+ uint64_t c1, c2, cycles, nsec;
+ odp_time_t t1, t2;
+ uint32_t rounds;
+ int num_stored;
+ int num_remain;
+ int num_obj;
+ test_stat_t *stat;
+ test_global_t *global = arg;
+ test_options_t *test_options = &global->options;
+ odp_stash_t stash;
+ uint64_t num_retry = 0;
+ uint64_t ops = 0;
+ uint32_t num_stash = test_options->num_stash;
+ uint32_t num_round = test_options->num_round;
+ int thr = odp_thread_id();
+ int ret = 0;
+ uint32_t i = 0;
+ uint32_t max_burst = test_options->max_burst;
+ uint32_t *tmp = malloc(sizeof(uint32_t) * max_burst);
+
+ if (tmp == NULL) {
+ ODPH_ERR("Error: malloc failed\n");
+ ret = -1;
+ goto error;
+ }
+
+ stat = &global->stat[thr];
+
+ /* Start all workers at the same time */
+ odp_barrier_wait(&global->barrier);
+
+ t1 = odp_time_local();
+ c1 = odp_cpu_cycles();
+
+ for (rounds = 0; rounds < num_round; rounds++) {
+ stash = global->stash[i++];
+
+ if (i == num_stash)
+ i = 0;
+
+ num_obj = odp_stash_get_u32(stash, tmp, max_burst);
+ if (num_obj == 0)
+ continue;
+
+ if (num_obj < 0) {
+ ODPH_ERR("Error: Stash get failed\n");
+ ret = -1;
+ goto error;
+ }
+ num_remain = num_obj;
+ do {
+ num_stored = odp_stash_put_u32(stash, tmp, num_remain);
+ if (num_stored < 0) {
+ ODPH_ERR("Error: Stash put failed\n");
+ ret = -1;
+ goto error;
+ }
+
+ if (num_stored != num_remain)
+ num_retry++;
+
+ num_remain -= num_stored;
+ } while (num_remain);
+ ops += num_obj;
+ }
+
+ c2 = odp_cpu_cycles();
+ t2 = odp_time_local();
+
+ nsec = odp_time_diff_ns(t2, t1);
+ cycles = odp_cpu_cycles_diff(c2, c1);
+
+ stat->rounds = rounds;
+ stat->ops = ops;
+ stat->nsec = nsec;
+ stat->cycles = cycles;
+ stat->num_retry = num_retry;
+error:
+ free(tmp);
+ return ret;
+}
+
+static int start_workers(test_global_t *global)
+{
+ odph_thread_common_param_t thr_common;
+ odph_thread_param_t thr_param;
+ odp_cpumask_t cpumask;
+ int ret;
+ test_options_t *test_options = &global->options;
+ int num_cpu = test_options->num_cpu;
+
+ ret = odp_cpumask_default_worker(&cpumask, num_cpu);
+
+ if (num_cpu && ret != num_cpu) {
+ ODPH_ERR("Error: Too many workers. Max supported %i\n.", ret);
+ return -1;
+ }
+
+ /* Zero: all available workers */
+ if (num_cpu == 0) {
+ num_cpu = ret;
+ test_options->num_cpu = num_cpu;
+ }
+
+ printf(" num workers %u\n\n", num_cpu);
+
+ odp_barrier_init(&global->barrier, num_cpu);
+
+ odph_thread_common_param_init(&thr_common);
+ thr_common.instance = global->instance;
+ thr_common.cpumask = &cpumask;
+ thr_common.share_param = 1;
+
+ odph_thread_param_init(&thr_param);
+ thr_param.start = run_test;
+ thr_param.arg = global;
+ thr_param.thr_type = ODP_THREAD_WORKER;
+
+ if (odph_thread_create(global->thread_tbl, &thr_common, &thr_param,
+ num_cpu) != num_cpu)
+ return -1;
+
+ return 0;
+}
+
+static void print_stat(test_global_t *global)
+{
+ int i, num;
+ double rounds_ave, ops_ave, nsec_ave, cycles_ave, retry_ave;
+ test_options_t *test_options = &global->options;
+ int num_cpu = test_options->num_cpu;
+ uint64_t rounds_sum = 0;
+ uint64_t ops_sum = 0;
+ uint64_t nsec_sum = 0;
+ uint64_t cycles_sum = 0;
+ uint64_t retry_sum = 0;
+
+ /* Averages */
+ for (i = 0; i < ODP_THREAD_COUNT_MAX; i++) {
+ rounds_sum += global->stat[i].rounds;
+ ops_sum += global->stat[i].ops;
+ nsec_sum += global->stat[i].nsec;
+ cycles_sum += global->stat[i].cycles;
+ retry_sum += global->stat[i].num_retry;
+ }
+
+ if (rounds_sum == 0) {
+ printf("No results.\n");
+ return;
+ }
+
+ rounds_ave = rounds_sum / num_cpu;
+ ops_ave = ops_sum / num_cpu;
+ nsec_ave = nsec_sum / num_cpu;
+ cycles_ave = cycles_sum / num_cpu;
+ retry_ave = retry_sum / num_cpu;
+ num = 0;
+
+ printf("RESULTS - per thread (Million ops per sec):\n");
+ printf("----------------------------------------------\n");
+ printf(" 1 2 3 4 5 6 7 8 9 10");
+
+ for (i = 0; i < ODP_THREAD_COUNT_MAX; i++) {
+ if (global->stat[i].rounds) {
+ if ((num % 10) == 0)
+ printf("\n ");
+
+ printf("%6.1f ", (1000.0 * global->stat[i].ops) /
+ global->stat[i].nsec);
+ num++;
+ }
+ }
+ printf("\n\n");
+
+ printf("RESULTS - per thread average (%i threads):\n", num_cpu);
+ printf("------------------------------------------\n");
+ printf(" duration: %.3f msec\n", nsec_ave / 1000000);
+ printf(" num cycles: %.3f M\n", cycles_ave / 1000000);
+ printf(" ops per get: %.3f\n", ops_ave / rounds_ave);
+ printf(" cycles per ops: %.3f\n", cycles_ave / ops_ave);
+ printf(" retries per sec: %.3f k\n",
+ (1000000.0 * retry_ave) / nsec_ave);
+ printf(" ops per sec: %.3f M\n\n",
+ (1000.0 * ops_ave) / nsec_ave);
+
+ printf("TOTAL ops per sec: %.3f M\n\n",
+ (1000.0 * ops_sum) / nsec_ave);
+}
+
+int main(int argc, char **argv)
+{
+ odph_helper_options_t helper_options;
+ odp_instance_t instance;
+ odp_init_t init;
+ odp_shm_t shm;
+ test_global_t *global;
+
+ /* Let helper collect its own arguments (e.g. --odph_proc) */
+ argc = odph_parse_options(argc, argv);
+ if (odph_options(&helper_options)) {
+ ODPH_ERR("Error: Reading ODP helper options failed.\n");
+ exit(EXIT_FAILURE);
+ }
+
+ /* List features not to be used */
+ odp_init_param_init(&init);
+ init.not_used.feat.cls = 1;
+ init.not_used.feat.compress = 1;
+ init.not_used.feat.crypto = 1;
+ init.not_used.feat.ipsec = 1;
+ init.not_used.feat.schedule = 1;
+ init.not_used.feat.timer = 1;
+ init.not_used.feat.tm = 1;
+
+ init.mem_model = helper_options.mem_model;
+
+ /* Init ODP before calling anything else */
+ if (odp_init_global(&instance, &init, NULL)) {
+ ODPH_ERR("Error: Global init failed.\n");
+ exit(EXIT_FAILURE);
+ }
+
+ /* Init this thread */
+ if (odp_init_local(instance, ODP_THREAD_WORKER)) {
+ ODPH_ERR("Error: Local init failed.\n");
+ exit(EXIT_FAILURE);
+ }
+
+ shm = odp_shm_reserve("stash_perf_global", sizeof(test_global_t),
+ ODP_CACHE_LINE_SIZE, 0);
+ if (shm == ODP_SHM_INVALID) {
+ ODPH_ERR("Error: Shared mem reserve failed.\n");
+ exit(EXIT_FAILURE);
+ }
+
+ global = odp_shm_addr(shm);
+ if (global == NULL) {
+ ODPH_ERR("Error: Shared mem alloc failed\n");
+ exit(EXIT_FAILURE);
+ }
+
+ memset(global, 0, sizeof(test_global_t));
+
+ if (parse_options(argc, argv, &global->options))
+ exit(EXIT_FAILURE);
+
+ odp_sys_info_print();
+
+ global->instance = instance;
+
+ if (create_stashes(global)) {
+ ODPH_ERR("Error: Create stashes failed.\n");
+ goto destroy;
+ }
+
+ if (start_workers(global)) {
+ ODPH_ERR("Error: Test start failed.\n");
+ exit(EXIT_FAILURE);
+ }
+
+ /* Wait workers to exit */
+ odph_thread_join(global->thread_tbl, global->options.num_cpu);
+
+ print_stat(global);
+
+destroy:
+ if (destroy_stashes(global)) {
+ ODPH_ERR("Error: Destroy stashes failed.\n");
+ exit(EXIT_FAILURE);
+ }
+
+ if (odp_shm_free(shm)) {
+ ODPH_ERR("Error: Shared mem free failed.\n");
+ exit(EXIT_FAILURE);
+ }
+
+ if (odp_term_local()) {
+ ODPH_ERR("Error: term local failed.\n");
+ exit(EXIT_FAILURE);
+ }
+
+ if (odp_term_global(instance)) {
+ ODPH_ERR("Error: term global failed.\n");
+ exit(EXIT_FAILURE);
+ }
+
+ return 0;
+}
diff --git a/test/performance/odp_timer_perf.c b/test/performance/odp_timer_perf.c
index a7d98e68f..279c5600e 100644
--- a/test/performance/odp_timer_perf.c
+++ b/test/performance/odp_timer_perf.c
@@ -16,7 +16,8 @@
#include <odp/helper/odph_api.h>
#define MODE_SCHED_OVERH 0
-#define MODE_SET_CANCEL 1
+#define MODE_START_CANCEL 1
+#define MODE_START_EXPIRE 2
#define MAX_TIMER_POOLS 32
#define MAX_TIMERS 10000
#define START_NS (100 * ODP_TIME_MSEC_IN_NS)
@@ -79,6 +80,7 @@ typedef struct thread_arg_t {
typedef struct timer_ctx_t {
uint64_t target_ns;
+ uint64_t target_tick;
uint32_t tp_idx;
uint32_t timer_idx;
int last;
@@ -131,6 +133,7 @@ static void print_usage(void)
" -m, --mode Select test mode. Default: 0\n"
" 0: Measure odp_schedule() overhead when using timers\n"
" 1: Measure timer set + cancel performance\n"
+ " 2: Measure odp_schedule() overhead while continuously restarting expiring timers\n"
" -R, --rounds Number of test rounds in timer set + cancel test.\n"
" Default: 100000\n"
" -h, --help This help\n"
@@ -280,6 +283,16 @@ static int create_timer_pools(test_global_t *global)
max_tmo_ns = START_NS + (num_timer * period_ns);
min_tmo_ns = START_NS / 2;
+ if (test_options->mode == MODE_START_EXPIRE) {
+ /*
+ * Timers are set to 1-2 periods from current time. Add an
+ * arbitrary margin of one period, resulting in maximum of
+ * three periods.
+ */
+ max_tmo_ns = period_ns * 3;
+ min_tmo_ns = test_options->res_ns / 2;
+ }
+
priv = 0;
if (test_options->shared == 0)
priv = 1;
@@ -463,6 +476,14 @@ static int set_timers(test_global_t *global)
start_param.tick = tick_cur + tick_ns;
start_param.tmo_ev = ev;
+ if (test_options->mode == MODE_START_EXPIRE) {
+ uint64_t offset_ns = period_ns + j * period_ns / num_timer;
+
+ ctx->target_ns = time_ns + offset_ns;
+ ctx->target_tick = tick_cur + odp_timer_ns_to_tick(tp, offset_ns);
+ start_param.tick = ctx->target_tick;
+ }
+
status = odp_timer_start(timer, &start_param);
if (status != ODP_TIMER_SUCCESS) {
ODPH_ERR("Timer set %i/%i (ret %i)\n", i, j, status);
@@ -805,6 +826,128 @@ static int set_cancel_mode_worker(void *arg)
return ret;
}
+static int set_expire_mode_worker(void *arg)
+{
+ int status, thr;
+ uint32_t i, j, exit_test;
+ odp_event_t ev;
+ odp_timeout_t tmo;
+ uint64_t c2, diff, nsec, time_ns, target_ns, period_tick;
+ odp_timer_t timer;
+ odp_timer_start_t start_param;
+ odp_time_t t1, t2;
+ time_stat_t before, after;
+ timer_ctx_t *ctx;
+ thread_arg_t *thread_arg = arg;
+ test_global_t *global = thread_arg->global;
+ test_options_t *opt = &global->test_options;
+ uint32_t num_tp = opt->num_tp;
+ uint64_t cycles = 0;
+ uint64_t events = 0;
+ uint64_t rounds = 0;
+ uint64_t c1 = 0;
+ int meas = 1;
+ int ret = 0;
+
+ memset(&before, 0, sizeof(time_stat_t));
+ memset(&after, 0, sizeof(time_stat_t));
+
+ thr = odp_thread_id();
+
+ /* Start all workers at the same time */
+ odp_barrier_wait(&global->barrier);
+
+ t1 = odp_time_local();
+
+ while (events < opt->test_rounds * opt->num_timer / opt->num_cpu) {
+ if (meas) {
+ c1 = odp_cpu_cycles();
+ meas = 0;
+ }
+
+ ev = odp_schedule(NULL, ODP_SCHED_NO_WAIT);
+ rounds++;
+
+ exit_test = odp_atomic_load_u32(&global->exit_test);
+ if (odp_likely(ev == ODP_EVENT_INVALID && exit_test < num_tp))
+ continue;
+
+ c2 = odp_cpu_cycles();
+ diff = odp_cpu_cycles_diff(c2, c1);
+ cycles += diff;
+
+ if (ev == ODP_EVENT_INVALID && exit_test >= num_tp)
+ break;
+
+ events++;
+ meas = 1;
+ tmo = odp_timeout_from_event(ev);
+ ctx = odp_timeout_user_ptr(tmo);
+ i = ctx->tp_idx;
+ j = ctx->timer_idx;
+ timer = global->timer[i][j];
+ period_tick = global->timer_pool[i].period_tick;
+ time_ns = odp_time_global_ns();
+ target_ns = ctx->target_ns;
+
+ if (time_ns < target_ns) {
+ diff = target_ns - time_ns;
+ before.num++;
+ before.sum_ns += diff;
+ if (diff > before.max_ns)
+ before.max_ns = diff;
+
+ ODPH_DBG("before %" PRIu64 "\n", diff);
+ } else {
+ diff = time_ns - target_ns;
+ after.num++;
+ after.sum_ns += diff;
+ if (diff > after.max_ns)
+ after.max_ns = diff;
+
+ ODPH_DBG("after %" PRIu64 "\n", diff);
+ }
+
+ /* Start the timer again */
+ start_param.tick_type = ODP_TIMER_TICK_ABS;
+ ctx->target_ns += opt->period_ns;
+ ctx->target_tick += period_tick;
+ start_param.tick = ctx->target_tick;
+ start_param.tmo_ev = ev;
+ status = odp_timer_start(timer, &start_param);
+
+ if (status != ODP_TIMER_SUCCESS) {
+ ODPH_ERR("Timer set (tmo) failed (ret %i)\n", status);
+ ret = -1;
+ break;
+ }
+ }
+
+ t2 = odp_time_local();
+ nsec = odp_time_diff_ns(t2, t1);
+
+ /* Cancel all timers that belong to this thread */
+ cancel_timers(global, thread_arg->worker_idx);
+
+ /* Free already scheduled events */
+ while (1) {
+ ev = odp_schedule(NULL, ODP_SCHED_NO_WAIT);
+ if (ev == ODP_EVENT_INVALID)
+ break;
+ odp_event_free(ev);
+ }
+
+ /* Update stats*/
+ global->stat[thr].events = events;
+ global->stat[thr].cycles = cycles;
+ global->stat[thr].rounds = rounds;
+ global->stat[thr].nsec = nsec;
+ global->stat[thr].before = before;
+ global->stat[thr].after = after;
+
+ return ret;
+}
+
static int start_workers(test_global_t *global, odp_instance_t instance)
{
odph_thread_common_param_t thr_common;
@@ -824,8 +967,10 @@ static int start_workers(test_global_t *global, odp_instance_t instance)
if (test_options->mode == MODE_SCHED_OVERH)
thr_param[i].start = sched_mode_worker;
- else
+ else if (test_options->mode == MODE_START_CANCEL)
thr_param[i].start = set_cancel_mode_worker;
+ else
+ thr_param[i].start = set_expire_mode_worker;
thr_param[i].arg = &global->thread_arg[i];
thr_param[i].thr_type = ODP_THREAD_WORKER;
@@ -1076,11 +1221,16 @@ int main(int argc, char **argv)
ODPH_ERR("Sched_mode_worker failed\n");
return -1;
}
- } else {
+ } else if (mode == MODE_START_CANCEL) {
if (set_cancel_mode_worker(&global->thread_arg[0])) {
ODPH_ERR("Set_cancel_mode_worker failed\n");
return -1;
}
+ } else {
+ if (set_expire_mode_worker(&global->thread_arg[0])) {
+ ODPH_ERR("Set_expire_mode_worker failed\n");
+ return -1;
+ }
}
} else {
/* Wait workers to exit */
@@ -1090,7 +1240,7 @@ int main(int argc, char **argv)
sum_stat(global);
- if (mode == MODE_SCHED_OVERH)
+ if (mode == MODE_SCHED_OVERH || mode == MODE_START_EXPIRE)
print_stat_sched_mode(global);
else
print_stat_set_cancel_mode(global);
diff --git a/test/performance/odp_timer_perf_run.sh b/test/performance/odp_timer_perf_run.sh
index 4f1cd6977..7738ca91b 100755
--- a/test/performance/odp_timer_perf_run.sh
+++ b/test/performance/odp_timer_perf_run.sh
@@ -11,7 +11,7 @@ TEST_DIR="${TEST_DIR:-$(dirname $0)}"
echo odp_timer_perf: odp_schedule overhead mode
echo ===============================================
-$TEST_DIR/odp_timer_perf${EXEEXT} -m 0 -c 1 -s 0
+$TEST_DIR/odp_timer_perf${EXEEXT} -m 0 -c 1
RET_VAL=$?
if [ $RET_VAL -ne 0 ]; then
@@ -22,7 +22,7 @@ fi
echo odp_timer_perf: timer set + cancel mode
echo ===============================================
-$TEST_DIR/odp_timer_perf${EXEEXT} -m 1 -c 1 -t 10 -R 50 -s 0
+$TEST_DIR/odp_timer_perf${EXEEXT} -m 1 -c 1 -t 10 -R 50
RET_VAL=$?
if [ $RET_VAL -ne 0 ]; then
diff --git a/test/validation/api/atomic/atomic.c b/test/validation/api/atomic/atomic.c
index 17d9dc82a..76e3c0d49 100644
--- a/test/validation/api/atomic/atomic.c
+++ b/test/validation/api/atomic/atomic.c
@@ -25,9 +25,6 @@
#define UNUSED __attribute__((__unused__))
-#define min(a, b) (a < b ? a : b)
-#define max(a, b) (a > b ? a : b)
-
typedef __volatile uint32_t volatile_u32_t;
typedef __volatile uint64_t volatile_u64_t;
@@ -929,7 +926,7 @@ static void test_atomic_validate_max_min(void)
* a long test, counter may overflow, in which case max is saturated at
* UINT32_MAX, and min at 0.
*/
- const uint32_t a32u_max = min(U32_INIT_VAL + total_count - 1, UINT32_MAX);
+ const uint32_t a32u_max = ODPH_MIN(U32_INIT_VAL + total_count - 1, UINT32_MAX);
const uint32_t a32u_min = U32_INIT_VAL + total_count - 1 > UINT32_MAX ? 0 : U32_INIT_VAL;
CU_ASSERT(odp_atomic_load_u32(&global_mem->a32u_max) == a32u_max);
@@ -1546,7 +1543,7 @@ static void test_atomic_validate_max(void)
{
const uint64_t total_count = CNT * global_mem->g_num_threads - 1;
/* In a long test, counter may overflow, in which case max is saturated at UINT32_MAX. */
- const uint32_t a32u_max = min(U32_INIT_VAL + total_count, UINT32_MAX);
+ const uint32_t a32u_max = ODPH_MIN(U32_INIT_VAL + total_count, UINT32_MAX);
CU_ASSERT(a32u_max == odp_atomic_load_u32(&global_mem->a32u_max));
CU_ASSERT(U64_INIT_VAL + total_count == odp_atomic_load_u64(&global_mem->a64u_max));
@@ -1561,7 +1558,7 @@ static void test_atomic_validate_min(void)
{
const uint64_t total_count = CNT * global_mem->g_num_threads - 1;
/* In a long test, counter may underflow, in which case min is saturated at 0. */
- const uint32_t a32u_min = max((int64_t)U32_INIT_VAL - (int64_t)total_count, 0);
+ const uint32_t a32u_min = ODPH_MAX((int64_t)U32_INIT_VAL - (int64_t)total_count, 0);
CU_ASSERT(a32u_min == odp_atomic_load_u32(&global_mem->a32u_min));
CU_ASSERT(U64_INIT_VAL - total_count == odp_atomic_load_u64(&global_mem->a64u_min));
diff --git a/test/validation/api/buffer/buffer.c b/test/validation/api/buffer/buffer.c
index 1d0cc9d01..909608ed8 100644
--- a/test/validation/api/buffer/buffer.c
+++ b/test/validation/api/buffer/buffer.c
@@ -537,7 +537,7 @@ static void buffer_test_user_area(void)
for (i = 0; i < num; i++) {
odp_event_t ev;
- int flag;
+ int flag = 0;
buffer[i] = odp_buffer_alloc(pool);
diff --git a/test/validation/api/classification/odp_classification_basic.c b/test/validation/api/classification/odp_classification_basic.c
index 2969dedab..2eb5c86b1 100644
--- a/test/validation/api/classification/odp_classification_basic.c
+++ b/test/validation/api/classification/odp_classification_basic.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2015-2018, Linaro Limited
- * Copyright (c) 2021-2022, Nokia
+ * Copyright (c) 2021-2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -11,6 +11,9 @@
#define PMR_SET_NUM 5
+/* Limit handle array allocation from stack to about 256kB */
+#define MAX_HANDLES (32 * 1024)
+
static void test_defaults(uint8_t fill)
{
odp_cls_cos_param_t cos_param;
@@ -31,13 +34,13 @@ static void test_defaults(uint8_t fill)
CU_ASSERT_EQUAL(pmr_param.range_term, false);
}
-static void classification_test_default_values(void)
+static void cls_default_values(void)
{
test_defaults(0);
test_defaults(0xff);
}
-static void classification_test_create_cos(void)
+static void cls_create_cos(void)
{
odp_cos_t cos;
odp_cls_cos_param_t cls_param;
@@ -64,15 +67,17 @@ static void classification_test_create_cos(void)
odp_queue_destroy(queue);
}
-static void classification_test_create_cos_max_common(odp_bool_t stats)
+static void cls_create_cos_max_common(odp_bool_t stats)
{
- uint32_t i;
+ uint32_t i, num;
odp_cls_cos_param_t cls_param;
odp_cls_capability_t capa;
CU_ASSERT_FATAL(odp_cls_capability(&capa) == 0);
- uint32_t num = capa.max_cos;
+ num = capa.max_cos;
+ if (num > MAX_HANDLES)
+ num = MAX_HANDLES;
if (stats && capa.max_cos_stats < num)
num = capa.max_cos_stats;
@@ -97,17 +102,89 @@ static void classification_test_create_cos_max_common(odp_bool_t stats)
CU_ASSERT(!odp_cos_destroy(cos[j]));
}
-static void classification_test_create_cos_max(void)
+static int cos_create_multi(const char *name[], const odp_cls_cos_param_t param[], odp_cos_t cos[],
+ uint32_t num)
+{
+ const uint32_t max_retries = 100;
+ uint32_t num_created = 0;
+ uint32_t num_retries = 0;
+
+ do {
+ const char **cur_name = (name != NULL) ? &name[num_created] : NULL;
+ int ret = odp_cls_cos_create_multi(cur_name, &param[num_created],
+ &cos[num_created], num - num_created);
+ if (ret < 0) {
+ CU_FAIL("CoS create multi failed");
+ break;
+ }
+ num_retries = (ret == 0) ? num_retries + 1 : 0;
+ num_created += ret;
+ } while (num_created < num && num_retries < max_retries);
+
+ return num_created;
+}
+
+static void cos_destroy_multi(odp_cos_t cos[], uint32_t num)
+{
+ uint32_t num_left = num;
+ uint32_t num_freed = 0;
+
+ while (num_left) {
+ int ret = odp_cos_destroy_multi(&cos[num_freed], num_left);
+
+ CU_ASSERT_FATAL(ret > 0 && (uint32_t)ret <= num_left);
+
+ num_left -= ret;
+ num_freed += ret;
+ }
+ CU_ASSERT_FATAL(num_freed == num);
+}
+
+static void cls_create_cos_multi(void)
+{
+ odp_cls_cos_param_t param_single;
+ odp_cls_cos_param_t param[MAX_HANDLES];
+ odp_cls_capability_t capa;
+ odp_cos_t cos[MAX_HANDLES];
+ const char *name[MAX_HANDLES] = {NULL, "aaa", NULL, "bbb", "ccc", NULL, "ddd"};
+ uint32_t num, num_created;
+
+ CU_ASSERT_FATAL(odp_cls_capability(&capa) == 0);
+ CU_ASSERT_FATAL(capa.max_cos);
+
+ num = capa.max_cos < MAX_HANDLES ? capa.max_cos : MAX_HANDLES;
+
+ for (uint32_t i = 0; i < num; i++) {
+ odp_cls_cos_param_init(&param[i]);
+ param[i].action = ODP_COS_ACTION_DROP;
+ }
+ odp_cls_cos_param_init(&param_single);
+ param_single.action = ODP_COS_ACTION_DROP;
+
+ num_created = cos_create_multi(NULL, &param_single, cos, 1);
+ CU_ASSERT(num_created == 1)
+ cos_destroy_multi(cos, num_created);
+
+ num_created = cos_create_multi(name, param, cos, num);
+ CU_ASSERT(num_created == num)
+ cos_destroy_multi(cos, num_created);
+
+ num_created = cos_create_multi(NULL, param, cos, num);
+ CU_ASSERT(num_created == num)
+ cos_destroy_multi(cos, num_created);
+}
+
+static void cls_create_cos_max(void)
{
- classification_test_create_cos_max_common(false);
+ cls_create_cos_max_common(false);
}
-static void classification_test_create_cos_max_stats(void)
+static void cls_create_cos_max_stats(void)
{
- classification_test_create_cos_max_common(true);
+ cls_create_cos_max_common(true);
}
-static void classification_test_destroy_cos(void)
+static void cls_destroy_cos(void)
{
odp_cos_t cos;
char name[ODP_COS_NAME_LEN];
@@ -141,7 +218,7 @@ static void classification_test_destroy_cos(void)
odp_queue_destroy(queue);
}
-static void classification_test_create_pmr_match(void)
+static void cls_create_pmr_match(void)
{
odp_pmr_t pmr;
uint16_t val;
@@ -214,7 +291,255 @@ static void classification_test_create_pmr_match(void)
odp_pktio_close(pktio);
}
-static void classification_test_cos_set_queue(void)
+/* Create maximum number of PMRs into the default CoS */
+static void cls_max_pmr_from_default_action(int drop)
+{
+ odp_cls_cos_param_t cos_param;
+ odp_queue_param_t queue_param;
+ odp_cls_capability_t capa;
+ odp_schedule_capability_t sched_capa;
+ odp_pmr_param_t pmr_param;
+ odp_pool_t pool;
+ odp_pktio_t pktio;
+ odp_cos_t default_cos;
+ uint32_t i, num_cos, num_pmr;
+ int ret;
+ uint32_t cos_created = 0;
+ uint32_t queue_created = 0;
+ uint32_t pmr_created = 0;
+ uint16_t val = 1024;
+ uint16_t mask = 0xffff;
+
+ CU_ASSERT_FATAL(odp_cls_capability(&capa) == 0);
+
+ CU_ASSERT_FATAL(odp_schedule_capability(&sched_capa) == 0);
+
+ pool = pool_create("pkt_pool");
+ CU_ASSERT_FATAL(pool != ODP_POOL_INVALID);
+
+ pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pool, true);
+ CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID);
+
+ num_cos = capa.max_cos;
+
+ if (num_cos > sched_capa.max_queues)
+ num_cos = sched_capa.max_queues;
+
+ if (num_cos > MAX_HANDLES)
+ num_cos = MAX_HANDLES;
+
+ CU_ASSERT_FATAL(num_cos > 1);
+
+ num_pmr = num_cos - 1;
+
+ odp_cos_t cos[num_cos];
+ odp_queue_t queue[num_cos];
+ odp_pmr_t pmr[num_pmr];
+
+ odp_queue_param_init(&queue_param);
+ queue_param.type = ODP_QUEUE_TYPE_SCHED;
+
+ odp_cls_cos_param_init(&cos_param);
+ if (drop)
+ cos_param.action = ODP_COS_ACTION_DROP;
+
+ for (i = 0; i < num_cos; i++) {
+ if (!drop) {
+ queue[i] = odp_queue_create(NULL, &queue_param);
+
+ if (queue[i] == ODP_QUEUE_INVALID) {
+ ODPH_ERR("odp_queue_create() failed %u / %u\n", i + 1, num_cos);
+ break;
+ }
+
+ cos_param.queue = queue[i];
+ queue_created++;
+ }
+
+ cos[i] = odp_cls_cos_create(NULL, &cos_param);
+
+ if (cos[i] == ODP_COS_INVALID) {
+ ODPH_ERR("odp_cls_cos_create() failed %u / %u\n", i + 1, num_cos);
+ break;
+ }
+
+ cos_created++;
+ }
+
+ if (!drop)
+ CU_ASSERT(queue_created == num_cos);
+
+ CU_ASSERT(cos_created == num_cos);
+
+ if (cos_created != num_cos)
+ goto destroy_cos;
+
+ default_cos = cos[0];
+
+ ret = odp_pktio_default_cos_set(pktio, default_cos);
+ CU_ASSERT_FATAL(ret == 0);
+
+ odp_cls_pmr_param_init(&pmr_param);
+ pmr_param.term = find_first_supported_l3_pmr();
+ pmr_param.match.value = &val;
+ pmr_param.match.mask = &mask;
+ pmr_param.val_sz = sizeof(val);
+
+ for (i = 0; i < num_pmr; i++) {
+ pmr[i] = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos[i + 1]);
+
+ if (pmr[i] == ODP_PMR_INVALID)
+ break;
+
+ val++;
+ pmr_created++;
+ }
+
+ printf("\n Number of CoS created: %u\n Number of PMR created: %u\n", cos_created,
+ pmr_created);
+
+ for (i = 0; i < pmr_created; i++)
+ CU_ASSERT(odp_cls_pmr_destroy(pmr[i]) == 0);
+
+ ret = odp_pktio_default_cos_set(pktio, ODP_COS_INVALID);
+ CU_ASSERT_FATAL(ret == 0);
+
+destroy_cos:
+ for (i = 0; i < cos_created; i++)
+ CU_ASSERT(odp_cos_destroy(cos[i]) == 0);
+
+ for (i = 0; i < queue_created; i++)
+ CU_ASSERT(odp_queue_destroy(queue[i]) == 0);
+
+ CU_ASSERT(odp_pktio_close(pktio) == 0);
+ CU_ASSERT(odp_pool_destroy(pool) == 0);
+}
+
+static void cls_max_pmr_from_default_drop(void)
+{
+ cls_max_pmr_from_default_action(1);
+}
+
+static void cls_max_pmr_from_default_enqueue(void)
+{
+ cls_max_pmr_from_default_action(0);
+}
+
+static void cls_create_pmr_multi(void)
+{
+ odp_cls_cos_param_t cos_param;
+ odp_cls_capability_t capa;
+ odp_pool_t pool;
+ odp_pktio_t pktio;
+ uint32_t i, num_cos, num_pmr, num_left;
+ int ret;
+ const uint32_t max_retries = 100;
+ uint32_t num_retries = 0;
+ uint32_t num_freed = 0;
+ uint32_t cos_created = 0;
+ uint32_t pmr_created = 0;
+ uint16_t mask = 0xffff;
+
+ CU_ASSERT_FATAL(odp_cls_capability(&capa) == 0);
+
+ pool = pool_create("pkt_pool");
+ CU_ASSERT_FATAL(pool != ODP_POOL_INVALID);
+
+ pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pool, true);
+ CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID);
+
+ num_cos = capa.max_cos;
+ if (num_cos > MAX_HANDLES)
+ num_cos = MAX_HANDLES;
+
+ CU_ASSERT_FATAL(num_cos > 1);
+
+ num_pmr = num_cos - 1;
+
+ odp_cos_t src_cos[num_cos];
+ odp_cos_t cos[num_cos];
+ odp_pmr_t pmr[num_pmr];
+ odp_pmr_create_opt_t pmr_opt[num_pmr];
+ odp_pmr_param_t pmr_param[num_pmr];
+ uint16_t val[num_pmr];
+
+ odp_cls_cos_param_init(&cos_param);
+ cos_param.action = ODP_COS_ACTION_DROP;
+
+ for (i = 0; i < num_cos; i++) {
+ cos[i] = odp_cls_cos_create(NULL, &cos_param);
+
+ if (cos[i] == ODP_COS_INVALID) {
+ ODPH_ERR("odp_cls_cos_create() failed %u / %u\n", i + 1, num_cos);
+ break;
+ }
+ /* Same source CoS used for all PMRs */
+ src_cos[i] = cos[0];
+
+ cos_created++;
+ }
+
+ CU_ASSERT(cos_created == num_cos);
+
+ if (cos_created != num_cos)
+ goto destroy_cos;
+
+ ret = odp_pktio_default_cos_set(pktio, cos[0]);
+ CU_ASSERT_FATAL(ret == 0);
+
+ for (i = 0; i < num_pmr; i++) {
+ val[i] = 1024 + i;
+
+ odp_cls_pmr_param_init(&pmr_param[i]);
+ pmr_param[i].term = find_first_supported_l3_pmr();
+ pmr_param[i].match.value = &val[i];
+ pmr_param[i].match.mask = &mask;
+ pmr_param[i].val_sz = sizeof(val[i]);
+
+ odp_cls_pmr_create_opt_init(&pmr_opt[i]);
+ pmr_opt[i].terms = &pmr_param[i];
+ pmr_opt[i].num_terms = 1;
+ }
+
+ do {
+ ret = odp_cls_pmr_create_multi(&pmr_opt[pmr_created],
+ &src_cos[pmr_created],
+ &cos[pmr_created + 1],
+ &pmr[pmr_created],
+ num_pmr - pmr_created);
+ CU_ASSERT_FATAL(ret <= (int)(num_pmr - pmr_created));
+
+ if (ret < 0)
+ break;
+
+ num_retries = (ret == 0) ? num_retries + 1 : 0;
+ pmr_created += ret;
+ } while (pmr_created < num_pmr && num_retries < max_retries);
+
+ CU_ASSERT(pmr_created > 0);
+
+ num_left = pmr_created;
+ while (num_left) {
+ ret = odp_cls_pmr_destroy_multi(&pmr[num_freed], num_left);
+
+ CU_ASSERT_FATAL(ret > 0 && (uint32_t)ret <= num_left);
+
+ num_left -= ret;
+ num_freed += ret;
+ }
+
+ ret = odp_pktio_default_cos_set(pktio, ODP_COS_INVALID);
+ CU_ASSERT_FATAL(ret == 0);
+
+destroy_cos:
+ for (i = 0; i < cos_created; i++)
+ CU_ASSERT(odp_cos_destroy(cos[i]) == 0);
+
+ CU_ASSERT(odp_pktio_close(pktio) == 0);
+ CU_ASSERT(odp_pool_destroy(pool) == 0);
+}
+
+static void cls_cos_set_queue(void)
{
int retval;
char cosname[ODP_COS_NAME_LEN];
@@ -259,7 +584,7 @@ static void classification_test_cos_set_queue(void)
odp_pool_destroy(pool);
}
-static void classification_test_cos_set_pool(void)
+static void cls_cos_set_pool(void)
{
int retval;
char cosname[ODP_COS_NAME_LEN];
@@ -302,7 +627,7 @@ static void classification_test_cos_set_pool(void)
#if ODP_DEPRECATED_API
-static void classification_test_cos_set_drop(void)
+static void cls_cos_set_drop(void)
{
int retval;
char cosname[ODP_COS_NAME_LEN];
@@ -339,7 +664,7 @@ static void classification_test_cos_set_drop(void)
#endif
-static void classification_test_pmr_composite_create(void)
+static void cls_pmr_composite_create(void)
{
odp_pmr_t pmr_composite;
int retval;
@@ -413,7 +738,7 @@ static void classification_test_pmr_composite_create(void)
odp_pktio_close(pktio);
}
-static void classification_test_create_cos_with_hash_queues(void)
+static void cls_create_cos_with_hash_queues(void)
{
odp_pool_t pool;
odp_cls_capability_t capa;
@@ -457,19 +782,22 @@ static int check_capa_cos_hashing(void)
}
odp_testinfo_t classification_suite_basic[] = {
- ODP_TEST_INFO(classification_test_default_values),
- ODP_TEST_INFO(classification_test_create_cos),
- ODP_TEST_INFO(classification_test_create_cos_max),
- ODP_TEST_INFO(classification_test_create_cos_max_stats),
- ODP_TEST_INFO(classification_test_destroy_cos),
- ODP_TEST_INFO(classification_test_create_pmr_match),
- ODP_TEST_INFO(classification_test_cos_set_queue),
+ ODP_TEST_INFO(cls_default_values),
+ ODP_TEST_INFO(cls_create_cos),
+ ODP_TEST_INFO(cls_create_cos_multi),
+ ODP_TEST_INFO(cls_create_cos_max),
+ ODP_TEST_INFO(cls_create_cos_max_stats),
+ ODP_TEST_INFO(cls_destroy_cos),
+ ODP_TEST_INFO(cls_create_pmr_match),
+ ODP_TEST_INFO(cls_create_pmr_multi),
+ ODP_TEST_INFO(cls_max_pmr_from_default_drop),
+ ODP_TEST_INFO(cls_max_pmr_from_default_enqueue),
+ ODP_TEST_INFO(cls_cos_set_queue),
#if ODP_DEPRECATED_API
- ODP_TEST_INFO(classification_test_cos_set_drop),
+ ODP_TEST_INFO(cls_cos_set_drop),
#endif
- ODP_TEST_INFO(classification_test_cos_set_pool),
- ODP_TEST_INFO(classification_test_pmr_composite_create),
- ODP_TEST_INFO_CONDITIONAL(classification_test_create_cos_with_hash_queues,
- check_capa_cos_hashing),
+ ODP_TEST_INFO(cls_cos_set_pool),
+ ODP_TEST_INFO(cls_pmr_composite_create),
+ ODP_TEST_INFO_CONDITIONAL(cls_create_cos_with_hash_queues, check_capa_cos_hashing),
ODP_TEST_INFO_NULL,
};
diff --git a/test/validation/api/classification/odp_classification_common.c b/test/validation/api/classification/odp_classification_common.c
index fe7677044..1fb4c51b5 100644
--- a/test/validation/api/classification/odp_classification_common.c
+++ b/test/validation/api/classification/odp_classification_common.c
@@ -113,7 +113,7 @@ static uint32_t seqno_offset(odp_packet_t pkt)
CU_ASSERT_FATAL(rc == 0);
len = sizeof(ip) + odp_be_to_cpu_16(ip.payload_len);
} else {
- CU_FAIL_FATAL("Unexcpected packet type");
+ CU_FAIL_FATAL("Unexpected packet type");
}
return l3_offset + len - sizeof(cls_test_packet_t);
@@ -360,7 +360,7 @@ odp_packet_t create_packet(cls_packet_info_t pkt_info)
break;
case CLS_PKT_L4_IGMP:
next_hdr = ODPH_IPPROTO_IGMP;
- l4_hdr_len = ODP_IGMP_HLEN;
+ l4_hdr_len = ODPH_IGMP_HLEN;
break;
case CLS_PKT_L4_AH:
next_hdr = ODPH_IPPROTO_AH;
@@ -465,7 +465,7 @@ odp_packet_t create_packet(cls_packet_info_t pkt_info)
igmp->code = 0;
igmp->csum = 0;
} else if (pkt_info.l4_type == CLS_PKT_L4_ICMP) {
- icmp->type = ICMP_ECHO;
+ icmp->type = ODPH_ICMP_ECHO;
icmp->code = 0;
icmp->un.echo.id = 0;
icmp->un.echo.sequence = 0;
diff --git a/test/validation/api/classification/odp_classification_test_pmr.c b/test/validation/api/classification/odp_classification_test_pmr.c
index bf067719b..b88f7beca 100644
--- a/test/validation/api/classification/odp_classification_test_pmr.c
+++ b/test/validation/api/classification/odp_classification_test_pmr.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2015-2018, Linaro Limited
- * Copyright (c) 2019, Nokia
+ * Copyright (c) 2019-2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -107,7 +107,7 @@ int classification_suite_pmr_term(void)
return ret;
}
-static void classification_test_pktin_classifier_flag(void)
+static void cls_pktin_classifier_flag(void)
{
odp_packet_t pkt;
odph_tcphdr_t *tcp;
@@ -206,7 +206,7 @@ static void classification_test_pktin_classifier_flag(void)
odp_pktio_close(pktio);
}
-static void _classification_test_pmr_term_tcp_dport(int num_pkt)
+static void cls_pmr_term_tcp_dport_n(int num_pkt)
{
odp_packet_t pkt;
odph_tcphdr_t *tcp;
@@ -471,7 +471,7 @@ static void test_pmr(const odp_pmr_param_t *pmr_param, odp_packet_t pkt,
odp_pktio_close(pktio);
}
-static void classification_test_pmr_term_tcp_sport(void)
+static void cls_pmr_term_tcp_sport(void)
{
odp_packet_t pkt;
odph_tcphdr_t *tcp;
@@ -503,7 +503,7 @@ static void classification_test_pmr_term_tcp_sport(void)
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_term_udp_dport(void)
+static void cls_pmr_term_udp_dport(void)
{
odp_packet_t pkt;
odph_udphdr_t *udp;
@@ -538,7 +538,7 @@ static void classification_test_pmr_term_udp_dport(void)
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_term_udp_sport(void)
+static void cls_pmr_term_udp_sport(void)
{
odp_packet_t pkt;
odph_udphdr_t *udp;
@@ -573,7 +573,7 @@ static void classification_test_pmr_term_udp_sport(void)
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_term_proto(odp_bool_t ipv6)
+static void cls_pmr_term_proto_ip(odp_bool_t ipv6)
{
odp_packet_t pkt;
uint8_t val;
@@ -605,17 +605,17 @@ static void classification_test_pmr_term_proto(odp_bool_t ipv6)
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_term_ipv4_proto(void)
+static void cls_pmr_term_ipv4_proto(void)
{
- classification_test_pmr_term_proto(TEST_IPV4);
+ cls_pmr_term_proto_ip(TEST_IPV4);
}
-static void classification_test_pmr_term_ipv6_proto(void)
+static void cls_pmr_term_ipv6_proto(void)
{
- classification_test_pmr_term_proto(TEST_IPV6);
+ cls_pmr_term_proto_ip(TEST_IPV6);
}
-static void classification_test_pmr_term_dscp(odp_bool_t ipv6)
+static void cls_pmr_term_dscp_ip(odp_bool_t ipv6)
{
odp_packet_t pkt;
uint8_t val;
@@ -648,17 +648,17 @@ static void classification_test_pmr_term_dscp(odp_bool_t ipv6)
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_term_ipv4_dscp(void)
+static void cls_pmr_term_ipv4_dscp(void)
{
- classification_test_pmr_term_dscp(TEST_IPV4);
+ cls_pmr_term_dscp_ip(TEST_IPV4);
}
-static void classification_test_pmr_term_ipv6_dscp(void)
+static void cls_pmr_term_ipv6_dscp(void)
{
- classification_test_pmr_term_dscp(TEST_IPV6);
+ cls_pmr_term_dscp_ip(TEST_IPV6);
}
-static void classification_test_pmr_term_dmac(void)
+static void cls_pmr_term_dmac(void)
{
odp_packet_t pkt;
uint32_t seqno;
@@ -763,7 +763,7 @@ static void classification_test_pmr_term_dmac(void)
odp_pktio_close(pktio);
}
-static void classification_test_pmr_term_packet_len(void)
+static void cls_pmr_term_packet_len(void)
{
odp_packet_t pkt;
uint32_t val;
@@ -796,7 +796,7 @@ static void classification_test_pmr_term_packet_len(void)
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_term_vlan_id_0(void)
+static void cls_pmr_term_vlan_id_0(void)
{
odp_packet_t pkt;
uint16_t val;
@@ -831,7 +831,7 @@ static void classification_test_pmr_term_vlan_id_0(void)
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_term_vlan_id_x(void)
+static void cls_pmr_term_vlan_id_x(void)
{
odp_packet_t pkt;
uint16_t val;
@@ -879,7 +879,7 @@ static void classification_test_pmr_term_vlan_id_x(void)
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_term_vlan_pcp_0(void)
+static void cls_pmr_term_vlan_pcp_0(void)
{
odp_packet_t pkt;
uint8_t val;
@@ -917,7 +917,7 @@ static void classification_test_pmr_term_vlan_pcp_0(void)
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_term_eth_type_0(void)
+static void cls_pmr_term_eth_type_0(void)
{
odp_packet_t pkt;
uint16_t val;
@@ -947,7 +947,7 @@ static void classification_test_pmr_term_eth_type_0(void)
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_term_eth_type_x(void)
+static void cls_pmr_term_eth_type_x(void)
{
odp_packet_t pkt;
uint16_t val;
@@ -995,7 +995,7 @@ static void classification_test_pmr_term_eth_type_x(void)
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_pool_set(void)
+static void cls_pmr_pool_set(void)
{
odp_packet_t pkt;
uint32_t seqno;
@@ -1097,7 +1097,7 @@ static void classification_test_pmr_pool_set(void)
odp_pktio_close(pktio);
}
-static void classification_test_pmr_queue_set(void)
+static void cls_pmr_queue_set(void)
{
odp_packet_t pkt;
uint32_t seqno;
@@ -1244,17 +1244,17 @@ static void test_pmr_term_ipv4_addr(int dst)
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_term_ipv4_saddr(void)
+static void cls_pmr_term_ipv4_saddr(void)
{
test_pmr_term_ipv4_addr(0);
}
-static void classification_test_pmr_term_ipv4_daddr(void)
+static void cls_pmr_term_ipv4_daddr(void)
{
test_pmr_term_ipv4_addr(1);
}
-static void classification_test_pmr_term_ipv6daddr(void)
+static void cls_pmr_term_ipv6daddr(void)
{
odp_packet_t pkt;
odp_pmr_param_t pmr_param;
@@ -1290,7 +1290,7 @@ static void classification_test_pmr_term_ipv6daddr(void)
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_term_ipv6saddr(void)
+static void cls_pmr_term_ipv6saddr(void)
{
odp_packet_t pkt;
odp_pmr_param_t pmr_param;
@@ -1325,14 +1325,14 @@ static void classification_test_pmr_term_ipv6saddr(void)
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_term_tcp_dport(void)
+static void cls_pmr_term_tcp_dport(void)
{
- _classification_test_pmr_term_tcp_dport(2);
+ cls_pmr_term_tcp_dport_n(2);
}
-static void classification_test_pmr_term_tcp_dport_multi(void)
+static void cls_pmr_term_tcp_dport_multi(void)
{
- _classification_test_pmr_term_tcp_dport(SHM_PKT_NUM_BUFS / 4);
+ cls_pmr_term_tcp_dport_n(SHM_PKT_NUM_BUFS / 4);
}
static void test_pmr_term_custom(int custom_l3)
@@ -1631,7 +1631,7 @@ static void test_pmr_series(const int num_udp, int marking)
odp_pktio_close(pktio);
}
-static void classification_test_pmr_term_sctp(bool is_dport)
+static void cls_pmr_term_sctp_port(bool is_dport)
{
odp_packet_t pkt;
odph_sctphdr_t *sctp;
@@ -1680,17 +1680,17 @@ static void classification_test_pmr_term_sctp(bool is_dport)
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_term_sctp_sport(void)
+static void cls_pmr_term_sctp_sport(void)
{
- classification_test_pmr_term_sctp(0);
+ cls_pmr_term_sctp_port(0);
}
-static void classification_test_pmr_term_sctp_dport(void)
+static void cls_pmr_term_sctp_dport(void)
{
- classification_test_pmr_term_sctp(1);
+ cls_pmr_term_sctp_port(1);
}
-static void classification_test_pmr_term_icmp_type(void)
+static void cls_pmr_term_icmp_type(void)
{
odp_packet_t pkt;
odph_icmphdr_t *icmp;
@@ -1699,7 +1699,7 @@ static void classification_test_pmr_term_icmp_type(void)
odp_pmr_param_t pmr_param;
cls_packet_info_t pkt_info;
- val = ICMP_ECHO;
+ val = ODPH_ICMP_ECHO;
mask = 0xff;
odp_cls_pmr_param_init(&pmr_param);
@@ -1720,12 +1720,12 @@ static void classification_test_pmr_term_icmp_type(void)
pkt = create_packet(pkt_info);
CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID);
icmp = (odph_icmphdr_t *)odp_packet_l4_ptr(pkt, NULL);
- icmp->type = ICMP_ECHOREPLY;
+ icmp->type = ODPH_ICMP_ECHOREPLY;
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_term_icmp_code(void)
+static void cls_pmr_term_icmp_code(void)
{
odp_packet_t pkt;
odph_icmphdr_t *icmp;
@@ -1760,7 +1760,7 @@ static void classification_test_pmr_term_icmp_code(void)
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_term_icmp_id(void)
+static void cls_pmr_term_icmp_id(void)
{
odp_packet_t pkt;
odph_icmphdr_t *icmp;
@@ -1795,7 +1795,7 @@ static void classification_test_pmr_term_icmp_id(void)
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_term_gtpu_teid(void)
+static void cls_pmr_term_gtpu_teid(void)
{
odp_packet_t pkt;
odph_gtphdr_t *gtpu;
@@ -1857,7 +1857,7 @@ static void classification_test_pmr_term_gtpu_teid(void)
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_term_igmp_grpaddr(void)
+static void cls_pmr_term_igmp_grpaddr(void)
{
odp_packet_t pkt;
odph_igmphdr_t *igmp;
@@ -1893,27 +1893,27 @@ static void classification_test_pmr_term_igmp_grpaddr(void)
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_serial(void)
+static void cls_pmr_serial(void)
{
test_pmr_series(1, 0);
}
-static void classification_test_pmr_parallel(void)
+static void cls_pmr_parallel(void)
{
test_pmr_series(MAX_NUM_UDP, 0);
}
-static void classification_test_pmr_marking(void)
+static void cls_pmr_marking(void)
{
test_pmr_series(MAX_NUM_UDP, 1);
}
-static void classification_test_pmr_term_custom_frame(void)
+static void cls_pmr_term_custom_frame(void)
{
test_pmr_term_custom(0);
}
-static void classification_test_pmr_term_custom_l3(void)
+static void cls_pmr_term_custom_l3(void)
{
test_pmr_term_custom(1);
}
@@ -1954,7 +1954,7 @@ static void test_pmr_term_ipsec_spi_ah(odp_bool_t is_ipv6)
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_term_ipsec_spi_ah_ipv4(void)
+static void cls_pmr_term_ipsec_spi_ah_ipv4(void)
{
test_pmr_term_ipsec_spi_ah(TEST_IPV4);
}
@@ -1995,17 +1995,17 @@ static void test_pmr_term_ipsec_spi_esp(odp_bool_t is_ipv6)
test_pmr(&pmr_param, pkt, NO_MATCH);
}
-static void classification_test_pmr_term_ipsec_spi_esp_ipv4(void)
+static void cls_pmr_term_ipsec_spi_esp_ipv4(void)
{
test_pmr_term_ipsec_spi_esp(TEST_IPV4);
}
-static void classification_test_pmr_term_ipsec_spi_ah_ipv6(void)
+static void cls_pmr_term_ipsec_spi_ah_ipv6(void)
{
test_pmr_term_ipsec_spi_ah(TEST_IPV6);
}
-static void classification_test_pmr_term_ipsec_spi_esp_ipv6(void)
+static void cls_pmr_term_ipsec_spi_esp_ipv6(void)
{
test_pmr_term_ipsec_spi_esp(TEST_IPV6);
}
@@ -2170,81 +2170,44 @@ static int check_capa_igmp_grpaddr(void)
}
odp_testinfo_t classification_suite_pmr[] = {
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_tcp_dport,
- check_capa_tcp_dport),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_tcp_sport,
- check_capa_tcp_sport),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_udp_dport,
- check_capa_udp_dport),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_udp_sport,
- check_capa_udp_sport),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_gtpu_teid,
- check_capa_gtpu_teid),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_igmp_grpaddr,
- check_capa_igmp_grpaddr),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_sctp_sport,
- check_capa_sctp_sport),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_sctp_dport,
- check_capa_sctp_dport),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_icmp_type,
- check_capa_icmp_type),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_icmp_code,
- check_capa_icmp_code),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_icmp_id,
- check_capa_icmp_id),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipv4_proto,
- check_capa_ip_proto),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipv6_proto,
- check_capa_ip_proto),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipv4_dscp,
- check_capa_ip_dscp),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipv6_dscp,
- check_capa_ip_dscp),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_dmac,
- check_capa_dmac),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_pool_set,
- check_capa_ip_proto),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_queue_set,
- check_capa_ip_proto),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipv4_saddr,
- check_capa_ipv4_saddr),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipv4_daddr,
- check_capa_ipv4_daddr),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipv6saddr,
- check_capa_ipv6_saddr),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipv6daddr,
- check_capa_ipv6_daddr),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_packet_len,
- check_capa_packet_len),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_vlan_id_0,
- check_capa_vlan_id_0),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_vlan_id_x,
- check_capa_vlan_id_x),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_vlan_pcp_0,
- check_capa_vlan_pcp_0),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_eth_type_0,
- check_capa_ethtype_0),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_eth_type_x,
- check_capa_ethtype_x),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_custom_frame,
- check_capa_custom_frame),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_custom_l3,
- check_capa_custom_l3),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipsec_spi_ah_ipv4,
- check_capa_ipsec_spi),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipsec_spi_esp_ipv4,
- check_capa_ipsec_spi),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipsec_spi_ah_ipv6,
- check_capa_ipsec_spi),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipsec_spi_esp_ipv6,
- check_capa_ipsec_spi),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_serial,
- check_capa_pmr_series),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_parallel,
- check_capa_pmr_series),
- ODP_TEST_INFO(classification_test_pktin_classifier_flag),
- ODP_TEST_INFO(classification_test_pmr_term_tcp_dport_multi),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_marking,
- check_capa_pmr_marking),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_tcp_dport, check_capa_tcp_dport),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_tcp_sport, check_capa_tcp_sport),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_udp_dport, check_capa_udp_dport),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_udp_sport, check_capa_udp_sport),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_gtpu_teid, check_capa_gtpu_teid),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_igmp_grpaddr, check_capa_igmp_grpaddr),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_sctp_sport, check_capa_sctp_sport),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_sctp_dport, check_capa_sctp_dport),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_icmp_type, check_capa_icmp_type),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_icmp_code, check_capa_icmp_code),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_icmp_id, check_capa_icmp_id),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipv4_proto, check_capa_ip_proto),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipv6_proto, check_capa_ip_proto),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipv4_dscp, check_capa_ip_dscp),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipv6_dscp, check_capa_ip_dscp),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_dmac, check_capa_dmac),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_pool_set, check_capa_ip_proto),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_queue_set, check_capa_ip_proto),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipv4_saddr, check_capa_ipv4_saddr),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipv4_daddr, check_capa_ipv4_daddr),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipv6saddr, check_capa_ipv6_saddr),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipv6daddr, check_capa_ipv6_daddr),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_packet_len, check_capa_packet_len),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_vlan_id_0, check_capa_vlan_id_0),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_vlan_id_x, check_capa_vlan_id_x),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_vlan_pcp_0, check_capa_vlan_pcp_0),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_eth_type_0, check_capa_ethtype_0),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_eth_type_x, check_capa_ethtype_x),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_custom_frame, check_capa_custom_frame),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_custom_l3, check_capa_custom_l3),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipsec_spi_ah_ipv4, check_capa_ipsec_spi),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipsec_spi_esp_ipv4, check_capa_ipsec_spi),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipsec_spi_ah_ipv6, check_capa_ipsec_spi),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipsec_spi_esp_ipv6, check_capa_ipsec_spi),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_serial, check_capa_pmr_series),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_parallel, check_capa_pmr_series),
+ ODP_TEST_INFO(cls_pktin_classifier_flag),
+ ODP_TEST_INFO(cls_pmr_term_tcp_dport_multi),
+ ODP_TEST_INFO_CONDITIONAL(cls_pmr_marking, check_capa_pmr_marking),
ODP_TEST_INFO_NULL,
};
diff --git a/test/validation/api/classification/odp_classification_tests.c b/test/validation/api/classification/odp_classification_tests.c
index 84dfcf562..008034d9a 100644
--- a/test/validation/api/classification/odp_classification_tests.c
+++ b/test/validation/api/classification/odp_classification_tests.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2015-2018, Linaro Limited
- * Copyright (c) 2020-2021, Nokia
+ * Copyright (c) 2020-2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -531,7 +531,7 @@ void test_pktio_drop_cos(odp_bool_t enable_pktv)
CU_ASSERT((stop.errors - start.errors) == 0);
}
-static int classification_check_queue_stats(void)
+static int check_queue_stats(void)
{
odp_cls_capability_t capa;
@@ -544,7 +544,7 @@ static int classification_check_queue_stats(void)
return ODP_TEST_INACTIVE;
}
-static void classification_test_queue_stats(odp_bool_t enable_pktv)
+static void cls_queue_stats(odp_bool_t enable_pktv)
{
odp_cls_capability_t capa;
odp_cls_queue_stats_t stats_start;
@@ -595,14 +595,14 @@ static void classification_test_queue_stats(odp_bool_t enable_pktv)
CU_ASSERT(stats_stop.packets == 0);
}
-static void classification_test_queue_stats_pkt(void)
+static void cls_queue_stats_pkt(void)
{
- classification_test_queue_stats(false);
+ cls_queue_stats(false);
}
-static void classification_test_queue_stats_pktv(void)
+static void cls_queue_stats_pktv(void)
{
- classification_test_queue_stats(true);
+ cls_queue_stats(true);
}
void configure_pktio_error_cos(odp_bool_t enable_pktv)
@@ -678,7 +678,7 @@ void test_pktio_error_cos(odp_bool_t enable_pktv)
odp_packet_free(pkt);
}
-static void classification_test_pktio_set_skip(void)
+static void cls_pktio_set_skip(void)
{
int retval;
size_t offset = 5;
@@ -696,7 +696,7 @@ static void classification_test_pktio_set_skip(void)
CU_ASSERT(retval == 0);
}
-static void classification_test_pktio_set_headroom(void)
+static void cls_pktio_set_headroom(void)
{
size_t headroom;
int retval;
@@ -1000,7 +1000,7 @@ void test_pktio_pmr_composite_cos(odp_bool_t enable_pktv)
odp_packet_free(pkt);
}
-static void classification_test_pktio_configure_common(odp_bool_t enable_pktv)
+static void cls_pktio_configure_common(odp_bool_t enable_pktv)
{
odp_cls_capability_t capa;
int num_cos;
@@ -1049,17 +1049,17 @@ static void classification_test_pktio_configure_common(odp_bool_t enable_pktv)
}
-static void classification_test_pktio_configure(void)
+static void cls_pktio_configure(void)
{
- classification_test_pktio_configure_common(false);
+ cls_pktio_configure_common(false);
}
-static void classification_test_pktio_configure_pktv(void)
+static void cls_pktio_configure_pktv(void)
{
- classification_test_pktio_configure_common(true);
+ cls_pktio_configure_common(true);
}
-static void classification_test_pktio_test_common(odp_bool_t enable_pktv)
+static void cls_pktio_test_common(odp_bool_t enable_pktv)
{
/* Test Different CoS on the pktio interface */
if (tc.default_cos && TEST_DEFAULT)
@@ -1080,17 +1080,17 @@ static void classification_test_pktio_test_common(odp_bool_t enable_pktv)
test_pktio_pmr_composite_cos(enable_pktv);
}
-static void classification_test_pktio_test(void)
+static void cls_pktio_test(void)
{
- classification_test_pktio_test_common(false);
+ cls_pktio_test_common(false);
}
-static void classification_test_pktio_test_pktv(void)
+static void cls_pktio_test_pktv(void)
{
- classification_test_pktio_test_common(true);
+ cls_pktio_test_common(true);
}
-static int classification_check_pktv(void)
+static int check_pktv(void)
{
return pktv_config.enable ? ODP_TEST_ACTIVE : ODP_TEST_INACTIVE;
}
@@ -1101,22 +1101,17 @@ static int check_capa_skip_offset(void)
}
odp_testinfo_t classification_suite[] = {
- ODP_TEST_INFO_CONDITIONAL(classification_test_pktio_set_skip,
- check_capa_skip_offset),
- ODP_TEST_INFO(classification_test_pktio_set_headroom),
- ODP_TEST_INFO(classification_test_pktio_configure),
- ODP_TEST_INFO(classification_test_pktio_test),
- ODP_TEST_INFO_CONDITIONAL(classification_test_queue_stats_pkt,
- classification_check_queue_stats),
+ ODP_TEST_INFO_CONDITIONAL(cls_pktio_set_skip, check_capa_skip_offset),
+ ODP_TEST_INFO(cls_pktio_set_headroom),
+ ODP_TEST_INFO(cls_pktio_configure),
+ ODP_TEST_INFO(cls_pktio_test),
+ ODP_TEST_INFO_CONDITIONAL(cls_queue_stats_pkt, check_queue_stats),
ODP_TEST_INFO_NULL,
};
odp_testinfo_t classification_suite_pktv[] = {
- ODP_TEST_INFO_CONDITIONAL(classification_test_pktio_configure_pktv,
- classification_check_pktv),
- ODP_TEST_INFO_CONDITIONAL(classification_test_pktio_test_pktv,
- classification_check_pktv),
- ODP_TEST_INFO_CONDITIONAL(classification_test_queue_stats_pktv,
- classification_check_queue_stats),
+ ODP_TEST_INFO_CONDITIONAL(cls_pktio_configure_pktv, check_pktv),
+ ODP_TEST_INFO_CONDITIONAL(cls_pktio_test_pktv, check_pktv),
+ ODP_TEST_INFO_CONDITIONAL(cls_queue_stats_pktv, check_queue_stats),
ODP_TEST_INFO_NULL,
};
diff --git a/test/validation/api/crypto/crypto_op_test.c b/test/validation/api/crypto/crypto_op_test.c
index 1d883f6b8..9e8ab0584 100644
--- a/test/validation/api/crypto/crypto_op_test.c
+++ b/test/validation/api/crypto/crypto_op_test.c
@@ -46,6 +46,7 @@ int crypto_op(odp_packet_t pkt_in,
odp_packet_t *pkt_out,
odp_bool_t *ok,
const odp_crypto_packet_op_param_t *op_params,
+ odp_crypto_op_type_t session_op_type,
odp_crypto_op_type_t op_type)
{
int rc;
@@ -69,7 +70,7 @@ int crypto_op(odp_packet_t pkt_in,
} else {
odp_packet_t *out_param = pkt_out;
- if (op_type == ODP_CRYPTO_OP_TYPE_BASIC)
+ if (session_op_type == ODP_CRYPTO_OP_TYPE_BASIC)
out_param = NULL;
rc = odp_crypto_op_enq(&pkt_in, out_param, op_params, 1);
@@ -199,6 +200,8 @@ static int prepare_input_packet(const crypto_op_test_param_t *param,
pkt_len = param->header_len + reflength + param->trailer_len;
if (param->digest_offset == param->header_len + reflength)
pkt_len += ref->digest_length;
+ if (pkt_len == 0)
+ pkt_len = 1;
pkt = odp_packet_alloc(suite_context.pool, pkt_len);
@@ -335,7 +338,7 @@ static void prepare_ignore_info(const crypto_op_test_param_t *param,
param->session.op == ODP_CRYPTO_OP_DECODE) {
uint32_t offs = param->digest_offset;
- if (param->session.op_type != ODP_CRYPTO_OP_TYPE_OOP ||
+ if (param->op_type != ODP_CRYPTO_OP_TYPE_OOP ||
is_in_range(offs, cipher_offset, cipher_len) ||
is_in_range(offs, auth_offset, auth_len)) {
add_ignored_range(ignore,
@@ -349,7 +352,7 @@ static void prepare_ignore_info(const crypto_op_test_param_t *param,
param->wrong_digest) {
add_ignored_range(ignore, cipher_offset + shift, cipher_len);
/* In OOP case, auth range may not get copied */
- if (param->session.op_type == ODP_CRYPTO_OP_TYPE_OOP)
+ if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP)
add_ignored_range(ignore, auth_offset + shift, auth_len);
}
}
@@ -366,9 +369,9 @@ static void prepare_expected_data(const crypto_op_test_param_t *param,
uint32_t cipher_len = cipher_range->length;
uint32_t auth_offset = auth_range->offset;
uint32_t auth_len = auth_range->length;
- const int32_t shift = param->session.op_type == ODP_CRYPTO_OP_TYPE_OOP ? param->oop_shift
+ const int32_t shift = param->op_type == ODP_CRYPTO_OP_TYPE_OOP ? param->oop_shift
: 0;
- const odp_packet_t base_pkt = param->session.op_type == ODP_CRYPTO_OP_TYPE_OOP ? pkt_out
+ const odp_packet_t base_pkt = param->op_type == ODP_CRYPTO_OP_TYPE_OOP ? pkt_out
: pkt_in;
int rc;
uint32_t cipher_offset_in_ref = param->cipher_range.offset;
@@ -398,7 +401,7 @@ static void prepare_expected_data(const crypto_op_test_param_t *param,
rc = odp_packet_copy_to_mem(base_pkt, 0, ex->len, ex->data);
CU_ASSERT(rc == 0);
- if (param->session.op_type == ODP_CRYPTO_OP_TYPE_OOP && auth_len > 0) {
+ if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP && auth_len > 0) {
/* copy auth range from input packet */
rc = odp_packet_copy_to_mem(pkt_in, auth_offset, auth_len,
ex->data + auth_offset + shift);
@@ -482,7 +485,7 @@ static int is_digest_in_cipher_range(const crypto_op_test_param_t *param,
d_offset < op_params->cipher_range.offset + op_params->cipher_range.length;
}
-void test_crypto_op(const crypto_op_test_param_t *param)
+static void do_test_crypto_op(const crypto_op_test_param_t *param)
{
odp_bool_t ok = false;
odp_packet_t pkt;
@@ -497,6 +500,7 @@ void test_crypto_op(const crypto_op_test_param_t *param)
.hash_result_offset = param->digest_offset,
.aad_ptr = param->ref->aad,
.dst_offset_shift = param->oop_shift,
+ .null_crypto = param->null_crypto,
};
odp_bool_t failure_allowed = false;
@@ -513,7 +517,7 @@ void test_crypto_op(const crypto_op_test_param_t *param)
if (prepare_input_packet(param, &pkt))
return;
- if (param->session.op_type == ODP_CRYPTO_OP_TYPE_OOP) {
+ if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP) {
prepare_oop_output_packet(param, &pkt_out, odp_packet_len(pkt));
pkt_copy = odp_packet_copy(pkt, suite_context.pool);
@@ -532,7 +536,7 @@ void test_crypto_op(const crypto_op_test_param_t *param)
prepare_expected_data(param, &op_params.cipher_range, &op_params.auth_range,
pkt, pkt_out, &expected);
- if (param->session.op_type == ODP_CRYPTO_OP_TYPE_OOP &&
+ if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP &&
param->session.op == ODP_CRYPTO_OP_ENCODE) {
/*
* In this type of sessions digest offset is an offset to the output
@@ -544,12 +548,13 @@ void test_crypto_op(const crypto_op_test_param_t *param)
test_packet_set_md(pkt);
test_packet_get_md(pkt, &md_in);
- if (crypto_op(pkt, &pkt_out, &ok, &op_params, param->session.op_type))
+ if (crypto_op(pkt, &pkt_out, &ok, &op_params,
+ param->session.op_type, param->op_type))
return;
test_packet_get_md(pkt_out, &md_out);
- if (param->session.op_type == ODP_CRYPTO_OP_TYPE_OOP) {
+ if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP) {
test_packet_md_t md;
/* check that input packet has not changed */
@@ -589,3 +594,21 @@ void test_crypto_op(const crypto_op_test_param_t *param)
out:
odp_packet_free(pkt_out);
}
+
+void test_crypto_op(const crypto_op_test_param_t *param)
+{
+ crypto_op_test_param_t null_param = *param;
+ crypto_test_reference_t ref = *param->ref;
+
+ if (param->session.null_crypto_enable && param->null_crypto) {
+ null_param = *param;
+ null_param.ref = &ref;
+ ref = *param->ref;
+ ref.cipher = ODP_CIPHER_ALG_NULL;
+ ref.auth = ODP_AUTH_ALG_NULL;
+ ref.digest_length = 0;
+ memcpy(ref.ciphertext, ref.plaintext, sizeof(ref.ciphertext));
+ param = &null_param;
+ }
+ do_test_crypto_op(param);
+}
diff --git a/test/validation/api/crypto/crypto_op_test.h b/test/validation/api/crypto/crypto_op_test.h
index 4f5957820..9805457ad 100644
--- a/test/validation/api/crypto/crypto_op_test.h
+++ b/test/validation/api/crypto/crypto_op_test.h
@@ -18,15 +18,18 @@ typedef struct crypto_session_t {
odp_crypto_op_type_t op_type;
odp_bool_t cipher_range_in_bits;
odp_bool_t auth_range_in_bits;
+ odp_bool_t null_crypto_enable;
} crypto_session_t;
typedef struct crypto_op_test_param_t {
crypto_session_t session;
+ odp_crypto_op_type_t op_type;
int32_t oop_shift;
crypto_test_reference_t *ref;
odp_packet_data_range_t cipher_range;
odp_packet_data_range_t auth_range;
uint32_t digest_offset;
+ odp_bool_t null_crypto;
odp_bool_t adjust_segmentation;
odp_bool_t wrong_digest;
uint32_t first_seg_len;
@@ -40,6 +43,7 @@ int crypto_op(odp_packet_t pkt_in,
odp_packet_t *pkt_out,
odp_bool_t *ok,
const odp_crypto_packet_op_param_t *op_params,
+ odp_crypto_op_type_t session_op_type,
odp_crypto_op_type_t op_type);
#endif
diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c
index 0cc01b8e4..d5f2e3e7a 100644
--- a/test/validation/api/crypto/odp_crypto_test_inp.c
+++ b/test/validation/api/crypto/odp_crypto_test_inp.c
@@ -39,6 +39,7 @@ static void test_defaults(uint8_t fill)
CU_ASSERT_EQUAL(param.cipher_range_in_bits, false);
CU_ASSERT_EQUAL(param.auth_range_in_bits, false);
CU_ASSERT_EQUAL(param.auth_cipher_text, false);
+ CU_ASSERT_EQUAL(param.null_crypto_enable, false);
CU_ASSERT_EQUAL(param.op_mode, ODP_CRYPTO_SYNC);
CU_ASSERT_EQUAL(param.cipher_alg, ODP_CIPHER_ALG_NULL);
CU_ASSERT_EQUAL(param.cipher_iv_len, 0);
@@ -68,6 +69,13 @@ static void print_alg_test_param(const crypto_op_test_param_t *p)
case ODP_CRYPTO_OP_TYPE_OOP:
printf("out-of-place ");
break;
+ case ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP:
+ printf("basic-and-out-of-place (%s)",
+ p->op_type == ODP_CRYPTO_OP_TYPE_BASIC ? "basic" : "oop");
+ break;
+ default:
+ printf("unknown (internal error) ");
+ break;
}
printf("%s\n", p->session.op == ODP_CRYPTO_OP_ENCODE ? "encode" : "decode");
@@ -90,8 +98,12 @@ static void print_alg_test_param(const crypto_op_test_param_t *p)
printf("header length: %d, trailer length: %d\n", p->header_len, p->trailer_len);
if (p->adjust_segmentation)
printf("segmentation adjusted, first_seg_len: %d\n", p->first_seg_len);
- if (p->session.op_type == ODP_CRYPTO_OP_TYPE_OOP)
+ if (p->op_type == ODP_CRYPTO_OP_TYPE_OOP)
printf("oop_shift: %d\n", p->oop_shift);
+ if (p->session.null_crypto_enable)
+ printf("null crypto enabled in session\n");
+ if (p->null_crypto)
+ printf("null crypto requested\n");
}
static void alg_test_execute_and_print(crypto_op_test_param_t *param)
@@ -113,13 +125,13 @@ static void alg_test_execute_and_print(crypto_op_test_param_t *param)
}
}
-static void alg_test_op(crypto_op_test_param_t *param)
+static void alg_test_op2(crypto_op_test_param_t *param)
{
int32_t oop_shifts[] = {0, 3, 130, -10};
- for (uint32_t n = 0; n < ARRAY_SIZE(oop_shifts); n++) {
+ for (uint32_t n = 0; n < ODPH_ARRAY_SIZE(oop_shifts); n++) {
if (oop_shifts[n] != 0 &&
- param->session.op_type != ODP_CRYPTO_OP_TYPE_OOP)
+ param->op_type != ODP_CRYPTO_OP_TYPE_OOP)
continue;
if ((int32_t)param->header_len + oop_shifts[n] < 0)
continue;
@@ -127,13 +139,35 @@ static void alg_test_op(crypto_op_test_param_t *param)
param->wrong_digest = false;
alg_test_execute_and_print(param);
+
+ param->null_crypto = true;
+ alg_test_execute_and_print(param);
+ param->null_crypto = false;
+
if (full_test)
alg_test_execute_and_print(param); /* rerun with the same parameters */
+
+ if (!full_test && param->session.null_crypto_enable)
+ break;
+ if (!full_test && param->session.op_type == ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP)
+ break;
+
param->wrong_digest = true;
alg_test_execute_and_print(param);
}
}
+static void alg_test_op(crypto_op_test_param_t *param)
+{
+ param->op_type = param->session.op_type;
+ if (param->op_type == ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP) {
+ param->op_type = ODP_CRYPTO_OP_TYPE_BASIC;
+ alg_test_op2(param);
+ param->op_type = ODP_CRYPTO_OP_TYPE_OOP;
+ }
+ alg_test_op2(param);
+}
+
static int combo_warning_shown;
static int oop_warning_shown;
@@ -150,7 +184,8 @@ typedef enum {
static int session_create(crypto_session_t *session,
alg_order_t order,
crypto_test_reference_t *ref,
- hash_test_mode_t hash_mode)
+ hash_test_mode_t hash_mode,
+ odp_bool_t must_fail)
{
int rc;
odp_crypto_ses_create_err_t status;
@@ -176,6 +211,7 @@ static int session_create(crypto_session_t *session,
ses_params.cipher_range_in_bits = session->cipher_range_in_bits;
ses_params.auth_range_in_bits = session->auth_range_in_bits;
ses_params.auth_cipher_text = (order == AUTH_CIPHERTEXT);
+ ses_params.null_crypto_enable = session->null_crypto_enable;
ses_params.op_mode = suite_context.op_mode;
ses_params.cipher_alg = ref->cipher;
ses_params.auth_alg = ref->auth;
@@ -190,6 +226,15 @@ static int session_create(crypto_session_t *session,
ses_params.hash_result_in_auth_range = (hash_mode == HASH_OVERLAP);
rc = odp_crypto_session_create(&ses_params, &session->session, &status);
+ if (must_fail) {
+ CU_ASSERT(rc < 0);
+ if (rc == 0) {
+ rc = odp_crypto_session_destroy(session->session);
+ CU_ASSERT(rc == 0);
+ }
+ return -1;
+ }
+
if (rc < 0 && status == ODP_CRYPTO_SES_ERR_ALG_COMBO) {
if (!combo_warning_shown) {
combo_warning_shown = 1;
@@ -216,9 +261,10 @@ static int session_create(crypto_session_t *session,
/* For now, allow out-of-place sessions not to be supported. */
if (rc < 0 && status == ODP_CRYPTO_SES_ERR_PARAMS &&
- ses_params.op_type == ODP_CRYPTO_OP_TYPE_OOP) {
+ (ses_params.op_type == ODP_CRYPTO_OP_TYPE_OOP ||
+ ses_params.op_type == ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP)) {
if (!oop_warning_shown)
- printf("\n Skipping ODP_CRYPTO_OP_TYPE_OOP tests\n");
+ printf("\n Skipping out-of-place tests\n");
oop_warning_shown = 1;
return -1;
}
@@ -247,7 +293,9 @@ static void alg_test_ses(odp_crypto_op_t op,
odp_packet_data_range_t auth_range,
uint32_t digest_offset,
odp_bool_t cipher_range_in_bits,
- odp_bool_t auth_range_in_bits)
+ odp_bool_t auth_range_in_bits,
+ odp_bool_t null_crypto_enable,
+ odp_bool_t session_creation_must_fail)
{
unsigned int initial_num_failures = CU_get_number_of_failures();
const uint32_t reflength = ref_length_in_bytes(ref);
@@ -258,6 +306,9 @@ static void alg_test_ses(odp_crypto_op_t op,
uint32_t max_shift;
crypto_op_test_param_t test_param;
+ if (null_crypto_enable && suite_context.op_mode == ODP_CRYPTO_SYNC)
+ return;
+
if (digest_offset * auth_scale >= auth_range.offset &&
digest_offset * auth_scale < auth_range.offset + auth_range.length)
hash_mode = HASH_OVERLAP;
@@ -267,7 +318,8 @@ static void alg_test_ses(odp_crypto_op_t op,
test_param.session.op_type = op_type;
test_param.session.cipher_range_in_bits = cipher_range_in_bits;
test_param.session.auth_range_in_bits = auth_range_in_bits;
- if (session_create(&test_param.session, order, ref, hash_mode))
+ test_param.session.null_crypto_enable = null_crypto_enable;
+ if (session_create(&test_param.session, order, ref, hash_mode, session_creation_must_fail))
return;
test_param.ref = ref;
test_param.cipher_range = cipher_range;
@@ -279,13 +331,15 @@ static void alg_test_ses(odp_crypto_op_t op,
max_shift = reflength + ref->digest_length;
seg_len = 0;
- if (!full_test &&
- ref->cipher != ODP_CIPHER_ALG_NULL &&
- ref->auth != ODP_AUTH_ALG_NULL) {
- /* run the loop body just once */
- seg_len = max_shift / 2;
- max_shift = seg_len;
- }
+ if (!full_test)
+ if ((ref->cipher != ODP_CIPHER_ALG_NULL &&
+ ref->auth != ODP_AUTH_ALG_NULL) ||
+ test_param.session.null_crypto_enable ||
+ test_param.session.op_type == ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP) {
+ /* run the loop body just once */
+ seg_len = max_shift / 2;
+ max_shift = seg_len;
+ }
/*
* Test with segmented packets with all possible segment boundaries
@@ -324,24 +378,29 @@ static void alg_test_op_types(odp_crypto_op_t op,
odp_packet_data_range_t auth_range,
uint32_t digest_offset,
odp_bool_t cipher_range_in_bits,
- odp_bool_t auth_range_in_bits)
+ odp_bool_t auth_range_in_bits,
+ odp_bool_t session_creation_must_fail)
{
odp_crypto_op_type_t op_types[] = {
ODP_CRYPTO_OP_TYPE_LEGACY,
ODP_CRYPTO_OP_TYPE_BASIC,
ODP_CRYPTO_OP_TYPE_OOP,
+ ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP,
};
- for (unsigned int n = 0; n < ARRAY_SIZE(op_types); n++) {
- alg_test_ses(op,
- op_types[n],
- order,
- ref,
- cipher_range,
- auth_range,
- digest_offset,
- cipher_range_in_bits,
- auth_range_in_bits);
+ for (unsigned int n = 0; n < ODPH_ARRAY_SIZE(op_types); n++) {
+ for (unsigned int null_crypto = 0 ; null_crypto <= 1; null_crypto++)
+ alg_test_ses(op,
+ op_types[n],
+ order,
+ ref,
+ cipher_range,
+ auth_range,
+ digest_offset,
+ cipher_range_in_bits,
+ auth_range_in_bits,
+ null_crypto,
+ session_creation_must_fail);
}
}
@@ -360,13 +419,11 @@ static void alg_test(odp_crypto_op_t op,
for (int cr_in_bits = 0; cr_in_bits <= 1; cr_in_bits++) {
if (!cr_in_bits && cipher_bit_range.length % 8 != 0)
continue;
- if (cr_in_bits && !is_bit_mode_cipher)
- continue;
for (int ar_in_bits = 0; ar_in_bits <= 1; ar_in_bits++) {
+ odp_bool_t session_creation_must_fail;
+
if (!ar_in_bits && auth_bit_range.length % 8 != 0)
continue;
- if (ar_in_bits && !is_bit_mode_auth)
- continue;
cipher_range = cipher_bit_range;
auth_range = auth_bit_range;
@@ -378,8 +435,11 @@ static void alg_test(odp_crypto_op_t op,
auth_range.offset /= 8;
auth_range.length /= 8;
}
+ session_creation_must_fail = ((ar_in_bits && !is_bit_mode_auth) ||
+ (cr_in_bits && !is_bit_mode_cipher));
alg_test_op_types(op, order, ref, cipher_range, auth_range,
- digest_offset, cr_in_bits, ar_in_bits);
+ digest_offset, cr_in_bits, ar_in_bits,
+ session_creation_must_fail);
}
}
}
@@ -433,25 +493,17 @@ static void check_alg(odp_crypto_op_t op,
for (idx = 0; idx < count; idx++) {
int cipher_idx = -1, auth_idx = -1;
- odp_bool_t bit_mode_needed = false;
odp_bool_t is_bit_mode_cipher = false;
odp_bool_t is_bit_mode_auth = false;
uint32_t digest_offs = ref_length_in_bytes(&ref[idx]);
odp_packet_data_range_t cipher_bit_range = {.offset = 0};
odp_packet_data_range_t auth_bit_range = {.offset = 0};
- if (ref_length_in_bits(&ref[idx]) % 8 != 0)
- bit_mode_needed = true;
-
for (i = 0; i < cipher_num; i++) {
if (cipher_capa[i].key_len ==
ref[idx].cipher_key_length &&
cipher_capa[i].iv_len ==
ref[idx].cipher_iv_length) {
- if (bit_mode_needed &&
- cipher_alg != ODP_CIPHER_ALG_NULL &&
- !cipher_capa[i].bit_mode)
- continue;
cipher_idx = i;
is_bit_mode_cipher = cipher_capa[i].bit_mode;
break;
@@ -460,11 +512,10 @@ static void check_alg(odp_crypto_op_t op,
if (cipher_idx < 0) {
printf("\n Unsupported: alg=%s, key_len=%" PRIu32
- ", iv_len=%" PRIu32 "%s\n",
+ ", iv_len=%" PRIu32 "\n",
cipher_alg_name(cipher_alg),
ref[idx].cipher_key_length,
- ref[idx].cipher_iv_length,
- bit_mode_needed ? ", bit mode" : "");
+ ref[idx].cipher_iv_length);
continue;
}
@@ -476,10 +527,6 @@ static void check_alg(odp_crypto_op_t op,
auth_capa[i].key_len ==
ref[idx].auth_key_length &&
aad_len_ok(&auth_capa[i], ref[idx].aad_length)) {
- if (bit_mode_needed &&
- auth_alg != ODP_AUTH_ALG_NULL &&
- !auth_capa[i].bit_mode)
- continue;
auth_idx = i;
is_bit_mode_auth = auth_capa[i].bit_mode;
break;
@@ -489,12 +536,11 @@ static void check_alg(odp_crypto_op_t op,
if (auth_idx < 0) {
printf("\n Unsupported: alg=%s, key_len=%" PRIu32
", iv_len=%" PRIu32 ", digest_len=%" PRIu32
- "%s\n",
+ "\n",
auth_alg_name(auth_alg),
ref[idx].auth_key_length,
ref[idx].auth_iv_length,
- ref[idx].digest_length,
- bit_mode_needed ? ", bit mode" : "");
+ ref[idx].digest_length);
continue;
}
@@ -600,10 +646,11 @@ static int create_hash_test_reference(odp_auth_alg_t auth,
CU_ASSERT(rc == 0);
session.op = ODP_CRYPTO_OP_ENCODE;
- session.op_type = ODP_CRYPTO_OP_TYPE_LEGACY;
+ session.op_type = ODP_CRYPTO_OP_TYPE_BASIC;
session.cipher_range_in_bits = false;
session.auth_range_in_bits = false;
- if (session_create(&session, AUTH_PLAINTEXT, ref, HASH_NO_OVERLAP))
+ session.null_crypto_enable = false;
+ if (session_create(&session, AUTH_PLAINTEXT, ref, HASH_NO_OVERLAP, false))
return -1;
odp_crypto_packet_op_param_t op_params = {
@@ -616,7 +663,8 @@ static int create_hash_test_reference(odp_auth_alg_t auth,
.auth_range = { .offset = 0, .length = auth_bytes },
.dst_offset_shift = 0,
};
- rc = crypto_op(pkt, &pkt, &ok, &op_params, ODP_CRYPTO_OP_TYPE_LEGACY);
+ rc = crypto_op(pkt, &pkt, &ok, &op_params,
+ ODP_CRYPTO_OP_TYPE_BASIC, ODP_CRYPTO_OP_TYPE_BASIC);
CU_ASSERT(rc == 0);
if (rc) {
@@ -649,6 +697,7 @@ static int create_hash_test_reference(odp_auth_alg_t auth,
static void test_auth_hash_in_auth_range(odp_auth_alg_t auth,
const odp_crypto_auth_capability_t *capa,
+ odp_bool_t is_bit_mode_cipher,
alg_order_t order)
{
static crypto_test_reference_t ref = {.length = 0};
@@ -681,7 +730,7 @@ static void test_auth_hash_in_auth_range(odp_auth_alg_t auth,
&ref,
cipher_bit_range, auth_bit_range,
digest_offset,
- false,
+ is_bit_mode_cipher,
capa->bit_mode);
/*
@@ -706,7 +755,7 @@ static void test_auth_hash_in_auth_range(odp_auth_alg_t auth,
&ref,
cipher_bit_range, auth_bit_range,
digest_offset,
- false,
+ is_bit_mode_cipher,
capa->bit_mode);
}
@@ -758,13 +807,17 @@ static odp_auth_alg_t auth_algs[] = {
static void test_auth_hashes_in_auth_range(void)
{
- for (size_t n = 0; n < ARRAY_SIZE(auth_algs); n++) {
+ for (size_t n = 0; n < ODPH_ARRAY_SIZE(auth_algs); n++) {
odp_auth_alg_t auth = auth_algs[n];
+ odp_crypto_cipher_capability_t c_capa;
int num;
if (check_alg_support(ODP_CIPHER_ALG_NULL, auth) == ODP_TEST_INACTIVE)
continue;
+ num = odp_crypto_cipher_capability(ODP_CIPHER_ALG_NULL, &c_capa, 1);
+ CU_ASSERT_FATAL(num == 1);
+
num = odp_crypto_auth_capability(auth, NULL, 0);
CU_ASSERT_FATAL(num > 0);
@@ -773,8 +826,10 @@ static void test_auth_hashes_in_auth_range(void)
num = odp_crypto_auth_capability(auth, capa, num);
for (int i = 0; i < num; i++) {
- test_auth_hash_in_auth_range(auth, &capa[i], AUTH_PLAINTEXT);
- test_auth_hash_in_auth_range(auth, &capa[i], AUTH_CIPHERTEXT);
+ test_auth_hash_in_auth_range(auth, &capa[i], c_capa.bit_mode,
+ AUTH_PLAINTEXT);
+ test_auth_hash_in_auth_range(auth, &capa[i], c_capa.bit_mode,
+ AUTH_CIPHERTEXT);
}
}
}
@@ -800,10 +855,11 @@ static int crypto_encode_ref(crypto_test_reference_t *ref,
CU_ASSERT(rc == 0);
session.op = ODP_CRYPTO_OP_ENCODE;
- session.op_type = ODP_CRYPTO_OP_TYPE_LEGACY;
+ session.op_type = ODP_CRYPTO_OP_TYPE_BASIC;
session.cipher_range_in_bits = false;
session.auth_range_in_bits = false;
- if (session_create(&session, AUTH_PLAINTEXT, ref, HASH_OVERLAP)) {
+ session.null_crypto_enable = false;
+ if (session_create(&session, AUTH_PLAINTEXT, ref, HASH_OVERLAP, false)) {
odp_packet_free(pkt);
return 1;
}
@@ -827,7 +883,8 @@ static int crypto_encode_ref(crypto_test_reference_t *ref,
.auth_range = auth_range,
.dst_offset_shift = 0,
};
- rc = crypto_op(pkt, &pkt, &ok, &op_params, ODP_CRYPTO_OP_TYPE_LEGACY);
+ rc = crypto_op(pkt, &pkt, &ok, &op_params,
+ ODP_CRYPTO_OP_TYPE_BASIC, ODP_CRYPTO_OP_TYPE_BASIC);
CU_ASSERT(rc == 0);
if (rc) {
(void)odp_crypto_session_destroy(session.session);
@@ -1296,9 +1353,14 @@ static void test_combo_variants(odp_cipher_alg_t cipher, odp_auth_alg_t auth)
static void test_all_combinations(void)
{
+ if (suite_context.partial_test) {
+ printf("skipped ");
+ return;
+ }
+
printf("\n");
- for (size_t n = 0; n < ARRAY_SIZE(cipher_algs); n++)
- for (size_t i = 0; i < ARRAY_SIZE(auth_algs); i++)
+ for (size_t n = 0; n < ODPH_ARRAY_SIZE(cipher_algs); n++)
+ for (size_t i = 0; i < ODPH_ARRAY_SIZE(auth_algs); i++)
test_combo_variants(cipher_algs[n], auth_algs[i]);
}
@@ -1311,14 +1373,14 @@ static void crypto_test_enc_alg_null(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
null_reference,
- ARRAY_SIZE(null_reference));
+ ODPH_ARRAY_SIZE(null_reference));
}
static void crypto_test_dec_alg_null(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
null_reference,
- ARRAY_SIZE(null_reference));
+ ODPH_ARRAY_SIZE(null_reference));
}
static int check_alg_3des_cbc(void)
@@ -1330,14 +1392,14 @@ static void crypto_test_enc_alg_3des_cbc(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
tdes_cbc_reference,
- ARRAY_SIZE(tdes_cbc_reference));
+ ODPH_ARRAY_SIZE(tdes_cbc_reference));
}
static void crypto_test_dec_alg_3des_cbc(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
tdes_cbc_reference,
- ARRAY_SIZE(tdes_cbc_reference));
+ ODPH_ARRAY_SIZE(tdes_cbc_reference));
}
static int check_alg_3des_ecb(void)
@@ -1349,14 +1411,14 @@ static void crypto_test_enc_alg_3des_ecb(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
tdes_ecb_reference,
- ARRAY_SIZE(tdes_ecb_reference));
+ ODPH_ARRAY_SIZE(tdes_ecb_reference));
}
static void crypto_test_dec_alg_3des_ecb(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
tdes_ecb_reference,
- ARRAY_SIZE(tdes_ecb_reference));
+ ODPH_ARRAY_SIZE(tdes_ecb_reference));
}
static int check_alg_chacha20_poly1305(void)
@@ -1369,14 +1431,14 @@ static void crypto_test_enc_alg_chacha20_poly1305(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
chacha20_poly1305_reference,
- ARRAY_SIZE(chacha20_poly1305_reference));
+ ODPH_ARRAY_SIZE(chacha20_poly1305_reference));
}
static void crypto_test_dec_alg_chacha20_poly1305(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
chacha20_poly1305_reference,
- ARRAY_SIZE(chacha20_poly1305_reference));
+ ODPH_ARRAY_SIZE(chacha20_poly1305_reference));
}
static int check_alg_aes_gcm(void)
@@ -1388,14 +1450,14 @@ static void crypto_test_enc_alg_aes_gcm(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
aes_gcm_reference,
- ARRAY_SIZE(aes_gcm_reference));
+ ODPH_ARRAY_SIZE(aes_gcm_reference));
}
static void crypto_test_dec_alg_aes_gcm(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
aes_gcm_reference,
- ARRAY_SIZE(aes_gcm_reference));
+ ODPH_ARRAY_SIZE(aes_gcm_reference));
}
static int check_alg_aes_ccm(void)
@@ -1407,14 +1469,14 @@ static void crypto_test_enc_alg_aes_ccm(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
aes_ccm_reference,
- ARRAY_SIZE(aes_ccm_reference));
+ ODPH_ARRAY_SIZE(aes_ccm_reference));
}
static void crypto_test_dec_alg_aes_ccm(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
aes_ccm_reference,
- ARRAY_SIZE(aes_ccm_reference));
+ ODPH_ARRAY_SIZE(aes_ccm_reference));
}
static int check_alg_aes_cbc(void)
@@ -1426,14 +1488,14 @@ static void crypto_test_enc_alg_aes_cbc(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
aes_cbc_reference,
- ARRAY_SIZE(aes_cbc_reference));
+ ODPH_ARRAY_SIZE(aes_cbc_reference));
}
static void crypto_test_dec_alg_aes_cbc(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
aes_cbc_reference,
- ARRAY_SIZE(aes_cbc_reference));
+ ODPH_ARRAY_SIZE(aes_cbc_reference));
}
static int check_alg_aes_ctr(void)
@@ -1445,14 +1507,14 @@ static void crypto_test_enc_alg_aes_ctr(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
aes_ctr_reference,
- ARRAY_SIZE(aes_ctr_reference));
+ ODPH_ARRAY_SIZE(aes_ctr_reference));
}
static void crypto_test_dec_alg_aes_ctr(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
aes_ctr_reference,
- ARRAY_SIZE(aes_ctr_reference));
+ ODPH_ARRAY_SIZE(aes_ctr_reference));
}
static int check_alg_aes_ecb(void)
@@ -1464,14 +1526,14 @@ static void crypto_test_enc_alg_aes_ecb(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
aes_ecb_reference,
- ARRAY_SIZE(aes_ecb_reference));
+ ODPH_ARRAY_SIZE(aes_ecb_reference));
}
static void crypto_test_dec_alg_aes_ecb(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
aes_ecb_reference,
- ARRAY_SIZE(aes_ecb_reference));
+ ODPH_ARRAY_SIZE(aes_ecb_reference));
}
static int check_alg_aes_cfb128(void)
@@ -1483,14 +1545,14 @@ static void crypto_test_enc_alg_aes_cfb128(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
aes_cfb128_reference,
- ARRAY_SIZE(aes_cfb128_reference));
+ ODPH_ARRAY_SIZE(aes_cfb128_reference));
}
static void crypto_test_dec_alg_aes_cfb128(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
aes_cfb128_reference,
- ARRAY_SIZE(aes_cfb128_reference));
+ ODPH_ARRAY_SIZE(aes_cfb128_reference));
}
static int check_alg_aes_xts(void)
@@ -1502,14 +1564,14 @@ static void crypto_test_enc_alg_aes_xts(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
aes_xts_reference,
- ARRAY_SIZE(aes_xts_reference));
+ ODPH_ARRAY_SIZE(aes_xts_reference));
}
static void crypto_test_dec_alg_aes_xts(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
aes_xts_reference,
- ARRAY_SIZE(aes_xts_reference));
+ ODPH_ARRAY_SIZE(aes_xts_reference));
}
static int check_alg_kasumi_f8(void)
@@ -1521,14 +1583,14 @@ static void crypto_test_enc_alg_kasumi_f8(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
kasumi_f8_reference,
- ARRAY_SIZE(kasumi_f8_reference));
+ ODPH_ARRAY_SIZE(kasumi_f8_reference));
}
static void crypto_test_dec_alg_kasumi_f8(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
kasumi_f8_reference,
- ARRAY_SIZE(kasumi_f8_reference));
+ ODPH_ARRAY_SIZE(kasumi_f8_reference));
}
static int check_alg_snow3g_uea2(void)
@@ -1540,14 +1602,14 @@ static void crypto_test_enc_alg_snow3g_uea2(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
snow3g_uea2_reference,
- ARRAY_SIZE(snow3g_uea2_reference));
+ ODPH_ARRAY_SIZE(snow3g_uea2_reference));
}
static void crypto_test_dec_alg_snow3g_uea2(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
snow3g_uea2_reference,
- ARRAY_SIZE(snow3g_uea2_reference));
+ ODPH_ARRAY_SIZE(snow3g_uea2_reference));
}
static int check_alg_aes_eea2(void)
@@ -1560,14 +1622,14 @@ static void crypto_test_enc_alg_aes_eea2(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
aes_eea2_reference,
- ARRAY_SIZE(aes_eea2_reference));
+ ODPH_ARRAY_SIZE(aes_eea2_reference));
}
static void crypto_test_dec_alg_aes_eea2(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
aes_eea2_reference,
- ARRAY_SIZE(aes_eea2_reference));
+ ODPH_ARRAY_SIZE(aes_eea2_reference));
}
static int check_alg_zuc_eea3(void)
@@ -1579,14 +1641,14 @@ static void crypto_test_enc_alg_zuc_eea3(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
zuc_eea3_reference,
- ARRAY_SIZE(zuc_eea3_reference));
+ ODPH_ARRAY_SIZE(zuc_eea3_reference));
}
static void crypto_test_dec_alg_zuc_eea3(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
zuc_eea3_reference,
- ARRAY_SIZE(zuc_eea3_reference));
+ ODPH_ARRAY_SIZE(zuc_eea3_reference));
}
static int check_alg_hmac_md5(void)
@@ -1598,14 +1660,14 @@ static void crypto_test_gen_alg_hmac_md5(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
hmac_md5_reference,
- ARRAY_SIZE(hmac_md5_reference));
+ ODPH_ARRAY_SIZE(hmac_md5_reference));
}
static void crypto_test_check_alg_hmac_md5(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
hmac_md5_reference,
- ARRAY_SIZE(hmac_md5_reference));
+ ODPH_ARRAY_SIZE(hmac_md5_reference));
}
static int check_alg_hmac_sha1(void)
@@ -1617,14 +1679,14 @@ static void crypto_test_gen_alg_hmac_sha1(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
hmac_sha1_reference,
- ARRAY_SIZE(hmac_sha1_reference));
+ ODPH_ARRAY_SIZE(hmac_sha1_reference));
}
static void crypto_test_check_alg_hmac_sha1(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
hmac_sha1_reference,
- ARRAY_SIZE(hmac_sha1_reference));
+ ODPH_ARRAY_SIZE(hmac_sha1_reference));
}
static int check_alg_hmac_sha224(void)
@@ -1636,14 +1698,14 @@ static void crypto_test_gen_alg_hmac_sha224(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
hmac_sha224_reference,
- ARRAY_SIZE(hmac_sha224_reference));
+ ODPH_ARRAY_SIZE(hmac_sha224_reference));
}
static void crypto_test_check_alg_hmac_sha224(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
hmac_sha224_reference,
- ARRAY_SIZE(hmac_sha224_reference));
+ ODPH_ARRAY_SIZE(hmac_sha224_reference));
}
static int check_alg_hmac_sha256(void)
@@ -1655,14 +1717,14 @@ static void crypto_test_gen_alg_hmac_sha256(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
hmac_sha256_reference,
- ARRAY_SIZE(hmac_sha256_reference));
+ ODPH_ARRAY_SIZE(hmac_sha256_reference));
}
static void crypto_test_check_alg_hmac_sha256(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
hmac_sha256_reference,
- ARRAY_SIZE(hmac_sha256_reference));
+ ODPH_ARRAY_SIZE(hmac_sha256_reference));
}
static int check_alg_hmac_sha384(void)
@@ -1674,14 +1736,14 @@ static void crypto_test_gen_alg_hmac_sha384(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
hmac_sha384_reference,
- ARRAY_SIZE(hmac_sha384_reference));
+ ODPH_ARRAY_SIZE(hmac_sha384_reference));
}
static void crypto_test_check_alg_hmac_sha384(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
hmac_sha384_reference,
- ARRAY_SIZE(hmac_sha384_reference));
+ ODPH_ARRAY_SIZE(hmac_sha384_reference));
}
static int check_alg_hmac_sha512(void)
@@ -1693,14 +1755,14 @@ static void crypto_test_gen_alg_hmac_sha512(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
hmac_sha512_reference,
- ARRAY_SIZE(hmac_sha512_reference));
+ ODPH_ARRAY_SIZE(hmac_sha512_reference));
}
static void crypto_test_check_alg_hmac_sha512(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
hmac_sha512_reference,
- ARRAY_SIZE(hmac_sha512_reference));
+ ODPH_ARRAY_SIZE(hmac_sha512_reference));
}
static int check_alg_aes_xcbc(void)
@@ -1713,14 +1775,14 @@ static void crypto_test_gen_alg_aes_xcbc(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
aes_xcbc_reference,
- ARRAY_SIZE(aes_xcbc_reference));
+ ODPH_ARRAY_SIZE(aes_xcbc_reference));
}
static void crypto_test_check_alg_aes_xcbc(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
aes_xcbc_reference,
- ARRAY_SIZE(aes_xcbc_reference));
+ ODPH_ARRAY_SIZE(aes_xcbc_reference));
}
static int check_alg_aes_gmac(void)
@@ -1732,14 +1794,14 @@ static void crypto_test_gen_alg_aes_gmac(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
aes_gmac_reference,
- ARRAY_SIZE(aes_gmac_reference));
+ ODPH_ARRAY_SIZE(aes_gmac_reference));
}
static void crypto_test_check_alg_aes_gmac(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
aes_gmac_reference,
- ARRAY_SIZE(aes_gmac_reference));
+ ODPH_ARRAY_SIZE(aes_gmac_reference));
}
static int check_alg_aes_cmac(void)
@@ -1751,14 +1813,14 @@ static void crypto_test_gen_alg_aes_cmac(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
aes_cmac_reference,
- ARRAY_SIZE(aes_cmac_reference));
+ ODPH_ARRAY_SIZE(aes_cmac_reference));
}
static void crypto_test_check_alg_aes_cmac(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
aes_cmac_reference,
- ARRAY_SIZE(aes_cmac_reference));
+ ODPH_ARRAY_SIZE(aes_cmac_reference));
}
static int check_alg_kasumi_f9(void)
@@ -1770,14 +1832,14 @@ static void crypto_test_gen_alg_kasumi_f9(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
kasumi_f9_reference,
- ARRAY_SIZE(kasumi_f9_reference));
+ ODPH_ARRAY_SIZE(kasumi_f9_reference));
}
static void crypto_test_check_alg_kasumi_f9(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
kasumi_f9_reference,
- ARRAY_SIZE(kasumi_f9_reference));
+ ODPH_ARRAY_SIZE(kasumi_f9_reference));
}
static int check_alg_snow3g_uia2(void)
@@ -1789,14 +1851,14 @@ static void crypto_test_gen_alg_snow3g_uia2(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
snow3g_uia2_reference,
- ARRAY_SIZE(snow3g_uia2_reference));
+ ODPH_ARRAY_SIZE(snow3g_uia2_reference));
}
static void crypto_test_check_alg_snow3g_uia2(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
snow3g_uia2_reference,
- ARRAY_SIZE(snow3g_uia2_reference));
+ ODPH_ARRAY_SIZE(snow3g_uia2_reference));
}
static int check_alg_aes_eia2(void)
@@ -1809,14 +1871,14 @@ static void crypto_test_gen_alg_aes_eia2(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
aes_eia2_reference,
- ARRAY_SIZE(aes_eia2_reference));
+ ODPH_ARRAY_SIZE(aes_eia2_reference));
}
static void crypto_test_check_alg_aes_eia2(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
aes_eia2_reference,
- ARRAY_SIZE(aes_eia2_reference));
+ ODPH_ARRAY_SIZE(aes_eia2_reference));
}
static int check_alg_zuc_eia3(void)
@@ -1828,14 +1890,14 @@ static void crypto_test_gen_alg_zuc_eia3(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
zuc_eia3_reference,
- ARRAY_SIZE(zuc_eia3_reference));
+ ODPH_ARRAY_SIZE(zuc_eia3_reference));
}
static void crypto_test_check_alg_zuc_eia3(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
zuc_eia3_reference,
- ARRAY_SIZE(zuc_eia3_reference));
+ ODPH_ARRAY_SIZE(zuc_eia3_reference));
}
static int check_alg_md5(void)
@@ -1847,14 +1909,14 @@ static void crypto_test_gen_alg_md5(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
md5_reference,
- ARRAY_SIZE(md5_reference));
+ ODPH_ARRAY_SIZE(md5_reference));
}
static void crypto_test_check_alg_md5(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
md5_reference,
- ARRAY_SIZE(md5_reference));
+ ODPH_ARRAY_SIZE(md5_reference));
}
static int check_alg_sha1(void)
@@ -1866,14 +1928,14 @@ static void crypto_test_gen_alg_sha1(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
sha1_reference,
- ARRAY_SIZE(sha1_reference));
+ ODPH_ARRAY_SIZE(sha1_reference));
}
static void crypto_test_check_alg_sha1(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
sha1_reference,
- ARRAY_SIZE(sha1_reference));
+ ODPH_ARRAY_SIZE(sha1_reference));
}
static int check_alg_sha224(void)
@@ -1885,14 +1947,14 @@ static void crypto_test_gen_alg_sha224(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
sha224_reference,
- ARRAY_SIZE(sha224_reference));
+ ODPH_ARRAY_SIZE(sha224_reference));
}
static void crypto_test_check_alg_sha224(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
sha224_reference,
- ARRAY_SIZE(sha224_reference));
+ ODPH_ARRAY_SIZE(sha224_reference));
}
static int check_alg_sha256(void)
@@ -1904,14 +1966,14 @@ static void crypto_test_gen_alg_sha256(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
sha256_reference,
- ARRAY_SIZE(sha256_reference));
+ ODPH_ARRAY_SIZE(sha256_reference));
}
static void crypto_test_check_alg_sha256(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
sha256_reference,
- ARRAY_SIZE(sha256_reference));
+ ODPH_ARRAY_SIZE(sha256_reference));
}
static int check_alg_sha384(void)
@@ -1923,14 +1985,14 @@ static void crypto_test_gen_alg_sha384(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
sha384_reference,
- ARRAY_SIZE(sha384_reference));
+ ODPH_ARRAY_SIZE(sha384_reference));
}
static void crypto_test_check_alg_sha384(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
sha384_reference,
- ARRAY_SIZE(sha384_reference));
+ ODPH_ARRAY_SIZE(sha384_reference));
}
static int check_alg_sha512(void)
@@ -1942,14 +2004,14 @@ static void crypto_test_gen_alg_sha512(void)
{
check_alg(ODP_CRYPTO_OP_ENCODE,
sha512_reference,
- ARRAY_SIZE(sha512_reference));
+ ODPH_ARRAY_SIZE(sha512_reference));
}
static void crypto_test_check_alg_sha512(void)
{
check_alg(ODP_CRYPTO_OP_DECODE,
sha512_reference,
- ARRAY_SIZE(sha512_reference));
+ ODPH_ARRAY_SIZE(sha512_reference));
}
static odp_queue_t sched_compl_queue_create(void)
@@ -1980,6 +2042,24 @@ static odp_event_t plain_compl_queue_deq(void)
return odp_queue_deq(suite_context.queue);
}
+static int partial_test_only(odp_crypto_op_mode_t op_mode, odp_queue_type_t q_type)
+{
+ odp_crypto_capability_t capa;
+
+ if (full_test || odp_crypto_capability(&capa))
+ return 0;
+
+ if (!capa.async_mode)
+ return 0;
+
+ if (op_mode == ODP_CRYPTO_SYNC)
+ return 1;
+ else if (q_type == ODP_QUEUE_TYPE_PLAIN && capa.queue_type_sched)
+ return 1;
+
+ return 0;
+}
+
static int crypto_suite_packet_sync_init(void)
{
suite_context.op_mode = ODP_CRYPTO_SYNC;
@@ -1989,6 +2069,8 @@ static int crypto_suite_packet_sync_init(void)
return -1;
suite_context.queue = ODP_QUEUE_INVALID;
+ suite_context.partial_test = partial_test_only(suite_context.op_mode,
+ ODP_QUEUE_TYPE_PLAIN);
return 0;
}
@@ -2010,6 +2092,8 @@ static int crypto_suite_packet_async_plain_init(void)
suite_context.queue = out_queue;
suite_context.q_type = ODP_QUEUE_TYPE_PLAIN;
suite_context.compl_queue_deq = plain_compl_queue_deq;
+ suite_context.partial_test = partial_test_only(suite_context.op_mode,
+ suite_context.q_type);
return 0;
}
@@ -2032,6 +2116,8 @@ static int crypto_suite_packet_async_sched_init(void)
suite_context.queue = out_queue;
suite_context.q_type = ODP_QUEUE_TYPE_SCHED;
suite_context.compl_queue_deq = sched_compl_queue_deq;
+ suite_context.partial_test = partial_test_only(suite_context.op_mode,
+ suite_context.q_type);
return 0;
}
diff --git a/test/validation/api/crypto/util.h b/test/validation/api/crypto/util.h
index a81a56820..5cba21890 100644
--- a/test/validation/api/crypto/util.h
+++ b/test/validation/api/crypto/util.h
@@ -12,14 +12,13 @@
#include <odp_api.h>
#include <odp_cunit_common.h>
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
-
struct suite_context_s {
odp_crypto_op_mode_t op_mode;
odp_pool_t pool;
odp_queue_t queue;
odp_queue_type_t q_type;
odp_event_t (*compl_queue_deq)(void);
+ int partial_test;
};
extern struct suite_context_s suite_context;
diff --git a/test/validation/api/dma/dma.c b/test/validation/api/dma/dma.c
index 05771e3cb..7129315ef 100644
--- a/test/validation/api/dma/dma.c
+++ b/test/validation/api/dma/dma.c
@@ -19,11 +19,9 @@
#define MULTI 1
#define RESULT 1
#define USER_DATA 0xdeadbeef
-#define ELEM_NUM 10
+#define ELEM_NUM 10u
#define UAREA 0xaa
-#define MIN(a, b) (a < b ? a : b)
-
typedef struct global_t {
odp_dma_capability_t dma_capa;
odp_shm_t shm;
@@ -105,7 +103,7 @@ static int dma_suite_init(void)
if (pkt_len == 0)
pkt_len = 4000;
- pkt_len = MIN(pkt_len, global.dma_capa.max_seg_len);
+ pkt_len = ODPH_MIN(pkt_len, global.dma_capa.max_seg_len);
odp_pool_param_init(&pool_param);
pool_param.type = ODP_POOL_PACKET;
pool_param.pkt.num = global.dma_capa.max_src_segs + global.dma_capa.max_dst_segs;
@@ -426,7 +424,7 @@ static void test_dma_compl_pool_max_pools(void)
static void test_dma_compl_user_area(void)
{
odp_dma_pool_param_t dma_pool_param;
- uint32_t num = MIN(ELEM_NUM, global.dma_capa.pool.max_num),
+ uint32_t num = ODPH_MIN(ELEM_NUM, global.dma_capa.pool.max_num),
size = global.dma_capa.pool.max_uarea_size, i;
odp_pool_t pool;
odp_dma_compl_t compl_evs[num];
@@ -441,7 +439,7 @@ static void test_dma_compl_user_area(void)
for (i = 0; i < num; i++) {
odp_event_t ev;
- int flag;
+ int flag = 0;
compl_evs[i] = odp_dma_compl_alloc(pool);
@@ -482,7 +480,7 @@ static void init_event_uarea(void *uarea, uint32_t size, void *args, uint32_t in
static void test_dma_compl_user_area_init(void)
{
odp_dma_pool_param_t dma_pool_param;
- uint32_t num = MIN(ELEM_NUM, global.dma_capa.pool.max_num), i;
+ uint32_t num = ODPH_MIN(ELEM_NUM, global.dma_capa.pool.max_num), i;
odp_pool_t pool;
uarea_init_t data;
odp_dma_compl_t compl_evs[num];
@@ -663,9 +661,6 @@ static int do_transfer_async(odp_dma_t dma, odp_dma_transfer_param_t *trs_param,
CU_ASSERT(user_data == USER_DATA);
odp_dma_transfer_id_free(dma, compl_param[i].transfer_id);
-
- return done;
-
} else if (compl_mode == ODP_DMA_COMPL_EVENT) {
odp_queue_t from = ODP_QUEUE_INVALID;
@@ -724,7 +719,7 @@ static void test_dma_addr_to_addr(odp_dma_compl_mode_t compl_mode_mask, uint32_t
uint32_t i, cur_len;
uint8_t *src = global.src_addr + OFFSET;
uint8_t *dst = global.dst_addr + OFFSET;
- uint32_t seg_len = MIN(global.len / num, global.dma_capa.max_seg_len);
+ uint32_t seg_len = ODPH_MIN(global.len / num, global.dma_capa.max_seg_len);
uint32_t len = seg_len * num;
uint32_t offset = 0;
@@ -784,7 +779,7 @@ static void test_dma_addr_to_addr_trs(odp_dma_compl_mode_t compl_mode_mask, uint
odp_dma_compl_mode_t compl_mode;
uint8_t *src = global.src_addr + OFFSET;
uint8_t *dst = global.dst_addr + OFFSET;
- uint32_t trs_len = MIN(global.len / num_trs, global.dma_capa.max_seg_len);
+ uint32_t trs_len = ODPH_MIN(global.len / num_trs, global.dma_capa.max_seg_len);
uint32_t len = trs_len * num_trs;
uint32_t offset = 0;
int ret = -1;
@@ -855,7 +850,7 @@ static void test_dma_addr_to_addr_max_trs(odp_dma_compl_mode_t compl_mode_mask)
uint32_t i, cur_len;
uint8_t *src = global.src_addr + OFFSET;
uint8_t *dst = global.dst_addr + OFFSET;
- uint32_t seg_len = MIN(global.len / num_trs, global.dma_capa.max_seg_len);
+ uint32_t seg_len = ODPH_MIN(global.len / num_trs, global.dma_capa.max_seg_len);
uint32_t len = seg_len * num_trs;
uint32_t offset = 0;
@@ -1318,8 +1313,9 @@ static void test_dma_addr_to_addr_sync_res(void)
static void get_seg_lens(uint32_t max_len, uint32_t *src, uint32_t *dst)
{
- uint32_t src_segs = *src, dst_segs = *dst;
+ uint32_t src_segs = *src, dst_segs = *dst, denom = ODPH_MIN(src_segs, dst_segs);
+ max_len = ODPH_MIN(max_len / denom, global.dma_capa.max_seg_len) * denom;
*src = max_len / src_segs;
*dst = *src * src_segs / dst_segs + *src * src_segs % dst_segs;
}
@@ -1360,7 +1356,7 @@ static void test_dma_addr_to_addr_sync_max_seg(void)
memset(&dst_seg[i], 0, sizeof(odp_dma_seg_t));
dst_seg[i].addr = addr;
- dst_seg[i].len = MIN(len, dst_len);
+ dst_seg[i].len = ODPH_MIN(len, dst_len);
len -= dst_len;
}
@@ -1443,7 +1439,7 @@ static void test_dma_pkt_to_pkt_sync_max_seg(void)
memset(odp_packet_data(pkt), 0, dst_len);
memset(&dst_seg[i], 0, sizeof(odp_dma_seg_t));
dst_seg[i].packet = pkt;
- dst_seg[i].len = MIN(len, dst_len);
+ dst_seg[i].len = ODPH_MIN(len, dst_len);
len -= dst_len;
}
diff --git a/test/validation/api/hash/hash.c b/test/validation/api/hash/hash.c
index a5dc2e286..5e4209800 100644
--- a/test/validation/api/hash/hash.c
+++ b/test/validation/api/hash/hash.c
@@ -6,6 +6,8 @@
*/
#include <odp_api.h>
+#include <odp/helper/odph_api.h>
+
#include <odp_cunit_common.h>
#include <test_packet_ipv4_with_crc.h>
@@ -216,7 +218,7 @@ static void hash_test_crc32c(void)
{
uint32_t ret, result;
int i;
- int num = sizeof(crc32c_test_vector) / sizeof(hash_test_vector_t);
+ int num = ODPH_ARRAY_SIZE(crc32c_test_vector);
for (i = 0; i < num; i++) {
ret = odp_hash_crc32c(crc32c_test_vector[i].data,
@@ -232,7 +234,7 @@ static void hash_test_crc32(void)
{
uint32_t ret, result;
int i;
- int num = sizeof(crc32_test_vector) / sizeof(hash_test_vector_t);
+ int num = ODPH_ARRAY_SIZE(crc32_test_vector);
for (i = 0; i < num; i++) {
ret = odp_hash_crc32(crc32_test_vector[i].data,
@@ -341,7 +343,7 @@ static void hash_test_crc32_generic(void)
crc_param.poly = 0x04c11db7;
crc_param.reflect_in = 1;
crc_param.reflect_out = 1;
- num = sizeof(crc32_test_vector) / sizeof(hash_test_vector_t);
+ num = ODPH_ARRAY_SIZE(crc32_test_vector);
for (i = 0; i < num; i++) {
if (odp_hash_crc_gen64(crc32_test_vector[i].data,
@@ -360,7 +362,7 @@ static void hash_test_crc32_generic(void)
crc_param.poly = 0x1edc6f41;
crc_param.reflect_in = 1;
crc_param.reflect_out = 1;
- num = sizeof(crc32c_test_vector) / sizeof(hash_test_vector_t);
+ num = ODPH_ARRAY_SIZE(crc32c_test_vector);
for (i = 0; i < num; i++) {
if (odp_hash_crc_gen64(crc32c_test_vector[i].data,
diff --git a/test/validation/api/init/init_main.c b/test/validation/api/init/init_main.c
index c3dba105e..64cefa30b 100644
--- a/test/validation/api/init/init_main.c
+++ b/test/validation/api/init/init_main.c
@@ -284,7 +284,7 @@ odp_suiteinfo_t init_suites[] = {
static int fill_testinfo(odp_testinfo_t *info, unsigned int test_case)
{
- if (test_case >= (sizeof(testinfo) / sizeof(odp_testinfo_t))) {
+ if (test_case >= ODPH_ARRAY_SIZE(testinfo)) {
ODPH_ERR("Bad test case number %u\n", test_case);
return -1;
}
diff --git a/test/validation/api/ipsec/ipsec.c b/test/validation/api/ipsec/ipsec.c
index 87688838b..da60c77b3 100644
--- a/test/validation/api/ipsec/ipsec.c
+++ b/test/validation/api/ipsec/ipsec.c
@@ -447,7 +447,7 @@ static void ipsec_status_event_handle(odp_event_t ev_status,
odp_ipsec_sa_t sa,
enum ipsec_test_sa_expiry sa_expiry)
{
- int flag;
+ int flag = 0;
odp_ipsec_status_t status = {
.id = 0,
.sa = ODP_IPSEC_SA_INVALID,
diff --git a/test/validation/api/ipsec/ipsec.h b/test/validation/api/ipsec/ipsec.h
index 1c17693f7..8eed65c50 100644
--- a/test/validation/api/ipsec/ipsec.h
+++ b/test/validation/api/ipsec/ipsec.h
@@ -16,8 +16,6 @@
((c) << 8) | \
((d) << 0))
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
-
/* test arrays: */
extern odp_testinfo_t ipsec_in_suite[];
extern odp_testinfo_t ipsec_out_suite[];
diff --git a/test/validation/api/ipsec/ipsec_test_in.c b/test/validation/api/ipsec/ipsec_test_in.c
index e72c01c94..b5251544e 100644
--- a/test/validation/api/ipsec/ipsec_test_in.c
+++ b/test/validation/api/ipsec/ipsec_test_in.c
@@ -1847,7 +1847,7 @@ static void test_in_ipv4_esp_reass_success_two_frags(odp_ipsec_sa_t out_sa,
ipsec_test_packet *result_packet = &pkt_ipv4_udp_p1;
test_multi_out_in(out_sa, in_sa, ODPH_IPV4,
- ARRAY_SIZE(input_packets),
+ ODPH_ARRAY_SIZE(input_packets),
input_packets,
result_packet,
ODP_PACKET_REASS_COMPLETE);
@@ -1865,7 +1865,7 @@ static void test_in_ipv4_esp_reass_success_four_frags(odp_ipsec_sa_t out_sa,
ipsec_test_packet *result_packet = &pkt_ipv4_udp_p2;
test_multi_out_in(out_sa, in_sa, ODPH_IPV4,
- ARRAY_SIZE(input_packets),
+ ODPH_ARRAY_SIZE(input_packets),
input_packets,
result_packet,
ODP_PACKET_REASS_COMPLETE);
@@ -1881,7 +1881,7 @@ static void test_in_ipv4_esp_reass_success_two_frags_ooo(odp_ipsec_sa_t out_sa,
ipsec_test_packet *result_packet = &pkt_ipv4_udp_p1;
test_multi_out_in(out_sa, in_sa, ODPH_IPV4,
- ARRAY_SIZE(input_packets),
+ ODPH_ARRAY_SIZE(input_packets),
input_packets,
result_packet,
ODP_PACKET_REASS_COMPLETE);
@@ -1899,7 +1899,7 @@ static void test_in_ipv4_esp_reass_success_four_frags_ooo(odp_ipsec_sa_t out_sa,
ipsec_test_packet *result_packet = &pkt_ipv4_udp_p2;
test_multi_out_in(out_sa, in_sa, ODPH_IPV4,
- ARRAY_SIZE(input_packets),
+ ODPH_ARRAY_SIZE(input_packets),
input_packets,
result_packet,
ODP_PACKET_REASS_COMPLETE);
@@ -1914,7 +1914,7 @@ static void test_in_ipv4_esp_reass_incomp_missing(odp_ipsec_sa_t out_sa,
ipsec_test_packet *result_packet = &pkt_ipv4_udp_p1_f1;
test_multi_out_in(out_sa, in_sa, ODPH_IPV4,
- ARRAY_SIZE(input_packets),
+ ODPH_ARRAY_SIZE(input_packets),
input_packets,
result_packet,
ODP_PACKET_REASS_INCOMPLETE);
@@ -2031,7 +2031,7 @@ static void test_in_ipv6_esp_reass_success_two_frags(odp_ipsec_sa_t out_sa,
ipsec_test_packet *result_packet = &pkt_ipv6_udp_p1;
test_multi_out_in(out_sa, in_sa, ODPH_IPV6,
- ARRAY_SIZE(input_packets),
+ ODPH_ARRAY_SIZE(input_packets),
input_packets,
result_packet,
ODP_PACKET_REASS_COMPLETE);
@@ -2049,7 +2049,7 @@ static void test_in_ipv6_esp_reass_success_four_frags(odp_ipsec_sa_t out_sa,
ipsec_test_packet *result_packet = &pkt_ipv6_udp_p2;
test_multi_out_in(out_sa, in_sa, ODPH_IPV6,
- ARRAY_SIZE(input_packets),
+ ODPH_ARRAY_SIZE(input_packets),
input_packets,
result_packet,
ODP_PACKET_REASS_COMPLETE);
@@ -2065,7 +2065,7 @@ static void test_in_ipv6_esp_reass_success_two_frags_ooo(odp_ipsec_sa_t out_sa,
ipsec_test_packet *result_packet = &pkt_ipv6_udp_p1;
test_multi_out_in(out_sa, in_sa, ODPH_IPV6,
- ARRAY_SIZE(input_packets),
+ ODPH_ARRAY_SIZE(input_packets),
input_packets,
result_packet,
ODP_PACKET_REASS_COMPLETE);
@@ -2083,7 +2083,7 @@ static void test_in_ipv6_esp_reass_success_four_frags_ooo(odp_ipsec_sa_t out_sa,
ipsec_test_packet *result_packet = &pkt_ipv6_udp_p2;
test_multi_out_in(out_sa, in_sa, ODPH_IPV6,
- ARRAY_SIZE(input_packets),
+ ODPH_ARRAY_SIZE(input_packets),
input_packets,
result_packet,
ODP_PACKET_REASS_COMPLETE);
@@ -2098,7 +2098,7 @@ static void test_in_ipv6_esp_reass_incomp_missing(odp_ipsec_sa_t out_sa,
ipsec_test_packet *result_packet = &pkt_ipv6_udp_p1_f1;
test_multi_out_in(out_sa, in_sa, ODPH_IPV6,
- ARRAY_SIZE(input_packets),
+ ODPH_ARRAY_SIZE(input_packets),
input_packets,
result_packet,
ODP_PACKET_REASS_INCOMPLETE);
diff --git a/test/validation/api/ipsec/ipsec_test_out.c b/test/validation/api/ipsec/ipsec_test_out.c
index 1a013289b..ca8bf97a5 100644
--- a/test/validation/api/ipsec/ipsec_test_out.c
+++ b/test/validation/api/ipsec/ipsec_test_out.c
@@ -715,11 +715,11 @@ static void test_esp_out_in_all(const ipsec_test_flags *flags_in)
flags.ah = false;
- for (c = 0; c < ARRAY_SIZE(ciphers); c++)
- for (a = 0; a < ARRAY_SIZE(auths); a++)
+ for (c = 0; c < ODPH_ARRAY_SIZE(ciphers); c++)
+ for (a = 0; a < ODPH_ARRAY_SIZE(auths); a++)
test_esp_out_in(&ciphers[c], &auths[a], &flags);
- for (c = 0; c < ARRAY_SIZE(cipher_auth_comb); c++)
+ for (c = 0; c < ODPH_ARRAY_SIZE(cipher_auth_comb); c++)
test_esp_out_in(&cipher_auth_comb[c].cipher,
&cipher_auth_comb[c].auth,
&flags);
@@ -777,9 +777,9 @@ static void test_ah_out_in_all(const ipsec_test_flags *flags)
{
uint32_t a;
- for (a = 0; a < ARRAY_SIZE(auths); a++)
+ for (a = 0; a < ODPH_ARRAY_SIZE(auths); a++)
test_ah_out_in(&auths[a], flags);
- for (a = 0; a < ARRAY_SIZE(ah_auths); a++)
+ for (a = 0; a < ODPH_ARRAY_SIZE(ah_auths); a++)
test_ah_out_in(&ah_auths[a], flags);
}
diff --git a/test/validation/api/lock/lock.c b/test/validation/api/lock/lock.c
index 5210f7e5d..78c6ee79b 100644
--- a/test/validation/api/lock/lock.c
+++ b/test/validation/api/lock/lock.c
@@ -400,7 +400,7 @@ static int no_lock_functional_test(void *arg UNUSED)
lock_owner_delay = BASE_DELAY;
/*
- * Tunning the iteration number:
+ * Tuning the iteration number:
* Here, we search for an iteration number that guarantees to show
* race conditions between the odp threads.
* Iterations is set to ITER_MPLY_FACTOR * cnt where cnt is when
@@ -470,7 +470,7 @@ static int no_lock_functional_test(void *arg UNUSED)
CU_ASSERT(sync_failures != 0 || global_mem->g_num_threads == 1);
/*
- * set the iterration for the future tests to be far above the
+ * set the iteration for the future tests to be far above the
* contention level
*/
iterations *= ITER_MPLY_FACTOR;
diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c
index 43530220e..b33291a28 100644
--- a/test/validation/api/packet/packet.c
+++ b/test/validation/api/packet/packet.c
@@ -3525,7 +3525,7 @@ static int packet_parse_suite_init(void)
return -1;
}
- num_test_pkt = sizeof(parse_test_pkt_len) / sizeof(uint32_t);
+ num_test_pkt = ODPH_ARRAY_SIZE(parse_test_pkt_len);
max_len = 0;
for (i = 0; i < num_test_pkt; i++) {
diff --git a/test/validation/api/pktio/pktio.c b/test/validation/api/pktio/pktio.c
index fa752c0a2..5feeea4c0 100644
--- a/test/validation/api/pktio/pktio.c
+++ b/test/validation/api/pktio/pktio.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2014-2018, Linaro Limited
- * Copyright (c) 2020-2022, Nokia
+ * Copyright (c) 2020-2023, Nokia
* Copyright (c) 2020, Marvell
* All rights reserved.
*
@@ -1705,6 +1705,9 @@ static void pktio_test_index(void)
ndx = odp_pktio_index(pktio);
CU_ASSERT(ndx >= 0);
+ CU_ASSERT(ODP_PKTIO_MAX_INDEX >= odp_pktio_max_index());
+ CU_ASSERT(ODP_PKTIO_MAX_INDEX >= 0 && ODP_PKTIO_MAX_INDEX <= 1024);
+
CU_ASSERT(odp_pktio_close(pktio) == 0);
}
@@ -3793,7 +3796,7 @@ static void pktio_test_pktout_compl_poll(void)
for (i = 0; i < TX_BATCH_LEN; i++) {
CU_ASSERT(odp_packet_has_tx_compl_request(pkt_tbl[i]) == 0);
opt.compl_id = i;
- opt.mode = ODP_PACKET_TX_COMPL_EVENT;
+ opt.mode = ODP_PACKET_TX_COMPL_POLL;
odp_packet_tx_compl_request(pkt_tbl[i], &opt);
CU_ASSERT(odp_packet_has_tx_compl_request(pkt_tbl[i]) != 0);
/* Set pkt sequence number as its user ptr */
@@ -3891,6 +3894,102 @@ static void pktio_test_pktout_compl_event_sched_queue(void)
pktio_test_pktout_compl_event(false);
}
+static void pktio_test_pktout_dont_free(void)
+{
+ odp_pktio_t pktio[MAX_NUM_IFACES] = {ODP_PKTIO_INVALID};
+ odp_packet_t pkt, rx_pkt;
+ odp_pktio_capability_t pktio_capa;
+ odp_pktout_queue_t pktout_queue;
+ odp_pktio_t pktio_tx, pktio_rx;
+ pktio_info_t pktio_rx_info;
+ uint32_t pkt_seq;
+ int ret, i;
+ const int num_pkt = 1;
+ int transmits = 5;
+ int num_rx = 0;
+
+ CU_ASSERT_FATAL(num_ifaces >= 1);
+
+ /* Open and configure interfaces */
+ for (i = 0; i < num_ifaces; ++i) {
+ pktio[i] = create_pktio(i, ODP_PKTIN_MODE_DIRECT, ODP_PKTOUT_MODE_DIRECT);
+ CU_ASSERT_FATAL(pktio[i] != ODP_PKTIO_INVALID);
+
+ CU_ASSERT_FATAL(odp_pktio_start(pktio[i]) == 0);
+ }
+
+ pktio_tx = pktio[0];
+ pktio_rx = (num_ifaces > 1) ? pktio[1] : pktio_tx;
+
+ /* Check TX interface capa */
+ CU_ASSERT_FATAL(odp_pktio_capability(pktio_tx, &pktio_capa) == 0);
+ CU_ASSERT_FATAL(pktio_capa.free_ctrl.dont_free == 1);
+
+ for (i = 0; i < num_ifaces; i++)
+ _pktio_wait_linkup(pktio[i]);
+
+ pktio_rx_info.id = pktio_rx;
+ pktio_rx_info.inq = ODP_QUEUE_INVALID;
+ pktio_rx_info.in_mode = ODP_PKTIN_MODE_DIRECT;
+
+ ret = create_packets(&pkt, &pkt_seq, num_pkt, pktio_tx, pktio_rx);
+ CU_ASSERT_FATAL(ret == num_pkt);
+
+ ret = odp_pktout_queue(pktio_tx, &pktout_queue, 1);
+ CU_ASSERT_FATAL(ret > 0);
+
+ /* Set don't free flag */
+ CU_ASSERT(odp_packet_free_ctrl(pkt) == ODP_PACKET_FREE_CTRL_DISABLED);
+ odp_packet_free_ctrl_set(pkt, ODP_PACKET_FREE_CTRL_DONT_FREE);
+ CU_ASSERT_FATAL(odp_packet_free_ctrl(pkt) == ODP_PACKET_FREE_CTRL_DONT_FREE);
+
+ while (transmits--) {
+ /* Retransmit the same packet after it has been received from the RX interface */
+ CU_ASSERT_FATAL(odp_pktout_send(pktout_queue, &pkt, num_pkt) == num_pkt);
+
+ num_rx = wait_for_packets(&pktio_rx_info, &rx_pkt, &pkt_seq, num_pkt,
+ TXRX_MODE_SINGLE, ODP_TIME_SEC_IN_NS, false);
+ CU_ASSERT(num_rx == num_pkt);
+
+ if (num_rx != num_pkt)
+ break;
+
+ CU_ASSERT(odp_packet_len(pkt) == odp_packet_len(rx_pkt));
+ odp_packet_free(rx_pkt);
+ }
+
+ odp_packet_free(pkt);
+
+ for (i = 0; i < num_ifaces; i++) {
+ CU_ASSERT_FATAL(odp_pktio_stop(pktio[i]) == 0);
+ CU_ASSERT_FATAL(odp_pktio_close(pktio[i]) == 0);
+ }
+}
+
+static int pktio_check_pktout_dont_free(void)
+{
+ odp_pktio_param_t pktio_param;
+ odp_pktio_capability_t capa;
+ odp_pktio_t pktio;
+ int ret;
+
+ odp_pktio_param_init(&pktio_param);
+ pktio_param.in_mode = ODP_PKTIN_MODE_DIRECT;
+ pktio_param.out_mode = ODP_PKTOUT_MODE_DIRECT;
+
+ pktio = odp_pktio_open(iface_name[0], pool[0], &pktio_param);
+ if (pktio == ODP_PKTIO_INVALID)
+ return ODP_TEST_INACTIVE;
+
+ ret = odp_pktio_capability(pktio, &capa);
+ (void)odp_pktio_close(pktio);
+
+ if (ret == 0 && capa.free_ctrl.dont_free == 1)
+ return ODP_TEST_ACTIVE;
+
+ return ODP_TEST_INACTIVE;
+}
+
static void pktio_test_chksum(void (*config_fn)(odp_pktio_t, odp_pktio_t),
void (*prep_fn)(odp_packet_t pkt),
void (*test_fn)(odp_packet_t pkt))
@@ -5332,6 +5431,7 @@ odp_testinfo_t pktio_suite_unsegmented[] = {
ODP_TEST_INFO_CONDITIONAL(pktio_test_pktout_compl_event_sched_queue,
pktio_check_pktout_compl_event_sched_queue),
ODP_TEST_INFO_CONDITIONAL(pktio_test_pktout_compl_poll, pktio_check_pktout_compl_poll),
+ ODP_TEST_INFO_CONDITIONAL(pktio_test_pktout_dont_free, pktio_check_pktout_dont_free),
ODP_TEST_INFO_CONDITIONAL(pktio_test_enable_pause_rx, pktio_check_pause_rx),
ODP_TEST_INFO_CONDITIONAL(pktio_test_enable_pause_tx, pktio_check_pause_tx),
ODP_TEST_INFO_CONDITIONAL(pktio_test_enable_pause_both, pktio_check_pause_both),
diff --git a/test/validation/api/pool/pool.c b/test/validation/api/pool/pool.c
index 5176bb96f..8515f9b64 100644
--- a/test/validation/api/pool/pool.c
+++ b/test/validation/api/pool/pool.c
@@ -20,8 +20,8 @@
#define VEC_LEN 32
#define PKT_LEN 400
#define PKT_NUM 500
-#define ELEM_NUM 10
-#define ELEM_SIZE 128
+#define ELEM_NUM 10u
+#define ELEM_SIZE 128u
#define CACHE_SIZE 32
#define MAX_NUM_DEFAULT (10 * 1024 * 1024)
#define UAREA 0xaa
@@ -34,8 +34,6 @@
#define EXT_HEADROOM 16
#define MAGIC_U8 0x7a
-#define MIN(a, b) (((a) < (b)) ? (a) : (b))
-
typedef struct {
odp_barrier_t init_barrier;
odp_atomic_u32_t index;
@@ -204,8 +202,8 @@ static void init_event_uarea(void *uarea, uint32_t size, void *args, uint32_t in
static void pool_test_buffer_uarea_init(void)
{
odp_pool_param_t param;
- uint32_t num = MIN(global_pool_capa.buf.max_num, ELEM_NUM),
- size = MIN(global_pool_capa.buf.max_size, ELEM_SIZE), i;
+ uint32_t num = ODPH_MIN(global_pool_capa.buf.max_num, ELEM_NUM),
+ size = ODPH_MIN(global_pool_capa.buf.max_size, ELEM_SIZE), i;
odp_pool_t pool;
uarea_init_t data;
odp_buffer_t bufs[num];
@@ -246,8 +244,8 @@ static void pool_test_buffer_uarea_init(void)
static void pool_test_packet_uarea_init(void)
{
odp_pool_param_t param;
- uint32_t num = MIN(global_pool_capa.pkt.max_num, ELEM_NUM),
- size = MIN(global_pool_capa.pkt.max_len, ELEM_SIZE), i;
+ uint32_t num = ODPH_MIN(global_pool_capa.pkt.max_num, ELEM_NUM),
+ size = ODPH_MIN(global_pool_capa.pkt.max_len, ELEM_SIZE), i;
odp_pool_t pool;
uarea_init_t data;
odp_packet_t pkts[num];
@@ -288,8 +286,8 @@ static void pool_test_packet_uarea_init(void)
static void pool_test_vector_uarea_init(void)
{
odp_pool_param_t param;
- uint32_t num = MIN(global_pool_capa.vector.max_num, ELEM_NUM),
- size = MIN(global_pool_capa.vector.max_size, ELEM_NUM), i;
+ uint32_t num = ODPH_MIN(global_pool_capa.vector.max_num, ELEM_NUM),
+ size = ODPH_MIN(global_pool_capa.vector.max_size, ELEM_NUM), i;
odp_pool_t pool;
uarea_init_t data;
odp_packet_vector_t vecs[num];
@@ -332,7 +330,7 @@ static void pool_test_vector_uarea_init(void)
static void pool_test_timeout_uarea_init(void)
{
odp_pool_param_t param;
- uint32_t num = MIN(global_pool_capa.tmo.max_num, ELEM_NUM), i;
+ uint32_t num = ODPH_MIN(global_pool_capa.tmo.max_num, ELEM_NUM), i;
odp_pool_t pool;
uarea_init_t data;
odp_timeout_t tmos[num];
@@ -1698,7 +1696,19 @@ static void pool_ext_init_packet_pool_param(odp_pool_ext_param_t *param)
static void test_packet_pool_ext_capa(void)
{
odp_pool_ext_capability_t capa;
- odp_pool_type_t type = ODP_POOL_PACKET;
+ odp_pool_type_t type;
+ const odp_pool_type_t unsupported_types[] = {ODP_POOL_BUFFER, ODP_POOL_TIMEOUT,
+ ODP_POOL_VECTOR, ODP_POOL_DMA_COMPL};
+ const int num_types = ODPH_ARRAY_SIZE(unsupported_types);
+
+ /* Verify operation for unsupported pool types */
+ for (int i = 0; i < num_types; i++) {
+ type = unsupported_types[i];
+ CU_ASSERT_FATAL(odp_pool_ext_capability(type, &capa) == 0);
+ CU_ASSERT(capa.max_pools == 0);
+ }
+
+ type = ODP_POOL_PACKET;
CU_ASSERT_FATAL(odp_pool_ext_capability(type, &capa) == 0);
@@ -2023,6 +2033,7 @@ static void test_packet_pool_ext_uarea_init(void)
odp_pool_ext_capability_t capa;
odp_pool_ext_param_t param;
uint32_t num = ELEM_NUM, i;
+ uint32_t max_payload;
odp_pool_t pool;
uarea_init_t data;
odp_shm_t shm;
@@ -2034,7 +2045,7 @@ static void test_packet_pool_ext_uarea_init(void)
pool_ext_init_packet_pool_param(&param);
param.uarea_init.init_fn = init_event_uarea;
param.uarea_init.args = &data;
- num = MIN(num, param.pkt.num_buf);
+ num = ODPH_MIN(num, param.pkt.num_buf);
param.pkt.num_buf = num;
param.pkt.uarea_size = 1;
pool = odp_pool_ext_create(NULL, &param);
@@ -2049,10 +2060,14 @@ static void test_packet_pool_ext_uarea_init(void)
CU_ASSERT_FATAL(shm != ODP_SHM_INVALID);
CU_ASSERT(data.count == num);
+ max_payload = param.pkt.buf_size;
+ max_payload -= capa.pkt.odp_header_size + param.pkt.app_header_size;
+ max_payload -= capa.pkt.max_headroom_size;
+ max_payload -= capa.pkt.odp_trailer_size;
for (i = 0; i < num; i++) {
CU_ASSERT(data.mark[i] == 1);
- pkts[i] = odp_packet_alloc(pool, (param.pkt.buf_size - param.pkt.headroom) / 2);
+ pkts[i] = odp_packet_alloc(pool, max_payload);
CU_ASSERT(pkts[i] != ODP_PACKET_INVALID);
diff --git a/test/validation/api/queue/queue.c b/test/validation/api/queue/queue.c
index 2cd474455..cb2b147ac 100644
--- a/test/validation/api/queue/queue.c
+++ b/test/validation/api/queue/queue.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2014-2018, Linaro Limited
- * Copyright (c) 2021-2022, Nokia
+ * Copyright (c) 2021-2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -208,6 +208,83 @@ static void queue_test_max_plain(void)
CU_ASSERT(odp_queue_destroy(queue[i]) == 0);
}
+static int queue_create_multi(const char *name[], const odp_queue_param_t param[],
+ odp_bool_t share_param, odp_queue_t queue[], uint32_t num)
+{
+ const uint32_t max_retries = 100;
+ uint32_t num_created = 0;
+ uint32_t num_retries = 0;
+
+ do {
+ const char **cur_name = name != NULL ? &name[num_created] : NULL;
+ const odp_queue_param_t *cur_param = share_param ? &param[0] : &param[num_created];
+ int ret = odp_queue_create_multi(cur_name, cur_param, share_param,
+ &queue[num_created], num - num_created);
+ if (ret < 0) {
+ CU_FAIL("Queue create multi failed");
+ break;
+ }
+ CU_ASSERT_FATAL((uint32_t)ret <= num - num_created);
+
+ num_retries = ret == 0 ? num_retries + 1 : 0;
+ num_created += ret;
+ } while (num_created < num && num_retries < max_retries);
+
+ return num_created;
+}
+
+static void queue_destroy_multi(odp_queue_t queue[], uint32_t num)
+{
+ uint32_t num_left = num;
+ uint32_t num_freed = 0;
+
+ while (num_left) {
+ int ret = odp_queue_destroy_multi(&queue[num_freed], num_left);
+
+ CU_ASSERT_FATAL(ret > 0 && (uint32_t)ret <= num_left);
+
+ num_left -= ret;
+ num_freed += ret;
+ }
+ CU_ASSERT_FATAL(num_freed == num);
+}
+
+static void queue_test_create_destroy_multi(void)
+{
+ odp_queue_capability_t capa;
+ odp_queue_param_t param_single;
+ odp_queue_param_t param[MAX_QUEUES];
+ odp_queue_t queue[MAX_QUEUES];
+ const char *name[MAX_QUEUES] = {NULL, "aaa", NULL, "bbb", "ccc", NULL, "ddd"};
+ uint32_t num_queues, num_created;
+
+ CU_ASSERT_FATAL(odp_queue_capability(&capa) == 0);
+ CU_ASSERT_FATAL(capa.plain.max_num != 0);
+
+ num_queues = capa.plain.max_num < MAX_QUEUES ? capa.plain.max_num : MAX_QUEUES;
+ for (uint32_t i = 0; i < num_queues; i++)
+ odp_queue_param_init(&param[i]);
+ odp_queue_param_init(&param_single);
+
+ /* Create queues using shared parameters */
+ num_created = queue_create_multi(name, &param_single, true, queue, num_queues);
+ CU_ASSERT(num_created == num_queues);
+ queue_destroy_multi(queue, num_created);
+
+ num_created = queue_create_multi(NULL, &param_single, true, queue, num_queues);
+ CU_ASSERT(num_created == num_queues);
+ queue_destroy_multi(queue, num_created);
+
+ /* Use separate parameters for each queue */
+ num_created = queue_create_multi(name, param, false, queue, num_queues);
+ CU_ASSERT(num_created == num_queues);
+ queue_destroy_multi(queue, num_created);
+
+ num_created = queue_create_multi(NULL, param, false, queue, num_queues);
+ CU_ASSERT(num_created == num_queues);
+ queue_destroy_multi(queue, num_created);
+}
+
static void queue_test_mode(void)
{
odp_queue_param_t qparams;
@@ -1051,6 +1128,7 @@ odp_testinfo_t queue_suite[] = {
ODP_TEST_INFO(queue_test_param_init),
ODP_TEST_INFO(queue_test_mode),
ODP_TEST_INFO(queue_test_max_plain),
+ ODP_TEST_INFO(queue_test_create_destroy_multi),
ODP_TEST_INFO(queue_test_burst),
ODP_TEST_INFO(queue_test_burst_spmc),
ODP_TEST_INFO(queue_test_burst_mpsc),
diff --git a/test/validation/api/scheduler/scheduler.c b/test/validation/api/scheduler/scheduler.c
index ec06cf27d..8f450a057 100644
--- a/test/validation/api/scheduler/scheduler.c
+++ b/test/validation/api/scheduler/scheduler.c
@@ -1250,7 +1250,7 @@ static void scheduler_test_groups(void)
num--;
}
- /* Release schduler context and leave groups */
+ /* Release scheduler context and leave groups */
odp_schedule_group_join(mygrp1, &mymask);
odp_schedule_group_join(mygrp2, &mymask);
CU_ASSERT(drain_queues() == 0);
@@ -1360,7 +1360,7 @@ static void chaos_run(unsigned int qtype)
odp_schedule_sync_t sync[] = {ODP_SCHED_SYNC_PARALLEL,
ODP_SCHED_SYNC_ATOMIC,
ODP_SCHED_SYNC_ORDERED};
- const unsigned num_sync = (sizeof(sync) / sizeof(odp_schedule_sync_t));
+ const unsigned int num_sync = ODPH_ARRAY_SIZE(sync);
const char *const qtypes[] = {"parallel", "atomic", "ordered"};
/* Set up the scheduling environment */
diff --git a/test/validation/api/system/system.c b/test/validation/api/system/system.c
index a98ebb634..89a46a7f2 100644
--- a/test/validation/api/system/system.c
+++ b/test/validation/api/system/system.c
@@ -534,12 +534,18 @@ static void system_test_info(void)
printf(" ODP_CPU_ARCH_ARMV8_6\n");
else if (info.cpu_isa_sw.arm == ODP_CPU_ARCH_ARMV8_7)
printf(" ODP_CPU_ARCH_ARMV8_7\n");
+ else if (info.cpu_isa_sw.arm == ODP_CPU_ARCH_ARMV8_8)
+ printf(" ODP_CPU_ARCH_ARMV8_8\n");
+ else if (info.cpu_isa_sw.arm == ODP_CPU_ARCH_ARMV8_9)
+ printf(" ODP_CPU_ARCH_ARMV8_9\n");
else if (info.cpu_isa_sw.arm == ODP_CPU_ARCH_ARMV9_0)
printf(" ODP_CPU_ARCH_ARMV9_0\n");
else if (info.cpu_isa_sw.arm == ODP_CPU_ARCH_ARMV9_1)
printf(" ODP_CPU_ARCH_ARMV9_1\n");
else if (info.cpu_isa_sw.arm == ODP_CPU_ARCH_ARMV9_2)
printf(" ODP_CPU_ARCH_ARMV9_2\n");
+ else if (info.cpu_isa_sw.arm == ODP_CPU_ARCH_ARMV9_3)
+ printf(" ODP_CPU_ARCH_ARMV9_3\n");
else
CU_FAIL("Unknown CPU ISA SW ARCH found!");
@@ -566,12 +572,18 @@ static void system_test_info(void)
printf(" ODP_CPU_ARCH_ARMV8_6\n");
else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARMV8_7)
printf(" ODP_CPU_ARCH_ARMV8_7\n");
+ else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARMV8_8)
+ printf(" ODP_CPU_ARCH_ARMV8_8\n");
+ else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARMV8_9)
+ printf(" ODP_CPU_ARCH_ARMV8_9\n");
else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARMV9_0)
printf(" ODP_CPU_ARCH_ARMV9_0\n");
else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARMV9_1)
printf(" ODP_CPU_ARCH_ARMV9_1\n");
else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARMV9_2)
printf(" ODP_CPU_ARCH_ARMV9_2\n");
+ else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARMV9_3)
+ printf(" ODP_CPU_ARCH_ARMV9_3\n");
else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARM_UNKNOWN)
printf(" ODP_CPU_ARCH_ARM_UNKNOWN\n");
else
diff --git a/test/validation/api/timer/timer.c b/test/validation/api/timer/timer.c
index 1927156ba..db66b3664 100644
--- a/test/validation/api/timer/timer.c
+++ b/test/validation/api/timer/timer.c
@@ -21,8 +21,6 @@
#define GLOBAL_SHM_NAME "GlobalTimerTest"
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
-
#define MAX_TIMER_POOLS 1024
/* Timeout range in milliseconds (ms) */
@@ -69,6 +67,12 @@ typedef struct {
/* Clock source support flags */
uint8_t clk_supported[ODP_CLOCK_NUM_SRC];
+ /* Periodic timer support per clock source*/
+ uint8_t periodic_support[ODP_CLOCK_NUM_SRC];
+
+ /* Periodic timers not supported with any clock source */
+ int no_periodic;
+
/* Default resolution / timeout parameters */
struct {
uint64_t res_ns;
@@ -97,9 +101,6 @@ typedef struct {
/* Number of timers allocated per thread */
uint32_t timers_per_thread;
- /* Periodic timers supported */
- int periodic;
-
/* Queue type to be tested */
odp_queue_type_t test_queue_type;
@@ -117,6 +118,7 @@ static int timer_global_init(odp_instance_t *inst)
uint64_t res_ns, min_tmo, max_tmo;
unsigned int range;
int i;
+ int num_periodic = 0;
if (odph_options(&helper_options)) {
ODPH_ERR("odph_options() failed\n");
@@ -184,23 +186,26 @@ static int timer_global_init(odp_instance_t *inst)
return -1;
}
- /* Default parameters for test cases */
- global_mem->clk_supported[0] = 1;
+ /* Default parameters for test cases using the default clock source */
global_mem->param.res_ns = res_ns;
global_mem->param.min_tmo = min_tmo;
global_mem->param.max_tmo = max_tmo;
global_mem->param.queue_type_plain = capa.queue_type_plain;
global_mem->param.queue_type_sched = capa.queue_type_sched;
- /* Check which other source clocks are supported */
- for (i = 1; i < ODP_CLOCK_NUM_SRC; i++) {
- if (odp_timer_capability(ODP_CLOCK_SRC_0 + i, &capa) == 0)
+ /* Check which clock sources are supported */
+ for (i = 0; i < ODP_CLOCK_NUM_SRC; i++) {
+ if (odp_timer_capability(ODP_CLOCK_SRC_0 + i, &capa) == 0) {
global_mem->clk_supported[i] = 1;
+
+ if (capa.periodic.max_pools) {
+ global_mem->periodic_support[i] = 1;
+ num_periodic++;
+ }
+ }
}
- /* Check if periodic timers are supported */
- if (capa.periodic.max_pools > 0)
- global_mem->periodic = 1;
+ global_mem->no_periodic = !num_periodic;
return 0;
}
@@ -248,15 +253,15 @@ check_plain_queue_support(void)
static int check_periodic_support(void)
{
- if (global_mem->periodic)
- return ODP_TEST_ACTIVE;
+ if (global_mem->no_periodic)
+ return ODP_TEST_INACTIVE;
- return ODP_TEST_INACTIVE;
+ return ODP_TEST_ACTIVE;
}
static int check_periodic_sched_support(void)
{
- if (global_mem->periodic && global_mem->param.queue_type_sched)
+ if (global_mem->periodic_support[0] && global_mem->param.queue_type_sched)
return ODP_TEST_ACTIVE;
return ODP_TEST_INACTIVE;
@@ -264,7 +269,7 @@ static int check_periodic_sched_support(void)
static int check_periodic_plain_support(void)
{
- if (global_mem->periodic && global_mem->param.queue_type_plain)
+ if (global_mem->periodic_support[0] && global_mem->param.queue_type_plain)
return ODP_TEST_ACTIVE;
return ODP_TEST_INACTIVE;
@@ -366,9 +371,17 @@ static void timer_test_capa(void)
#endif
for (i = 0; i < ODP_CLOCK_NUM_SRC; i++) {
+ odp_timer_capability_t capa;
+ int ret;
+
clk_src = ODP_CLOCK_SRC_0 + i;
+
+ ret = odp_timer_capability(clk_src, &capa);
+ CU_ASSERT(ret == 0 || ret == -1);
+
if (global_mem->clk_supported[i]) {
ODPH_DBG("\nTesting clock source: %i\n", clk_src);
+ CU_ASSERT(ret == 0);
timer_test_capa_run(clk_src);
}
}
@@ -453,6 +466,66 @@ static void timer_test_timeout_pool_alloc(void)
CU_ASSERT(odp_pool_destroy(pool) == 0);
}
+static void timer_test_timeout_pool_alloc_multi(void)
+{
+ odp_pool_capability_t capa;
+ odp_pool_t pool;
+ odp_pool_param_t params;
+ uint32_t num_timeouts = 1000;
+ uint32_t num_allocated = 0;
+ uint32_t num_freed = 0;
+ uint32_t num_retries = 0;
+
+ CU_ASSERT_FATAL(!odp_pool_capability(&capa));
+
+ if (capa.tmo.max_num && capa.tmo.max_num < num_timeouts)
+ num_timeouts = capa.tmo.max_num;
+
+ odp_pool_param_init(&params);
+ params.type = ODP_POOL_TIMEOUT;
+ params.tmo.num = num_timeouts;
+
+ pool = odp_pool_create("timeout_pool_alloc_multi", &params);
+ CU_ASSERT_FATAL(pool != ODP_POOL_INVALID);
+
+ odp_timeout_t tmo[num_timeouts];
+
+ do {
+ int ret;
+ int num = (num_timeouts - num_allocated) / 2;
+
+ if (num < 1)
+ num = 1;
+
+ ret = odp_timeout_alloc_multi(pool, &tmo[num_allocated], num);
+ if (ret < 0) {
+ CU_FAIL("Timeout alloc multi failed");
+ break;
+ }
+ CU_ASSERT_FATAL(ret <= num);
+
+ num_retries = (ret == 0) ? num_retries + 1 : 0;
+ num_allocated += ret;
+ } while (num_allocated < num_timeouts && num_retries < 100);
+ CU_ASSERT(num_allocated == num_timeouts)
+
+ if (num_allocated) {
+ do {
+ int num = num_allocated / 2;
+
+ if (num < 1)
+ num = 1;
+
+ odp_timeout_free_multi(&tmo[num_freed], num);
+
+ num_freed += num;
+ num_allocated -= num;
+ } while (num_allocated);
+ }
+
+ CU_ASSERT(odp_pool_destroy(pool) == 0);
+}
+
static void timer_test_timeout_from_event(void)
{
odp_pool_t pool;
@@ -562,7 +635,7 @@ static void timer_test_timeout_user_area(void)
for (i = 0; i < num; i++) {
odp_event_t ev;
- int flag;
+ int flag = 0;
tmo[i] = odp_timeout_alloc(pool);
@@ -733,6 +806,9 @@ static void timer_pool_create_max(void)
ODPH_ERR("Timer alloc failed: %u / %u\n", i, num);
CU_ASSERT_FATAL(timer[i] != ODP_TIMER_INVALID);
+
+ /* Pool should have only one timer */
+ CU_ASSERT_FATAL(odp_timer_alloc(tp[i], queue, USER_PTR) == ODP_TIMER_INVALID);
}
for (i = 0; i < num; i++)
@@ -2627,7 +2703,7 @@ static void timer_test_sched_all(void)
timer_test_all(ODP_QUEUE_TYPE_SCHED);
}
-static void timer_test_periodic_capa(void)
+static void timer_test_periodic_capa_run(odp_timer_clk_src_t clk_src)
{
odp_timer_capability_t timer_capa;
odp_timer_periodic_capability_t capa;
@@ -2639,7 +2715,7 @@ static void timer_test_periodic_capa(void)
uint32_t num = 100;
memset(&timer_capa, 0, sizeof(odp_timer_capability_t));
- CU_ASSERT_FATAL(odp_timer_capability(ODP_CLOCK_DEFAULT, &timer_capa) == 0);
+ CU_ASSERT_FATAL(odp_timer_capability(clk_src, &timer_capa) == 0);
CU_ASSERT(timer_capa.periodic.max_pools);
CU_ASSERT(timer_capa.periodic.max_timers);
@@ -2670,7 +2746,7 @@ static void timer_test_periodic_capa(void)
capa.max_multiplier = 1;
capa.res_ns = 0;
- CU_ASSERT(odp_timer_periodic_capability(ODP_CLOCK_DEFAULT, &capa) == 1);
+ CU_ASSERT(odp_timer_periodic_capability(clk_src, &capa) == 1);
CU_ASSERT(capa.base_freq_hz.integer == min_fract.integer);
CU_ASSERT(capa.base_freq_hz.numer == min_fract.numer);
CU_ASSERT(capa.base_freq_hz.denom == min_fract.denom);
@@ -2682,7 +2758,7 @@ static void timer_test_periodic_capa(void)
capa.max_multiplier = 1;
capa.res_ns = 0;
- CU_ASSERT(odp_timer_periodic_capability(ODP_CLOCK_DEFAULT, &capa) == 1);
+ CU_ASSERT(odp_timer_periodic_capability(clk_src, &capa) == 1);
CU_ASSERT(capa.base_freq_hz.integer == max_fract.integer);
CU_ASSERT(capa.base_freq_hz.numer == max_fract.numer);
CU_ASSERT(capa.base_freq_hz.denom == max_fract.denom);
@@ -2732,7 +2808,7 @@ static void timer_test_periodic_capa(void)
ODPH_DBG("freq %" PRIu64 ", multip %" PRIu64 ", res %" PRIu64 ",\n",
base_freq.integer, max_multiplier, res_ns);
- ret = odp_timer_periodic_capability(ODP_CLOCK_DEFAULT, &capa);
+ ret = odp_timer_periodic_capability(clk_src, &capa);
if (ret == 1) {
CU_ASSERT(capa.base_freq_hz.integer == base_freq.integer);
@@ -2767,7 +2843,22 @@ static void timer_test_periodic_capa(void)
}
}
-static void timer_test_periodic(odp_queue_type_t queue_type, int use_first, int rounds)
+static void timer_test_periodic_capa(void)
+{
+ odp_timer_clk_src_t clk_src;
+ int i;
+
+ for (i = 0; i < ODP_CLOCK_NUM_SRC; i++) {
+ clk_src = ODP_CLOCK_SRC_0 + i;
+ if (global_mem->periodic_support[i]) {
+ ODPH_DBG("\nTesting clock source: %i\n", clk_src);
+ timer_test_periodic_capa_run(clk_src);
+ }
+ }
+}
+
+static void timer_test_periodic(odp_queue_type_t queue_type, int use_first, int rounds,
+ int reuse_event)
{
odp_timer_capability_t timer_capa;
odp_timer_periodic_capability_t periodic_capa;
@@ -2779,7 +2870,7 @@ static void timer_test_periodic(odp_queue_type_t queue_type, int use_first, int
odp_timer_periodic_start_t start_param;
odp_queue_t queue;
odp_timeout_t tmo;
- odp_event_t ev;
+ odp_event_t ev = ODP_EVENT_INVALID;
odp_timer_t timer;
odp_time_t t1, t2;
uint64_t tick, cur_tick, period_ns, duration_ns, diff_ns, offset_ns;
@@ -2898,6 +2989,9 @@ static void timer_test_periodic(odp_queue_type_t queue_type, int use_first, int
timer = odp_timer_alloc(timer_pool, queue, user_ctx);
CU_ASSERT_FATAL(timer != ODP_TIMER_INVALID);
+ /* Pool should have only one timer */
+ CU_ASSERT_FATAL(odp_timer_alloc(timer_pool, queue, user_ctx) == ODP_TIMER_INVALID);
+
memset(&start_param, 0, sizeof(odp_timer_periodic_start_t));
offset_ns = period_ns / 2;
@@ -2910,10 +3004,12 @@ static void timer_test_periodic(odp_queue_type_t queue_type, int use_first, int
num_tmo = 0;
done = 0;
- tmo = odp_timeout_alloc(pool);
- ev = odp_timeout_to_event(tmo);
- CU_ASSERT_FATAL(ev != ODP_EVENT_INVALID);
+ if (!reuse_event || round == 0) {
+ tmo = odp_timeout_alloc(pool);
+ ev = odp_timeout_to_event(tmo);
+ }
+ CU_ASSERT_FATAL(ev != ODP_EVENT_INVALID);
cur_tick = odp_timer_current_tick(timer_pool);
tick = cur_tick + odp_timer_ns_to_tick(timer_pool, offset_ns);
@@ -3015,8 +3111,10 @@ static void timer_test_periodic(odp_queue_type_t queue_type, int use_first, int
CU_ASSERT(ret == 1 || ret == 2);
if (ret == 2) {
- odp_event_free(ev);
done = 1;
+ if (reuse_event && round < rounds - 1)
+ break;
+ odp_event_free(ev);
}
}
@@ -3033,33 +3131,39 @@ static void timer_test_periodic(odp_queue_type_t queue_type, int use_first, int
static void timer_test_periodic_sched(void)
{
- timer_test_periodic(ODP_QUEUE_TYPE_SCHED, 0, 1);
+ timer_test_periodic(ODP_QUEUE_TYPE_SCHED, 0, 1, 0);
}
static void timer_test_periodic_plain(void)
{
- timer_test_periodic(ODP_QUEUE_TYPE_PLAIN, 0, 1);
+ timer_test_periodic(ODP_QUEUE_TYPE_PLAIN, 0, 1, 0);
}
static void timer_test_periodic_sched_first(void)
{
- timer_test_periodic(ODP_QUEUE_TYPE_SCHED, FIRST_TICK, 1);
+ timer_test_periodic(ODP_QUEUE_TYPE_SCHED, FIRST_TICK, 1, 0);
}
static void timer_test_periodic_plain_first(void)
{
- timer_test_periodic(ODP_QUEUE_TYPE_PLAIN, FIRST_TICK, 1);
+ timer_test_periodic(ODP_QUEUE_TYPE_PLAIN, FIRST_TICK, 1, 0);
}
static void timer_test_periodic_reuse(void)
{
- timer_test_periodic(ODP_QUEUE_TYPE_SCHED, 0, 2);
+ timer_test_periodic(ODP_QUEUE_TYPE_SCHED, 0, 2, 0);
+}
+
+static void timer_test_periodic_event_reuse(void)
+{
+ timer_test_periodic(ODP_QUEUE_TYPE_SCHED, 0, 2, 1);
}
odp_testinfo_t timer_suite[] = {
ODP_TEST_INFO(timer_test_capa),
ODP_TEST_INFO(timer_test_param_init),
ODP_TEST_INFO(timer_test_timeout_pool_alloc),
+ ODP_TEST_INFO(timer_test_timeout_pool_alloc_multi),
ODP_TEST_INFO(timer_test_timeout_from_event),
ODP_TEST_INFO(timer_test_timeout_pool_free),
ODP_TEST_INFO(timer_test_timeout_user_area),
@@ -3150,6 +3254,8 @@ odp_testinfo_t timer_suite[] = {
check_periodic_plain_support),
ODP_TEST_INFO_CONDITIONAL(timer_test_periodic_reuse,
check_periodic_sched_support),
+ ODP_TEST_INFO_CONDITIONAL(timer_test_periodic_event_reuse,
+ check_periodic_sched_support),
ODP_TEST_INFO_NULL,
};
diff --git a/test/validation/api/traffic_mngr/traffic_mngr.c b/test/validation/api/traffic_mngr/traffic_mngr.c
index c83cc105f..ed07db751 100644
--- a/test/validation/api/traffic_mngr/traffic_mngr.c
+++ b/test/validation/api/traffic_mngr/traffic_mngr.c
@@ -27,7 +27,7 @@
#define NUM_LEVELS 3
#define NUM_PRIORITIES 4
#define NUM_QUEUES_PER_NODE NUM_PRIORITIES
-#define FANIN_RATIO 8
+#define FANIN_RATIO 8u
#define NUM_LEVEL0_TM_NODES 1
#define NUM_LEVEL1_TM_NODES FANIN_RATIO
#define NUM_LEVEL2_TM_NODES (FANIN_RATIO * FANIN_RATIO)
@@ -65,7 +65,7 @@
#define MED_DROP_PROB 4
#define MAX_DROP_PROB 8
-#define MAX_PKTS 1000
+#define MAX_PKTS 1000u
#define PKT_BUF_SIZE 1460
#define MAX_PAYLOAD 1400
#define USE_IPV4 false
@@ -109,13 +109,8 @@
#define MBPS 1000000
#define GBPS 1000000000
-#define MIN(a, b) (((a) <= (b)) ? (a) : (b))
-#define MAX(a, b) (((a) <= (b)) ? (b) : (a))
-
#define TM_PERCENT(percent) ((uint32_t)(100 * percent))
-#define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0]))
-
typedef enum {
SHAPER_PROFILE, SCHED_PROFILE, THRESHOLD_PROFILE, WRED_PROFILE
} profile_kind_t;
@@ -211,7 +206,7 @@ static const char ALPHABET[] =
/* The following constant table determines the minimum and maximum number of
* pkts that will be received when sending 100 pkts through a system with a
* drop probability of p% (using a uniform probability distribution), with a
- * confidence of 99.9% 99.99% and 99.999%. The confidence is interepreted as
+ * confidence of 99.9% 99.99% and 99.999%. The confidence is interpreted as
* follows: a 99.99% confidence says that receiving LESS pkts than the given
* minimum or receiving MORE pkts than the given maximum (assuming a uniform
* drop percent of p) will happen less than 1 time in 10,000 trials.
@@ -400,13 +395,13 @@ static odp_bool_t approx_eq64(uint64_t val, uint64_t correct)
static uint64_t
clamp_rate(uint64_t rate)
{
- return MIN(MAX(rate, tm_shaper_min_rate), tm_shaper_max_rate);
+ return ODPH_MIN(ODPH_MAX(rate, tm_shaper_min_rate), tm_shaper_max_rate);
}
static uint32_t
clamp_burst(uint32_t burst)
{
- return MIN(MAX(burst, tm_shaper_min_burst), tm_shaper_max_burst);
+ return ODPH_MIN(ODPH_MAX(burst, tm_shaper_min_burst), tm_shaper_max_burst);
}
static int test_overall_capabilities(void)
@@ -1464,8 +1459,8 @@ static inline void calc_rcv_stats(rcv_stats_t *rcv_stats,
last_rcv_gap_idx = (rcv_gap_cnt * (100 - ending_drop_percent)) / 100;
for (idx = first_rcv_gap_idx; idx <= last_rcv_gap_idx; idx++) {
rcv_gap = rcv_gaps[idx];
- rcv_stats->min_rcv_gap = MIN(rcv_stats->min_rcv_gap, rcv_gap);
- rcv_stats->max_rcv_gap = MAX(rcv_stats->max_rcv_gap, rcv_gap);
+ rcv_stats->min_rcv_gap = ODPH_MIN(rcv_stats->min_rcv_gap, rcv_gap);
+ rcv_stats->max_rcv_gap = ODPH_MAX(rcv_stats->max_rcv_gap, rcv_gap);
rcv_stats->total_rcv_gap += rcv_gap;
rcv_stats->total_rcv_gap_squared += rcv_gap * rcv_gap;
rcv_stats->num_samples++;
@@ -2365,7 +2360,7 @@ static int traffic_mngr_suite_init(void)
payload_len = 0;
while (payload_len < MAX_PAYLOAD) {
- copy_len = MIN(MAX_PAYLOAD - payload_len, sizeof(ALPHABET));
+ copy_len = ODPH_MIN(MAX_PAYLOAD - payload_len, sizeof(ALPHABET));
memcpy(&payload_data[payload_len], ALPHABET, copy_len);
payload_len += copy_len;
}
@@ -3087,7 +3082,7 @@ static int set_sched_fanin(const char *node_name,
CU_ASSERT_FATAL(odp_tm_stop(odp_tm_systems[0]) == 0);
}
- fanin_cnt = MIN(node_desc->num_children, FANIN_RATIO);
+ fanin_cnt = ODPH_MIN(node_desc->num_children, FANIN_RATIO);
for (fanin = 0; fanin < fanin_cnt; fanin++) {
odp_tm_sched_params_init(&sched_params);
sched_weight = sched_weights[fanin];
@@ -3352,7 +3347,7 @@ static int test_sched_wfq(const char *sched_base_name,
/* Now determine at least one tm_queue that feeds into each fanin/
* child node. */
priority = 0;
- fanin_cnt = MIN(node_desc->num_children, FANIN_RATIO);
+ fanin_cnt = ODPH_MIN(node_desc->num_children, FANIN_RATIO);
for (fanin = 0; fanin < fanin_cnt; fanin++) {
child_desc = node_desc->children[fanin];
num_queues = find_child_queues(0, child_desc, priority,
@@ -3482,7 +3477,7 @@ static int test_threshold(const char *threshold_name,
odp_tm_threshold_params_init(&threshold_params);
if (max_pkts != 0) {
- max_pkts = MIN(max_pkts, MAX_PKTS / 3);
+ max_pkts = ODPH_MIN(max_pkts, MAX_PKTS / 3);
threshold_params.max_pkts = max_pkts;
threshold_params.enable_max_pkts = true;
num_pkts = 2 * max_pkts;
@@ -3490,7 +3485,7 @@ static int test_threshold(const char *threshold_name,
}
if (max_bytes != 0) {
- max_bytes = MIN(max_bytes, MAX_PKTS * MAX_PAYLOAD / 3);
+ max_bytes = ODPH_MIN(max_bytes, MAX_PKTS * MAX_PAYLOAD / 3);
threshold_params.max_bytes = max_bytes;
threshold_params.enable_max_bytes = true;
num_pkts = 2 * max_bytes / MAX_PAYLOAD;
@@ -3545,7 +3540,7 @@ static wred_pkt_cnts_t *search_expected_pkt_rcv_tbl(odp_tm_percent_t confidence,
uint32_t idx, table_size;
/* Search the EXPECTED_PKT_RCVD table to find a matching entry */
- table_size = sizeof(EXPECTED_PKT_RCVD) / sizeof(wred_pkt_cnts_t);
+ table_size = ODPH_ARRAY_SIZE(EXPECTED_PKT_RCVD);
for (idx = 0; idx < table_size; idx++) {
wred_pkt_cnts = &EXPECTED_PKT_RCVD[idx];
if ((wred_pkt_cnts->confidence_percent == confidence) &&
@@ -4662,7 +4657,7 @@ static void traffic_mngr_test_queue_stats(void)
odp_tm_capabilities_t capa;
pkt_info_t pkt_info;
uint32_t pkts_sent;
- uint32_t num_pkts = MIN(50, MAX_PKTS);
+ uint32_t num_pkts = ODPH_MIN(50u, MAX_PKTS);
uint32_t pkt_len = 256;
CU_ASSERT_FATAL(odp_tm_capability(odp_tm_systems[0], &capa) == 0);
@@ -5039,7 +5034,7 @@ int main(int argc, char *argv[])
ret = odp_cunit_run();
/* Exit with 77 in order to indicate that test is skipped completely */
- if (!ret && suite_inactive == (ARRAY_SIZE(traffic_mngr_suites) - 1))
+ if (!ret && suite_inactive == (ODPH_ARRAY_SIZE(traffic_mngr_suites) - 1))
return 77;
return ret;
}