提交 75c33da8 编写于 作者: O Or Gerlitz 提交者: Saeed Mahameed

net/mlx5e: TC ipv4 tunnel encap offload cosmetic changes

Move around some settings of variables as pre-step to make things
more robust and clear for the ipv6 case in down-stream patch.
This patch doesn't change any functionality.
Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: NHadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
上级 19f44401
...@@ -689,7 +689,6 @@ static int mlx5e_route_lookup_ipv4(struct mlx5e_priv *priv, ...@@ -689,7 +689,6 @@ static int mlx5e_route_lookup_ipv4(struct mlx5e_priv *priv,
{ {
struct rtable *rt; struct rtable *rt;
struct neighbour *n = NULL; struct neighbour *n = NULL;
int ttl;
#if IS_ENABLED(CONFIG_INET) #if IS_ENABLED(CONFIG_INET)
int ret; int ret;
...@@ -708,7 +707,7 @@ static int mlx5e_route_lookup_ipv4(struct mlx5e_priv *priv, ...@@ -708,7 +707,7 @@ static int mlx5e_route_lookup_ipv4(struct mlx5e_priv *priv,
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
ttl = ip4_dst_hoplimit(&rt->dst); *out_ttl = ip4_dst_hoplimit(&rt->dst);
n = dst_neigh_lookup(&rt->dst, &fl4->daddr); n = dst_neigh_lookup(&rt->dst, &fl4->daddr);
ip_rt_put(rt); ip_rt_put(rt);
if (!n) if (!n)
...@@ -716,7 +715,6 @@ static int mlx5e_route_lookup_ipv4(struct mlx5e_priv *priv, ...@@ -716,7 +715,6 @@ static int mlx5e_route_lookup_ipv4(struct mlx5e_priv *priv,
*out_n = n; *out_n = n;
*saddr = fl4->saddr; *saddr = fl4->saddr;
*out_ttl = ttl;
*out_dev = rt->dst.dev; *out_dev = rt->dst.dev;
return 0; return 0;
...@@ -792,15 +790,15 @@ static int mlx5e_create_encap_header_ipv4(struct mlx5e_priv *priv, ...@@ -792,15 +790,15 @@ static int mlx5e_create_encap_header_ipv4(struct mlx5e_priv *priv,
if (err) if (err)
goto out; goto out;
e->n = n;
e->out_dev = *out_dev;
if (!(n->nud_state & NUD_VALID)) { if (!(n->nud_state & NUD_VALID)) {
pr_warn("%s: can't offload, neighbour to %pI4 invalid\n", __func__, &fl4.daddr); pr_warn("%s: can't offload, neighbour to %pI4 invalid\n", __func__, &fl4.daddr);
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
goto out; goto out;
} }
e->n = n;
e->out_dev = *out_dev;
neigh_ha_snapshot(e->h_dest, n, *out_dev); neigh_ha_snapshot(e->h_dest, n, *out_dev);
switch (e->tunnel_type) { switch (e->tunnel_type) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册