From d305bb5249b6b2677c90265507bff6467fd7cab6 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Thu, 30 May 2019 19:48:12 -0400 Subject: Update vnet hardware flags if link state changes Explains a variety of hard-to-diagnose problems with certain Atom and Denverton NIC types. I finally tripped over a highly-repeatable failure: home gateway use-case bitten by refusal to negotiate a DHCP lease for the trunk port. The dhcp client won't send pkts unless VNET_HW_INTERFACE_FLAG_LINK_UP is set on the tx hw interface: /* Interface(s) down? */ if ((hw->flags & VNET_HW_INTERFACE_FLAG_LINK_UP) == 0) return; Change-Id: I17ef2ba7b39078555fa27d2d874a60c67e1530ee Signed-off-by: Dave Barach --- src/plugins/dpdk/device/init.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/plugins/dpdk/device') diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c index 2e4c8a22743..d15f5bf4774 100644 --- a/src/plugins/dpdk/device/init.c +++ b/src/plugins/dpdk/device/init.c @@ -1500,7 +1500,7 @@ dpdk_update_link_state (dpdk_device_t * xd, f64 now) ed->new_link_state = (u8) xd->link.link_status; } - if (hw_flags_chg || (xd->link.link_duplex != prev_link.link_duplex)) + if ((xd->link.link_duplex != prev_link.link_duplex)) { hw_flags_chg = 1; switch (xd->link.link_duplex) @@ -1519,6 +1519,14 @@ dpdk_update_link_state (dpdk_device_t * xd, f64 now) vnet_hw_interface_set_link_speed (vnm, xd->hw_if_index, xd->link.link_speed * 1000); + if (xd->link.link_status != prev_link.link_status) + { + hw_flags_chg = 1; + + if (xd->link.link_status) + hw_flags |= VNET_HW_INTERFACE_FLAG_LINK_UP; + } + if (hw_flags_chg) { if (LINK_STATE_ELOGS) -- cgit 1.2.3-korg