Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56e858df authored by Rabie Loulou's avatar Rabie Loulou Committed by Saeed Mahameed
Browse files

net/mlx5e: Explicitly set destination e-switch in FDB rules



Set a specific destination e-switch when setting a destination vport.

Signed-off-by: default avatarRabie Loulou <rabiel@mellanox.com>
Reviewed-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: default avatarRoi Dayan <roid@mellanox.com>
Reviewed-by: default avatarShahar Klein <shahark@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent b17f7fc1
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -836,6 +836,7 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv,
		out_priv = netdev_priv(encap_dev);
		out_priv = netdev_priv(encap_dev);
		rpriv = out_priv->ppriv;
		rpriv = out_priv->ppriv;
		attr->out_rep = rpriv->rep;
		attr->out_rep = rpriv->rep;
		attr->out_mdev = out_priv->mdev;
	}
	}


	err = mlx5_eswitch_add_vlan_action(esw, attr);
	err = mlx5_eswitch_add_vlan_action(esw, attr);
@@ -2501,6 +2502,7 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, struct tcf_exts *exts,
				out_priv = netdev_priv(out_dev);
				out_priv = netdev_priv(out_dev);
				rpriv = out_priv->ppriv;
				rpriv = out_priv->ppriv;
				attr->out_rep = rpriv->rep;
				attr->out_rep = rpriv->rep;
				attr->out_mdev = out_priv->mdev;
			} else if (encap) {
			} else if (encap) {
				parse_attr->mirred_ifindex = out_dev->ifindex;
				parse_attr->mirred_ifindex = out_dev->ifindex;
				parse_attr->tun_info = *info;
				parse_attr->tun_info = *info;
+1 −0
Original line number Original line Diff line number Diff line
@@ -230,6 +230,7 @@ enum {
struct mlx5_esw_flow_attr {
struct mlx5_esw_flow_attr {
	struct mlx5_eswitch_rep *in_rep;
	struct mlx5_eswitch_rep *in_rep;
	struct mlx5_eswitch_rep *out_rep;
	struct mlx5_eswitch_rep *out_rep;
	struct mlx5_core_dev	*out_mdev;


	int	action;
	int	action;
	__be16	vlan_proto;
	__be16	vlan_proto;
+5 −0
Original line number Original line Diff line number Diff line
@@ -72,6 +72,11 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
	if (flow_act.action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) {
	if (flow_act.action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) {
		dest[i].type = MLX5_FLOW_DESTINATION_TYPE_VPORT;
		dest[i].type = MLX5_FLOW_DESTINATION_TYPE_VPORT;
		dest[i].vport.num = attr->out_rep->vport;
		dest[i].vport.num = attr->out_rep->vport;
		if (MLX5_CAP_ESW(esw->dev, merged_eswitch)) {
			dest[i].vport.vhca_id =
				MLX5_CAP_GEN(attr->out_mdev, vhca_id);
			dest[i].vport.vhca_id_valid = 1;
		}
		i++;
		i++;
	}
	}
	if (flow_act.action & MLX5_FLOW_CONTEXT_ACTION_COUNT) {
	if (flow_act.action & MLX5_FLOW_CONTEXT_ACTION_COUNT) {