Skip to content

Commit 3d093bc

Browse files
ayalevin123Saeed Mahameed
authored andcommitted
net/mlx5e: Fix driver's declaration to support GRE offload
Declare GRE offload support with respect to the inner protocol. Add a list of supported inner protocols on which the driver can offload checksum and GSO. For other protocols, inform the stack to do the needed operations. There is no noticeable impact on GRE performance. Fixes: 2729984 ("net/mlx5e: Support TSO and TX checksum offloads for GRE tunnels") Signed-off-by: Aya Levin <ayal@mellanox.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
1 parent 2b02198 commit 3d093bc

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

  • drivers/net/ethernet/mellanox/mlx5/core

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4226,6 +4226,21 @@ int mlx5e_get_vf_stats(struct net_device *dev,
42264226
}
42274227
#endif
42284228

4229+
static bool mlx5e_gre_tunnel_inner_proto_offload_supported(struct mlx5_core_dev *mdev,
4230+
struct sk_buff *skb)
4231+
{
4232+
switch (skb->inner_protocol) {
4233+
case htons(ETH_P_IP):
4234+
case htons(ETH_P_IPV6):
4235+
case htons(ETH_P_TEB):
4236+
return true;
4237+
case htons(ETH_P_MPLS_UC):
4238+
case htons(ETH_P_MPLS_MC):
4239+
return MLX5_CAP_ETH(mdev, tunnel_stateless_mpls_over_gre);
4240+
}
4241+
return false;
4242+
}
4243+
42294244
static netdev_features_t mlx5e_tunnel_features_check(struct mlx5e_priv *priv,
42304245
struct sk_buff *skb,
42314246
netdev_features_t features)
@@ -4248,7 +4263,9 @@ static netdev_features_t mlx5e_tunnel_features_check(struct mlx5e_priv *priv,
42484263

42494264
switch (proto) {
42504265
case IPPROTO_GRE:
4251-
return features;
4266+
if (mlx5e_gre_tunnel_inner_proto_offload_supported(priv->mdev, skb))
4267+
return features;
4268+
break;
42524269
case IPPROTO_IPIP:
42534270
case IPPROTO_IPV6:
42544271
if (mlx5e_tunnel_proto_supported(priv->mdev, IPPROTO_IPIP))

0 commit comments

Comments
 (0)