From ccd4b393e98a20dfa3cb7675a980844a0f013932 Mon Sep 17 00:00:00 2001 From: Pim van Pelt Date: Fri, 24 Dec 2021 21:12:24 +0000 Subject: [PATCH] Roll back carrier set -- it works fine for phy's that are carrier-up, but crashes if they are carrier-down. 0: /home/pim/src/vpp/src/vnet/interface_funcs.h:46 (vnet_get_hw_interface) assertion `! pool_is_free (vnm->interface_main.hw_interfaces, _e)' fails at /home/pim/src/vpp/src/vppinfra/error.c:143 ns=0x7fff98774e80 "dataplane", host_sw_if_indexp=0x0) at /home/pim/src/vpp/src/plugins/lcpng/lcpng_interface.c:998 at /home/pim/src/vpp/src/plugins/lcpng/lcpng_if_cli.c:96 parent_command_index=371) at /home/pim/src/vpp/src/vlib/cli.c:591 parent_command_index=0) at /home/pim/src/vpp/src/vlib/cli.c:548 at /home/pim/src/vpp/src/vlib/cli.c:694 --- lcpng_interface.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lcpng_interface.c b/lcpng_interface.c index 9626dc5..8edea21 100644 --- a/lcpng_interface.c +++ b/lcpng_interface.c @@ -993,10 +993,12 @@ lcp_itf_pair_create (u32 phy_sw_if_index, u8 *host_if_name, else vnet_sw_interface_set_mtu (vnm, args.sw_if_index, ETHERNET_MAX_PACKET_BYTES); - /* Initialize the TAP carrier based on the (hardware) phy + /* TODO(pim) - figure out why we cannot initalize the carrier. Ideally, once + * the first TAP is created, we copy forward the link-carrier from the hardware. + * However, this provokes a crash on interfaces which are carrier down. + * + * tap_set_carrier (args.sw_if_index, (hw->flags & VNET_HW_INTERFACE_FLAG_LINK_UP)); */ - if (hw->flags & VNET_HW_INTERFACE_FLAG_LINK_UP) - tap_set_carrier (args.sw_if_index, 1); /* * get the hw and ethernet of the tap