* vxlan regression: multiple VXLANs on a single multicast group broken in kernel 4.1
@ 2015-08-25 17:35 John Nielsen
2015-08-25 18:52 ` Marcelo Ricardo Leitner
0 siblings, 1 reply; 5+ messages in thread
From: John Nielsen @ 2015-08-25 17:35 UTC (permalink / raw)
To: netdev; +Cc: marcelo.leitner
After updating the kernel on a KVM host, I discovered yesterday that I can no longer use more than one vxlan interface on a single multicast group/address. The interfaces can be created but only the first one may be brought up:
# ip link add vx100 type vxlan id 100 group 239.0.0.1 dev eth0
# ip link add vx200 type vxlan id 200 group 239.0.0.1 dev eth0
# ip link set up dev vx100
# ip link set up dev vx200
RTNETLINK answers: Address already in use
Using unique group addresses (one VNI per group) still works as expected. The problem is not present in kernel 4.0.5 but it is in kernel 4.1.0.
I suspect (but have not verified) that the regression was caused by this commit:
vxlan: Move socket initialization to within rtnl scope 56ef9c909b40483d2c8cb63fcbf83865f162d5ec
https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/drivers/net/vxlan.c?id=56ef9c909b40483d2c8cb63fcbf83865f162d5ec
I am working to verify that that is the culprit but I thought I’d see in the mean time if anyone else has encountered and/or fixed this, or can at least shed more light on the problem.
Thanks!
JN
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: vxlan regression: multiple VXLANs on a single multicast group broken in kernel 4.1
2015-08-25 17:35 vxlan regression: multiple VXLANs on a single multicast group broken in kernel 4.1 John Nielsen
@ 2015-08-25 18:52 ` Marcelo Ricardo Leitner
2015-08-25 23:22 ` [PATCH net] vxlan: re-ignore EADDRINUSE from igmp_join Marcelo Ricardo Leitner
0 siblings, 1 reply; 5+ messages in thread
From: Marcelo Ricardo Leitner @ 2015-08-25 18:52 UTC (permalink / raw)
To: John Nielsen, netdev
Em 25-08-2015 14:35, John Nielsen escreveu:
> After updating the kernel on a KVM host, I discovered yesterday that I can no longer use more than one vxlan interface on a single multicast group/address. The interfaces can be created but only the first one may be brought up:
>
> # ip link add vx100 type vxlan id 100 group 239.0.0.1 dev eth0
> # ip link add vx200 type vxlan id 200 group 239.0.0.1 dev eth0
> # ip link set up dev vx100
> # ip link set up dev vx200
> RTNETLINK answers: Address already in use
>
> Using unique group addresses (one VNI per group) still works as expected. The problem is not present in kernel 4.0.5 but it is in kernel 4.1.0.
>
> I suspect (but have not verified) that the regression was caused by this commit:
> vxlan: Move socket initialization to within rtnl scope 56ef9c909b40483d2c8cb63fcbf83865f162d5ec
>
> https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/drivers/net/vxlan.c?id=56ef9c909b40483d2c8cb63fcbf83865f162d5ec
>
> I am working to verify that that is the culprit but I thought I’d see in the mean time if anyone else has encountered and/or fixed this, or can at least shed more light on the problem.
Yes that commit is the culprit. Previously it was ignoring igmp_join
errors, and now it's not but at the same time, it's trying to double
join that group on the socket that is reused.
Will try to cook a patch here, thanks for the report!
If you need a hack for now, just ignore vxlan_igmp_join() return value
at vxlan_open() and it should be fine.
Marcelo
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH net] vxlan: re-ignore EADDRINUSE from igmp_join
2015-08-25 18:52 ` Marcelo Ricardo Leitner
@ 2015-08-25 23:22 ` Marcelo Ricardo Leitner
2015-08-25 23:25 ` David Miller
2015-09-01 21:02 ` John Nielsen
0 siblings, 2 replies; 5+ messages in thread
From: Marcelo Ricardo Leitner @ 2015-08-25 23:22 UTC (permalink / raw)
To: netdev; +Cc: John Nielsen
Before 56ef9c909b40[1] it used to ignore all errors from igmp_join().
That commit enhanced that and made it error out whatever error happened
with igmp_join(), but that's not good because when using multicast
groups vxlan will try to join it multiple times if the socket is reused
and then the 2nd and further attempts will fail with EADDRINUSE.
As we don't track to which groups the socket is already subscribed, it's
okay to just ignore that error.
Fixes: 56ef9c909b40 ("vxlan: Move socket initialization to within rtnl scope")
Reported-by: John Nielsen <lists@jnielsen.net>
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
---
John, please see how this goes for you. It worked in here.
Dave, please consider this for stable trees. At least 4.1 is affected.
Thanks.
drivers/net/vxlan.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 61b457b9ec00517037e4833790bea97ac53aa832..b0a2da5d4e57e602c915b65abd34a83939c4c473 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2279,6 +2279,8 @@ static int vxlan_open(struct net_device *dev)
if (vxlan_addr_multicast(&vxlan->default_dst.remote_ip)) {
ret = vxlan_igmp_join(vxlan);
+ if (ret == -EADDRINUSE)
+ ret = 0;
if (ret) {
vxlan_sock_release(vs);
return ret;
--
2.4.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net] vxlan: re-ignore EADDRINUSE from igmp_join
2015-08-25 23:22 ` [PATCH net] vxlan: re-ignore EADDRINUSE from igmp_join Marcelo Ricardo Leitner
@ 2015-08-25 23:25 ` David Miller
2015-09-01 21:02 ` John Nielsen
1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2015-08-25 23:25 UTC (permalink / raw)
To: marcelo.leitner; +Cc: netdev, lists
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Date: Tue, 25 Aug 2015 20:22:35 -0300
> Before 56ef9c909b40[1] it used to ignore all errors from igmp_join().
> That commit enhanced that and made it error out whatever error happened
> with igmp_join(), but that's not good because when using multicast
> groups vxlan will try to join it multiple times if the socket is reused
> and then the 2nd and further attempts will fail with EADDRINUSE.
>
> As we don't track to which groups the socket is already subscribed, it's
> okay to just ignore that error.
>
> Fixes: 56ef9c909b40 ("vxlan: Move socket initialization to within rtnl scope")
> Reported-by: John Nielsen <lists@jnielsen.net>
> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
> ---
>
> John, please see how this goes for you. It worked in here.
>
> Dave, please consider this for stable trees. At least 4.1 is affected.
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net] vxlan: re-ignore EADDRINUSE from igmp_join
2015-08-25 23:22 ` [PATCH net] vxlan: re-ignore EADDRINUSE from igmp_join Marcelo Ricardo Leitner
2015-08-25 23:25 ` David Miller
@ 2015-09-01 21:02 ` John Nielsen
1 sibling, 0 replies; 5+ messages in thread
From: John Nielsen @ 2015-09-01 21:02 UTC (permalink / raw)
To: Marcelo Ricardo Leitner; +Cc: netdev
On Aug 25, 2015, at 5:22 PM, Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> wrote:
> Before 56ef9c909b40[1] it used to ignore all errors from igmp_join().
> That commit enhanced that and made it error out whatever error happened
> with igmp_join(), but that's not good because when using multicast
> groups vxlan will try to join it multiple times if the socket is reused
> and then the 2nd and further attempts will fail with EADDRINUSE.
>
> As we don't track to which groups the socket is already subscribed, it's
> okay to just ignore that error.
>
> Fixes: 56ef9c909b40 ("vxlan: Move socket initialization to within rtnl scope")
> Reported-by: John Nielsen <lists@jnielsen.net>
> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
> ---
>
> John, please see how this goes for you. It worked in here.
Confirmed working here. Thanks again!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-09-01 21:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-25 17:35 vxlan regression: multiple VXLANs on a single multicast group broken in kernel 4.1 John Nielsen
2015-08-25 18:52 ` Marcelo Ricardo Leitner
2015-08-25 23:22 ` [PATCH net] vxlan: re-ignore EADDRINUSE from igmp_join Marcelo Ricardo Leitner
2015-08-25 23:25 ` David Miller
2015-09-01 21:02 ` John Nielsen
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).