From: Petr Machata <petrm@nvidia.com>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
<netdev@vger.kernel.org>
Cc: Ido Schimmel <idosch@nvidia.com>, Petr Machata <petrm@nvidia.com>,
Danielle Ratson <danieller@nvidia.com>, <mlxsw@nvidia.com>
Subject: [PATCH net-next 1/8] selftests: router_bridge: Add remastering tests
Date: Mon, 31 Jul 2023 17:47:15 +0200 [thread overview]
Message-ID: <fb0ca021be3647d157ff8b8dd65990130ff3329d.1690815746.git.petrm@nvidia.com> (raw)
In-Reply-To: <cover.1690815746.git.petrm@nvidia.com>
Add two tests to deslave a port from and reenslave to a bridge. This should
retain the ability of the system to forward traffic, but on an offloading
driver that is sensitive to ordering of operations, it might not.
The first test does this configuration in a way that relies on
vlan_default_pvid to assign the PVID. The second test disables that
autoconfiguration and configures PVID by hand in a separate step.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
---
.../selftests/net/forwarding/router_bridge.sh | 26 +++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/tools/testing/selftests/net/forwarding/router_bridge.sh b/tools/testing/selftests/net/forwarding/router_bridge.sh
index 4f33db04699d..0182eb2abfa6 100755
--- a/tools/testing/selftests/net/forwarding/router_bridge.sh
+++ b/tools/testing/selftests/net/forwarding/router_bridge.sh
@@ -20,6 +20,9 @@
# +---------------------------------------------------------------------------+
ALL_TESTS="
+ ping_ipv4
+ ping_ipv6
+ config_remaster
ping_ipv4
ping_ipv6
config_remove_pvid
@@ -28,6 +31,9 @@ ALL_TESTS="
config_add_pvid
ping_ipv4
ping_ipv6
+ config_late_pvid
+ ping_ipv4
+ ping_ipv6
"
NUM_NETIFS=4
source lib.sh
@@ -86,6 +92,15 @@ router_destroy()
ip link del dev br1
}
+config_remaster()
+{
+ log_info "Remaster bridge slave"
+
+ ip link set dev $swp1 nomaster
+ sleep 2
+ ip link set dev $swp1 master br1
+}
+
config_remove_pvid()
{
log_info "Remove PVID from the bridge"
@@ -102,6 +117,17 @@ config_add_pvid()
sleep 2
}
+config_late_pvid()
+{
+ log_info "Add bridge PVID after enslaving port"
+
+ ip link set dev $swp1 nomaster
+ ip link set dev br1 type bridge vlan_default_pvid 0
+ sleep 2
+ ip link set dev $swp1 master br1
+ ip link set dev br1 type bridge vlan_default_pvid 1
+}
+
setup_prepare()
{
h1=${NETIFS[p1]}
--
2.41.0
next prev parent reply other threads:[~2023-07-31 15:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-31 15:47 [PATCH net-next 0/8] selftests: New selftests for out-of-order-operations patches in mlxsw Petr Machata
2023-07-31 15:47 ` Petr Machata [this message]
2023-07-31 15:47 ` [PATCH net-next 2/8] selftests: router_bridge_1d: Add a new selftest Petr Machata
2023-07-31 15:47 ` [PATCH net-next 3/8] selftests: router_bridge_vlan_upper: " Petr Machata
2023-07-31 15:47 ` [PATCH net-next 4/8] selftests: router_bridge_lag: " Petr Machata
2023-07-31 15:47 ` [PATCH net-next 5/8] selftests: router_bridge_1d_lag: " Petr Machata
2023-07-31 15:47 ` [PATCH net-next 6/8] selftests: mlxsw: rif_lag: " Petr Machata
2023-07-31 15:47 ` [PATCH net-next 7/8] selftests: mlxsw: rif_lag_vlan: " Petr Machata
2023-07-31 15:47 ` [PATCH net-next 8/8] selftests: mlxsw: rif_bridge: " Petr Machata
2023-08-02 8:20 ` [PATCH net-next 0/8] selftests: New selftests for out-of-order-operations patches in mlxsw patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fb0ca021be3647d157ff8b8dd65990130ff3329d.1690815746.git.petrm@nvidia.com \
--to=petrm@nvidia.com \
--cc=danieller@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=mlxsw@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).