From: Marina Varshaver <mari...@mellanox.com>

Add TX offloads support for IP-in-IP tunneled packets by reporting
the needed netdev features.

Signed-off-by: Marina Varshaver <mari...@mellanox.com>
Reviewed-by: Aya Levin <a...@mellanox.com>
Signed-off-by: Saeed Mahameed <sae...@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c 
b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 1c4f82842df9..f4a5055dfaff 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -4241,6 +4241,7 @@ static netdev_features_t 
mlx5e_tunnel_features_check(struct mlx5e_priv *priv,
 
        switch (proto) {
        case IPPROTO_GRE:
+       case IPPROTO_IPIP:
                return features;
        case IPPROTO_UDP:
                udph = udp_hdr(skb);
@@ -4901,6 +4902,15 @@ static void mlx5e_build_nic_netdev(struct net_device 
*netdev)
                                                NETIF_F_GSO_GRE_CSUM;
        }
 
+       if (mlx5e_tunnel_proto_supported(mdev, IPPROTO_IPIP)) {
+               netdev->hw_features |= NETIF_F_GSO_IPXIP4 |
+                                      NETIF_F_GSO_IPXIP6;
+               netdev->hw_enc_features |= NETIF_F_GSO_IPXIP4 |
+                                          NETIF_F_GSO_IPXIP6;
+               netdev->gso_partial_features |= NETIF_F_GSO_IPXIP4 |
+                                               NETIF_F_GSO_IPXIP6;
+       }
+
        netdev->hw_features                      |= NETIF_F_GSO_PARTIAL;
        netdev->gso_partial_features             |= NETIF_F_GSO_UDP_L4;
        netdev->hw_features                      |= NETIF_F_GSO_UDP_L4;
-- 
2.21.0

Reply via email to