* [PATCH net-next v2 0/5] vxlan: Join / leave MC group when reconfigured
@ 2025-02-14 16:18 Petr Machata
2025-02-14 16:18 ` [PATCH net-next v2 1/5] vxlan: Drop 'changelink' parameter from vxlan_dev_configure() Petr Machata
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Petr Machata @ 2025-02-14 16:18 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, netdev
Cc: Ido Schimmel, Petr Machata, mlxsw, Andrew Lunn,
Nikolay Aleksandrov, Roopa Prabhu, Menglong Dong, Guillaume Nault
When a vxlan netdevice is brought up, if its default remote is a multicast
address, the device joins the indicated group.
Therefore when the multicast remote address changes, the device should
leave the current group and subscribe to the new one. Similarly when the
interface used for endpoint communication is changed in a situation when
multicast remote is configured. This is currently not done.
Both vxlan_igmp_join() and vxlan_igmp_leave() can however fail. So it is
possible that with such fix, the netdevice will end up in an inconsistent
situation where the old group is not joined anymore, but joining the
new group fails. Should we join the new group first, and leave the old one
second, we might end up in the opposite situation, where both groups are
joined. Undoing any of this during rollback is going to be similarly
problematic.
One solution would be to just forbid the change when the netdevice is up.
However in vnifilter mode, changing the group address is allowed, and these
problems are simply ignored (see vxlan_vni_update_group()):
# ip link add name br up type bridge vlan_filtering 1
# ip link add vx1 up master br type vxlan external vnifilter local 192.0.2.1 dev lo dstport 4789
# bridge vni add dev vx1 vni 200 group 224.0.0.1
# tcpdump -i lo &
# bridge vni add dev vx1 vni 200 group 224.0.0.2
18:55:46.523438 IP 0.0.0.0 > 224.0.0.22: igmp v3 report, 1 group record(s)
18:55:46.943447 IP 0.0.0.0 > 224.0.0.22: igmp v3 report, 1 group record(s)
# bridge vni
dev vni group/remote
vx1 200 224.0.0.2
Having two different modes of operation for conceptually the same interface
is silly, so in this patchset, just do what the vnifilter code does and
deal with the errors by crossing fingers real hard.
v2:
- Patch #1:
- New patch.
- Patch #2:
- Adjust the code so that it is closer to vnifilter.
Expand the commit message the explain in detail
which aspects of vnifilter code were emulated.
Petr Machata (5):
vxlan: Drop 'changelink' parameter from vxlan_dev_configure()
vxlan: Join / leave MC group after remote changes
selftests: forwarding: lib: Move require_command to net, generalize
selftests: test_vxlan_fdb_changelink: Convert to lib.sh
selftests: test_vxlan_fdb_changelink: Add a test for MC remote change
drivers/net/vxlan/vxlan_core.c | 24 +++-
tools/testing/selftests/net/forwarding/lib.sh | 10 --
tools/testing/selftests/net/lib.sh | 19 +++
.../net/test_vxlan_fdb_changelink.sh | 111 ++++++++++++++++--
4 files changed, 136 insertions(+), 28 deletions(-)
--
2.47.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next v2 1/5] vxlan: Drop 'changelink' parameter from vxlan_dev_configure()
2025-02-14 16:18 [PATCH net-next v2 0/5] vxlan: Join / leave MC group when reconfigured Petr Machata
@ 2025-02-14 16:18 ` Petr Machata
2025-02-14 16:18 ` [PATCH net-next v2 2/5] vxlan: Join / leave MC group after remote changes Petr Machata
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Petr Machata @ 2025-02-14 16:18 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, netdev
Cc: Ido Schimmel, Petr Machata, mlxsw, Andrew Lunn,
Nikolay Aleksandrov, Roopa Prabhu, Menglong Dong, Guillaume Nault
vxlan_dev_configure() only has a single caller that passes false
for the changelink parameter. Drop the parameter and inline the
sole value.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
---
Notes:
v2:
- New patch.
---
CC: Andrew Lunn <andrew+netdev@lunn.ch>
CC: Nikolay Aleksandrov <razor@blackwall.org>
CC: Roopa Prabhu <roopa@nvidia.com>
CC: Menglong Dong <menglong8.dong@gmail.com>
CC: Guillaume Nault <gnault@redhat.com>
drivers/net/vxlan/vxlan_core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c
index b1158a1bb855..ec0aee1d5b91 100644
--- a/drivers/net/vxlan/vxlan_core.c
+++ b/drivers/net/vxlan/vxlan_core.c
@@ -3936,7 +3936,7 @@ static void vxlan_config_apply(struct net_device *dev,
}
static int vxlan_dev_configure(struct net *src_net, struct net_device *dev,
- struct vxlan_config *conf, bool changelink,
+ struct vxlan_config *conf,
struct netlink_ext_ack *extack)
{
struct vxlan_dev *vxlan = netdev_priv(dev);
@@ -3947,7 +3947,7 @@ static int vxlan_dev_configure(struct net *src_net, struct net_device *dev,
if (ret)
return ret;
- vxlan_config_apply(dev, conf, lowerdev, src_net, changelink);
+ vxlan_config_apply(dev, conf, lowerdev, src_net, false);
return 0;
}
@@ -3965,7 +3965,7 @@ static int __vxlan_dev_create(struct net *net, struct net_device *dev,
int err;
dst = &vxlan->default_dst;
- err = vxlan_dev_configure(net, dev, conf, false, extack);
+ err = vxlan_dev_configure(net, dev, conf, extack);
if (err)
return err;
--
2.47.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next v2 2/5] vxlan: Join / leave MC group after remote changes
2025-02-14 16:18 [PATCH net-next v2 0/5] vxlan: Join / leave MC group when reconfigured Petr Machata
2025-02-14 16:18 ` [PATCH net-next v2 1/5] vxlan: Drop 'changelink' parameter from vxlan_dev_configure() Petr Machata
@ 2025-02-14 16:18 ` Petr Machata
2025-02-14 16:18 ` [PATCH net-next v2 3/5] selftests: forwarding: lib: Move require_command to net, generalize Petr Machata
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Petr Machata @ 2025-02-14 16:18 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, netdev
Cc: Ido Schimmel, Petr Machata, mlxsw, Andrew Lunn,
Nikolay Aleksandrov, Roopa Prabhu, Menglong Dong, Guillaume Nault
When a vxlan netdevice is brought up, if its default remote is a multicast
address, the device joins the indicated group.
Therefore when the multicast remote address changes, the device should
leave the current group and subscribe to the new one. Similarly when the
interface used for endpoint communication is changed in a situation when
multicast remote is configured. This is currently not done.
Both vxlan_igmp_join() and vxlan_igmp_leave() can however fail. So it is
possible that with such fix, the netdevice will end up in an inconsistent
situation where the old group is not joined anymore, but joining the new
group fails. Should we join the new group first, and leave the old one
second, we might end up in the opposite situation, where both groups are
joined. Undoing any of this during rollback is going to be similarly
problematic.
One solution would be to just forbid the change when the netdevice is up.
However in vnifilter mode, changing the group address is allowed, and these
problems are simply ignored (see vxlan_vni_update_group()):
# ip link add name br up type bridge vlan_filtering 1
# ip link add vx1 up master br type vxlan external vnifilter local 192.0.2.1 dev lo dstport 4789
# bridge vni add dev vx1 vni 200 group 224.0.0.1
# tcpdump -i lo &
# bridge vni add dev vx1 vni 200 group 224.0.0.2
18:55:46.523438 IP 0.0.0.0 > 224.0.0.22: igmp v3 report, 1 group record(s)
18:55:46.943447 IP 0.0.0.0 > 224.0.0.22: igmp v3 report, 1 group record(s)
# bridge vni
dev vni group/remote
vx1 200 224.0.0.2
Having two different modes of operation for conceptually the same interface
is silly, so in this patch, just do what the vnifilter code does and deal
with the errors by crossing fingers real hard.
The vnifilter code leaves old before joining new, and in case of join /
leave failures does not roll back the configuration changes that have
already been applied, but bails out of joining if it could not leave. Do
the same here: leave before join, apply changes unconditionally and do not
attempt to join if we couldn't leave.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
---
Notes:
v2:
- Adjust the code so that it is closer to vnifilter.
Expand the commit message the explain in detail
which aspects of vnifilter code were emulated.
---
CC: Andrew Lunn <andrew+netdev@lunn.ch>
CC: Nikolay Aleksandrov <razor@blackwall.org>
CC: Roopa Prabhu <roopa@nvidia.com>
CC: Menglong Dong <menglong8.dong@gmail.com>
CC: Guillaume Nault <gnault@redhat.com>
drivers/net/vxlan/vxlan_core.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c
index ec0aee1d5b91..588ab2c16c67 100644
--- a/drivers/net/vxlan/vxlan_core.c
+++ b/drivers/net/vxlan/vxlan_core.c
@@ -4419,6 +4419,7 @@ static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[],
struct netlink_ext_ack *extack)
{
struct vxlan_dev *vxlan = netdev_priv(dev);
+ bool rem_ip_changed, change_igmp;
struct net_device *lowerdev;
struct vxlan_config conf;
struct vxlan_rdst *dst;
@@ -4442,8 +4443,13 @@ static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[],
if (err)
return err;
+ rem_ip_changed = !vxlan_addr_equal(&conf.remote_ip, &dst->remote_ip);
+ change_igmp = vxlan->dev->flags & IFF_UP &&
+ (rem_ip_changed ||
+ dst->remote_ifindex != conf.remote_ifindex);
+
/* handle default dst entry */
- if (!vxlan_addr_equal(&conf.remote_ip, &dst->remote_ip)) {
+ if (rem_ip_changed) {
u32 hash_index = fdb_head_index(vxlan, all_zeros_mac, conf.vni);
spin_lock_bh(&vxlan->hash_lock[hash_index]);
@@ -4487,6 +4493,9 @@ static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[],
}
}
+ if (change_igmp && vxlan_addr_multicast(&dst->remote_ip))
+ err = vxlan_multicast_leave(vxlan);
+
if (conf.age_interval != vxlan->cfg.age_interval)
mod_timer(&vxlan->age_timer, jiffies);
@@ -4494,7 +4503,12 @@ static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[],
if (lowerdev && lowerdev != dst->remote_dev)
dst->remote_dev = lowerdev;
vxlan_config_apply(dev, &conf, lowerdev, vxlan->net, true);
- return 0;
+
+ if (!err && change_igmp &&
+ vxlan_addr_multicast(&dst->remote_ip))
+ err = vxlan_multicast_join(vxlan);
+
+ return err;
}
static void vxlan_dellink(struct net_device *dev, struct list_head *head)
--
2.47.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next v2 3/5] selftests: forwarding: lib: Move require_command to net, generalize
2025-02-14 16:18 [PATCH net-next v2 0/5] vxlan: Join / leave MC group when reconfigured Petr Machata
2025-02-14 16:18 ` [PATCH net-next v2 1/5] vxlan: Drop 'changelink' parameter from vxlan_dev_configure() Petr Machata
2025-02-14 16:18 ` [PATCH net-next v2 2/5] vxlan: Join / leave MC group after remote changes Petr Machata
@ 2025-02-14 16:18 ` Petr Machata
2025-02-14 16:18 ` [PATCH net-next v2 4/5] selftests: test_vxlan_fdb_changelink: Convert to lib.sh Petr Machata
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Petr Machata @ 2025-02-14 16:18 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, netdev
Cc: Ido Schimmel, Petr Machata, mlxsw, Nikolay Aleksandrov,
Shuah Khan, linux-kselftest
This helper could be useful to more than just forwarding tests.
Move it upstairs and port over to log_test_skip().
Split the function into two parts: the bit that actually checks and
reports skip, which is in a new function check_command(). And a bit
that exits the test script if the check fails. This allows users
consistent checking behavior while giving an option to bail out from
a single test without bailing out of the whole script.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
---
Notes:
CC: Simon Horman <horms@kernel.org>
CC: Shuah Khan <shuah@kernel.org>
CC: linux-kselftest@vger.kernel.org
tools/testing/selftests/net/forwarding/lib.sh | 10 ----------
tools/testing/selftests/net/lib.sh | 19 +++++++++++++++++++
2 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
index 8de80acf249e..508f3c700d71 100644
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -291,16 +291,6 @@ if [[ "$CHECK_TC" = "yes" ]]; then
check_tc_version
fi
-require_command()
-{
- local cmd=$1; shift
-
- if [[ ! -x "$(command -v "$cmd")" ]]; then
- echo "SKIP: $cmd not installed"
- exit $ksft_skip
- fi
-}
-
# IPv6 support was added in v3.0
check_mtools_version()
{
diff --git a/tools/testing/selftests/net/lib.sh b/tools/testing/selftests/net/lib.sh
index 0bd9a038a1f0..975be4fdbcdb 100644
--- a/tools/testing/selftests/net/lib.sh
+++ b/tools/testing/selftests/net/lib.sh
@@ -450,6 +450,25 @@ kill_process()
{ kill $pid && wait $pid; } 2>/dev/null
}
+check_command()
+{
+ local cmd=$1; shift
+
+ if [[ ! -x "$(command -v "$cmd")" ]]; then
+ log_test_skip "$cmd not installed"
+ return $EXIT_STATUS
+ fi
+}
+
+require_command()
+{
+ local cmd=$1; shift
+
+ if ! check_command "$cmd"; then
+ exit $EXIT_STATUS
+ fi
+}
+
ip_link_add()
{
local name=$1; shift
--
2.47.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next v2 4/5] selftests: test_vxlan_fdb_changelink: Convert to lib.sh
2025-02-14 16:18 [PATCH net-next v2 0/5] vxlan: Join / leave MC group when reconfigured Petr Machata
` (2 preceding siblings ...)
2025-02-14 16:18 ` [PATCH net-next v2 3/5] selftests: forwarding: lib: Move require_command to net, generalize Petr Machata
@ 2025-02-14 16:18 ` Petr Machata
2025-02-14 16:18 ` [PATCH net-next v2 5/5] selftests: test_vxlan_fdb_changelink: Add a test for MC remote change Petr Machata
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Petr Machata @ 2025-02-14 16:18 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, netdev
Cc: Ido Schimmel, Petr Machata, mlxsw, Nikolay Aleksandrov,
Shuah Khan, linux-kselftest
Instead of inlining equivalents, use lib.sh-provided primitives.
Use defer to manage vx lifetime.
This will make it easier to extend the test in the next patch.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
---
Notes:
CC: Simon Horman <horms@kernel.org>
CC: Shuah Khan <shuah@kernel.org>
CC: linux-kselftest@vger.kernel.org
.../net/test_vxlan_fdb_changelink.sh | 39 ++++++++++++-------
1 file changed, 24 insertions(+), 15 deletions(-)
diff --git a/tools/testing/selftests/net/test_vxlan_fdb_changelink.sh b/tools/testing/selftests/net/test_vxlan_fdb_changelink.sh
index 2d442cdab11e..6f2bca4b346c 100755
--- a/tools/testing/selftests/net/test_vxlan_fdb_changelink.sh
+++ b/tools/testing/selftests/net/test_vxlan_fdb_changelink.sh
@@ -1,29 +1,38 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
-# Check FDB default-remote handling across "ip link set".
+ALL_TESTS="
+ test_set_remote
+"
+source lib.sh
check_remotes()
{
local what=$1; shift
local N=$(bridge fdb sh dev vx | grep 00:00:00:00:00:00 | wc -l)
- echo -ne "expected two remotes after $what\t"
- if [[ $N != 2 ]]; then
- echo "[FAIL]"
- EXIT_STATUS=1
- else
- echo "[ OK ]"
- fi
+ ((N == 2))
+ check_err $? "expected 2 remotes after $what, got $N"
}
-ip link add name vx up type vxlan id 2000 dstport 4789
-bridge fdb ap dev vx 00:00:00:00:00:00 dst 192.0.2.20 self permanent
-bridge fdb ap dev vx 00:00:00:00:00:00 dst 192.0.2.30 self permanent
-check_remotes "fdb append"
+# Check FDB default-remote handling across "ip link set".
+test_set_remote()
+{
+ RET=0
-ip link set dev vx type vxlan remote 192.0.2.30
-check_remotes "link set"
+ ip_link_add vx up type vxlan id 2000 dstport 4789
+ bridge fdb ap dev vx 00:00:00:00:00:00 dst 192.0.2.20 self permanent
+ bridge fdb ap dev vx 00:00:00:00:00:00 dst 192.0.2.30 self permanent
+ check_remotes "fdb append"
+
+ ip link set dev vx type vxlan remote 192.0.2.30
+ check_remotes "link set"
+
+ log_test 'FDB default-remote handling across "ip link set"'
+}
+
+trap defer_scopes_cleanup EXIT
+
+tests_run
-ip link del dev vx
exit $EXIT_STATUS
--
2.47.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next v2 5/5] selftests: test_vxlan_fdb_changelink: Add a test for MC remote change
2025-02-14 16:18 [PATCH net-next v2 0/5] vxlan: Join / leave MC group when reconfigured Petr Machata
` (3 preceding siblings ...)
2025-02-14 16:18 ` [PATCH net-next v2 4/5] selftests: test_vxlan_fdb_changelink: Convert to lib.sh Petr Machata
@ 2025-02-14 16:18 ` Petr Machata
2025-02-16 15:10 ` [PATCH net-next v2 0/5] vxlan: Join / leave MC group when reconfigured Nikolay Aleksandrov
2025-02-18 12:10 ` patchwork-bot+netdevbpf
6 siblings, 0 replies; 8+ messages in thread
From: Petr Machata @ 2025-02-14 16:18 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, netdev
Cc: Ido Schimmel, Petr Machata, mlxsw, Nikolay Aleksandrov,
Shuah Khan, linux-kselftest
Changes to MC remote need to be reflected in actual group memberships.
Add a test to verify that it is the case.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
---
Notes:
CC: Simon Horman <horms@kernel.org>
CC: Shuah Khan <shuah@kernel.org>
CC: linux-kselftest@vger.kernel.org
.../net/test_vxlan_fdb_changelink.sh | 76 +++++++++++++++++++
1 file changed, 76 insertions(+)
diff --git a/tools/testing/selftests/net/test_vxlan_fdb_changelink.sh b/tools/testing/selftests/net/test_vxlan_fdb_changelink.sh
index 6f2bca4b346c..062f957950af 100755
--- a/tools/testing/selftests/net/test_vxlan_fdb_changelink.sh
+++ b/tools/testing/selftests/net/test_vxlan_fdb_changelink.sh
@@ -3,6 +3,7 @@
ALL_TESTS="
test_set_remote
+ test_change_mc_remote
"
source lib.sh
@@ -31,6 +32,81 @@ test_set_remote()
log_test 'FDB default-remote handling across "ip link set"'
}
+fmt_remote()
+{
+ local addr=$1; shift
+
+ if [[ $addr == 224.* ]]; then
+ echo "group $addr"
+ else
+ echo "remote $addr"
+ fi
+}
+
+change_remote()
+{
+ local remote=$1; shift
+
+ ip link set dev vx type vxlan $(fmt_remote $remote) dev v1
+}
+
+check_membership()
+{
+ local check_vec=("$@")
+
+ local memberships
+ memberships=$(
+ netstat -n --groups |
+ sed -n '/^v1\b/p' |
+ grep -o '[^ ]*$'
+ )
+ check_err $? "Couldn't obtain group memberships"
+
+ local item
+ for item in "${check_vec[@]}"; do
+ eval "local $item"
+ echo "$memberships" | grep -q "\b$group\b"
+ check_err_fail $fail $? "$group is_ex reported in IGMP query response"
+ done
+}
+
+test_change_mc_remote()
+{
+ check_command netstat || return
+
+ ip_link_add v1 up type veth peer name v2
+ ip_link_set_up v2
+
+ RET=0
+
+ ip_link_add vx up type vxlan dstport 4789 \
+ local 192.0.2.1 $(fmt_remote 224.1.1.1) dev v1 vni 1000
+
+ check_membership "group=224.1.1.1 fail=0" \
+ "group=224.1.1.2 fail=1" \
+ "group=224.1.1.3 fail=1"
+
+ log_test "MC group report after VXLAN creation"
+
+ RET=0
+
+ change_remote 224.1.1.2
+ check_membership "group=224.1.1.1 fail=1" \
+ "group=224.1.1.2 fail=0" \
+ "group=224.1.1.3 fail=1"
+
+ log_test "MC group report after changing VXLAN remote MC->MC"
+
+ RET=0
+
+ change_remote 192.0.2.2
+ check_membership "group=224.1.1.1 fail=1" \
+ "group=224.1.1.2 fail=1" \
+ "group=224.1.1.3 fail=1"
+
+ log_test "MC group report after changing VXLAN remote MC->UC"
+}
+
trap defer_scopes_cleanup EXIT
tests_run
--
2.47.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v2 0/5] vxlan: Join / leave MC group when reconfigured
2025-02-14 16:18 [PATCH net-next v2 0/5] vxlan: Join / leave MC group when reconfigured Petr Machata
` (4 preceding siblings ...)
2025-02-14 16:18 ` [PATCH net-next v2 5/5] selftests: test_vxlan_fdb_changelink: Add a test for MC remote change Petr Machata
@ 2025-02-16 15:10 ` Nikolay Aleksandrov
2025-02-18 12:10 ` patchwork-bot+netdevbpf
6 siblings, 0 replies; 8+ messages in thread
From: Nikolay Aleksandrov @ 2025-02-16 15:10 UTC (permalink / raw)
To: Petr Machata, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, netdev
Cc: Ido Schimmel, mlxsw, Andrew Lunn, Roopa Prabhu, Menglong Dong,
Guillaume Nault
On 2/14/25 18:18, Petr Machata wrote:
> When a vxlan netdevice is brought up, if its default remote is a multicast
> address, the device joins the indicated group.
>
> Therefore when the multicast remote address changes, the device should
> leave the current group and subscribe to the new one. Similarly when the
> interface used for endpoint communication is changed in a situation when
> multicast remote is configured. This is currently not done.
>
> Both vxlan_igmp_join() and vxlan_igmp_leave() can however fail. So it is
> possible that with such fix, the netdevice will end up in an inconsistent
> situation where the old group is not joined anymore, but joining the
> new group fails. Should we join the new group first, and leave the old one
> second, we might end up in the opposite situation, where both groups are
> joined. Undoing any of this during rollback is going to be similarly
> problematic.
>
> One solution would be to just forbid the change when the netdevice is up.
> However in vnifilter mode, changing the group address is allowed, and these
> problems are simply ignored (see vxlan_vni_update_group()):
>
> # ip link add name br up type bridge vlan_filtering 1
> # ip link add vx1 up master br type vxlan external vnifilter local 192.0.2.1 dev lo dstport 4789
> # bridge vni add dev vx1 vni 200 group 224.0.0.1
> # tcpdump -i lo &
> # bridge vni add dev vx1 vni 200 group 224.0.0.2
> 18:55:46.523438 IP 0.0.0.0 > 224.0.0.22: igmp v3 report, 1 group record(s)
> 18:55:46.943447 IP 0.0.0.0 > 224.0.0.22: igmp v3 report, 1 group record(s)
> # bridge vni
> dev vni group/remote
> vx1 200 224.0.0.2
>
> Having two different modes of operation for conceptually the same interface
> is silly, so in this patchset, just do what the vnifilter code does and
> deal with the errors by crossing fingers real hard.
>
> v2:
> - Patch #1:
> - New patch.
> - Patch #2:
> - Adjust the code so that it is closer to vnifilter.
> Expand the commit message the explain in detail
> which aspects of vnifilter code were emulated.
>
> Petr Machata (5):
> vxlan: Drop 'changelink' parameter from vxlan_dev_configure()
> vxlan: Join / leave MC group after remote changes
> selftests: forwarding: lib: Move require_command to net, generalize
> selftests: test_vxlan_fdb_changelink: Convert to lib.sh
> selftests: test_vxlan_fdb_changelink: Add a test for MC remote change
>
> drivers/net/vxlan/vxlan_core.c | 24 +++-
> tools/testing/selftests/net/forwarding/lib.sh | 10 --
> tools/testing/selftests/net/lib.sh | 19 +++
> .../net/test_vxlan_fdb_changelink.sh | 111 ++++++++++++++++--
> 4 files changed, 136 insertions(+), 28 deletions(-)
>
For the set:
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v2 0/5] vxlan: Join / leave MC group when reconfigured
2025-02-14 16:18 [PATCH net-next v2 0/5] vxlan: Join / leave MC group when reconfigured Petr Machata
` (5 preceding siblings ...)
2025-02-16 15:10 ` [PATCH net-next v2 0/5] vxlan: Join / leave MC group when reconfigured Nikolay Aleksandrov
@ 2025-02-18 12:10 ` patchwork-bot+netdevbpf
6 siblings, 0 replies; 8+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-02-18 12:10 UTC (permalink / raw)
To: Petr Machata
Cc: davem, edumazet, kuba, pabeni, horms, netdev, idosch, mlxsw,
andrew+netdev, razor, roopa, menglong8.dong, gnault
Hello:
This series was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Fri, 14 Feb 2025 17:18:19 +0100 you wrote:
> When a vxlan netdevice is brought up, if its default remote is a multicast
> address, the device joins the indicated group.
>
> Therefore when the multicast remote address changes, the device should
> leave the current group and subscribe to the new one. Similarly when the
> interface used for endpoint communication is changed in a situation when
> multicast remote is configured. This is currently not done.
>
> [...]
Here is the summary with links:
- [net-next,v2,1/5] vxlan: Drop 'changelink' parameter from vxlan_dev_configure()
https://git.kernel.org/netdev/net-next/c/5afb1596b90c
- [net-next,v2,2/5] vxlan: Join / leave MC group after remote changes
https://git.kernel.org/netdev/net-next/c/d42d54336834
- [net-next,v2,3/5] selftests: forwarding: lib: Move require_command to net, generalize
https://git.kernel.org/netdev/net-next/c/f802f172d78b
- [net-next,v2,4/5] selftests: test_vxlan_fdb_changelink: Convert to lib.sh
https://git.kernel.org/netdev/net-next/c/24adf47ea9ac
- [net-next,v2,5/5] selftests: test_vxlan_fdb_changelink: Add a test for MC remote change
https://git.kernel.org/netdev/net-next/c/eae1e92a1d41
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-02-18 12:10 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-14 16:18 [PATCH net-next v2 0/5] vxlan: Join / leave MC group when reconfigured Petr Machata
2025-02-14 16:18 ` [PATCH net-next v2 1/5] vxlan: Drop 'changelink' parameter from vxlan_dev_configure() Petr Machata
2025-02-14 16:18 ` [PATCH net-next v2 2/5] vxlan: Join / leave MC group after remote changes Petr Machata
2025-02-14 16:18 ` [PATCH net-next v2 3/5] selftests: forwarding: lib: Move require_command to net, generalize Petr Machata
2025-02-14 16:18 ` [PATCH net-next v2 4/5] selftests: test_vxlan_fdb_changelink: Convert to lib.sh Petr Machata
2025-02-14 16:18 ` [PATCH net-next v2 5/5] selftests: test_vxlan_fdb_changelink: Add a test for MC remote change Petr Machata
2025-02-16 15:10 ` [PATCH net-next v2 0/5] vxlan: Join / leave MC group when reconfigured Nikolay Aleksandrov
2025-02-18 12:10 ` patchwork-bot+netdevbpf
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).