diff mbox

tap/bridge: Dropping NETIF_F_GSO/NETIF_F_SG

Message ID 4DC26F33.8010700@cn.fujitsu.com
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Shan Wei May 5, 2011, 9:34 a.m. UTC
Michael S. Tsirkin wrote, at 05/05/2011 04:44 PM:
> On Thu, May 05, 2011 at 01:28:54AM +0200, Michał Mirosław wrote:
>> On Thu, May 05, 2011 at 08:34:15AM +1000, Herbert Xu wrote:
>>> On Wed, May 04, 2011 at 09:18:14PM +0300, Michael S. Tsirkin wrote:
>>>> BTW, I just noticed that net-next spits out
>>>> many of the following when I run any VMs:
>>>>
>>>> tap0: Dropping NETIF_F_SG since no checksum feature.
>>>> tap0: Dropping NETIF_F_GSO since no SG feature.
>>>> tap0: Features changed: 0x401b4849 -> 0x40004040
>>>> device msttap0 entered promiscuous mode
>>>> br0: Dropping NETIF_F_GSO since no SG feature.
>>>> br0: port 1(msttap0) entering forwarding state
>>>> br0: port 1(msttap0) entering forwarding state
>>>> tap0: Features changed: 0x40004040 -> 0x40024849
>>>> tap0: Dropping NETIF_F_SG since no checksum feature.
>>>> tap0: Dropping NETIF_F_GSO since no SG feature.
>>>> tap0: Features changed: 0x40024849 -> 0x40004040
>>>> br0: Dropping NETIF_F_GSO since no SG feature.
>>>> tap0: Dropping NETIF_F_SG since no checksum feature.
>>>> tap0: Dropping NETIF_F_GSO since no SG feature.
>>>> tap0: Dropping NETIF_F_SG since no checksum feature.
>>>> tap0: Dropping NETIF_F_GSO since no SG feature.
>>>> tap0: Dropping NETIF_F_SG since no checksum feature.
>>>> tap0: Dropping NETIF_F_GSO since no SG feature.
>>>> tap0: Dropping NETIF_F_SG since no checksum feature.
>>>> tap0: Dropping NETIF_F_GSO since no SG feature.
>>>> tap0: Features changed: 0x40004040 -> 0x401b4849
>>>> tap0: Dropping NETIF_F_SG since no checksum feature.
>>>> tap0: Dropping NETIF_F_GSO since no SG feature.
>>>> tap0: Features changed: 0x401b4849 -> 0x40004040
>>>> br0: Dropping NETIF_F_GSO since no SG feature.
>>>>
>>>> My problem is not primarily with warnings:
>>>>
>>>> will that linearize all packets and disable GSO
>>>> for tap and bridge? If yes it can't be good
>>>> for performance...
>>> I think so.  So the question is why is checksum off?
>>
>> Whatever application is creating the tap0 device is not calling
>> ioctl(TUNSETOFFLOAD) with TUN_F_CSUM set. This is userspace bug/feature
>> exposed by recent changes to netdev features handling.
>>
>> Best Regards,
>> Michał Mirosław
> 
> No, I think it's not a bug in userspace. Here is what it does:
> 
>     /* Check if our kernel supports TUNSETOFFLOAD */
>     if (ioctl(fd, TUNSETOFFLOAD, 0) != 0 && errno == EINVAL) {
>         return;
>     }
> 
>     if (csum) {
>         offload |= TUN_F_CSUM;
>         if (tso4)
>             offload |= TUN_F_TSO4;
>         if (tso6)
>             offload |= TUN_F_TSO6;
>         if ((tso4 || tso6) && ecn)
>             offload |= TUN_F_TSO_ECN;
>         if (ufo)
>             offload |= TUN_F_UFO;
>     }
> 
>     if (ioctl(fd, TUNSETOFFLOAD, offload) != 0) {
>         offload &= ~TUN_F_UFO;
>         if (ioctl(fd, TUNSETOFFLOAD, offload) != 0) {
>             fprintf(stderr, "TUNSETOFFLOAD ioctl() failed: %s\n",
>                     strerror(errno));
>         }
>     }
> 
> The first call is just to check that ioctl works.
> When checking for ioctl in this way, userspace clears checksum.
> This will clear SG and thus GSO; later userspace enables checksum.
> checksum is on but SG is by now disabled so GSO gets cleared again too.
> 
> 
> It's also likely a problem that
> userspace can trigger warnings in log for what used to be
> a legal way to check for ioctl and/or disable checksum offloading,
> but that is more minor.

Maybe it's a kernel bug. Can you try following changes?

