From: unixtech <[email protected]> - add is_vpp_bridge() to detect vppbrN interfaces - skip tap_plug() for VPP bridges (vhost-user sockets are used instead of tap interfaces) - skip read_bridge_mtu() kernel path for VPP bridges, return 1500
Signed-off-by: Ryosuke Nakayama <[email protected]> Signed-off-by: unixtech <[email protected]> --- src/PVE/Network.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/PVE/Network.pm b/src/PVE/Network.pm index 573e34e..2c57ddb 100644 --- a/src/PVE/Network.pm +++ b/src/PVE/Network.pm @@ -128,6 +128,8 @@ sub tap_rate_limit { sub read_bridge_mtu { my ($bridge) = @_; + return 1500 if is_vpp_bridge($bridge); + my $mtu = PVE::Tools::file_read_firstline("/sys/class/net/$bridge/mtu"); die "bridge '$bridge' does not exist\n" if !$mtu; @@ -515,6 +517,9 @@ sub tap_plug { $opts = {} if !defined($opts); $opts = { learning => $opts } if !ref($opts); # FIXME: backward compat, drop with PVE 8.0 + # VPP bridges use vhost-user sockets, not tap devices + return if is_vpp_bridge($bridge); + if (!defined($opts->{learning})) { # auto-detect $opts = {} if !defined($opts); my $interfaces_config = PVE::INotify::read_file('interfaces'); @@ -966,6 +971,11 @@ sub is_ovs_bridge { die "failed to query OVS to determine type of '$bridge': $res\n"; } +sub is_vpp_bridge { + my ($bridge) = @_; + return defined($bridge) && $bridge =~ /^vppbr\d+$/; +} + # for backward compat, prefer the methods from the leaner IPRoute2 module. sub ip_link_details { return PVE::IPRoute2::ip_link_details(); -- 2.50.1 (Apple Git-155)
