From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id B55DB9EF3 for ; Tue, 27 Jun 2023 08:54:25 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 95FBB3171E for ; Tue, 27 Jun 2023 08:53:55 +0200 (CEST) Received: from bastionodiso.odiso.net (bastionodiso.odiso.net [IPv6:2a0a:1580:2000::2d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 27 Jun 2023 08:53:53 +0200 (CEST) Received: from kvmformation3.odiso.net (formationkvm3.odiso.net [10.3.94.12]) by bastionodiso.odiso.net (Postfix) with ESMTP id 3F75F7FC0; Tue, 27 Jun 2023 08:53:52 +0200 (CEST) Received: by kvmformation3.odiso.net (Postfix, from userid 0) id 264D63349AE; Tue, 27 Jun 2023 08:53:52 +0200 (CEST) From: Alexandre Derumier To: pve-devel@lists.proxmox.com Date: Tue, 27 Jun 2023 08:53:51 +0200 Message-Id: <20230627065351.1348117-2-aderumier@odiso.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627065351.1348117-1-aderumier@odiso.com> References: <20230627065351.1348117-1-aderumier@odiso.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.020 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy HEADER_FROM_DIFFERENT_DOMAINS 0.249 From and EnvelopeFrom 2nd level mail domains are different KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [inotify.pm] Subject: [pve-devel] [PATCH v2 pve-common 1/1] network_interfaces: disable rx-vlan-filter for physical interfaces ports of a vlan-aware bridge X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jun 2023 06:54:25 -0000 some nic like mellanox connectx or intel i40e don't work well vlan-aware bridge because they are limited in number of vlan filtering in hardware Signed-off-by: Alexandre Derumier --- src/PVE/INotify.pm | 15 +++++++++++++++ test/etc_network_interfaces/t.parsed_options.pl | 7 +++++++ 2 files changed, 22 insertions(+) diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm index bc33a8f..c4dd85d 100644 --- a/src/PVE/INotify.pm +++ b/src/PVE/INotify.pm @@ -963,6 +963,7 @@ sub __read_etc_network_interfaces { 'vxlan-svcnodeip' => 1, 'vxlan-physdev' => 1, 'vxlan-local-tunnelip' => 1, + 'rx-vlan-filter' => 1, }; if ($id eq 'address' || $id eq 'netmask' || $id eq 'broadcast' || $id eq 'gateway') { @@ -1514,6 +1515,7 @@ sub __write_etc_network_interfaces { } # check bond + my $bondslaves = {}; foreach my $iface (keys %$ifaces) { my $d = $ifaces->{$iface}; next if !($d->{type} eq 'bond' && $d->{slaves}); @@ -1529,6 +1531,7 @@ sub __write_etc_network_interfaces { $check_mtu->($ifaces, $iface, $p); $bond_primary_is_slave = 1 if $d->{'bond-primary'} && $d->{'bond-primary'} eq $p; + $bondslaves->{$p} = $iface; } die "bond '$iface' - bond-primary interface is not a slave" if $d->{'bond-primary'} && !$bond_primary_is_slave; } @@ -1658,6 +1661,18 @@ sub __write_etc_network_interfaces { } } + # disable rx-vlan-filter if physical nic is port of a vlan-aware bridge + foreach my $iface (keys %$ifaces) { + next if $iface !~ /^$PVE::Network::PHYSICAL_NIC_RE/; + my $phys_iface = $iface; + $iface = $bondslaves->{$iface} if $bondslaves->{$iface}; + if ($bridgeports->{$iface} && $bridges->{$bridgeports->{$iface}}->{bridge_vlan_aware}) { + $ifaces->{$phys_iface}->{'rx-vlan-filter'} = 'off' if !defined($ifaces->{$phys_iface}->{'rx-vlan-filter'}); + } else { + delete $ifaces->{$phys_iface}->{'rx-vlan-filter'}; + } + } + my $raw = <<'NETWORKDOC'; # network interface settings; autogenerated # Please do NOT modify this file directly, unless you know what diff --git a/test/etc_network_interfaces/t.parsed_options.pl b/test/etc_network_interfaces/t.parsed_options.pl index bbb2a27..fbedf6a 100644 --- a/test/etc_network_interfaces/t.parsed_options.pl +++ b/test/etc_network_interfaces/t.parsed_options.pl @@ -15,6 +15,7 @@ my $gw6 = 'fc05::1'; # Load my $cfg = load('base') . <<"CHECK"; iface eth1 inet manual + rx-vlan-filter off auto vmbr0 iface vmbr0 inet static @@ -23,6 +24,12 @@ iface vmbr0 inet static bridge-ports eth0 bridge-stp off bridge-fd 0 + +auto vmbr1 +iface vmbr1 inet manual + bridge-ports eth1 + bridge-stp off + bridge-fd 0 bridge-vlan-aware yes bridge-vids 2-4094 -- 2.39.2