aboutsummaryrefslogtreecommitdiff
path: root/example/sysinfo/odp_sysinfo.c
blob: cad87b121b68ed221a765365b52f969e1a2a4e9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
/* Copyright (c) 2018, Linaro Limited
 * All rights reserved.
 *
 * SPDX-License-Identifier:     BSD-3-Clause
 */

#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <inttypes.h>

#include <odp_api.h>

#define KB              1024
#define MB              (1024 * 1024)
#define MAX_HUGE_PAGES  32

static const char *support_level(odp_support_t support)
{
	switch (support) {
	case ODP_SUPPORT_NO: return "no";
	case ODP_SUPPORT_YES: return "yes";
	case ODP_SUPPORT_PREFERRED: return "yes, preferred";
	default: return "UNKNOWN";
	}
}

static const char *cpu_arch_name(odp_system_info_t *sysinfo)
{
	odp_cpu_arch_t cpu_arch = sysinfo->cpu_arch;

	switch (cpu_arch) {
	case ODP_CPU_ARCH_ARM:
		return "ARM";
	case ODP_CPU_ARCH_MIPS:
		return "MIPS";
	case ODP_CPU_ARCH_PPC:
		return "PPC";
	case ODP_CPU_ARCH_RISCV:
		return "RISC-V";
	case ODP_CPU_ARCH_X86:
		return "x86";
	default:
		return "Unknown";
	}
}

static const char *arm_isa(odp_cpu_arch_arm_t isa)
{
	switch (isa) {
	case ODP_CPU_ARCH_ARMV6:
		return "ARMv6";
	case ODP_CPU_ARCH_ARMV7:
		return "ARMv7-A";
	case ODP_CPU_ARCH_ARMV8_0:
		return "ARMv8.0-A";
	case ODP_CPU_ARCH_ARMV8_1:
		return "ARMv8.1-A";
	case ODP_CPU_ARCH_ARMV8_2:
		return "ARMv8.2-A";
	case ODP_CPU_ARCH_ARMV8_3:
		return "ARMv8.3-A";
	case ODP_CPU_ARCH_ARMV8_4:
		return "ARMv8.4-A";
	case ODP_CPU_ARCH_ARMV8_5:
		return "ARMv8.5-A";
	case ODP_CPU_ARCH_ARMV8_6:
		return "ARMv8.6-A";
	case ODP_CPU_ARCH_ARMV8_7:
		return "ARMv8.7-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";
	default:
		return "Unknown";
	}
}

static const char *x86_isa(odp_cpu_arch_x86_t isa)
{
	switch (isa) {
	case ODP_CPU_ARCH_X86_I686:
		return "x86_i686";
	case ODP_CPU_ARCH_X86_64:
		return "x86_64";
	default:
		return "Unknown";
	}
}

static const char *cpu_arch_isa(odp_system_info_t *sysinfo, int isa_sw)
{
	odp_cpu_arch_t cpu_arch = sysinfo->cpu_arch;

	switch (cpu_arch) {
	case ODP_CPU_ARCH_ARM:
		if (isa_sw)
			return arm_isa(sysinfo->cpu_isa_sw.arm);
		else
			return arm_isa(sysinfo->cpu_isa_hw.arm);
	case ODP_CPU_ARCH_MIPS:
		return "Unknown";
	case ODP_CPU_ARCH_PPC:
		return "Unknown";
	case ODP_CPU_ARCH_RISCV:
		return "Unknown";
	case ODP_CPU_ARCH_X86:
		if (isa_sw)
			return x86_isa(sysinfo->cpu_isa_sw.x86);
		else
			return x86_isa(sysinfo->cpu_isa_hw.x86);
	default:
		return "Unknown";
	}
}

static const char *cipher_alg_name(odp_cipher_alg_t cipher)
{
	switch (cipher) {
	case ODP_CIPHER_ALG_NULL:
		return "null";
	case ODP_CIPHER_ALG_DES:
		return "des";
	case ODP_CIPHER_ALG_3DES_CBC:
		return "3des_cbc";
	case ODP_CIPHER_ALG_AES_CBC:
		return "aes_cbc";
	case ODP_CIPHER_ALG_AES_CTR:
		return "aes_ctr";
	case ODP_CIPHER_ALG_AES_GCM:
		return "aes_gcm";
	case ODP_CIPHER_ALG_AES_CCM:
		return "aes_ccm";
	case ODP_CIPHER_ALG_CHACHA20_POLY1305:
		return "chacha20_poly1305";
	default:
		return "Unknown";
	}
}