TUN_F_TSO4, TUN_F_TSO6, TUN_F_TSO_ECN, TUN_F_UFO these features are 
depend on NETIF_F_SG. If NETIF_F_SG is not set, these features are not be
enabled and  warnings are printed in netdev_fix_features().

Comments

Herbert Xu May 5, 2011, 10:05 a.m. UTC | #1
On Thu, May 05, 2011 at 05:34:43PM +0800, Shan Wei wrote:
>
> TUN_F_TSO4, TUN_F_TSO6, TUN_F_TSO_ECN, TUN_F_UFO these features are 
> depend on NETIF_F_SG. If NETIF_F_SG is not set, these features are not be
> enabled and  warnings are printed in netdev_fix_features().

No, when the user turns off checksum offload everything should
be turned off as well.  However, when it's turned on, we shouldn't
enable everything automatically.

Cheers,
Michael S. Tsirkin May 16, 2011, 7:32 a.m. UTC | #2
On Thu, May 05, 2011 at 08:05:06PM +1000, Herbert Xu wrote:
> On Thu, May 05, 2011 at 05:34:43PM +0800, Shan Wei wrote:
> >
> > TUN_F_TSO4, TUN_F_TSO6, TUN_F_TSO_ECN, TUN_F_UFO these features are 
> > depend on NETIF_F_SG. If NETIF_F_SG is not set, these features are not be
> > enabled and  warnings are printed in netdev_fix_features().
> 
> No, when the user turns off checksum offload everything should
> be turned off as well.  However, when it's turned on, we shouldn't
> enable everything automatically.
> 
> Cheers,

So how is NETIF_F_SG supposed to be enabled then?

In upstream kernels userspace can disable checksum offloading then
re-enable and get SG set back.  userspace came to depend on this
behaviour so I think changing this is a regression.


> -- 
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Herbert Xu May 16, 2011, 8:07 a.m. UTC | #3
On Mon, May 16, 2011 at 10:32:10AM +0300, Michael S. Tsirkin wrote:
>
> So how is NETIF_F_SG supposed to be enabled then?

It should either be enabled at device creation time, or whatever
user-space entity managing the device creation should enable it
along with checksumming and anything else applicable.

> In upstream kernels userspace can disable checksum offloading then
> re-enable and get SG set back.  userspace came to depend on this
> behaviour so I think changing this is a regression.

Can you point me to the relevant code in the upstream kernel?
I'm not aware of any automatic SG enabling for network devices
in general when you enable checksum offloading.

Cheers,
Michael S. Tsirkin May 16, 2011, 8:18 a.m. UTC | #4
On Mon, May 16, 2011 at 06:07:02PM +1000, Herbert Xu wrote:
> On Mon, May 16, 2011 at 10:32:10AM +0300, Michael S. Tsirkin wrote:
> >
> > So how is NETIF_F_SG supposed to be enabled then?
> 
> It should either be enabled at device creation time, or whatever
> user-space entity managing the device creation should enable it
> along with checksumming and anything else applicable.

There's no interface for userspace to enable it: userspace
only has an ioctl to enable/disable checksum offloading.
SG is an implementation detail.

> > In upstream kernels userspace can disable checksum offloading then
> > re-enable and get SG set back.  userspace came to depend on this
> > behaviour so I think changing this is a regression.
> 
> Can you point me to the relevant code in the upstream kernel?
> I'm not aware of any automatic SG enabling for network devices
> in general when you enable checksum offloading.
> 
> Cheers,

I think what happens _SG is enabled at device creation time and
then upstream just keeps it on always, even when user clears
CSUM. With net-next code changed so that _SG gets cleared when CSUM
'gets cleared. But then it does not get reenabled when CSUM
gets reenabled.

> -- 
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Michael S. Tsirkin May 16, 2011, 8:28 a.m. UTC | #5
On Mon, May 16, 2011 at 06:07:02PM +1000, Herbert Xu wrote:
> On Mon, May 16, 2011 at 10:32:10AM +0300, Michael S. Tsirkin wrote:
> >
> > So how is NETIF_F_SG supposed to be enabled then?
> 
> It should either be enabled at device creation time, or whatever
> user-space entity managing the device creation should enable it
> along with checksumming and anything else applicable.
> 
> > In upstream kernels userspace can disable checksum offloading then
> > re-enable and get SG set back.  userspace came to depend on this
> > behaviour so I think changing this is a regression.
> 
> Can you point me to the relevant code in the upstream kernel?
> I'm not aware of any automatic SG enabling for network devices
> in general when you enable checksum offloading.
> 
> Cheers,

