|
@@ -71,7 +71,12 @@ 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;
|
|
|
+ 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) {
|
|
@@ -88,8 +93,16 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
|
|
|
misc = MLX5_ADDR_OF(fte_match_param, spec->match_value, misc_parameters);
|
|
|
MLX5_SET(fte_match_set_misc, misc, source_port, attr->in_rep->vport);
|
|
|
|
|
|
+ if (MLX5_CAP_ESW(esw->dev, merged_eswitch))
|
|
|
+ MLX5_SET(fte_match_set_misc, misc,
|
|
|
+ source_eswitch_owner_vhca_id,
|
|
|
+ MLX5_CAP_GEN(attr->in_mdev, vhca_id));
|
|
|
+
|
|
|
misc = MLX5_ADDR_OF(fte_match_param, spec->match_criteria, misc_parameters);
|
|
|
MLX5_SET_TO_ONES(fte_match_set_misc, misc, source_port);
|
|
|
+ if (MLX5_CAP_ESW(esw->dev, merged_eswitch))
|
|
|
+ MLX5_SET_TO_ONES(fte_match_set_misc, misc,
|
|
|
+ source_eswitch_owner_vhca_id);
|
|
|
|
|
|
spec->match_criteria_enable = MLX5_MATCH_OUTER_HEADERS |
|
|
|
MLX5_MATCH_MISC_PARAMETERS;
|
|
@@ -343,7 +356,7 @@ mlx5_eswitch_add_send_to_vport_rule(struct mlx5_eswitch *esw, int vport, u32 sqn
|
|
|
|
|
|
spec->match_criteria_enable = MLX5_MATCH_MISC_PARAMETERS;
|
|
|
dest.type = MLX5_FLOW_DESTINATION_TYPE_VPORT;
|
|
|
- dest.vport_num = vport;
|
|
|
+ dest.vport.num = vport;
|
|
|
flow_act.action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
|
|
|
|
|
|
flow_rule = mlx5_add_flow_rules(esw->fdb_table.offloads.fdb, spec,
|
|
@@ -387,7 +400,7 @@ static int esw_add_fdb_miss_rule(struct mlx5_eswitch *esw)
|
|
|
dmac_c[0] = 0x01;
|
|
|
|
|
|
dest.type = MLX5_FLOW_DESTINATION_TYPE_VPORT;
|
|
|
- dest.vport_num = 0;
|
|
|
+ dest.vport.num = 0;
|
|
|
flow_act.action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
|
|
|
|
|
|
flow_rule = mlx5_add_flow_rules(esw->fdb_table.offloads.fdb, spec,
|
|
@@ -663,7 +676,7 @@ static int esw_create_vport_rx_group(struct mlx5_eswitch *esw)
|
|
|
|
|
|
esw->offloads.vport_rx_group = g;
|
|
|
out:
|
|
|
- kfree(flow_group_in);
|
|
|
+ kvfree(flow_group_in);
|
|
|
return err;
|
|
|
}
|
|
|
|