diff mbox series

nfp: support VxLAN inner TSO with GSO_PARTIAL offload

Message ID 20220430231150.175270-1-simon.horman@corigine.com (mailing list archive)
State Accepted
Commit ae664d9d8559b123766b47af4dfbfa877a80156e
Delegated to: Netdev Maintainers
Headers show
Series nfp: support VxLAN inner TSO with GSO_PARTIAL offload | expand

Checks

Context Check Description
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 4 maintainers not CCed: niklas.soderlund@corigine.com yinjun.zhang@corigine.com edumazet@google.com pabeni@redhat.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch warning WARNING: line length of 83 exceeds 80 columns
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Simon Horman April 30, 2022, 11:11 p.m. UTC
From: Fei Qin <fei.qin@corigine.com>

VxLAN belongs to UDP-based encapsulation protocol. Inner TSO for VxLAN
packet with udpcsum requires offloading of outer header csum.

The device doesn't support outer header csum offload. However, inner TSO
for VxLAN with udpcsum can still work with GSO_PARTIAL offload, which
means outer udp csum computed by stack and inner tcp segmentation finished
by hardware. Thus, the patch enable features "NETIF_F_GSO_UDP_TUNNEL_CSUM"
and "NETIF_F_GSO_PARTIAL" and set gso_partial_features.

Signed-off-by: Fei Qin <fei.qin@corigine.com>
Signed-off-by: Yinjun Zhang <yinjun.zhang@corigine.com>
Signed-off-by: Louis Peens <louis.peens@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
---
 drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Simon Horman April 30, 2022, 11:14 p.m. UTC | #1
On Sun, May 01, 2022 at 08:11:50AM +0900, Simon Horman wrote:
> From: Fei Qin <fei.qin@corigine.com>
> 
> VxLAN belongs to UDP-based encapsulation protocol. Inner TSO for VxLAN
> packet with udpcsum requires offloading of outer header csum.
> 
> The device doesn't support outer header csum offload. However, inner TSO
> for VxLAN with udpcsum can still work with GSO_PARTIAL offload, which
> means outer udp csum computed by stack and inner tcp segmentation finished
> by hardware. Thus, the patch enable features "NETIF_F_GSO_UDP_TUNNEL_CSUM"
> and "NETIF_F_GSO_PARTIAL" and set gso_partial_features.
> 
> Signed-off-by: Fei Qin <fei.qin@corigine.com>
> Signed-off-by: Yinjun Zhang <yinjun.zhang@corigine.com>
> Signed-off-by: Louis Peens <louis.peens@corigine.com>
> Signed-off-by: Simon Horman <simon.horman@corigine.com>

Sorry, missed the annotation in the subject for some reason.
This is targeted at net-next.

> ---
>  drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
> index b412670d89b2..5528d12d1f48 100644
> --- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
> +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
> @@ -2259,8 +2259,12 @@ static void nfp_net_netdev_init(struct nfp_net *nn)
>  	if (nn->cap & NFP_NET_CFG_CTRL_RSS_ANY)
>  		netdev->hw_features |= NETIF_F_RXHASH;
>  	if (nn->cap & NFP_NET_CFG_CTRL_VXLAN) {
> -		if (nn->cap & NFP_NET_CFG_CTRL_LSO)
> -			netdev->hw_features |= NETIF_F_GSO_UDP_TUNNEL;
> +		if (nn->cap & NFP_NET_CFG_CTRL_LSO) {
> +			netdev->hw_features |= NETIF_F_GSO_UDP_TUNNEL |
> +					       NETIF_F_GSO_UDP_TUNNEL_CSUM |
> +					       NETIF_F_GSO_PARTIAL;
> +			netdev->gso_partial_features = NETIF_F_GSO_UDP_TUNNEL_CSUM;
> +		}
>  		netdev->udp_tunnel_nic_info = &nfp_udp_tunnels;
>  		nn->dp.ctrl |= NFP_NET_CFG_CTRL_VXLAN;
>  	}
> -- 
> 2.30.2
>
patchwork-bot+netdevbpf@kernel.org May 2, 2022, 11:10 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (master)
by Paolo Abeni <pabeni@redhat.com>:

On Sun,  1 May 2022 08:11:50 +0900 you wrote:
> From: Fei Qin <fei.qin@corigine.com>
> 
> VxLAN belongs to UDP-based encapsulation protocol. Inner TSO for VxLAN
> packet with udpcsum requires offloading of outer header csum.
> 
> The device doesn't support outer header csum offload. However, inner TSO
> for VxLAN with udpcsum can still work with GSO_PARTIAL offload, which
> means outer udp csum computed by stack and inner tcp segmentation finished
> by hardware. Thus, the patch enable features "NETIF_F_GSO_UDP_TUNNEL_CSUM"
> and "NETIF_F_GSO_PARTIAL" and set gso_partial_features.
> 
> [...]

Here is the summary with links:
  - nfp: support VxLAN inner TSO with GSO_PARTIAL offload
    https://git.kernel.org/netdev/net-next/c/ae664d9d8559

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
index b412670d89b2..5528d12d1f48 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -2259,8 +2259,12 @@  static void nfp_net_netdev_init(struct nfp_net *nn)
 	if (nn->cap & NFP_NET_CFG_CTRL_RSS_ANY)
 		netdev->hw_features |= NETIF_F_RXHASH;
 	if (nn->cap & NFP_NET_CFG_CTRL_VXLAN) {
-		if (nn->cap & NFP_NET_CFG_CTRL_LSO)
-			netdev->hw_features |= NETIF_F_GSO_UDP_TUNNEL;
+		if (nn->cap & NFP_NET_CFG_CTRL_LSO) {
+			netdev->hw_features |= NETIF_F_GSO_UDP_TUNNEL |
+					       NETIF_F_GSO_UDP_TUNNEL_CSUM |
+					       NETIF_F_GSO_PARTIAL;
+			netdev->gso_partial_features = NETIF_F_GSO_UDP_TUNNEL_CSUM;
+		}
 		netdev->udp_tunnel_nic_info = &nfp_udp_tunnels;
 		nn->dp.ctrl |= NFP_NET_CFG_CTRL_VXLAN;
 	}