By the way with kvm we let an unpriveledged application
control netdev flags through and ioctl. It's probably
not a good idea to print out stuff on flag change
unconditionally as that will let that application
fill up the system log.

> -- 
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Herbert Xu May 16, 2011, 9:38 a.m. UTC | #6
On Mon, May 16, 2011 at 11:18:41AM +0300, Michael S. Tsirkin wrote:
>
> There's no interface for userspace to enable it: userspace
> only has an ioctl to enable/disable checksum offloading.
> SG is an implementation detail.

Yes there is: ethtool -K

Cheers,
Michael S. Tsirkin May 16, 2011, 9:48 a.m. UTC | #7
On Mon, May 16, 2011 at 07:38:22PM +1000, Herbert Xu wrote:
> On Mon, May 16, 2011 at 11:18:41AM +0300, Michael S. Tsirkin wrote:
> >
> > There's no interface for userspace to enable it: userspace
> > only has an ioctl to enable/disable checksum offloading.
> > SG is an implementation detail.
> 
> Yes there is: ethtool -K
> 
> Cheers,

Ok. You are right of course, I was confused.

So it's just an info message: in the end if userspace DTRT features
get enabled properly. Functionally, there is no regression.

Both bridge and tun trigger the messages ATM. I note that
dev.c takes pains to avoid these messages:
	Avoid warning from netdev_fix_features() for GSO without SG

Should all drivers do this: clear _SG if they clear checksum?  What about _GSO?
If we start doing this, this spills info about flag dependencies out to drivers.
Herbert Xu May 16, 2011, 10:43 a.m. UTC | #8
On Mon, May 16, 2011 at 12:48:21PM +0300, Michael S. Tsirkin wrote:
>
> Both bridge and tun trigger the messages ATM. I note that
> dev.c takes pains to avoid these messages:
> 	Avoid warning from netdev_fix_features() for GSO without SG
> 
> Should all drivers do this: clear _SG if they clear checksum?  What about _GSO?
> If we start doing this, this spills info about flag dependencies out to drivers.

Drivers don't need to do this at all since the network stack
will automatically clear SG and related features if checksum
is disabled.

Cheers,
=?ISO-8859-2?Q?Micha=B3_Miros=B3aw?= May 16, 2011, 10:53 a.m. UTC | #9
2011/5/16 Michael S. Tsirkin <mst@redhat.com>:
> On Mon, May 16, 2011 at 07:38:22PM +1000, Herbert Xu wrote:
>> On Mon, May 16, 2011 at 11:18:41AM +0300, Michael S. Tsirkin wrote:
>> >
>> > There's no interface for userspace to enable it: userspace
>> > only has an ioctl to enable/disable checksum offloading.
>> > SG is an implementation detail.
>> Yes there is: ethtool -K
> Ok. You are right of course, I was confused.
>
> So it's just an info message: in the end if userspace DTRT features
> get enabled properly. Functionally, there is no regression.

I proposed changing those messages to DEBUG level some time ago.Those
dependencies are constant, so they could be moved to
Documentation/networking/.

> Both bridge and tun trigger the messages ATM. I note that
> dev.c takes pains to avoid these messages:
>        Avoid warning from netdev_fix_features() for GSO without SG
>
> Should all drivers do this: clear _SG if they clear checksum?  What about _GSO?
> If we start doing this, this spills info about flag dependencies out to drivers.

Drivers should not care about those dependencies.

Best Regards,
Michał Mirosław
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Michael S. Tsirkin May 16, 2011, 11:21 a.m. UTC | #10
On Mon, May 16, 2011 at 08:43:10PM +1000, Herbert Xu wrote:
> On Mon, May 16, 2011 at 12:48:21PM +0300, Michael S. Tsirkin wrote:
> >
> > Both bridge and tun trigger the messages ATM. I note that
> > dev.c takes pains to avoid these messages:
> > 	Avoid warning from netdev_fix_features() for GSO without SG
> > 
> > Should all drivers do this: clear _SG if they clear checksum?  What about _GSO?
> > If we start doing this, this spills info about flag dependencies out to drivers.
> 
> Drivers don't need to do this at all since the network stack
> will automatically clear SG and related features if checksum
> is disabled.
> 
> Cheers,

Yes, but then we get annoying info messages every time.
Change them all to debug or remove completely?

> -- 
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Herbert Xu May 16, 2011, 12:18 p.m. UTC | #11
On Mon, May 16, 2011 at 02:21:33PM +0300, Michael S. Tsirkin wrote:
>
> Yes, but then we get annoying info messages every time.
> Change them all to debug or remove completely?

If you are getting warning messages then it probably means that
your driver is doing something wrong.

