Subject: Re: LRO/GSO interaction when packets are forwarded

From: Ben Hutchings <[email-masked]>
Date: Wed, 23 Apr 2008 11:04:46 +0100

Stephen Hemminger wrote:
<snip>
> > diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
> > index 6848e47..f88d395 100644
> > --- a/net/ipv4/devinet.c
> > +++ b/net/ipv4/devinet.c
> > @@ -171,6 +171,8 @@ static struct in_device *inetdev_init(struct net_device *dev)
> >  	in_dev->dev = dev;
> >  	if ((in_dev->arp_parms = neigh_parms_alloc(dev, &arp_tbl)) == NULL)
> >  		goto out_kfree;
> > +	if (IPV4_DEVCONF(in_dev->cnf, FORWARDING))
> > +		dev_disable_lro(dev);
> >  	/* Reference in_dev->dev */
> >  	dev_hold(dev);
> >  	/* Account for reference dev->ip_ptr (below) */
> > @@ -1250,6 +1252,8 @@ static void inet_forward_change(struct net *net)
> >  	read_lock(&dev_base_lock);
> >  	for_each_netdev(net, dev) {
> >  		struct in_device *in_dev;
> > +		if (on)
> > +			dev_disable_lro(dev);
> >  		rcu_read_lock();
> >  		in_dev = __in_dev_get_rcu(dev);
> >  		if (in_dev)
> > @@ -1257,8 +1261,6 @@ static void inet_forward_change(struct net *net)
> >  		rcu_read_unlock();
> >  	}
> >  	read_unlock(&dev_base_lock);
> > -
> > -	rt_cache_flush(0);
> >  }
> 
> Why did you delete the route cache flush here?

I changed devinet_sysctl_forward() (the only caller of inet_forward_change())
to combine code for the change-one and change-all cases.  It calls
rt_cache_flush(0) in both cases.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.