diff options
author | 2017-08-21 15:01:42 +0200 | |
---|---|---|
committer | 2017-12-14 15:18:05 +0100 | |
commit | 4c34d6c16947c5e1465319d9d44dbdaaa2f04c4e (patch) | |
tree | 47aecd5a2719916187f319357efde738674ae788 /src/plugins/odp/node.c | |
parent | 7e1f3998634c89aa6344468d26df0de519578a5f (diff) |
Read ODP configuration from VPP startup config
1) Allow to setup size of allocated memory, number of packets in the
pool, number of packets in transmit burst and delay in scheduler
mode from VPP startup file.
More details are in template: src/vpp/conf/startup.conf
2) Separate Rx mode from Tx mode. Traffic Manager is not supported.
3) Devices defined in VPP startup are automatically created at start.
Change-Id: I1f8a3c2900f56cb23ce6997d311cfe55e1c2078c
Signed-off-by: Michal Mazur <mkm@semihalf.com>
Diffstat (limited to 'src/plugins/odp/node.c')
-rwxr-xr-x | src/plugins/odp/node.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/odp/node.c b/src/plugins/odp/node.c index f7e02b7b..1a8b04c9 100755 --- a/src/plugins/odp/node.c +++ b/src/plugins/odp/node.c @@ -80,7 +80,7 @@ odp_packet_queue_mode (odp_packet_if_t * oif, odp_packet_t pkt_tbl[], clib_warning ("invalid oif->pktio value"); return 0; } - if ((oif->mode == APPL_MODE_PKT_QUEUE) && + if ((oif->m.rx_mode == APPL_MODE_PKT_QUEUE) && (oif->rxq[queue_id] == ODP_QUEUE_INVALID)) { clib_warning ("invalid rxq[%d] queue", queue_id); @@ -89,14 +89,15 @@ odp_packet_queue_mode (odp_packet_if_t * oif, odp_packet_t pkt_tbl[], while (req_pkts) { - if (oif->mode == APPL_MODE_PKT_QUEUE) + if (oif->m.rx_mode == APPL_MODE_PKT_QUEUE) { i = odp_queue_deq_multi (oif->rxq[queue_id], &evt_tbl[num_evts], req_pkts); } else { - sched_wait = odp_schedule_wait_time (ODP_TIME_USEC_IN_NS); + sched_wait = odp_schedule_wait_time (ODP_TIME_USEC_IN_NS * + rx_sched_wait); i = odp_schedule_multi (NULL, sched_wait, &evt_tbl[num_evts], req_pkts); } @@ -229,8 +230,8 @@ odp_packet_device_input_fn (vlib_main_t * vm, vlib_node_runtime_t * node, do { - if ((oif->mode == (APPL_MODE_PKT_QUEUE)) || - (oif->mode == (APPL_MODE_PKT_SCHED))) + if ((oif->m.rx_mode == (APPL_MODE_PKT_QUEUE)) || + (oif->m.rx_mode == (APPL_MODE_PKT_SCHED))) { pkts = odp_packet_queue_mode (oif, pkt_tbl, queue_id, n_left_to_next); |