aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorPetri Savolainen <petri.savolainen@nokia.com>2022-02-11 12:49:33 +0200
committerPetri Savolainen <petri.savolainen@nokia.com>2022-02-17 11:31:51 +0200
commitcfe6116eab8671140123e04e0425adb0e1ba2c99 (patch)
tree97c7b4a8793b0b479bca67aa95fe5f881eb2c2e1 /example
parentd46f3d02d632038ea8e997c9e6c62c571e4e155e (diff)
example: sysinfo: add new capability prints
Added classifier, compression, DMA, and stash capability prints. Updated shm, pool, scheduler, timer, crypto, and IPSEC API capability prints. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
Diffstat (limited to 'example')
-rw-r--r--example/sysinfo/odp_sysinfo.c131
1 files changed, 119 insertions, 12 deletions
diff --git a/example/sysinfo/odp_sysinfo.c b/example/sysinfo/odp_sysinfo.c
index 00ba6e5de..4df26dbb2 100644
--- a/example/sysinfo/odp_sysinfo.c
+++ b/example/sysinfo/odp_sysinfo.c
@@ -332,11 +332,15 @@ int main(void)
odp_system_info_t sysinfo;
odp_shm_capability_t shm_capa;
odp_pool_capability_t pool_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;
uint64_t huge_page[MAX_HUGE_PAGES];
char ava_mask_str[ODP_CPUMASK_STR_SIZE];
char work_mask_str[ODP_CPUMASK_STR_SIZE];
@@ -402,6 +406,21 @@ int main(void)
return -1;
}
+ if (odp_cls_capability(&cls_capa)) {
+ printf("classifier capability failed\n");
+ return -1;
+ }
+
+ if (odp_comp_capability(&comp_capa)) {
+ printf("compression capability failed\n");
+ return -1;
+ }
+
+ if (odp_dma_capability(&dma_capa)) {
+ printf("dma capability failed\n");
+ return -1;
+ }
+
if (odp_queue_capability(&queue_capa)) {
printf("queue capability failed\n");
return -1;
@@ -412,6 +431,11 @@ int main(void)
return -1;
}
+ if (odp_stash_capability(&stash_capa, ODP_STASH_TYPE_DEFAULT)) {
+ printf("stash capability failed\n");
+ return -1;
+ }
+
if (odp_timer_capability(ODP_CLOCK_DEFAULT, &timer_capa)) {
printf("timer capability failed\n");
return -1;
@@ -469,6 +493,13 @@ int main(void)
printf(" max_blocks: %u\n", shm_capa.max_blocks);
printf(" max_size: %" PRIu64 " MB\n", shm_capa.max_size / MB);
printf(" max_align: %" PRIu64 " B\n", shm_capa.max_align);
+ printf(" flags: 0x%x: %s%s%s%s%s%s\n", shm_capa.flags,
+ (shm_capa.flags & ODP_SHM_PROC) ? "PROC " : "",
+ (shm_capa.flags & ODP_SHM_SINGLE_VA) ? "SINGLE_VA " : "",
+ (shm_capa.flags & ODP_SHM_EXPORT) ? "EXPORT " : "",
+ (shm_capa.flags & ODP_SHM_HP) ? "HP " : "",
+ (shm_capa.flags & ODP_SHM_HW_ACCESS) ? "HW_ACCESS " : "",
+ (shm_capa.flags & ODP_SHM_NO_HP) ? "NO_HP " : "");
printf("\n");
printf(" POOL\n");
@@ -477,14 +508,64 @@ int main(void)
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_segs: %u\n", pool_capa.pkt.max_segs_per_pkt);
+ 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: %u B\n", pool_capa.pkt.max_uarea_size);
+ 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("\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("\n");
+ printf(" COMPRESSION\n");
+ printf(" max_sessions: %u\n", comp_capa.max_sessions);
+ printf(" compl_algos: 0x%x\n", comp_capa.comp_algos.all_bits);
+ printf(" hash_algos: 0x%x\n", comp_capa.hash_algos.all_bits);
+ printf(" sync support: %i\n", comp_capa.sync);
+ printf(" async support: %i\n", comp_capa.async);
+
+ 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("\n");
printf(" QUEUE\n");
@@ -498,28 +579,52 @@ int main(void)
printf("\n");
printf(" SCHEDULER\n");
- printf(" max ordered locks: %u\n", schedule_capa.max_ordered_locks);
- printf(" max groups: %u\n", schedule_capa.max_groups);
- printf(" priorities: %u\n", schedule_capa.max_prios);
- printf(" sched.max_queues: %u\n", schedule_capa.max_queues);
- printf(" sched.max_queue_size: %u\n", schedule_capa.max_queue_size);
- printf(" sched.lf_queues: %ssupported\n",
+ printf(" max_ordered_locks: %u\n", schedule_capa.max_ordered_locks);
+ printf(" max_groups: %u\n", schedule_capa.max_groups);
+ printf(" max_prios: %u\n", schedule_capa.max_prios);
+ 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(" sched.wf_queues: %ssupported\n",
+ printf(" waitfree_queues: %ssupported\n",
schedule_capa.waitfree_queues ? "" : "not ");
printf("\n");
- printf(" TIMER\n");
- printf(" highest resolution: %" PRIu64 " nsec\n",
- timer_capa.highest_res_ns);
+ 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_cache_size: %u\n", stash_capa.max_cache_size);
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");
if (crypto_ret == 0) {
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: ");
print_cipher_algos(crypto_capa.ciphers);
printf("\n");
@@ -563,6 +668,8 @@ int main(void)
support_level(ipsec_capa.chksums_in.chksum.sctp));
printf(" max destination CoSes: %u\n", ipsec_capa.max_cls_cos);
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(" max anti-replay window size: %u\n",
ipsec_capa.max_antireplay_ws);
printf(" inline TM pipelining: %s\n",