static const char *auth_alg_name(odp_auth_alg_t auth)
{
	switch (auth) {
	case ODP_AUTH_ALG_NULL:
		return "null";
	case ODP_AUTH_ALG_MD5_HMAC:
		return "md5_hmac";
	case ODP_AUTH_ALG_SHA1_HMAC:
		return "sha1_hmac";
	case ODP_AUTH_ALG_SHA256_HMAC:
		return "sha256_hmac";
	case ODP_AUTH_ALG_SHA384_HMAC:
		return "sha384_hmac";
	case ODP_AUTH_ALG_SHA512_HMAC:
		return "sha512_hmac";
	case ODP_AUTH_ALG_AES_XCBC_MAC:
		return "aes_xcbc_mac";
	case ODP_AUTH_ALG_AES_GCM:
		return "aes_gcm";
	case ODP_AUTH_ALG_AES_GMAC:
		return "aes_gmac";
	case ODP_AUTH_ALG_AES_CCM:
		return "aes_ccm";
	case ODP_AUTH_ALG_AES_CMAC:
		return "aes_cmac";
	case ODP_AUTH_ALG_CHACHA20_POLY1305:
		return "chacha20_poly1305";
	default:
		return "Unknown";
	}
}

static void print_cipher_algos(odp_crypto_cipher_algos_t ciphers)
{
	if (ciphers.bit.null)
		printf("%s ", cipher_alg_name(ODP_CIPHER_ALG_NULL));
	if (ciphers.bit.des)
		printf("%s ", cipher_alg_name(ODP_CIPHER_ALG_DES));
	if (ciphers.bit.trides_cbc)
		printf("%s ", cipher_alg_name(ODP_CIPHER_ALG_3DES_CBC));
	if (ciphers.bit.aes_cbc)
		printf("%s ", cipher_alg_name(ODP_CIPHER_ALG_AES_CBC));
	if (ciphers.bit.aes_ctr)
		printf("%s ", cipher_alg_name(ODP_CIPHER_ALG_AES_CTR));
	if (ciphers.bit.aes_gcm)
		printf("%s ", cipher_alg_name(ODP_CIPHER_ALG_AES_GCM));
	if (ciphers.bit.aes_ccm)
		printf("%s ", cipher_alg_name(ODP_CIPHER_ALG_AES_CCM));
	if (ciphers.bit.chacha20_poly1305)
		printf("%s ",
		       cipher_alg_name(ODP_CIPHER_ALG_CHACHA20_POLY1305));
}

static void print_auth_algos(odp_crypto_auth_algos_t auths)
{
	if (auths.bit.null)
		printf("%s ", auth_alg_name(ODP_AUTH_ALG_NULL));
	if (auths.bit.md5_hmac)
		printf("%s ", auth_alg_name(ODP_AUTH_ALG_MD5_HMAC));
	if (auths.bit.sha1_hmac)
		printf("%s ", auth_alg_name(ODP_AUTH_ALG_SHA1_HMAC));
	if (auths.bit.sha256_hmac)
		printf("%s ", auth_alg_name(ODP_AUTH_ALG_SHA256_HMAC));
	if (auths.bit.sha384_hmac)
		printf("%s ", auth_alg_name(ODP_AUTH_ALG_SHA384_HMAC));
	if (auths.bit.sha512_hmac)
		printf("%s ", auth_alg_name(ODP_AUTH_ALG_SHA512_HMAC));
	if (auths.bit.aes_gcm)
		printf("%s ", auth_alg_name(ODP_AUTH_ALG_AES_GCM));
	if (auths.bit.aes_gmac)
		printf("%s ", auth_alg_name(ODP_AUTH_ALG_AES_GMAC));
	if (auths.bit.aes_ccm)
		printf("%s ", auth_alg_name(ODP_AUTH_ALG_AES_CCM));
	if (auths.bit.aes_cmac)
		printf("%s ", auth_alg_name(ODP_AUTH_ALG_AES_CMAC));
	if (auths.bit.aes_xcbc_mac)
		printf("%s ", auth_alg_name(ODP_AUTH_ALG_AES_XCBC_MAC));
	if (auths.bit.chacha20_poly1305)
		printf("%s ", auth_alg_name(ODP_AUTH_ALG_CHACHA20_POLY1305));
}

