]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
net/mlx5e: Explicitly set destination e-switch in FDB rules
authorRabie Loulou <rabiel@mellanox.com>
Sun, 18 Mar 2018 06:29:04 +0000 (08:29 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 17 May 2018 21:17:34 +0000 (14:17 -0700)
Set a specific destination e-switch when setting a destination vport.

Signed-off-by: Rabie Loulou <rabiel@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Shahar Klein <shahark@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

index 4197001f98015377a7bd534f192616a13aead70d..880adc810cccdf627af85fdb9b4d98eb0a92578c 100644 (file)
@@ -836,6 +836,7 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv,
                out_priv = netdev_priv(encap_dev);
                rpriv = out_priv->ppriv;
                attr->out_rep = rpriv->rep;
+               attr->out_mdev = out_priv->mdev;
        }
 
        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);
                                rpriv = out_priv->ppriv;
                                attr->out_rep = rpriv->rep;
+                               attr->out_mdev = out_priv->mdev;
                        } else if (encap) {
                                parse_attr->mirred_ifindex = out_dev->ifindex;
                                parse_attr->tun_info = *info;
index 4cd773fa55e333f20dad15619a0509bdb3006f1a..ac5db54823a1fd2a51e9277b24a5bff166fbac7d 100644 (file)
@@ -230,6 +230,7 @@ enum {
 struct mlx5_esw_flow_attr {
        struct mlx5_eswitch_rep *in_rep;
        struct mlx5_eswitch_rep *out_rep;
+       struct mlx5_core_dev    *out_mdev;
 
        int     action;
        __be16  vlan_proto;
index 90c8cb31e633b07afe66d8692adbb1025e0dbc9b..ea93867d1ab41ecc56393b2b59f8013a844f1598 100644 (file)
@@ -72,6 +72,11 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
        if (flow_act.action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) {
                dest[i].type = MLX5_FLOW_DESTINATION_TYPE_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++;
        }
        if (flow_act.action & MLX5_FLOW_CONTEXT_ACTION_COUNT) {