Skip to content

Commit a3e6736

Browse files
author
Saeed Mahameed
committed
net/mlx5e: Issue direct lookup on vxlan ports by vport representors
Remove uplink representor netdevice private structure lookup, and use mlx5 core handle directly from representor private structure to lookup vxlan ports. Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
1 parent 358aa5c commit a3e6736

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

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

‎drivers/net/ethernet/mellanox/mlx5/core/en_tc.c‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,16 +1124,12 @@ static int parse_tunnel_attr(struct mlx5e_priv *priv,
11241124
skb_flow_dissector_target(f->dissector,
11251125
FLOW_DISSECTOR_KEY_ENC_PORTS,
11261126
f->mask);
1127-
struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
1128-
struct mlx5e_rep_priv *uplink_rpriv = mlx5_eswitch_get_uplink_priv(esw, REP_ETH);
1129-
struct net_device *up_dev = uplink_rpriv->netdev;
1130-
struct mlx5e_priv *up_priv = netdev_priv(up_dev);
11311127

11321128
/* Full udp dst port must be given */
11331129
if (memchr_inv(&mask->dst, 0xff, sizeof(mask->dst)))
11341130
goto vxlan_match_offload_err;
11351131

1136-
if (mlx5_vxlan_lookup_port(up_priv->mdev->vxlan, be16_to_cpu(key->dst)) &&
1132+
if (mlx5_vxlan_lookup_port(priv->mdev->vxlan, be16_to_cpu(key->dst)) &&
11371133
MLX5_CAP_ESW(priv->mdev, vxlan_encap_decap))
11381134
parse_vxlan_attr(spec, f);
11391135
else {
@@ -2533,11 +2529,7 @@ static int mlx5e_attach_encap(struct mlx5e_priv *priv,
25332529
struct mlx5e_tc_flow *flow)
25342530
{
25352531
struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
2536-
struct mlx5e_rep_priv *uplink_rpriv = mlx5_eswitch_get_uplink_priv(esw,
2537-
REP_ETH);
2538-
struct net_device *up_dev = uplink_rpriv->netdev;
25392532
unsigned short family = ip_tunnel_info_af(tun_info);
2540-
struct mlx5e_priv *up_priv = netdev_priv(up_dev);
25412533
struct mlx5_esw_flow_attr *attr = flow->esw_attr;
25422534
struct ip_tunnel_key *key = &tun_info->key;
25432535
struct mlx5e_encap_entry *e;
@@ -2557,7 +2549,7 @@ static int mlx5e_attach_encap(struct mlx5e_priv *priv,
25572549
return -EOPNOTSUPP;
25582550
}
25592551

2560-
if (mlx5_vxlan_lookup_port(up_priv->mdev->vxlan, be16_to_cpu(key->tp_dst)) &&
2552+
if (mlx5_vxlan_lookup_port(priv->mdev->vxlan, be16_to_cpu(key->tp_dst)) &&
25612553
MLX5_CAP_ESW(priv->mdev, vxlan_encap_decap)) {
25622554
tunnel_type = MLX5_HEADER_TYPE_VXLAN;
25632555
} else {

0 commit comments

Comments
 (0)