Commit 48d67543 authored by Guillaume Nault's avatar Guillaume Nault Committed by Jakub Kicinski

mlx5: Don't accidentally set RTO_ONLINK before mlx5e_route_lookup_ipv4_get()

Mask the ECN bits before calling mlx5e_route_lookup_ipv4_get(). The
tunnel key might have the last ECN bit set. This interferes with the
route lookup process as ip_route_output_key_hash() interpretes this bit
specially (to restrict the route scope).

Found by code inspection, compile tested only.

Fixes: c7b9038d ("net/mlx5e: TC preparation refactoring for routing update event")
Fixes: 9a941117 ("net/mlx5e: Maximize ip tunnel key usage on the TC offloading path")
Signed-off-by: default avatarGuillaume Nault <gnault@redhat.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent a915deaa
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
/* Copyright (c) 2018 Mellanox Technologies. */ /* Copyright (c) 2018 Mellanox Technologies. */
#include <net/inet_ecn.h>
#include <net/vxlan.h> #include <net/vxlan.h>
#include <net/gre.h> #include <net/gre.h>
#include <net/geneve.h> #include <net/geneve.h>
...@@ -235,7 +236,7 @@ int mlx5e_tc_tun_create_header_ipv4(struct mlx5e_priv *priv, ...@@ -235,7 +236,7 @@ int mlx5e_tc_tun_create_header_ipv4(struct mlx5e_priv *priv,
int err; int err;
/* add the IP fields */ /* add the IP fields */
attr.fl.fl4.flowi4_tos = tun_key->tos; attr.fl.fl4.flowi4_tos = tun_key->tos & ~INET_ECN_MASK;
attr.fl.fl4.daddr = tun_key->u.ipv4.dst; attr.fl.fl4.daddr = tun_key->u.ipv4.dst;
attr.fl.fl4.saddr = tun_key->u.ipv4.src; attr.fl.fl4.saddr = tun_key->u.ipv4.src;
attr.ttl = tun_key->ttl; attr.ttl = tun_key->ttl;
...@@ -350,7 +351,7 @@ int mlx5e_tc_tun_update_header_ipv4(struct mlx5e_priv *priv, ...@@ -350,7 +351,7 @@ int mlx5e_tc_tun_update_header_ipv4(struct mlx5e_priv *priv,
int err; int err;
/* add the IP fields */ /* add the IP fields */
attr.fl.fl4.flowi4_tos = tun_key->tos; attr.fl.fl4.flowi4_tos = tun_key->tos & ~INET_ECN_MASK;
attr.fl.fl4.daddr = tun_key->u.ipv4.dst; attr.fl.fl4.daddr = tun_key->u.ipv4.dst;
attr.fl.fl4.saddr = tun_key->u.ipv4.src; attr.fl.fl4.saddr = tun_key->u.ipv4.src;
attr.ttl = tun_key->ttl; attr.ttl = tun_key->ttl;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment