Skip to content

Commit a64c5ed

Browse files
Paul BlakeySaeed Mahameed
authored andcommitted
net/mlx5: Remove unnecessary checks for slow path flag
After previous changes, caller (mlx5e_tc_offload_fdb_rules()) already checks for the slow path flag, and if set won't call offload/unoffload sample. Signed-off-by: Paul Blakey <[email protected]> Reviewed-by: Maor Dickman <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 537e4d2 commit a64c5ed

File tree

1 file changed

+1
-16
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/en/tc

1 file changed

+1
-16
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -509,13 +509,6 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample,
509509
if (IS_ERR_OR_NULL(tc_psample))
510510
return ERR_PTR(-EOPNOTSUPP);
511511

512-
/* If slow path flag is set, eg. when the neigh is invalid for encap,
513-
* don't offload sample action.
514-
*/
515-
esw = tc_psample->esw;
516-
if (attr->flags & MLX5_ESW_ATTR_FLAG_SLOW_PATH)
517-
return mlx5_eswitch_add_offloaded_rule(esw, spec, attr);
518-
519512
sample_flow = kzalloc(sizeof(*sample_flow), GFP_KERNEL);
520513
if (!sample_flow)
521514
return ERR_PTR(-ENOMEM);
@@ -527,6 +520,7 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample,
527520
* Only match the fte id instead of the same match in the
528521
* original flow table.
529522
*/
523+
esw = tc_psample->esw;
530524
if (MLX5_CAP_GEN(esw->dev, reg_c_preserve) ||
531525
attr->action & MLX5_FLOW_CONTEXT_ACTION_DECAP) {
532526
struct mlx5_flow_table *ft;
@@ -634,15 +628,6 @@ mlx5e_tc_sample_unoffload(struct mlx5e_tc_psample *tc_psample,
634628
if (IS_ERR_OR_NULL(tc_psample))
635629
return;
636630

637-
/* If slow path flag is set, sample action is not offloaded.
638-
* No need to delete sample rule.
639-
*/
640-
esw = tc_psample->esw;
641-
if (attr->flags & MLX5_ESW_ATTR_FLAG_SLOW_PATH) {
642-
mlx5_eswitch_del_offloaded_rule(esw, rule, attr);
643-
return;
644-
}
645-
646631
/* The following delete order can't be changed, otherwise,
647632
* will hit fw syndromes.
648633
*/

0 commit comments

Comments
 (0)