From d43b583c7b48545a034f0294116490af9d48eab2 Mon Sep 17 00:00:00 2001 From: Pim van Pelt Date: Thu, 12 Aug 2021 15:22:35 +0200 Subject: [PATCH] Initialize the TAP host state from the VPP state DBGvpp# set interface state TenGigabitEthernet3/0/0 down DBGvpp# lcpng create TenGigabitEthernet3/0/0 host-if e0 DBGvpp# set interface state TenGigabitEthernet3/0/1 up DBGvpp# lcpng create TenGigabitEthernet3/0/1 host-if e1 Yields: pim@hippo:~/src/lcpng$ ip link show e0 304: e0: mtu 9000 qdisc mq state DOWN mode DEFAULT group default qlen 1000 link/ether 68:05:ca:32:46:14 brd ff:ff:ff:ff:ff:ff pim@hippo:~/src/lcpng$ ip link show e1 305: e1: mtu 9000 qdisc mq state UNKNOWN mode DEFAULT group default qlen 1000 link/ether 68:05:ca:32:46:15 brd ff:ff:ff:ff:ff:ff --- lcpng_interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lcpng_interface.c b/lcpng_interface.c index 033c0b3..5763ae4 100644 --- a/lcpng_interface.c +++ b/lcpng_interface.c @@ -793,13 +793,13 @@ lcp_itf_pair_create (u32 phy_sw_if_index, u8 *host_if_name, hw = vnet_get_sup_hw_interface (vnm, args.sw_if_index); /* - * Set the interface down on the host side. + * Copy the link state from VPP inon the host side. * This controls whether the host can RX/TX. */ virtio_main_t *mm = &virtio_main; virtio_if_t *vif = pool_elt_at_index (mm->interfaces, hw->dev_instance); - lcp_itf_set_vif_link_state (vif->ifindex, 0 /* down */, + lcp_itf_set_vif_link_state (vif->ifindex, sw->flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP, args.host_namespace); /*