Skip to content

Commit 10ff535

Browse files
Shahar KleinSaeed Mahameed
authored andcommitted
net/mlx5e: Explicitly set source e-switch in offloaded TC rules
Set a specific source e-switch when setting a rule that matches on the ingress port. Signed-off-by: Shahar Klein <[email protected]> Reviewed-by: Or Gerlitz <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 3e99df8 commit 10ff535

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2462,6 +2462,7 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, struct tcf_exts *exts,
24622462

24632463
memset(attr, 0, sizeof(*attr));
24642464
attr->in_rep = rpriv->rep;
2465+
attr->in_mdev = priv->mdev;
24652466

24662467
tcf_exts_to_list(exts, &actions);
24672468
list_for_each_entry(a, &actions, list) {

drivers/net/ethernet/mellanox/mlx5/core/eswitch.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ struct mlx5_esw_flow_attr {
231231
struct mlx5_eswitch_rep *in_rep;
232232
struct mlx5_eswitch_rep *out_rep;
233233
struct mlx5_core_dev *out_mdev;
234+
struct mlx5_core_dev *in_mdev;
234235

235236
int action;
236237
__be16 vlan_proto;

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,16 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
9393
misc = MLX5_ADDR_OF(fte_match_param, spec->match_value, misc_parameters);
9494
MLX5_SET(fte_match_set_misc, misc, source_port, attr->in_rep->vport);
9595

96+
if (MLX5_CAP_ESW(esw->dev, merged_eswitch))
97+
MLX5_SET(fte_match_set_misc, misc,
98+
source_eswitch_owner_vhca_id,
99+
MLX5_CAP_GEN(attr->in_mdev, vhca_id));
100+
96101
misc = MLX5_ADDR_OF(fte_match_param, spec->match_criteria, misc_parameters);
97102
MLX5_SET_TO_ONES(fte_match_set_misc, misc, source_port);
103+
if (MLX5_CAP_ESW(esw->dev, merged_eswitch))
104+
MLX5_SET_TO_ONES(fte_match_set_misc, misc,
105+
source_eswitch_owner_vhca_id);
98106

99107
spec->match_criteria_enable = MLX5_MATCH_OUTER_HEADERS |
100108
MLX5_MATCH_MISC_PARAMETERS;

0 commit comments

Comments
 (0)