From: Matthew Smith Date: Tue, 5 Apr 2022 18:20:07 +0000 (+0000) Subject: linux-cp: fix setting mtu on hardware interfaces X-Git-Tag: v22.10-rc0~108 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=6120441f9fbfd275e3993712b92eeb80da652767;p=vpp.git linux-cp: fix setting mtu on hardware interfaces Type: fix Fixes: 616447c39231 In lcp_router_link_mtu(), either vnet_hw_interface_set_mtu() or vnet_sw_interface_set_mtu() is called, based on whether this appears to be a physical interface. The test to determine whether this is true was incorrect and probably never worked right so vnet_sw_interface_set_mtu() was always being called. This causes some breakage with Recent changes to code which manages interface MTUs. Fix the test so the right function is called. Change-Id: I1ecccbce37d5a1e53b2349ed40f3d0d27eb03569 Signed-off-by: Matthew Smith --- diff --git a/src/plugins/linux-cp/lcp_router.c b/src/plugins/linux-cp/lcp_router.c index 05943e4ca67..af01b54d52f 100644 --- a/src/plugins/linux-cp/lcp_router.c +++ b/src/plugins/linux-cp/lcp_router.c @@ -265,7 +265,7 @@ lcp_router_link_mtu (struct rtnl_link *rl, u32 sw_if_index) hw = vnet_get_sup_hw_interface (vnm, sw_if_index); /* If HW interface, try to change hw link */ - if ((sw->type == sw->sup_sw_if_index) && + if ((sw->sw_if_index == sw->sup_sw_if_index) && (hw->hw_class_index == ethernet_hw_interface_class.index)) vnet_hw_interface_set_mtu (vnm, hw->hw_if_index, mtu); else