* GSO and IPv4 forwarding
@ 2010-10-26 20:02 Kevin Wilson
2010-10-26 20:15 ` Eric Dumazet
2010-10-26 20:19 ` David Miller
0 siblings, 2 replies; 6+ messages in thread
From: Kevin Wilson @ 2010-10-26 20:02 UTC (permalink / raw)
To: netdev
Hi,
When we set a netdevice to support forwarding, we disable LRO.
This is done because we don't want to forward an SKB which has been
processed by LRO.
This is done in inet_forward_change() in net/ipv4/devinet.c:
We call dev_disable_lro(dev) in this method, when setting forwarding
for the device.
As a result, in ip_forward(), the packet will be dropped. (because
skb_warn_if_lro(), called by this method, returns TRUE)
My question is:
dev_disable_lro(dev) disable the LRO feature (NETIF_F_LRO) of the
device. But suppose I have a device where GRO is enabled (and LRO is
not). And let's say I set forwarding on this device.
it seems to me that is such case, calling dev_disable_lro(dev) in
net_forward_change() to disable the LRO feature of the device (which
is already disabled) is not enough, and in such case , GRO packets,
which want to be forwarded, will **not** be dropped in ip_forward().
(since kb_warn_if_lro() will return false in this case)
Is it so ? I am ready to send a patch fixing it, but I am a newbie in
kernel, so I want to ask first.
rgs,
Kevin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GSO and IPv4 forwarding
2010-10-26 20:02 GSO and IPv4 forwarding Kevin Wilson
@ 2010-10-26 20:15 ` Eric Dumazet
2010-10-26 20:26 ` Kevin Wilson
2010-10-26 20:19 ` David Miller
1 sibling, 1 reply; 6+ messages in thread
From: Eric Dumazet @ 2010-10-26 20:15 UTC (permalink / raw)
To: Kevin Wilson; +Cc: netdev
Le mardi 26 octobre 2010 à 22:02 +0200, Kevin Wilson a écrit :
> Hi,
> When we set a netdevice to support forwarding, we disable LRO.
> This is done because we don't want to forward an SKB which has been
> processed by LRO.
>
> This is done in inet_forward_change() in net/ipv4/devinet.c:
> We call dev_disable_lro(dev) in this method, when setting forwarding
> for the device.
> As a result, in ip_forward(), the packet will be dropped. (because
> skb_warn_if_lro(), called by this method, returns TRUE)
>
> My question is:
> dev_disable_lro(dev) disable the LRO feature (NETIF_F_LRO) of the
> device. But suppose I have a device where GRO is enabled (and LRO is
> not). And let's say I set forwarding on this device.
>
> it seems to me that is such case, calling dev_disable_lro(dev) in
> net_forward_change() to disable the LRO feature of the device (which
> is already disabled) is not enough, and in such case , GRO packets,
> which want to be forwarded, will **not** be dropped in ip_forward().
> (since kb_warn_if_lro() will return false in this case)
>
> Is it so ? I am ready to send a patch fixing it, but I am a newbie in
> kernel, so I want to ask first.
GRO packets can be forwarded just fine.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GSO and IPv4 forwarding
2010-10-26 20:02 GSO and IPv4 forwarding Kevin Wilson
2010-10-26 20:15 ` Eric Dumazet
@ 2010-10-26 20:19 ` David Miller
1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2010-10-26 20:19 UTC (permalink / raw)
To: wkevils; +Cc: netdev
From: Kevin Wilson <wkevils@gmail.com>
Date: Tue, 26 Oct 2010 22:02:26 +0200
> My question is:
> dev_disable_lro(dev) disable the LRO feature (NETIF_F_LRO) of the
> device. But suppose I have a device where GRO is enabled (and LRO is
> not). And let's say I set forwarding on this device.
GRO is completely different from LRO, and can remain enabled
when forwarding is turned on.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GSO and IPv4 forwarding
2010-10-26 20:15 ` Eric Dumazet
@ 2010-10-26 20:26 ` Kevin Wilson
2010-10-26 20:43 ` Eric Dumazet
2010-10-26 20:52 ` Stephen Hemminger
0 siblings, 2 replies; 6+ messages in thread
From: Kevin Wilson @ 2010-10-26 20:26 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev
Hi,
Thanks a lot for your quick answer, I appreciate it (and did not
expect it to be so quick!)
Can someone please explain in 2-3 short sentences Why GRO can be
forwarded and LRO cannot be forwarded ?
rgs,
Kevin
On Tue, Oct 26, 2010 at 10:15 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le mardi 26 octobre 2010 à 22:02 +0200, Kevin Wilson a écrit :
>> Hi,
>> When we set a netdevice to support forwarding, we disable LRO.
>> This is done because we don't want to forward an SKB which has been
>> processed by LRO.
>>
>> This is done in inet_forward_change() in net/ipv4/devinet.c:
>> We call dev_disable_lro(dev) in this method, when setting forwarding
>> for the device.
>> As a result, in ip_forward(), the packet will be dropped. (because
>> skb_warn_if_lro(), called by this method, returns TRUE)
>>
>> My question is:
>> dev_disable_lro(dev) disable the LRO feature (NETIF_F_LRO) of the
>> device. But suppose I have a device where GRO is enabled (and LRO is
>> not). And let's say I set forwarding on this device.
>>
>> it seems to me that is such case, calling dev_disable_lro(dev) in
>> net_forward_change() to disable the LRO feature of the device (which
>> is already disabled) is not enough, and in such case , GRO packets,
>> which want to be forwarded, will **not** be dropped in ip_forward().
>> (since kb_warn_if_lro() will return false in this case)
>>
>> Is it so ? I am ready to send a patch fixing it, but I am a newbie in
>> kernel, so I want to ask first.
>
> GRO packets can be forwarded just fine.
>
>
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GSO and IPv4 forwarding
2010-10-26 20:26 ` Kevin Wilson
@ 2010-10-26 20:43 ` Eric Dumazet
2010-10-26 20:52 ` Stephen Hemminger
1 sibling, 0 replies; 6+ messages in thread
From: Eric Dumazet @ 2010-10-26 20:43 UTC (permalink / raw)
To: Kevin Wilson; +Cc: netdev
Le mardi 26 octobre 2010 à 22:26 +0200, Kevin Wilson a écrit :
> Hi,
> Thanks a lot for your quick answer, I appreciate it (and did not
> expect it to be so quick!)
>
> Can someone please explain in 2-3 short sentences Why GRO can be
> forwarded and LRO cannot be forwarded ?
Well, GRO is a pure software thing, completely handled in linux stack,
not driver specific. Its design included forwarding ability, LRO did
not.
http://lwn.net/Articles/311357/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GSO and IPv4 forwarding
2010-10-26 20:26 ` Kevin Wilson
2010-10-26 20:43 ` Eric Dumazet
@ 2010-10-26 20:52 ` Stephen Hemminger
1 sibling, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2010-10-26 20:52 UTC (permalink / raw)
To: Kevin Wilson; +Cc: Eric Dumazet, netdev
On Tue, 26 Oct 2010 22:26:07 +0200
Kevin Wilson <wkevils@gmail.com> wrote:
> Hi,
> Thanks a lot for your quick answer, I appreciate it (and did not
> expect it to be so quick!)
>
> Can someone please explain in 2-3 short sentences Why GRO can be
> forwarded and LRO cannot be forwarded ?
> rgs,
> Kevin
LRO merges packets together creating one large skb. This is a layering
violation for forwarding or bridging (it violates end to end principle).
GRO maintains the headers of each packet and passes them as
a cluster.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-10-26 20:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-26 20:02 GSO and IPv4 forwarding Kevin Wilson
2010-10-26 20:15 ` Eric Dumazet
2010-10-26 20:26 ` Kevin Wilson
2010-10-26 20:43 ` Eric Dumazet
2010-10-26 20:52 ` Stephen Hemminger
2010-10-26 20:19 ` David Miller
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).