From 69d7cb73cc43da152771ebd087aa85afd29cfc21 Mon Sep 17 00:00:00 2001 From: Pim van Pelt Date: Sun, 8 Aug 2021 21:53:04 +0200 Subject: [PATCH] Copy L3 VPP interface MTU if available Still use a sensible default of 9216, but if the L3 packet size is set on the VPP interface, copy it forward (just as we do in the 'host' interface of the TAP itself, ie the interface created in the linux namespace). Now they will all line up initially. --- lcpng_interface.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lcpng_interface.c b/lcpng_interface.c index 374dc0b..a2b665b 100644 --- a/lcpng_interface.c +++ b/lcpng_interface.c @@ -780,9 +780,13 @@ lcp_itf_pair_create (u32 phy_sw_if_index, u8 *host_if_name, * interface's L3 MTU, but it should also ensure that the VPP tap * interface has an MTU that is greater-or-equal to those. Considering * users can set the interfaces at runtime (set interface mtu packet ...) - * ensure that the tap MTU is large enough. + * ensure that the tap MTU is large enough, taking the VPP interface L3 + * if it's set, and otherwise a sensible default. */ - vnet_sw_interface_set_mtu (vnm, args.sw_if_index, ETHERNET_MAX_PACKET_BYTES); + if (sw->mtu[VNET_MTU_L3]) + vnet_sw_interface_set_mtu (vnm, args.sw_if_index, sw->mtu[VNET_MTU_L3]); + else + vnet_sw_interface_set_mtu (vnm, args.sw_if_index, ETHERNET_MAX_PACKET_BYTES); /* * get the hw and ethernet of the tap