Cheers,
=?ISO-8859-2?Q?Micha=B3_Miros=B3aw?= May 16, 2011, 12:24 p.m. UTC | #12
2011/5/16 Herbert Xu <herbert@gondor.apana.org.au>:
> On Mon, May 16, 2011 at 02:21:33PM +0300, Michael S. Tsirkin wrote:
>> Yes, but then we get annoying info messages every time.
>> Change them all to debug or remove completely?
> If you are getting warning messages then it probably means that
> your driver is doing something wrong.

In this case - no. Those messages inform that driver supports more
feature combinations than network core and the feature set is reduced
because of that.

Best Regards,
Michał Mirosław
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Herbert Xu May 16, 2011, 10:46 p.m. UTC | #13
On Mon, May 16, 2011 at 02:24:19PM +0200, Michał Mirosław wrote:
>
> In this case - no. Those messages inform that driver supports more
> feature combinations than network core and the feature set is reduced
> because of that.

The driver should never even claim to support SG/TSO/UFO if it
does not support checksum.  That is the point of the warning.

Cheers,
David Miller May 16, 2011, 11:06 p.m. UTC | #14
From: Herbert Xu <herbert@gondor.hengli.com.au>
Date: Tue, 17 May 2011 08:46:58 +1000

> On Mon, May 16, 2011 at 02:24:19PM +0200, Michał Mirosław wrote:
>>
>> In this case - no. Those messages inform that driver supports more
>> feature combinations than network core and the feature set is reduced
>> because of that.
> 
> The driver should never even claim to support SG/TSO/UFO if it
> does not support checksum.  That is the point of the warning.

Well the check has to exist somewhere.

Currently userspace can configure tun/tap into whatever set
of offloads it likes.

We're warning when the user asks for something that needs to be
corrected.  So the only thing you can suggest is to duplicate these
changes in the tun/tap driver.

But if we do that, and error on bad combinations instead of fixing
them up, we know from this discussion that existing virtualization
setups and tools are going to stop working.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Herbert Xu May 16, 2011, 11:45 p.m. UTC | #15
On Mon, May 16, 2011 at 07:06:15PM -0400, David Miller wrote:
>
> Well the check has to exist somewhere.
> 
> Currently userspace can configure tun/tap into whatever set
> of offloads it likes.
> 
> We're warning when the user asks for something that needs to be
> corrected.  So the only thing you can suggest is to duplicate these
> changes in the tun/tap driver.
> 
> But if we do that, and error on bad combinations instead of fixing
> them up, we know from this discussion that existing virtualization
> setups and tools are going to stop working.

Yeah the tun driver is simply busted.  We should never have allowed
user-space to tweak the feature bits like this.  Instead they should
have gone through the ethtool interface like everyone else, or at
least use the same underlying calls as ethtool.

Actually, I think we can still do that, and apply the same rules
as ethtool with respect to automatically turning things on/off.

AFAICS the current set_offload in tun.c does not call anything
that verifies/fixes up the settings.  If you change the feature
bits after registering the tun device it may never get fixed up
at all.

Allowing an unprivileged user to tweak feature bits directly with
no verification is just wrong.

Cheers,
Michael S. Tsirkin May 17, 2011, 5:18 a.m. UTC | #16
On Tue, May 17, 2011 at 09:45:38AM +1000, Herbert Xu wrote:
> On Mon, May 16, 2011 at 07:06:15PM -0400, David Miller wrote:
> >
> > Well the check has to exist somewhere.
> > 
> > Currently userspace can configure tun/tap into whatever set
> > of offloads it likes.
> > 
> > We're warning when the user asks for something that needs to be
> > corrected.  So the only thing you can suggest is to duplicate these
> > changes in the tun/tap driver.
> > 
> > But if we do that, and error on bad combinations instead of fixing
> > them up, we know from this discussion that existing virtualization
> > setups and tools are going to stop working.
> 
> Yeah the tun driver is simply busted.  We should never have allowed
> user-space to tweak the feature bits like this.  Instead they should
> have gone through the ethtool interface like everyone else, or at
> least use the same underlying calls as ethtool.
> 
> Actually, I think we can still do that, and apply the same rules
> as ethtool with respect to automatically turning things on/off.
> 
> AFAICS the current set_offload in tun.c does not call anything
> that verifies/fixes up the settings.  If you change the feature
> bits after registering the tun device it may never get fixed up
> at all.

Hmm, we get the warnings about bits dropped on each set_offload
call:
	netdev_update_features is called,
	that calls netdev_fix_features

No?

> Allowing an unprivileged user to tweak feature bits directly with
> no verification is just wrong.
> 
> Cheers,

