act_mirred: get rid of tcfm_ifindex from struct tcf_mirred
[linux-block.git] / drivers / net / ethernet / mellanox / mlx5 / core / en_tc.c
index 55979ec2e88a14f7123ad164769feefe9c730618..3e03d2e8f96a93d536e8cd01ece012bec9cdf22a 100644 (file)
@@ -1982,11 +1982,10 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, struct tcf_exts *exts,
                }
 
                if (is_tcf_mirred_egress_redirect(a)) {
-                       int ifindex = tcf_mirred_ifindex(a);
                        struct net_device *out_dev;
                        struct mlx5e_priv *out_priv;
 
-                       out_dev = __dev_get_by_index(dev_net(priv->netdev), ifindex);
+                       out_dev = tcf_mirred_dev(a);
 
                        if (switchdev_port_same_parent_id(priv->netdev,
                                                          out_dev)) {
@@ -1996,7 +1995,7 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, struct tcf_exts *exts,
                                rpriv = out_priv->ppriv;
                                attr->out_rep = rpriv->rep;
                        } else if (encap) {
-                               parse_attr->mirred_ifindex = ifindex;
+                               parse_attr->mirred_ifindex = out_dev->ifindex;
                                parse_attr->tun_info = *info;
                                attr->parse_attr = parse_attr;
                                attr->action |= MLX5_FLOW_CONTEXT_ACTION_ENCAP |