static void print_cipher_capa(odp_cipher_alg_t cipher)
{
	int caps = odp_crypto_cipher_capability(cipher, NULL, 0);
	int rc, i;

	if (caps <= 0)
		return;

	odp_crypto_cipher_capability_t capa[caps];

	rc = odp_crypto_cipher_capability(cipher, capa, caps);
	if (rc < 0)
		return;

	printf("        %s:\n", cipher_alg_name(cipher));
	for (i = 0; i < rc; i++)
		printf("            key %d iv %d\n",
		       capa[i].key_len, capa[i].iv_len);
}

static void print_auth_capa(odp_auth_alg_t auth)
{
	int caps = odp_crypto_auth_capability(auth, NULL, 0);
	int rc, i;

	if (caps <= 0)
		return;

	odp_crypto_auth_capability_t capa[caps];

	rc = odp_crypto_auth_capability(auth, capa, caps);
	if (rc < 0)
		return;

	printf("        %s:\n", auth_alg_name(auth));
	for (i = 0; i < rc; i++) {
		printf("            digest %d", capa[i].digest_len);
		if (capa[i].key_len != 0)
			printf(" key %d", capa[i].key_len);
		if (capa[i].iv_len != 0)
			printf(" iv %d", capa[i].iv_len);
		if (capa[i].aad_len.max != 0)
			printf(" aad %d, %d, %d",
			       capa[i].aad_len.min, capa[i].aad_len.max,
			       capa[i].aad_len.inc);
		printf("\n");
	}
}

static void print_cipher_caps(odp_crypto_cipher_algos_t ciphers)
{
	if (ciphers.bit.null)
		print_cipher_capa(ODP_CIPHER_ALG_NULL);
	if (ciphers.bit.des)
		print_cipher_capa(ODP_CIPHER_ALG_DES);
	if (ciphers.bit.trides_cbc)
		print_cipher_capa(ODP_CIPHER_ALG_3DES_CBC);
	if (ciphers.bit.aes_cbc)
		print_cipher_capa(ODP_CIPHER_ALG_AES_CBC);
	if (ciphers.bit.aes_ctr)
		print_cipher_capa(ODP_CIPHER_ALG_AES_CTR);
	if (ciphers.bit.aes_gcm)
		print_cipher_capa(ODP_CIPHER_ALG_AES_GCM);
	if (ciphers.bit.aes_ccm)
		print_cipher_capa(ODP_CIPHER_ALG_AES_CCM);
	if (ciphers.bit.chacha20_poly1305)
		print_cipher_capa(ODP_CIPHER_ALG_CHACHA20_POLY1305);
}

static void print_auth_caps(odp_crypto_auth_algos_t auths)
{
	if (auths.bit.null)
		print_auth_capa(ODP_AUTH_ALG_NULL);
	if (auths.bit.md5_hmac)
		print_auth_capa(ODP_AUTH_ALG_MD5_HMAC);
	if (auths.bit.sha1_hmac)
		print_auth_capa(ODP_AUTH_ALG_SHA1_HMAC);
	if (auths.bit.sha256_hmac)
		print_auth_capa(ODP_AUTH_ALG_SHA256_HMAC);
	if (auths.bit.sha384_hmac)
		print_auth_capa(ODP_AUTH_ALG_SHA384_HMAC);
	if (auths.bit.sha512_hmac)
		print_auth_capa(ODP_AUTH_ALG_SHA512_HMAC);
	if (auths.bit.aes_gcm)
		print_auth_capa(ODP_AUTH_ALG_AES_GCM);
	if (auths.bit.aes_gmac)
		print_auth_capa(ODP_AUTH_ALG_AES_GMAC);
	if (auths.bit.aes_ccm)
		print_auth_capa(ODP_AUTH_ALG_AES_CCM);
	if (auths.bit.aes_cmac)
		print_auth_capa(ODP_AUTH_ALG_AES_CMAC);
	if (auths.bit.aes_xcbc_mac)
		print_auth_capa(ODP_AUTH_ALG_AES_XCBC_MAC);
	if (auths.bit.chacha20_poly1305)
		print_auth_capa(ODP_AUTH_ALG_CHACHA20_POLY1305);
}