But we do verify bits, and only allow the user
to tweak these ones:

#define TUN_USER_FEATURES (NETIF_F_HW_CSUM|NETIF_F_TSO_ECN|NETIF_F_TSO|
\
                          NETIF_F_TSO6|NETIF_F_UFO)

No?

> -- 
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Herbert Xu May 17, 2011, 5:24 a.m. UTC | #17
On Tue, May 17, 2011 at 08:18:45AM +0300, Michael S. Tsirkin wrote:
>
> Hmm, we get the warnings about bits dropped on each set_offload
> call:
> 	netdev_update_features is called,
> 	that calls netdev_fix_features
> 
> No?

I presume this has changed recently as the current Linus tree
does not contain a call to netdev_update_features, it only calls
netdev_features_change.

If so then this does ensure that the feature bits will be sane.

I still think the warnings should be retained at their previous
level in the call paths other than set_offload.  All we have to
do is add a parameter to netdev_update_features and co.

Cheers,
Michael S. Tsirkin May 17, 2011, 5:48 a.m. UTC | #18
On Tue, May 17, 2011 at 03:24:01PM +1000, Herbert Xu wrote:
> On Tue, May 17, 2011 at 08:18:45AM +0300, Michael S. Tsirkin wrote:
> >
> > Hmm, we get the warnings about bits dropped on each set_offload
> > call:
> > 	netdev_update_features is called,
> > 	that calls netdev_fix_features
> > 
> > No?
> 
> I presume this has changed recently as the current Linus tree
> does not contain a call to netdev_update_features, it only calls
> netdev_features_change.
> 
> If so then this does ensure that the feature bits will be sane.
> 
> I still think the warnings should be retained at their previous
> level in the call paths other than set_offload.  All we have to
> do is add a parameter to netdev_update_features and co.
> 
> Cheers,

You mean like bool quiet?
Herbert Xu May 17, 2011, 6:25 a.m. UTC | #19
On Tue, May 17, 2011 at 08:48:23AM +0300, Michael S. Tsirkin wrote:
>
> You mean like bool quiet?

Yes when tun calls netdev_update_features we expect it to contain
bogus combinations so all warnings should disappear.

Everybody should still need maintain sanity.

Cheers,
=?ISO-8859-2?Q?Micha=B3_Miros=B3aw?= May 17, 2011, 8:08 a.m. UTC | #20
2011/5/17 Herbert Xu <herbert@gondor.apana.org.au>:
> On Mon, May 16, 2011 at 02:24:19PM +0200, Michał Mirosław wrote:
>> In this case - no. Those messages inform that driver supports more
>> feature combinations than network core and the feature set is reduced
>> because of that.
> The driver should never even claim to support SG/TSO/UFO if it
> does not support checksum.  That is the point of the warning.

Not really. The dependency of SG on checksum is in network core code
only, not in the hardware. For TSO/UFO they imply hw checksumming for
the respective protocol, but still theres no point in duplicating
features dependencies in driver code.

In the tun/tap case, by using TUNSETOFFLOAD userspace advertises that
it is willing to receive unchecksummed/TSOed packets from kernel (it
should use TUN_VNET_HDR for this to work correctly unless it doesn't
forward the packets). After the conversion, those offloads can be
disabled by using ethtool even if userspace does support them.
Previously you were able to push offloaded packets to apllications not
prepared for them.

Best Regards,
Michał Mirosław
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
=?ISO-8859-2?Q?Micha=B3_Miros=B3aw?= May 17, 2011, 8:15 a.m. UTC | #21
W dniu 17 maja 2011 10:08 użytkownik Michał Mirosław <mirqus@gmail.com> napisał:
> In the tun/tap case, by using TUNSETOFFLOAD userspace advertises that
> it is willing to receive unchecksummed/TSOed packets from kernel (it
> should use TUN_VNET_HDR for this to work correctly unless it doesn't
> forward the packets). After the conversion, those offloads can be
> disabled by using ethtool even if userspace does support them.
> Previously you were able to push offloaded packets to apllications not
> prepared for them.

And there is a bug in the logic implementing this. I'll send a fix in a minute.

Best Regards,
Michał Mirosław
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 0636f70..eea92e0 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1178,7 +1178,7 @@  static int set_offload(struct tun_struct *tun, unsigned long arg)
        u32 features = 0;
 
        if (arg & TUN_F_CSUM) {
-               features |= NETIF_F_HW_CSUM;
+               features |= NETIF_F_HW_CSUM | NETIF_F_SG;
                arg &= ~TUN_F_CSUM;
 
                if (arg & (TUN_F_TSO4|TUN_F_TSO6)) {