All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Bob Falken <NetFestivalHaveFun@gmx.com>,
	Julian Anastasov <ja@ssi.bg>,
	netdev@vger.kernel.org
Subject: Re: Multicast routing stops functioning after 4G multicast packets recived.
Date: Tue, 7 Jan 2014 21:29:03 +0100	[thread overview]
Message-ID: <20140107202903.GI30393@order.stressinduktion.org> (raw)
In-Reply-To: <1389126413.26646.60.camel@edumazet-glaptop2.roam.corp.google.com>

On Tue, Jan 07, 2014 at 12:26:53PM -0800, Eric Dumazet wrote:
> On Tue, 2014-01-07 at 21:11 +0100, Hannes Frederic Sowa wrote:
> 
> > It seems ip(6)mr_fib_lookup is not always called  from rcu section
> > (ndo_start_xmit), so I had to restructure a bit. Could you retest this
> > patch as preparation for a submission to stable? Thanks!
> > 
> > RCU conversion can be done later then.
> > 
> > diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
> > index 421a249..9ae4ae7 100644
> > --- a/net/ipv4/ipmr.c
> > +++ b/net/ipv4/ipmr.c
> 
> >  
> >  static netdev_tx_t reg_vif_xmit(struct sk_buff *skb, struct net_device *dev)
> >  {
> > +	int err;
> > +	struct ipmr_result res;
> >  	struct net *net = dev_net(dev);
> > -	struct mr_table *mrt;
> > +
> > +	struct fib_lookup_arg arg = {
> > +		.result = &res,
> > +		.flags = FIB_LOOKUP_NOREF,
> > +	};
> > +
> >  	struct flowi4 fl4 = {
> >  		.flowi4_oif	= dev->ifindex,
> >  		.flowi4_iif	= skb->skb_iif,
> >  		.flowi4_mark	= skb->mark,
> >  	};
> > -	int err;
> 
> Technically speaking, I don't think reg_vif_xmit() is enclosed
> in rcu_read_lock() section.
> 
> >  
> > -	err = ipmr_fib_lookup(net, &fl4, &mrt);
> > +	err = fib_rules_lookup(net->ipv4.mr_rules_ops,
> > +			       flowi4_to_flowi(&fl4), 0, &arg);
> >  	if (err < 0) {
> >  		kfree_skb(skb);
> >  		return err;
> > @@ -466,9 +476,12 @@ static netdev_tx_t reg_vif_xmit(struct sk_buff *skb, struct net_device *dev)
> >  	read_lock(&mrt_lock);
> >  	dev->stats.tx_bytes += skb->len;
> >  	dev->stats.tx_packets++;
> > -	ipmr_cache_report(mrt, skb, mrt->mroute_reg_vif_num, IGMPMSG_WHOLEPKT);
> > +	ipmr_cache_report(res.mrt, skb, res.mrt->mroute_reg_vif_num,
> > +			  IGMPMSG_WHOLEPKT);
> >  	read_unlock(&mrt_lock);
> >  	kfree_skb(skb);
> > +	if (arg.rule)
> > +		fib_rule_put(arg.rule);
> >  	return NETDEV_TX_OK;
> >  }
> >  
> 
> Hmm... Are you sure you meant to use FIB_LOOKUP_NOREF in
> reg_vif_xmit() ?

Nope, that's the reason for the second patch. Should have mentioned that.

Thanks for the review,

  Hannes

  reply	other threads:[~2014-01-07 20:29 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07 17:01 Multicast routing stops functioning after 4G multicast packets recived Bob Falken
2014-01-07 17:43 ` Hannes Frederic Sowa
2014-01-07 20:11   ` Hannes Frederic Sowa
2014-01-07 20:20     ` Hannes Frederic Sowa
2014-01-07 20:26     ` Eric Dumazet
2014-01-07 20:29       ` Hannes Frederic Sowa [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-01-12  0:25 Bob Falken
2014-01-09 20:14 Bob Falken
2014-01-10  6:36 ` Hannes Frederic Sowa
2014-01-10  7:01   ` Eric Dumazet
2014-01-10  7:10     ` Hannes Frederic Sowa
2014-01-10  7:32       ` Eric Dumazet
2014-01-10  7:43         ` Hannes Frederic Sowa
2014-01-10  7:50           ` Hannes Frederic Sowa
2014-01-12  7:42             ` Hannes Frederic Sowa
2014-01-13  0:56               ` Eric Dumazet
2014-01-04 18:53 Bob Falken
2013-12-21 22:35 Bob Falken
2014-01-03  7:37 ` Hannes Frederic Sowa
2013-12-19 16:28 Bob Falken
2013-12-19 17:24 ` Eric Dumazet
2013-12-19 17:32   ` Hannes Frederic Sowa
2013-12-22  3:10   ` Hannes Frederic Sowa
2013-12-19 14:48 Bob Falken
2013-12-19 15:09 ` Hannes Frederic Sowa
2013-12-19 15:15   ` Ben Greear
2013-12-19 15:48     ` Hannes Frederic Sowa
2014-01-04 19:55 ` Julian Anastasov
2014-01-04 23:38   ` Hannes Frederic Sowa
2014-01-05  8:56     ` Julian Anastasov
2014-01-05 10:41       ` Hannes Frederic Sowa
2014-01-05 19:12         ` Eric Dumazet

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=20140107202903.GI30393@order.stressinduktion.org \
    --to=hannes@stressinduktion.org \
    --cc=NetFestivalHaveFun@gmx.com \
    --cc=eric.dumazet@gmail.com \
    --cc=ja@ssi.bg \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.