Skip to content

Commit ffa99b5

Browse files
Chris MiSaeed Mahameed
authored andcommitted
net/mlx5e: Set decap action based on attr for sample
Currently decap action is set based on tunnel_id. That means it is set unconditionally. But for decap, ct and sample actions, decap is done before ct. No need to decap again in sample. And the actions are set correctly when parsing. So set decap action based on attr instead of tunnel_id. Fixes: 2741f22 ("net/mlx5e: TC, Support sample offload action for tunneled traffic") Signed-off-by: Chris Mi <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 4ddf77f commit ffa99b5

File tree

1 file changed

+2
-3
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/en/tc

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,6 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample,
477477
struct mlx5e_sample_flow *sample_flow;
478478
struct mlx5e_sample_attr *sample_attr;
479479
struct mlx5_flow_attr *pre_attr;
480-
u32 tunnel_id = attr->tunnel_id;
481480
struct mlx5_eswitch *esw;
482481
u32 default_tbl_id;
483482
u32 obj_id;
@@ -522,7 +521,7 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample,
522521
restore_obj.sample.group_id = sample_attr->group_num;
523522
restore_obj.sample.rate = sample_attr->rate;
524523
restore_obj.sample.trunc_size = sample_attr->trunc_size;
525-
restore_obj.sample.tunnel_id = tunnel_id;
524+
restore_obj.sample.tunnel_id = attr->tunnel_id;
526525
err = mapping_add(esw->offloads.reg_c0_obj_pool, &restore_obj, &obj_id);
527526
if (err)
528527
goto err_obj_id;
@@ -548,7 +547,7 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample,
548547
/* For decap action, do decap in the original flow table instead of the
549548
* default flow table.
550549
*/
551-
if (tunnel_id)
550+
if (attr->action & MLX5_FLOW_CONTEXT_ACTION_DECAP)
552551
pre_attr->action |= MLX5_FLOW_CONTEXT_ACTION_DECAP;
553552
pre_attr->modify_hdr = sample_flow->restore->modify_hdr;
554553
pre_attr->flags = MLX5_ATTR_FLAG_SAMPLE;

0 commit comments

Comments
 (0)