提交 ffa99b53 编写于 作者: C Chris Mi 提交者: Saeed Mahameed

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: 2741f223 ("net/mlx5e: TC, Support sample offload action for tunneled traffic")
Signed-off-by: NChris Mi <cmi@nvidia.com>
Reviewed-by: NRoi Dayan <roid@nvidia.com>
Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
上级 4ddf77f9
...@@ -477,7 +477,6 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample, ...@@ -477,7 +477,6 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample,
struct mlx5e_sample_flow *sample_flow; struct mlx5e_sample_flow *sample_flow;
struct mlx5e_sample_attr *sample_attr; struct mlx5e_sample_attr *sample_attr;
struct mlx5_flow_attr *pre_attr; struct mlx5_flow_attr *pre_attr;
u32 tunnel_id = attr->tunnel_id;
struct mlx5_eswitch *esw; struct mlx5_eswitch *esw;
u32 default_tbl_id; u32 default_tbl_id;
u32 obj_id; u32 obj_id;
...@@ -522,7 +521,7 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample, ...@@ -522,7 +521,7 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample,
restore_obj.sample.group_id = sample_attr->group_num; restore_obj.sample.group_id = sample_attr->group_num;
restore_obj.sample.rate = sample_attr->rate; restore_obj.sample.rate = sample_attr->rate;
restore_obj.sample.trunc_size = sample_attr->trunc_size; restore_obj.sample.trunc_size = sample_attr->trunc_size;
restore_obj.sample.tunnel_id = tunnel_id; restore_obj.sample.tunnel_id = attr->tunnel_id;
err = mapping_add(esw->offloads.reg_c0_obj_pool, &restore_obj, &obj_id); err = mapping_add(esw->offloads.reg_c0_obj_pool, &restore_obj, &obj_id);
if (err) if (err)
goto err_obj_id; goto err_obj_id;
...@@ -548,7 +547,7 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample, ...@@ -548,7 +547,7 @@ mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample,
/* For decap action, do decap in the original flow table instead of the /* For decap action, do decap in the original flow table instead of the
* default flow table. * default flow table.
*/ */
if (tunnel_id) if (attr->action & MLX5_FLOW_CONTEXT_ACTION_DECAP)
pre_attr->action |= MLX5_FLOW_CONTEXT_ACTION_DECAP; pre_attr->action |= MLX5_FLOW_CONTEXT_ACTION_DECAP;
pre_attr->modify_hdr = sample_flow->restore->modify_hdr; pre_attr->modify_hdr = sample_flow->restore->modify_hdr;
pre_attr->flags = MLX5_ATTR_FLAG_SAMPLE; pre_attr->flags = MLX5_ATTR_FLAG_SAMPLE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册