summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface_cli.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-06-21 14:29:44 +0200
committerOle Trøan <otroan@employees.org>2017-06-21 20:48:08 +0000
commit4e53a0d0f01c8c81842d1f50fb5cf0d26e0c1713 (patch)
treed9ea3553be8d0a2a6c75d2cc39db0cd77e159830 /src/vnet/interface_cli.c
parentc817daa74ae52cd0bb64b14050b52bc6b3308698 (diff)
Introduce default rx mode for device drivers
If interface is down and queues are not configured then we are not able to change rx-mode. This change introducess default mode which is stored per interface and applied if driver wants. Change-Id: I70149c21c1530eafc148d5e4aa03fbee53dec62f Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/interface_cli.c')
-rw-r--r--src/vnet/interface_cli.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/vnet/interface_cli.c b/src/vnet/interface_cli.c
index d37c78942c9..bf2873acbe9 100644
--- a/src/vnet/interface_cli.c
+++ b/src/vnet/interface_cli.c
@@ -1186,6 +1186,9 @@ set_hw_interface_rx_mode (vnet_main_t * vnm, u32 hw_if_index,
vnet_hw_interface_rx_mode old_mode;
int rv;
+ if (mode == VNET_HW_INTERFACE_RX_MODE_DEFAULT)
+ mode = hw->default_rx_mode;
+
rv = vnet_hw_interface_get_rx_mode (vnm, hw_if_index, queue_id, &old_mode);
switch (rv)
{
@@ -1272,12 +1275,15 @@ set_interface_rx_mode (vlib_main_t * vm, unformat_input_t * input,
hw = vnet_get_hw_interface (vnm, hw_if_index);
if (queue_id == ~0)
- for (i = 0; i < vec_len (hw->dq_runtime_index_by_queue); i++)
- {
- error = set_hw_interface_rx_mode (vnm, hw_if_index, i, mode);
- if (error)
- break;
- }
+ {
+ for (i = 0; i < vec_len (hw->dq_runtime_index_by_queue); i++)
+ {
+ error = set_hw_interface_rx_mode (vnm, hw_if_index, i, mode);
+ if (error)
+ break;
+ }
+ hw->default_rx_mode = mode;
+ }
else
error = set_hw_interface_rx_mode (vnm, hw_if_index, queue_id, mode);