summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Li <gavinl@nvidia.com>2022-12-27 04:54:09 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-18 11:44:59 +0100
commit092f0c2d1f836498fff8f68b26d529daa24b94a6 (patch)
tree90bc40bff9c12c576f645fc34c6b83386fc12b27
parentb3d47227f06f0f3b9e6eafdc32d5d8a3036820f8 (diff)
downloadlinux-092f0c2d1f836498fff8f68b26d529daa24b94a6.tar.gz
linux-092f0c2d1f836498fff8f68b26d529daa24b94a6.tar.bz2
linux-092f0c2d1f836498fff8f68b26d529daa24b94a6.zip
net/mlx5e: Don't support encap rules with gbp option
[ Upstream commit d515d63cae2cd186acf40deaa8ef33067bb7f637 ] Previously, encap rules with gbp option would be offloaded by mistake but driver does not support gbp option offload. To fix this issue, check if the encap rule has gbp option and don't offload the rule Fixes: d8f9dfae49ce ("net: sched: allow flower to match vxlan options") Signed-off-by: Gavin Li <gavinl@nvidia.com> Reviewed-by: Maor Dickman <maord@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_vxlan.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_vxlan.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_vxlan.c
index 038a0f1cecec..e44281ae570d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_vxlan.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_vxlan.c
@@ -88,6 +88,8 @@ static int mlx5e_gen_ip_tunnel_header_vxlan(char buf[],
struct udphdr *udp = (struct udphdr *)(buf);
struct vxlanhdr *vxh;
+ if (tun_key->tun_flags & TUNNEL_VXLAN_OPT)
+ return -EOPNOTSUPP;
vxh = (struct vxlanhdr *)((char *)udp + sizeof(struct udphdr));
*ip_proto = IPPROTO_UDP;