netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Bizon <mbizon@freebox.fr>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: 3.6 routing cache regression, multicast loopback broken
Date: Mon, 05 Nov 2012 17:37:51 +0100	[thread overview]
Message-ID: <1352133471.12029.43.camel@sakura.staff.proxad.net> (raw)


Hi David & all,


kernel 3.6 to 3.6.5 (3.5 is working fine)

I have a "sender" sample app that does:

  - socket(dgram)
  - setsockopt mcast ttl 8
  - setsockopt mcast loopback
  - sendto() to 239.0.0.x

and a "receiver" sample app:

  - socket(dgram)
  - bind(239.0.0.x)
  - add membership (239.0.0.x)
  - loop on recv()


My setup: no default route, "ip route add 239.0.0.0/8 dev eth0", sender
& receiver running on same host.

If I first start one sender app (on 239.0.0.1), and after a receiver app
on 239.0.0.1 => no problem

If I first start two or more sender apps (239.0.0.1/239.0.0.2/...), then
assuming I don't start as many matching receivers, receivers sometimes
get all data or nothing at all.


After digging in __mkroute_output(), I found that unless I'm using a
default route (fi != NULL), rtable is cached and shared by all senders
(even those with different mcast addresses)

Since ip_check_mc_rcu() returns different results depending on whether
fl->daddr is present in device mc_list or not, I don't think we can
cache this.

The random working/not working effect I get is because add_membership
flushes the rt_cache, so depending on which sender does sendto() first
after flush, the cached entry will either use ip_mc_output() or
ip_output().

-- 
Maxime

             reply	other threads:[~2012-11-05 16:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-05 16:37 Maxime Bizon [this message]
2012-11-21  0:35 ` 3.6 routing cache regression, multicast loopback broken Julian Anastasov
2012-11-21 17:25   ` David Miller
2012-11-22 14:04   ` Maxime Bizon

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=1352133471.12029.43.camel@sakura.staff.proxad.net \
    --to=mbizon@freebox.fr \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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).