int main(void)
{
	odp_instance_t inst;
	int i, num_hp, num_hp_print;
	int num_ava, num_work, num_ctrl;
	odp_cpumask_t ava_mask, work_mask, ctrl_mask;
	odp_system_info_t sysinfo;
	odp_shm_capability_t shm_capa;
	odp_pool_capability_t pool_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;
	uint64_t huge_page[MAX_HUGE_PAGES];
	char ava_mask_str[ODP_CPUMASK_STR_SIZE];
	char work_mask_str[ODP_CPUMASK_STR_SIZE];
	char ctrl_mask_str[ODP_CPUMASK_STR_SIZE];
	int crypto_ret;
	int ipsec_ret;

	printf("\n");
	printf("ODP system info example\n");
	printf("***********************************************************\n");
	printf("\n");

	if (odp_init_global(&inst, NULL, NULL)) {
		printf("Global init failed.\n");
		return -1;
	}

	if (odp_init_local(inst, ODP_THREAD_CONTROL)) {
		printf("Local init failed.\n");
		return -1;
	}

	printf("\n");
	printf("odp_sys_info_print()\n");
	printf("***********************************************************\n");
	odp_sys_info_print();

	printf("\n");
	printf("odp_sys_config_print()\n");
	printf("***********************************************************\n");
	odp_sys_config_print();

	if (odp_system_info(&sysinfo)) {
		printf("system info call failed\n");
		return -1;
	}

	memset(ava_mask_str, 0, ODP_CPUMASK_STR_SIZE);
	num_ava = odp_cpumask_all_available(&ava_mask);
	odp_cpumask_to_str(&ava_mask, ava_mask_str, ODP_CPUMASK_STR_SIZE);

	memset(work_mask_str, 0, ODP_CPUMASK_STR_SIZE);
	num_work = odp_cpumask_default_worker(&work_mask, 0);
	odp_cpumask_to_str(&work_mask, work_mask_str, ODP_CPUMASK_STR_SIZE);

	memset(ctrl_mask_str, 0, ODP_CPUMASK_STR_SIZE);
	num_ctrl = odp_cpumask_default_control(&ctrl_mask, 0);
	odp_cpumask_to_str(&ctrl_mask, ctrl_mask_str, ODP_CPUMASK_STR_SIZE);

	num_hp = odp_sys_huge_page_size_all(huge_page, MAX_HUGE_PAGES);

	num_hp_print = num_hp;
	if (num_hp_print > MAX_HUGE_PAGES)
		num_hp_print = MAX_HUGE_PAGES;

	if (odp_shm_capability(&shm_capa)) {
		printf("shm capability failed\n");
		return -1;
	}

	if (odp_pool_capability(&pool_capa)) {
		printf("pool capability failed\n");
		return -1;
	}

	if (odp_queue_capability(&queue_capa)) {
		printf("queue capability failed\n");
		return -1;
	}

	if (odp_schedule_capability(&schedule_capa)) {
		printf("schedule capability failed\n");
		return -1;
	}

	if (odp_timer_capability(ODP_CLOCK_CPU, &timer_capa)) {
		printf("timer capability failed\n");
		return -1;
	}

	crypto_ret = odp_crypto_capability(&crypto_capa);
	if (crypto_ret < 0)
		printf("crypto capability failed\n");

	ipsec_ret = odp_ipsec_capability(&ipsec_capa);
	if (ipsec_ret < 0)
		printf("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");
	printf("***********************************************************\n");
	printf("\n");
	printf("  ODP API version:        %s\n", odp_version_api_str());
	printf("  ODP impl name:          %s\n", odp_version_impl_name());
	printf("  ODP impl details:       %s\n", odp_version_impl_str());
	printf("  CPU model:              %s\n", odp_cpu_model_str());
	printf("  CPU arch:               %s\n", cpu_arch_name(&sysinfo));
	printf("  CPU ISA version:        %s\n", cpu_arch_isa(&sysinfo, 0));
	printf("  SW ISA version:         %s\n", cpu_arch_isa(&sysinfo, 1));
	printf("  CPU max freq:           %" PRIu64 " hz\n", odp_cpu_hz_max());
	printf("  Current CPU:            %i\n", odp_cpu_id());
	printf("  Current CPU freq:       %" PRIu64 " hz\n", odp_cpu_hz());
	printf("  CPU count:              %i\n", odp_cpu_count());
	printf("  CPU available num:      %i\n", num_ava);
	printf("  CPU available mask:     %s\n", ava_mask_str);
	printf("  CPU worker num:         %i\n", num_work);
	printf("  CPU worker mask:        %s\n", work_mask_str);
	printf("  CPU control num:        %i\n", num_ctrl);
	printf("  CPU control mask:       %s\n", ctrl_mask_str);
	printf("  Max threads (define):   %i\n", ODP_THREAD_COUNT_MAX);
	printf("  Max threads:            %i\n", odp_thread_count_max());
	printf("  Byte order:             %s (%i / %i)\n",
	       ODP_BYTE_ORDER == ODP_BIG_ENDIAN ? "big" : "little",
	       ODP_BIG_ENDIAN, ODP_LITTLE_ENDIAN);
	printf("  Bitfield order:         %s (%i / %i)\n",
	       ODP_BITFIELD_ORDER == ODP_BIG_ENDIAN_BITFIELD ?
	       "big" : "little",
	       ODP_BIG_ENDIAN_BITFIELD, ODP_LITTLE_ENDIAN_BITFIELD);
	printf("  Cache line size:        %i B\n", odp_sys_cache_line_size());
	printf("  Page size:              %" PRIu64 " kB\n",
	       odp_sys_page_size() / KB);
	printf("  Default huge page size: %" PRIu64 " kB\n",
	       odp_sys_huge_page_size() / KB);
	printf("  Num huge page sizes:    %i\n", num_hp);

	for (i = 0; i < num_hp_print; i++)
		printf("  Huge page size [%i]:     %" PRIu64 " kB\n",
		       i, huge_page[i] / KB);

	printf("\n");
	printf("  SHM\n");
	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("\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:        %" PRIu32 " B\n",
	       pool_capa.buf.max_align);
	printf("    buf.max_size:         %" PRIu32 " kB\n",
	       pool_capa.buf.max_size / KB);
	printf("    buf.max_num:          %" PRIu32 "\n",
	       pool_capa.buf.max_num);
	printf("    pkt.max_pools:        %u\n", pool_capa.pkt.max_pools);
	printf("    pkt.max_len:          %" PRIu32 " kB\n",
	       pool_capa.pkt.max_len / KB);
	printf("    pkt.max_num:          %" PRIu32 "\n",
	       pool_capa.pkt.max_num);
	printf("    pkt.max_segs:         %" PRIu32 "\n",
	       pool_capa.pkt.max_segs_per_pkt);
	printf("    pkt.max_seg_len:      %" PRIu32 " B\n",
	       pool_capa.pkt.max_seg_len);
	printf("    pkt.max_uarea:        %" PRIu32 " B\n",
	       pool_capa.pkt.max_uarea_size);
	printf("    tmo.max_pools:        %u\n", pool_capa.tmo.max_pools);
	printf("    tmo.max_num:          %" PRIu32 "\n",
	       pool_capa.tmo.max_num);

	printf("\n");
	printf("  QUEUE\n");
	printf("    max queues:           %" PRIu32 "\n",
	       queue_capa.max_queues);
	printf("    plain.max_num:        %" PRIu32 "\n",
	       queue_capa.plain.max_num);
	printf("    plain.max_size:       %" PRIu32 "\n",
	       queue_capa.plain.max_size);
	printf("    plain.lf.max_num:     %" PRIu32 "\n",
	       queue_capa.plain.lockfree.max_num);
	printf("    plain.lf.max_size:    %" PRIu32 "\n",
	       queue_capa.plain.lockfree.max_size);
	printf("    plain.wf.max_num:     %" PRIu32 "\n",
	       queue_capa.plain.waitfree.max_num);
	printf("    plain.wf.max_size:    %" PRIu32 "\n",
	       queue_capa.plain.waitfree.max_size);

	printf("\n");
	printf("  SCHEDULER\n");
	printf("    max ordered locks:    %" PRIu32 "\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:     %" PRIu32 "\n",
	       schedule_capa.max_queues);
	printf("    sched.max_queue_size: %" PRIu32 "\n",
	       schedule_capa.max_queue_size);
	printf("    sched.lf_queues:      %ssupported\n",
	       schedule_capa.lockfree_queues ? "" : "not ");
	printf("    sched.wf_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("\n");

	if (crypto_ret == 0) {
		printf("  CRYPTO\n");
		printf("    max sessions:         %" PRIu32 "\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("    cipher algorithms:    ");
		print_cipher_algos(crypto_capa.ciphers);
		printf("\n");
		print_cipher_caps(crypto_capa.ciphers);
		printf("    auth algorithms:      ");
		print_auth_algos(crypto_capa.auths);
		printf("\n");
		print_auth_caps(crypto_capa.auths);
		printf("\n");
	}

	if (ipsec_ret == 0) {
		printf("  IPSEC\n");
		printf("    max SAs:                      %" PRIu32 "\n",
		       ipsec_capa.max_num_sa);
		printf("    sync mode support:            %s\n",
		       support_level(ipsec_capa.op_mode_sync));
		printf("    async mode support:           %s\n",
		       support_level(ipsec_capa.op_mode_async));
		printf("    inline inbound mode support:  %s\n",
		       support_level(ipsec_capa.op_mode_inline_in));
		printf("    inline outbound mode support: %s\n",
		       support_level(ipsec_capa.op_mode_inline_out));
		printf("    AH support:                   %s\n",
		       support_level(ipsec_capa.proto_ah));
		printf("    post-IPsec fragmentation:     %s\n",
		       support_level(ipsec_capa.frag_after));
		printf("    pre-IPsec fragmentation:      %s\n",
		       support_level(ipsec_capa.frag_before));
		printf("    post-IPsec classification:    %s\n",
		       support_level(ipsec_capa.pipeline_cls));
		printf("    retaining outer headers:      %s\n",
		       support_level(ipsec_capa.retain_header));
		printf("    inbound checksum offload support:\n");
		printf("      IPv4 header checksum:       %s\n",
		       support_level(ipsec_capa.chksums_in.chksum.ipv4));
		printf("      UDP checksum:               %s\n",
		       support_level(ipsec_capa.chksums_in.chksum.udp));
		printf("      TCP checksum:               %s\n",
		       support_level(ipsec_capa.chksums_in.chksum.tcp));
		printf("      SCTP checksum:              %s\n",
		       support_level(ipsec_capa.chksums_in.chksum.sctp));
		printf("    max destination CoSes:        %" PRIu32 "\n",
		       ipsec_capa.max_cls_cos);
		printf("    max destination queues:       %" PRIu32 "\n",
		       ipsec_capa.max_queues);
		printf("    max anti-replay window size:  %" PRIu32 "\n",
		       ipsec_capa.max_antireplay_ws);
		printf("    inline TM pipelining:         %s\n",
		       support_level(ipsec_capa.inline_ipsec_tm));
		printf("    cipher algorithms:            ");
		print_cipher_algos(ipsec_capa.ciphers);
		printf("\n");
		printf("    auth algorithms:              ");
		print_auth_algos(ipsec_capa.auths);
		printf("\n\n");
	}

	printf("  SHM MEMORY BLOCKS:\n");
	odp_shm_print_all();

	printf("\n");
	printf("***********************************************************\n");
	printf("\n");

	if (odp_term_local()) {
		printf("Local term failed.\n");
		return -1;
	}

	if (odp_term_global(inst)) {
		printf("Global term failed.\n");
		return -1;
	}

	return 0;
}