All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] sfc: correctly advertise tunneled IPv6 segmentation
@ 2023-01-25 14:35 Íñigo Huguet
  2023-01-26  8:52 ` Martin Habets
  2023-01-28  8:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Íñigo Huguet @ 2023-01-25 14:35 UTC (permalink / raw)
  To: ecree.xilinx, habetsm.xilinx
  Cc: davem, edumazet, kuba, pabeni, netdev, Íñigo Huguet,
	Tianhao Zhao

Recent sfc NICs are TSO capable for some tunnel protocols. However, it
was not working properly because the feature was not advertised in
hw_enc_features, but in hw_features only.

Setting up a GENEVE tunnel and using iperf3 to send IPv4 and IPv6 traffic
to the tunnel show, with tcpdump, that the IPv4 packets still had ~64k
size but the IPv6 ones had only ~1500 bytes (they had been segmented by
software, not offloaded). With this patch segmentation is offloaded as
expected and the traffic is correctly received at the other end.

Fixes: 24b2c3751aa3 ("sfc: advertise encapsulated offloads on EF10")
Reported-by: Tianhao Zhao <tizhao@redhat.com>
Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
---
 drivers/net/ethernet/sfc/efx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 0556542d7a6b..3a86f1213a05 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -1003,8 +1003,11 @@ static int efx_pci_probe_post_io(struct efx_nic *efx)
 	/* Determine netdevice features */
 	net_dev->features |= (efx->type->offload_features | NETIF_F_SG |
 			      NETIF_F_TSO | NETIF_F_RXCSUM | NETIF_F_RXALL);
-	if (efx->type->offload_features & (NETIF_F_IPV6_CSUM | NETIF_F_HW_CSUM))
+	if (efx->type->offload_features & (NETIF_F_IPV6_CSUM | NETIF_F_HW_CSUM)) {
 		net_dev->features |= NETIF_F_TSO6;
+		if (efx_has_cap(efx, TX_TSO_V2_ENCAP))
+			net_dev->hw_enc_features |= NETIF_F_TSO6;
+	}
 	/* Check whether device supports TSO */
 	if (!efx->type->tso_versions || !efx->type->tso_versions(efx))
 		net_dev->features &= ~NETIF_F_ALL_TSO;
-- 
2.34.3


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

* Re: [PATCH net] sfc: correctly advertise tunneled IPv6 segmentation
  2023-01-25 14:35 [PATCH net] sfc: correctly advertise tunneled IPv6 segmentation Íñigo Huguet
@ 2023-01-26  8:52 ` Martin Habets
  2023-01-28  8:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Martin Habets @ 2023-01-26  8:52 UTC (permalink / raw)
  To: Íñigo Huguet
  Cc: ecree.xilinx, davem, edumazet, kuba, pabeni, netdev, Tianhao Zhao

On Wed, Jan 25, 2023 at 03:35:13PM +0100, Íñigo Huguet wrote:
> Recent sfc NICs are TSO capable for some tunnel protocols. However, it
> was not working properly because the feature was not advertised in
> hw_enc_features, but in hw_features only.
> 
> Setting up a GENEVE tunnel and using iperf3 to send IPv4 and IPv6 traffic
> to the tunnel show, with tcpdump, that the IPv4 packets still had ~64k
> size but the IPv6 ones had only ~1500 bytes (they had been segmented by
> software, not offloaded). With this patch segmentation is offloaded as
> expected and the traffic is correctly received at the other end.
> 
> Fixes: 24b2c3751aa3 ("sfc: advertise encapsulated offloads on EF10")
> Reported-by: Tianhao Zhao <tizhao@redhat.com>
> Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>

Acked-by: Martin Habets <habetsm.xilinx@gmail.com>

> ---
>  drivers/net/ethernet/sfc/efx.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
> index 0556542d7a6b..3a86f1213a05 100644
> --- a/drivers/net/ethernet/sfc/efx.c
> +++ b/drivers/net/ethernet/sfc/efx.c
> @@ -1003,8 +1003,11 @@ static int efx_pci_probe_post_io(struct efx_nic *efx)
>  	/* Determine netdevice features */
>  	net_dev->features |= (efx->type->offload_features | NETIF_F_SG |
>  			      NETIF_F_TSO | NETIF_F_RXCSUM | NETIF_F_RXALL);
> -	if (efx->type->offload_features & (NETIF_F_IPV6_CSUM | NETIF_F_HW_CSUM))
> +	if (efx->type->offload_features & (NETIF_F_IPV6_CSUM | NETIF_F_HW_CSUM)) {
>  		net_dev->features |= NETIF_F_TSO6;
> +		if (efx_has_cap(efx, TX_TSO_V2_ENCAP))
> +			net_dev->hw_enc_features |= NETIF_F_TSO6;
> +	}
>  	/* Check whether device supports TSO */
>  	if (!efx->type->tso_versions || !efx->type->tso_versions(efx))
>  		net_dev->features &= ~NETIF_F_ALL_TSO;
> -- 
> 2.34.3

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

* Re: [PATCH net] sfc: correctly advertise tunneled IPv6 segmentation
  2023-01-25 14:35 [PATCH net] sfc: correctly advertise tunneled IPv6 segmentation Íñigo Huguet
  2023-01-26  8:52 ` Martin Habets
@ 2023-01-28  8:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-01-28  8:40 UTC (permalink / raw)
  To: =?utf-8?b?w43DsWlnbyBIdWd1ZXQgPGlodWd1ZXRAcmVkaGF0LmNvbT4=?=
  Cc: ecree.xilinx, habetsm.xilinx, davem, edumazet, kuba, pabeni,
	netdev, tizhao

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 25 Jan 2023 15:35:13 +0100 you wrote:
> Recent sfc NICs are TSO capable for some tunnel protocols. However, it
> was not working properly because the feature was not advertised in
> hw_enc_features, but in hw_features only.
> 
> Setting up a GENEVE tunnel and using iperf3 to send IPv4 and IPv6 traffic
> to the tunnel show, with tcpdump, that the IPv4 packets still had ~64k
> size but the IPv6 ones had only ~1500 bytes (they had been segmented by
> software, not offloaded). With this patch segmentation is offloaded as
> expected and the traffic is correctly received at the other end.
> 
> [...]

Here is the summary with links:
  - [net] sfc: correctly advertise tunneled IPv6 segmentation
    https://git.kernel.org/netdev/net/c/ffffd2454a7a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2023-01-28  8:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-25 14:35 [PATCH net] sfc: correctly advertise tunneled IPv6 segmentation Íñigo Huguet
2023-01-26  8:52 ` Martin Habets
2023-01-28  8:40 ` patchwork-bot+netdevbpf

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.