lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <485B91B6.6090303@trash.net>
Date:	Fri, 20 Jun 2008 13:17:10 +0200
From:	Patrick McHardy <kaber@...sh.net>
To:	Ben Hutchings <bhutchings@...arflare.com>
CC:	David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
	linux-net-drivers@...arflare.com,
	Kieran Mansley <kmansley@...arflare.com>,
	Herbert Xu <herbert@...dor.apana.org.au>,
	Stephen Hemminger <shemminger@...tta.com>
Subject: Re: [PATCH 1/2] net: Disable LRO on devices that are forwarding

Ben Hutchings wrote:
> Ben Hutchings wrote:
> [...]
>> diff --git a/net/core/dev.c b/net/core/dev.c
>> index a495f71..f6944ec 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
> [...]
>> @@ -1123,6 +1124,29 @@ int dev_close(struct net_device *dev)
>>  }
>>  
>>  
>> +/**
>> + *	dev_disable_lro - disable Large Receive Offload on a device
>> + *	@dev: device
>> + *
>> + *	Disable Large Receive Offload (LRO) on a net device.  Must be
>> + *	called under RTNL.  This is needed if received packets may be
>> + *	forwarded to another interface.
>> + */
>> +void dev_disable_lro(struct net_device *dev)
>> +{
>> +	if (dev->ethtool_ops && dev->ethtool_ops->get_flags &&
>> +	    dev->ethtool_ops->set_flags) {
>> +		u32 flags = dev->ethtool_ops->get_flags(dev);
>> +		if (flags & ETH_FLAG_LRO) {
>> +			flags &= ~ETH_FLAG_LRO;
>> +			dev->ethtool_ops->set_flags(dev, flags);
>> +		}
>> +	}
>> +	WARN_ON(dev->features & NETIF_F_LRO);
>> +}
>> +EXPORT_SYMBOL(dev_disable_lro);
> [...]
> 
> Of course, this doesn't work where the device that's about to start
> forwarding is a VLAN device, bonding device or other device depending on
> the physical device which is doing LRO.
> 
> It might be worth separating out the offload control ops from ethtool ops
> since they could usefully be applied to other device types... particularly
> here.


You can propagate it to the real device. I have a patch queued
to add ethtool support to vlan, I can send it to Dave this
weekend. I guess for bonding etc. that would also be useful
for disabling offloading/checksumming/... globally or just
querying the state.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