All of lore.kernel.org
 help / color / mirror / Atom feed
* ethtool features: tx-udp_tnl-csum-segmentation and tx-udp_tnl-segmentation
@ 2021-04-29  9:16 Aya Levin
  2021-04-29 14:49 ` Edward Cree
  0 siblings, 1 reply; 3+ messages in thread
From: Aya Levin @ 2021-04-29  9:16 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Jonathan Corbet, netdev, Saeed Mahameed
  Cc: Tariq Toukan, Moshe Shemesh, Maria Pasechnik

Hi,

I see a strange behavior when toggling feature flags:
(1) tx-udp_tnl-csum-segmentation
(2) tx-udp_tnl-segmentation

I had a guess that tx-udp_tnl-segmentation is responsible for 
segmentation of inner packets (SKB encapsulation + GSO) while 
tx-udp_tnl-csum-segmentation is responsible for checksum of the inner 
packet (SKB encapsulation  + ip_summed == CHECKSUM_PARTIAL). But testing 
proved me wrong.
What I see is that tx-udp_tnl-csum-segmentation controls TSO on inner, 
while tx-udp_tnl-segmentation has no effect - none of them controls the 
inner csum (ip_summed == CHECKSUM_PARTIAL always).

I looked for answers in documentation 
(Documentation/networking/vxlan.rst), with no luck.

Is the above behavior expected?
What is the role of each feature flag?
More specifically: Why are there 2? What is the difference between them?

Regards,
Aya

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ethtool features: tx-udp_tnl-csum-segmentation and tx-udp_tnl-segmentation
  2021-04-29  9:16 ethtool features: tx-udp_tnl-csum-segmentation and tx-udp_tnl-segmentation Aya Levin
@ 2021-04-29 14:49 ` Edward Cree
  2021-05-10 15:44   ` Aya Levin
  0 siblings, 1 reply; 3+ messages in thread
From: Edward Cree @ 2021-04-29 14:49 UTC (permalink / raw)
  To: Aya Levin, David S. Miller, Jakub Kicinski, Jonathan Corbet,
	netdev, Saeed Mahameed
  Cc: Tariq Toukan, Moshe Shemesh, Maria Pasechnik

On 29/04/2021 10:16, Aya Levin wrote:
> I see a strange behavior when toggling feature flags:
> (1) tx-udp_tnl-csum-segmentation
> (2) tx-udp_tnl-segmentation
...
> What is the role of each feature flag?
IIRC, tx-udp_tnl-segmentation controls whether to do TSO on packets that don't
 have an outer checksum to offload, whereas tx-udp_tnl-csum-segmentation controls
 the same for packets that _do_ need outer checksum offload.  The difference
 being whether gso_type is SKB_GSO_UDP_TUNNEL or SKB_GSO_UDP_TUNNEL_CSUM.

To a first approximation there's one feature flag for each SKB_GSO_* bit, and if
 an skb's gso_type requires a feature that's not enabled on the device, the core
 will segment that skb in software before handing it to the driver.

Documentation/networking/segmentation-offloads.rst may also be useful to read if
 you haven't already.

(And note that the kernel's favourite way for hardware to behave is to instead
 provide GSO_PARTIAL offload / tx-gso-partial, rather than doing protocol-
 ossified offloads for specific kinds of tunnels.)

-ed

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ethtool features: tx-udp_tnl-csum-segmentation and tx-udp_tnl-segmentation
  2021-04-29 14:49 ` Edward Cree
@ 2021-05-10 15:44   ` Aya Levin
  0 siblings, 0 replies; 3+ messages in thread
From: Aya Levin @ 2021-05-10 15:44 UTC (permalink / raw)
  To: Edward Cree, David S. Miller, Jakub Kicinski, Jonathan Corbet,
	netdev, Saeed Mahameed
  Cc: Tariq Toukan, Moshe Shemesh, Maria Pasechnik

Thanks a lot for your response!

On 4/29/2021 5:49 PM, Edward Cree wrote:
> On 29/04/2021 10:16, Aya Levin wrote:
>> I see a strange behavior when toggling feature flags:
>> (1) tx-udp_tnl-csum-segmentation
>> (2) tx-udp_tnl-segmentation
> ...
>> What is the role of each feature flag?
> IIRC, tx-udp_tnl-segmentation controls whether to do TSO on packets that don't
>   have an outer checksum to offload, whereas tx-udp_tnl-csum-segmentation controls
>   the same for packets that _do_ need outer checksum offload.  The difference
>   being whether gso_type is SKB_GSO_UDP_TUNNEL or SKB_GSO_UDP_TUNNEL_CSUM.
Digging further in the code I see that the driver may allow/block inner 
checksum offload by set/unset NETIF_F_HW_CSUM to hw_enc_features at 
driver's load.
I couldn't find a control - is this expected?
> 
> To a first approximation there's one feature flag for each SKB_GSO_* bit, and if
>   an skb's gso_type requires a feature that's not enabled on the device, the core
>   will segment that skb in software before handing it to the driver.
> 
> Documentation/networking/segmentation-offloads.rst may also be useful to read if
>   you haven't already.
> 
> (And note that the kernel's favourite way for hardware to behave is to instead
>   provide GSO_PARTIAL offload / tx-gso-partial, rather than doing protocol-
>   ossified offloads for specific kinds of tunnels.)
> 
> -ed
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-10 15:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-29  9:16 ethtool features: tx-udp_tnl-csum-segmentation and tx-udp_tnl-segmentation Aya Levin
2021-04-29 14:49 ` Edward Cree
2021-05-10 15:44   ` Aya Levin

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.