diff options
author | Michal Mazur <mkm@semihalf.com> | 2017-08-21 15:01:42 +0200 |
---|---|---|
committer | Michal Mazur <mkm@semihalf.com> | 2017-12-14 15:18:05 +0100 |
commit | 4c34d6c16947c5e1465319d9d44dbdaaa2f04c4e (patch) | |
tree | 47aecd5a2719916187f319357efde738674ae788 /src/plugins/odp/cli.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/cli.c')
-rwxr-xr-x | src/plugins/odp/cli.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/plugins/odp/cli.c b/src/plugins/odp/cli.c index 4da921a0..2392ca1d 100755 --- a/src/plugins/odp/cli.c +++ b/src/plugins/odp/cli.c @@ -25,14 +25,14 @@ odp_packet_create_command_fn (vlib_main_t * vm, unformat_input_t * input, u8 *host_if_name = NULL; u8 hwaddr[6]; u8 *hw_addr_ptr = 0; - u32 sw_if_index; - u32 mode = APPL_MODE_PKT_BURST; - u32 rx_queues = 0; + u32 sw_if_index, num; + odp_if_mode_t if_mode; int r; if (!unformat_user (input, unformat_line_input, line_input)) return 0; + if_mode = def_if_mode; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { @@ -42,10 +42,14 @@ odp_packet_create_command_fn (vlib_main_t * vm, unformat_input_t * input, if (unformat (line_input, "hw-addr %U", unformat_ethernet_address, hwaddr)) hw_addr_ptr = hwaddr; - else if (unformat (line_input, "mode %d", &mode)) - ; - else if (unformat (line_input, "rx-queues %d", &rx_queues)) - ; + else if (unformat (line_input, "rx-mode %d", &num)) + if_mode.rx_mode = num; + else if (unformat (line_input, "tx-mode %d", &num)) + if_mode.tx_mode = num; + else if (unformat (line_input, "rx-queues %d", &num)) + if_mode.num_rx_queues = num; + else if (unformat (line_input, "tx-queues %d", &num)) + if_mode.num_tx_queues = num; else return clib_error_return (0, "unknown input `%U'", format_unformat_error, input); @@ -56,7 +60,7 @@ odp_packet_create_command_fn (vlib_main_t * vm, unformat_input_t * input, return clib_error_return (0, "missing host interface name"); r = odp_packet_create_if (vm, host_if_name, hw_addr_ptr, &sw_if_index, - mode, rx_queues); + &if_mode); vec_free (host_if_name); if (r == VNET_API_ERROR_SYSCALL_ERROR_1) |