Backport https://gerrit.fd.io/r/c/vpp/+/35719
This commit is contained in:
@ -960,6 +960,7 @@ lcp_itf_pair_create (u32 phy_sw_if_index, u8 *host_if_name,
|
|||||||
.host_namespace = 0,
|
.host_namespace = 0,
|
||||||
};
|
};
|
||||||
ethernet_interface_t *ei;
|
ethernet_interface_t *ei;
|
||||||
|
u32 host_sw_mtu_size;
|
||||||
|
|
||||||
if (host_if_type == LCP_ITF_HOST_TUN)
|
if (host_if_type == LCP_ITF_HOST_TUN)
|
||||||
args.tap_flags |= TAP_FLAG_TUN;
|
args.tap_flags |= TAP_FLAG_TUN;
|
||||||
@ -969,26 +970,6 @@ lcp_itf_pair_create (u32 phy_sw_if_index, u8 *host_if_name,
|
|||||||
mac_address_copy (&args.host_mac_addr, &ei->address.mac);
|
mac_address_copy (&args.host_mac_addr, &ei->address.mac);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sw->mtu[VNET_MTU_L3])
|
|
||||||
{
|
|
||||||
args.host_mtu_set = 1;
|
|
||||||
args.host_mtu_size = sw->mtu[VNET_MTU_L3];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ns && ns[0] != 0)
|
|
||||||
{
|
|
||||||
args.host_namespace = ns;
|
|
||||||
}
|
|
||||||
|
|
||||||
vm = vlib_get_main ();
|
|
||||||
tap_create_if (vm, &args);
|
|
||||||
|
|
||||||
if (args.rv < 0)
|
|
||||||
{
|
|
||||||
LCP_ITF_PAIR_ERR ("pair_create: could not create tap: retval:%d", args.rv);
|
|
||||||
return args.rv;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The TAP interface does copy forward the host MTU based on the VPP
|
* The TAP interface does copy forward the host MTU based on the VPP
|
||||||
* interface's L3 MTU, but it should also ensure that the VPP tap
|
* interface's L3 MTU, but it should also ensure that the VPP tap
|
||||||
@ -997,17 +978,28 @@ lcp_itf_pair_create (u32 phy_sw_if_index, u8 *host_if_name,
|
|||||||
* ensure that the tap MTU is large enough, taking the VPP interface L3
|
* ensure that the tap MTU is large enough, taking the VPP interface L3
|
||||||
* if it's set, and otherwise a sensible default.
|
* if it's set, and otherwise a sensible default.
|
||||||
*/
|
*/
|
||||||
if (sw->mtu[VNET_MTU_L3])
|
host_sw_mtu_size = sw->mtu[VNET_MTU_L3];
|
||||||
vnet_sw_interface_set_mtu (vnm, args.sw_if_index, sw->mtu[VNET_MTU_L3]);
|
if (host_sw_mtu_size)
|
||||||
|
{
|
||||||
|
args.host_mtu_set = 1;
|
||||||
|
args.host_mtu_size = host_sw_mtu_size;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
vnet_sw_interface_set_mtu (vnm, args.sw_if_index, ETHERNET_MAX_PACKET_BYTES);
|
host_sw_mtu_size = ETHERNET_MAX_PACKET_BYTES;
|
||||||
|
|
||||||
/* TODO(pim) - figure out why we cannot initalize the carrier. Ideally, once
|
if (ns && ns[0] != 0)
|
||||||
* the first TAP is created, we copy forward the link-carrier from the hardware.
|
args.host_namespace = ns;
|
||||||
* However, this provokes a crash on interfaces which are carrier down.
|
|
||||||
*
|
vm = vlib_get_main ();
|
||||||
* tap_set_carrier (args.sw_if_index, (hw->flags & VNET_HW_INTERFACE_FLAG_LINK_UP));
|
tap_create_if (vm, &args);
|
||||||
*/
|
if (args.rv < 0)
|
||||||
|
{
|
||||||
|
LCP_ITF_PAIR_ERR ("pair_create: could not create tap, retval:%d",
|
||||||
|
args.rv);
|
||||||
|
return args.rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
vnet_sw_interface_set_mtu (vnm, args.sw_if_index, host_sw_mtu_size);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* get the hw and ethernet of the tap
|
* get the hw and ethernet of the tap
|
||||||
|
Reference in New Issue
Block a user