27#include <odp/helper/odph_api.h>
37#define PKT_BUF_NUM (32 * 1024)
38#define MAX_NUM_IFACES 2
39#define TEST_HDR_MAGIC 0x92749451
40#define MAX_WORKERS (ODP_THREAD_COUNT_MAX - 1)
41#define BATCH_LEN_MAX 32
44#define RATE_SEARCH_INITIAL_PPS 1000000
49#define RATE_SEARCH_ACCURACY_PPS 100000
54#define SHUTDOWN_DELAY_NS (ODP_TIME_MSEC_IN_NS * 100)
60#define DEFAULT_DURATION 1
62#define PKT_HDR_LEN (sizeof(pkt_head_t) + ODPH_UDPHDR_LEN + \
63 ODPH_IPV4HDR_LEN + ODPH_ETHHDR_LEN)
67 unsigned int cpu_count;
70 uint32_t tx_batch_len;
74 uint32_t rx_batch_len;
87 const char *ifaces[MAX_NUM_IFACES];
98 uint64_t alloc_failures;
99 uint64_t enq_failures;
113 pkt_rx_stats_t *rx_stats;
114 pkt_tx_stats_t *tx_stats;
115 uint8_t src_mac[ODPH_ETHADDR_LEN];
116 uint8_t dst_mac[ODPH_ETHADDR_LEN];
117 uint32_t rx_stats_size;
118 uint32_t tx_stats_size;
145static test_globals_t *gbl_args;
161 payload_len =
sizeof(pkt_hdr) + gbl_args->args.pkt_len;
164 payload_len + ODPH_UDPHDR_LEN +
165 ODPH_IPV4HDR_LEN + ODPH_ETHHDR_LEN);
175 eth = (odph_ethhdr_t *)buf;
176 memcpy(eth->src.addr, gbl_args->src_mac, ODPH_ETHADDR_LEN);
177 memcpy(eth->dst.addr, gbl_args->dst_mac, ODPH_ETHADDR_LEN);
181 offset += ODPH_ETHHDR_LEN;
183 ip = (odph_ipv4hdr_t *)(buf + ODPH_ETHHDR_LEN);
186 ip->ver_ihl = ODPH_IPV4 << 4 | ODPH_IPV4HDR_IHL_MIN;
190 ip->proto = ODPH_IPPROTO_UDP;
193 odph_ipv4_csum_update(pkt);
196 offset += ODPH_IPV4HDR_LEN;
198 udp = (odph_udphdr_t *)(buf + offset);
205 offset += ODPH_UDPHDR_LEN;
206 pkt_hdr.magic = TEST_HDR_MAGIC;
209 ODPH_ABORT(
"Failed to generate test packet.\n");
222 l4_off = ODPH_ETHHDR_LEN + ODPH_IPV4HDR_LEN;
224 l4_off + ODPH_UDPHDR_LEN,
225 sizeof(pkt_hdr), &pkt_hdr);
230 if (pkt_hdr.magic == TEST_HDR_MAGIC)
239static int alloc_packets(
odp_packet_t *pkt_tbl,
int num_pkts)
245 for (n = 0; n < num_pkts; ++n) {
246 pkt_tbl[n] = pktio_create_packet(seq + n);
263 while (sent < pkts) {
274 tx_drops = pkts - sent;
286static int run_thread_tx(
void *arg)
288 test_globals_t *globals;
291 pkt_tx_stats_t *stats;
292 odp_time_t cur_time, send_time_end, send_duration;
299 thread_args_t *targs = arg;
301 batch_len = targs->batch_len;
303 if (batch_len > BATCH_LEN_MAX)
304 batch_len = BATCH_LEN_MAX;
309 stats = &globals->tx_stats[thr_id];
312 ODPH_ABORT(
"Failed to get output queue for thread %d\n",
324 burst_gap_end = cur_time;
326 unsigned alloc_cnt = 0, tx_cnt;
331 idle_start = cur_time;
346 alloc_cnt = alloc_packets(tx_packet, batch_len - unsent_pkts);
347 if (alloc_cnt != batch_len)
348 stats->alloc_failures++;
350 tx_cnt = send_packets(pktout, tx_packet, alloc_cnt);
351 unsent_pkts = alloc_cnt - tx_cnt;
352 stats->enq_failures += unsent_pkts;
353 stats->tx_cnt += tx_cnt;
358 if (gbl_args->args.verbose)
359 printf(
" %02d: TxPkts %-8" PRIu64
" EnqFail %-6" PRIu64
360 " AllocFail %-6" PRIu64
" Idle %" PRIu64
"ms\n",
361 thr_id, stats->tx_cnt, stats->enq_failures,
362 stats->alloc_failures,
390 event_tbl, num_pkts);
396static int run_thread_rx(
void *arg)
398 test_globals_t *globals;
399 int thr_id, batch_len;
403 thread_args_t *targs = arg;
405 batch_len = targs->batch_len;
407 if (batch_len > BATCH_LEN_MAX)
408 batch_len = BATCH_LEN_MAX;
414 pkt_rx_stats_t *stats = &globals->rx_stats[thr_id];
416 if (gbl_args->args.schedule == 0) {
418 ODPH_ABORT(
"No input queue.\n");
426 n_ev = receive_packets(queue, ev, batch_len);
428 for (i = 0; i < n_ev; ++i) {
431 if (pktio_pkt_has_magic(pkt))
450static int process_results(uint64_t expected_tx_cnt,
451 test_status_t *status)
455 uint64_t rx_pkts = 0;
456 uint64_t tx_pkts = 0;
457 uint64_t attempted_pps;
463 rx_pkts += gbl_args->rx_stats[i].rx_cnt;
464 tx_pkts += gbl_args->tx_stats[i].tx_cnt;
468 ODPH_ERR(
"no packets received\n");
472 if (tx_pkts < (expected_tx_cnt - (expected_tx_cnt / 100))) {
475 }
else if (tx_pkts > rx_pkts) {
478 drops = tx_pkts - rx_pkts;
481 attempted_pps = status->pps_curr;
483 len += snprintf(&str[len],
sizeof(str) - 1 - len,
484 "PPS: %-8" PRIu64
" ", attempted_pps);
485 len += snprintf(&str[len],
sizeof(str) - 1 - len,
486 "Succeeded: %-4s ", fail ?
"No" :
"Yes");
487 len += snprintf(&str[len],
sizeof(str) - 1 - len,
488 "TxPkts: %-8" PRIu64
" ", tx_pkts);
489 len += snprintf(&str[len],
sizeof(str) - 1 - len,
490 "RxPkts: %-8" PRIu64
" ", rx_pkts);
491 len += snprintf(&str[len],
sizeof(str) - 1 - len,
492 "DropPkts: %-8" PRIu64
" ", drops);
495 if (gbl_args->args.search == 0) {
496 printf(
"Result: %s\n", fail ?
"FAILED" :
"PASSED");
497 return fail ? -1 : 0;
500 if (fail && (status->pps_fail == 0 ||
501 attempted_pps < status->pps_fail)) {
502 status->pps_fail = attempted_pps;
503 }
else if (attempted_pps > status->pps_pass) {
504 status->pps_pass = attempted_pps;
507 if (status->pps_fail == 0) {
509 status->pps_curr *= 2;
513 status->pps_curr = status->pps_pass +
514 ((status->pps_fail - status->pps_pass) / 2);
518 if ((status->pps_fail - status->pps_pass) < RATE_SEARCH_ACCURACY_PPS) {
519 unsigned pkt_len = gbl_args->args.pkt_len + PKT_HDR_LEN;
520 int mbps = (pkt_len * status->pps_pass * 8) / 1024 / 1024;
522 printf(
"Maximum packet rate: %" PRIu64
" PPS (%d Mbps)\n",
523 status->pps_pass, mbps);
535 int num_workers, num_tx_workers, num_rx_workers;
540 gbl_args->args.cpu_count);
541 if (num_workers < 2) {
542 ODPH_ERR(
"Need at least two cores\n");
546 if (num_workers > MAX_WORKERS) {
547 ODPH_DBG(
"Worker count limited to MAX_WORKERS define (=%d)\n",
549 num_workers = MAX_WORKERS;
552 if (gbl_args->args.num_tx_workers) {
553 if (gbl_args->args.num_tx_workers > (num_workers - 1)) {
554 ODPH_ERR(
"Invalid TX worker count\n");
557 num_tx_workers = gbl_args->args.num_tx_workers;
561 num_tx_workers = (num_workers + 1) / 2;
568 for (i = 0; i < num_workers; ++i) {
569 if (i < num_tx_workers)
591 test_status_t *status)
593 odph_thread_t thread_tbl[MAX_WORKERS];
594 odph_thread_common_param_t thr_common;
595 odph_thread_param_t thr_param;
596 thread_args_t args_tx, args_rx;
597 uint64_t expected_tx_cnt;
598 int num_tx_workers, num_rx_workers;
602 memset(thread_tbl, 0,
sizeof(thread_tbl));
603 memset(gbl_args->rx_stats, 0, gbl_args->rx_stats_size);
604 memset(gbl_args->tx_stats, 0, gbl_args->tx_stats_size);
606 expected_tx_cnt = status->pps_curr * gbl_args->args.duration / T_SCALE;
611 args_rx.batch_len = gbl_args->args.rx_batch_len;
613 odph_thread_common_param_init(&thr_common);
614 thr_common.instance = gbl_args->instance;
615 thr_common.cpumask = thd_mask_rx;
616 thr_common.share_param = 1;
618 odph_thread_param_init(&thr_param);
619 thr_param.start = run_thread_rx;
620 thr_param.arg = &args_rx;
623 odph_thread_create(thread_tbl, &thr_common, &thr_param, num_rx_workers);
629 args_tx.pps = status->pps_curr / num_tx_workers;
630 args_tx.duration = gbl_args->args.duration;
631 args_tx.batch_len = gbl_args->args.tx_batch_len;
633 odph_thread_common_param_init(&thr_common);
634 thr_common.instance = gbl_args->instance;
635 thr_common.cpumask = thd_mask_tx;
636 thr_common.share_param = 1;
638 odph_thread_param_init(&thr_param);
639 thr_param.start = run_thread_tx;
640 thr_param.arg = &args_tx;
643 odph_thread_create(&thread_tbl[num_rx_workers], &thr_common, &thr_param, num_tx_workers);
647 odph_thread_join(&thread_tbl[num_rx_workers], num_tx_workers);
656 odph_thread_join(thread_tbl, num_rx_workers);
659 return process_results(expected_tx_cnt, status);
664static int run_test(
void)
669 test_status_t status = {
670 .pps_curr = gbl_args->args.pps,
676 ret = setup_txrx_masks(&txmask, &rxmask);
680 printf(
"Starting test with params:\n");
683 printf(
"\tDuration (seconds): \t%d\n", gbl_args->args.duration);
684 printf(
"\tTransmit batch length:\t%" PRIu32
"\n",
685 gbl_args->args.tx_batch_len);
686 printf(
"\tReceive batch length: \t%" PRIu32
"\n",
687 gbl_args->args.rx_batch_len);
688 printf(
"\tPacket receive method:\t%s\n",
689 gbl_args->args.schedule ?
"schedule" :
"plain");
690 printf(
"\tInterface(s): \t");
691 for (i = 0; i < gbl_args->args.num_ifaces; ++i)
692 printf(
"%s ", gbl_args->args.ifaces[i]);
696 run_test_single(&txmask, &rxmask, &status);
700 ret = run_test_single(&txmask, &rxmask, &status);
708static odp_pktio_t create_pktio(
const char *iface,
int schedule)
717 params.
pkt.
len = PKT_HDR_LEN + gbl_args->args.pkt_len;
719 params.
pkt.
num = PKT_BUF_NUM;
722 snprintf(pool_name,
sizeof(pool_name),
"pkt_pool_%s", iface);
739static int test_init(
void)
747 params.
pkt.
len = PKT_HDR_LEN + gbl_args->args.pkt_len;
749 params.
pkt.
num = PKT_BUF_NUM;
755 ODPH_ABORT(
"Failed to create transmit pool\n");
760 iface = gbl_args->args.ifaces[0];
761 schedule = gbl_args->args.schedule;
767 gbl_args->pktio_tx = create_pktio(iface, schedule);
768 if (gbl_args->args.num_ifaces > 1) {
769 iface = gbl_args->args.ifaces[1];
770 gbl_args->pktio_rx = create_pktio(iface, schedule);
772 gbl_args->pktio_rx = gbl_args->pktio_tx;
782 ODPH_ERR(
"failed to open pktio\n");
788 ODPH_ERR(
"failed to configure pktio_tx queue\n");
794 ODPH_ERR(
"failed to configure pktio_tx queue\n");
805 if (gbl_args->args.num_ifaces > 1) {
807 ODPH_ERR(
"failed to configure pktio_rx queue\n");
812 ODPH_ERR(
"failed to configure pktio_rx queue\n");
819 if (gbl_args->args.num_ifaces > 1 &&
853static int test_term(
void)
860 if (gbl_args->pktio_tx != gbl_args->pktio_rx) {
862 ODPH_ERR(
"Failed to stop pktio_tx\n");
867 ODPH_ERR(
"Failed to close pktio_tx\n");
872 empty_inq(gbl_args->pktio_rx);
875 ODPH_ERR(
"Failed to stop pktio_rx\n");
880 ODPH_ERR(
"Failed to close pktio_rx\n");
884 for (i = 0; i < gbl_args->args.num_ifaces; ++i) {
885 snprintf(pool_name,
sizeof(pool_name),
886 "pkt_pool_%s", gbl_args->args.ifaces[i]);
892 ODPH_ERR(
"Failed to destroy pool %s\n", pool_name);
898 ODPH_ERR(
"Failed to destroy transmit pool\n");
902 free(gbl_args->args.if_str);
905 ODPH_ERR(
"Failed to free test_globals\n");
909 ODPH_ERR(
"Failed to free test_globals.rx_stats\n");
913 ODPH_ERR(
"Failed to free test_globals.tx_stats\n");
920static void usage(
void)
922 printf(
"\nUsage: odp_pktio_perf [options]\n\n");
923 printf(
" -c, --count <number> CPU count, 0=all available, default=2\n");
924 printf(
" -t, --txcount <number> Number of CPUs to use for TX\n");
925 printf(
" default: cpu_count+1/2\n");
926 printf(
" -b, --txbatch <length> Number of packets per TX batch\n");
927 printf(
" default: %d\n", BATCH_LEN_MAX);
928 printf(
" -p, --plain Plain input queue for packet RX\n");
929 printf(
" default: disabled (use scheduler)\n");
930 printf(
" -R, --rxbatch <length> Number of packets per RX batch\n");
931 printf(
" default: %d\n", BATCH_LEN_MAX);
932 printf(
" -l, --length <length> Additional payload length in bytes\n");
933 printf(
" default: 0\n");
934 printf(
" -r, --rate <number> Attempted packet rate in PPS\n");
935 printf(
" -i, --interface <list> List of interface names to use\n");
936 printf(
" -d, --duration <secs> Duration of each test iteration\n");
937 printf(
" -v, --verbose Print verbose information\n");
938 printf(
" -h, --help This help\n");
942static void parse_args(
int argc,
char *argv[], test_args_t *args)
946 static const struct option longopts[] = {
947 {
"count", required_argument, NULL,
'c'},
948 {
"txcount", required_argument, NULL,
't'},
949 {
"txbatch", required_argument, NULL,
'b'},
950 {
"plain", no_argument, NULL,
'p'},
951 {
"rxbatch", required_argument, NULL,
'R'},
952 {
"length", required_argument, NULL,
'l'},
953 {
"rate", required_argument, NULL,
'r'},
954 {
"interface", required_argument, NULL,
'i'},
955 {
"duration", required_argument, NULL,
'd'},
956 {
"verbose", no_argument, NULL,
'v'},
957 {
"help", no_argument, NULL,
'h'},
961 static const char *shortopts =
"+c:t:b:pR:l:r:i:d:vh";
964 args->num_tx_workers = 0;
965 args->tx_batch_len = BATCH_LEN_MAX;
966 args->rx_batch_len = BATCH_LEN_MAX;
967 args->duration = DEFAULT_DURATION;
968 args->pps = RATE_SEARCH_INITIAL_PPS;
974 opt = getopt_long(argc, argv, shortopts,
985 args->cpu_count = atoi(optarg);
988 args->num_tx_workers = atoi(optarg);
991 args->duration = atoi(optarg) * T_SCALE;
994 args->pps = atoi(optarg);
1002 args->if_str = malloc(strlen(optarg) + 1);
1005 ODPH_ABORT(
"Failed to alloc iface storage\n");
1007 strcpy(args->if_str, optarg);
1008 for (token = strtok(args->if_str,
",");
1009 token != NULL && args->num_ifaces < MAX_NUM_IFACES;
1010 token = strtok(NULL,
","))
1011 args->ifaces[args->num_ifaces++] = token;
1018 args->tx_batch_len = atoi(optarg);
1021 args->rx_batch_len = atoi(optarg);
1027 args->pkt_len = atoi(optarg);
1032 if (args->num_ifaces == 0) {
1033 args->ifaces[0] =
"loop";
1034 args->num_ifaces = 1;
1038int main(
int argc,
char **argv)
1043 odph_helper_options_t helper_options;
1048 argc = odph_parse_options(argc, argv);
1049 if (odph_options(&helper_options)) {
1050 ODPH_ERR(
"Error: reading ODP helper options failed.\n");
1055 init_param.
mem_model = helper_options.mem_model;
1058 ODPH_ABORT(
"Failed global init.\n");
1061 ODPH_ABORT(
"Failed local init.\n");
1066 sizeof(test_globals_t), ODP_CACHE_LINE_SIZE, 0);
1068 ODPH_ABORT(
"Shared memory reserve failed.\n");
1071 if (gbl_args == NULL)
1072 ODPH_ABORT(
"Shared memory reserve failed.\n");
1073 memset(gbl_args, 0,
sizeof(test_globals_t));
1077 gbl_args->instance = instance;
1078 gbl_args->rx_stats_size = max_thrs *
sizeof(pkt_rx_stats_t);
1079 gbl_args->tx_stats_size = max_thrs *
sizeof(pkt_tx_stats_t);
1082 gbl_args->rx_stats_size,
1083 ODP_CACHE_LINE_SIZE, 0);
1085 ODPH_ABORT(
"Shared memory reserve failed.\n");
1089 if (gbl_args->rx_stats == NULL)
1090 ODPH_ABORT(
"Shared memory reserve failed.\n");
1092 memset(gbl_args->rx_stats, 0, gbl_args->rx_stats_size);
1095 gbl_args->tx_stats_size,
1096 ODP_CACHE_LINE_SIZE, 0);
1098 ODPH_ABORT(
"Shared memory reserve failed.\n");
1102 if (gbl_args->tx_stats == NULL)
1103 ODPH_ABORT(
"Shared memory reserve failed.\n");
1105 memset(gbl_args->tx_stats, 0, gbl_args->tx_stats_size);
1107 parse_args(argc, argv, &gbl_args->args);
void odp_atomic_init_u32(odp_atomic_u32_t *atom, uint32_t val)
Initialize atomic uint32 variable.
uint32_t odp_atomic_load_u32(odp_atomic_u32_t *atom)
Load value of atomic uint32 variable.
uint32_t odp_atomic_fetch_add_u32(odp_atomic_u32_t *atom, uint32_t val)
Fetch and add to atomic uint32 variable.
void odp_atomic_store_u32(odp_atomic_u32_t *atom, uint32_t val)
Store value to atomic uint32 variable.
void odp_barrier_init(odp_barrier_t *barr, int count)
Initialize barrier with thread count.
void odp_barrier_wait(odp_barrier_t *barr)
Synchronize thread execution on barrier.
#define ODP_ALIGNED_CACHE
Defines type/struct/variable to be cache line size aligned.
#define odp_unlikely(x)
Branch unlikely taken.
uint32_t odp_u32be_t
unsigned 32bit big endian
odp_u16be_t odp_cpu_to_be_16(uint16_t cpu16)
Convert cpu native uint16_t to 16bit big endian.
#define odp_likely(x)
Branch likely taken.
odp_u32be_t odp_cpu_to_be_32(uint32_t cpu32)
Convert cpu native uint32_t to 32bit big endian.
void odp_cpumask_set(odp_cpumask_t *mask, int cpu)
Add CPU to mask.
int odp_cpumask_default_worker(odp_cpumask_t *mask, int num)
Default CPU mask for worker threads.
int odp_cpumask_first(const odp_cpumask_t *mask)
Find first set CPU in mask.
int odp_cpumask_next(const odp_cpumask_t *mask, int cpu)
Find next set CPU in mask.
void odp_cpumask_zero(odp_cpumask_t *mask)
Clear entire CPU mask.
int odp_cpumask_count(const odp_cpumask_t *mask)
Count number of CPUs set in mask.
void odp_event_free(odp_event_t event)
Free event.
odp_event_type_t odp_event_type(odp_event_t event)
Event type of an event.
#define ODP_EVENT_INVALID
Invalid event.
void odp_init_param_init(odp_init_t *param)
Initialize the odp_init_t to default values for all fields.
int odp_init_local(odp_instance_t instance, odp_thread_type_t thr_type)
Thread local ODP initialization.
int odp_init_global(odp_instance_t *instance, const odp_init_t *params, const odp_platform_init_t *platform_params)
Global ODP initialization.
int odp_term_local(void)
Thread local ODP termination.
int odp_term_global(odp_instance_t instance)
Global ODP termination.
uint64_t odp_instance_t
ODP instance ID.
int odp_pktio_mac_addr(odp_pktio_t pktio, void *mac_addr, int size)
Get the default MAC address of a packet IO interface.
void odp_pktio_param_init(odp_pktio_param_t *param)
Initialize pktio params.
int odp_pktio_close(odp_pktio_t pktio)
Close a packet IO interface.
int odp_pktout_queue(odp_pktio_t pktio, odp_pktout_queue_t queues[], int num)
Direct packet output queues.
void odp_pktio_config_init(odp_pktio_config_t *config)
Initialize packet IO configuration options.
int odp_pktin_event_queue(odp_pktio_t pktio, odp_queue_t queues[], int num)
Event queues for packet input.
odp_pktio_t odp_pktio_open(const char *name, odp_pool_t pool, const odp_pktio_param_t *param)
Open a packet IO interface.
int odp_pktio_config(odp_pktio_t pktio, const odp_pktio_config_t *config)
Configure packet IO interface options.
int odp_pktio_start(odp_pktio_t pktio)
Start packet receive and transmit.
#define ODP_PKTIO_INVALID
Invalid packet IO handle.
int odp_pktio_stop(odp_pktio_t pktio)
Stop packet receive and transmit.
int odp_pktout_send(odp_pktout_queue_t queue, const odp_packet_t packets[], int num)
Send packets directly to an interface output queue.
int odp_pktin_queue_config(odp_pktio_t pktio, const odp_pktin_queue_param_t *param)
Configure packet input queues.
int odp_pktout_queue_config(odp_pktio_t pktio, const odp_pktout_queue_param_t *param)
Configure packet output queues.
@ ODP_PKTIN_MODE_QUEUE
Packet input through plain event queues.
@ ODP_PKTIN_MODE_SCHED
Packet input through scheduler and scheduled event queues.
int odp_packet_l3_offset_set(odp_packet_t pkt, uint32_t offset)
Set layer 3 start offset.
void * odp_packet_data(odp_packet_t pkt)
Packet data pointer.
int odp_packet_l4_offset_set(odp_packet_t pkt, uint32_t offset)
Set layer 4 start offset.
odp_packet_t odp_packet_alloc(odp_pool_t pool, uint32_t len)
Allocate a packet from a packet pool.
int odp_packet_l2_offset_set(odp_packet_t pkt, uint32_t offset)
Set layer 2 start offset.
odp_packet_t odp_packet_from_event(odp_event_t ev)
Get packet handle from event.
int odp_packet_copy_from_mem(odp_packet_t pkt, uint32_t offset, uint32_t len, const void *src)
Copy data from memory to packet.
#define ODP_PACKET_INVALID
Invalid packet.
void odp_packet_free_multi(const odp_packet_t pkt[], int num)
Free multiple packets.
int odp_packet_copy_to_mem(odp_packet_t pkt, uint32_t offset, uint32_t len, void *dst)
Copy data from packet to memory.
@ ODP_PROTO_LAYER_NONE
No layers.
#define ODP_POOL_NAME_LEN
Maximum pool name length, including the null character.
odp_pool_t odp_pool_create(const char *name, const odp_pool_param_t *param)
Create a pool.
void odp_pool_param_init(odp_pool_param_t *param)
Initialize pool params.
int odp_pool_destroy(odp_pool_t pool)
Destroy a pool previously created by odp_pool_create()
odp_pool_t odp_pool_lookup(const char *name)
Find a pool by name.
#define ODP_POOL_INVALID
Invalid pool.
@ ODP_POOL_PACKET
Packet pool.
#define ODP_QUEUE_INVALID
Invalid queue.
odp_event_t odp_queue_deq(odp_queue_t queue)
Dequeue an event from a queue.
odp_queue_type_t
Queue type.
odp_queue_type_t odp_queue_type(odp_queue_t queue)
Queue type.
int odp_queue_deq_multi(odp_queue_t queue, odp_event_t events[], int num)
Dequeue multiple events from a queue.
@ ODP_QUEUE_TYPE_PLAIN
Plain queue.
int odp_schedule_multi(odp_queue_t *from, uint64_t wait, odp_event_t events[], int num)
Schedule multiple events.
#define ODP_SCHED_NO_WAIT
Do not wait.
int odp_schedule_config(const odp_schedule_config_t *config)
Global schedule configuration.
odp_event_t odp_schedule(odp_queue_t *from, uint64_t wait)
Schedule an event.
odp_shm_t odp_shm_lookup(const char *name)
Lookup for a block of shared memory.
int odp_shm_free(odp_shm_t shm)
Free a contiguous block of shared memory.
void * odp_shm_addr(odp_shm_t shm)
Shared memory block address.
#define ODP_SHM_INVALID
Invalid shared memory block.
odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align, uint32_t flags)
Reserve a contiguous block of shared memory.
void odp_sys_info_print(void)
Print system info.
int odp_thread_count_max(void)
Maximum thread count.
int odp_thread_id(void)
Get thread identifier.
@ ODP_THREAD_WORKER
Worker thread.
@ ODP_THREAD_CONTROL
Control thread.
uint64_t odp_time_to_ns(odp_time_t time)
Convert time to nanoseconds.
odp_time_t odp_time_diff(odp_time_t t2, odp_time_t t1)
Time difference.
odp_time_t odp_time_sum(odp_time_t t1, odp_time_t t2)
Time sum.
#define ODP_TIME_SEC_IN_NS
A second in nanoseconds.
odp_time_t odp_time_local_from_ns(uint64_t ns)
Convert nanoseconds to local time.
void odp_time_wait_ns(uint64_t ns)
Wait the specified number of nanoseconds.
odp_time_t odp_time_local(void)
Current local time.
#define ODP_TIME_NULL
Zero time stamp.
#define ODP_TIME_MSEC_IN_NS
A millisecond in nanoseconds.
int odp_time_cmp(odp_time_t t2, odp_time_t t1)
Compare two times.
Global initialization parameters.
odp_mem_model_t mem_model
Application memory model.
Packet IO configuration options.
odp_pktio_parser_config_t parser
Packet input parser configuration.
odp_pktin_mode_t in_mode
Packet input mode.
odp_proto_layer_t layer
Protocol parsing level in packet input.
uint32_t num
Number of buffers in the pool.
struct odp_pool_param_t::@139 pkt
Parameters for packet pools.
odp_pool_type_t type
Pool type.
uint32_t len
Minimum length of 'num' packets.
uint32_t seg_len
Minimum number of packet data bytes that can be stored in the first segment of a newly allocated pack...