summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2017-05-15 19:21:15 -0400
committerDamjan Marion <dmarion.lists@gmail.com>2017-05-16 10:09:47 +0000
commit0a69734dfe9ea35e3983f0c6a71e7853037adb74 (patch)
treefab3e2e8f4be112f89e02c686589fd79101f7db2
parent305bcd760c2589aac5525eb52105f50195358c4a (diff)
Fix regression of setting device to admin-down state
Change-Id: I0ffa572839405efe1170d6ddb073e53e9af02db7 Signed-off-by: John Lo <loj@cisco.com>
-rw-r--r--src/plugins/dpdk/device/device.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/plugins/dpdk/device/device.c b/src/plugins/dpdk/device/device.c
index 6a0b1acf6c1..c68ecbda246 100644
--- a/src/plugins/dpdk/device/device.c
+++ b/src/plugins/dpdk/device/device.c
@@ -618,22 +618,21 @@ dpdk_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index, u32 flags)
if (is_up)
{
- f64 now = vlib_time_now (dm->vlib_main);
-
+ vnet_hw_interface_set_flags (vnm, xd->hw_if_index,
+ VNET_HW_INTERFACE_FLAG_LINK_UP);
if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) == 0)
dpdk_device_start (xd);
-
xd->flags |= DPDK_DEVICE_FLAG_ADMIN_UP;
+ f64 now = vlib_time_now (dm->vlib_main);
dpdk_update_counters (xd, now);
dpdk_update_link_state (xd, now);
}
else
{
- xd->flags &= ~DPDK_DEVICE_FLAG_ADMIN_UP;
vnet_hw_interface_set_flags (vnm, xd->hw_if_index, 0);
-
if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) != 0)
dpdk_device_stop (xd);
+ xd->flags &= ~DPDK_DEVICE_FLAG_ADMIN_UP;
}
return /* no error */ 0;