Commit ff993167 authored by Roi Dayan's avatar Roi Dayan Committed by Saeed Mahameed

net/mlx5e: TC, Refactor mlx5e_tc_add_flow_mod_hdr() to get flow attr

In later commit we are going to instantiate multiple attr instances
for flow instead of single attr.
Make sure mlx5e_tc_add_flow_mod_hdr() use the correct attr and not flow->attr.
Signed-off-by: default avatarRoi Dayan <roid@nvidia.com>
Reviewed-by: default avatarOz Shlomo <ozsh@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 8be9686d
...@@ -1380,7 +1380,7 @@ static void mlx5e_reoffload_encap(struct mlx5e_priv *priv, ...@@ -1380,7 +1380,7 @@ static void mlx5e_reoffload_encap(struct mlx5e_priv *priv,
continue; continue;
} }
err = mlx5e_tc_add_flow_mod_hdr(priv, parse_attr, flow); err = mlx5e_tc_add_flow_mod_hdr(priv, flow, attr);
if (err) { if (err) {
mlx5_core_warn(priv->mdev, "Failed to update flow mod_hdr err=%d", mlx5_core_warn(priv->mdev, "Failed to update flow mod_hdr err=%d",
err); err);
......
...@@ -1360,10 +1360,10 @@ int mlx5e_tc_query_route_vport(struct net_device *out_dev, struct net_device *ro ...@@ -1360,10 +1360,10 @@ int mlx5e_tc_query_route_vport(struct net_device *out_dev, struct net_device *ro
} }
int mlx5e_tc_add_flow_mod_hdr(struct mlx5e_priv *priv, int mlx5e_tc_add_flow_mod_hdr(struct mlx5e_priv *priv,
struct mlx5e_tc_flow_parse_attr *parse_attr, struct mlx5e_tc_flow *flow,
struct mlx5e_tc_flow *flow) struct mlx5_flow_attr *attr)
{ {
struct mlx5e_tc_mod_hdr_acts *mod_hdr_acts = &parse_attr->mod_hdr_acts; struct mlx5e_tc_mod_hdr_acts *mod_hdr_acts = &attr->parse_attr->mod_hdr_acts;
struct mlx5_modify_hdr *mod_hdr; struct mlx5_modify_hdr *mod_hdr;
mod_hdr = mlx5_modify_header_alloc(priv->mdev, mod_hdr = mlx5_modify_header_alloc(priv->mdev,
...@@ -1373,8 +1373,8 @@ int mlx5e_tc_add_flow_mod_hdr(struct mlx5e_priv *priv, ...@@ -1373,8 +1373,8 @@ int mlx5e_tc_add_flow_mod_hdr(struct mlx5e_priv *priv,
if (IS_ERR(mod_hdr)) if (IS_ERR(mod_hdr))
return PTR_ERR(mod_hdr); return PTR_ERR(mod_hdr);
WARN_ON(flow->attr->modify_hdr); WARN_ON(attr->modify_hdr);
flow->attr->modify_hdr = mod_hdr; attr->modify_hdr = mod_hdr;
return 0; return 0;
} }
...@@ -1577,7 +1577,7 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv, ...@@ -1577,7 +1577,7 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv,
if (attr->action & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR && if (attr->action & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR &&
!(attr->ct_attr.ct_action & TCA_CT_ACT_CLEAR)) { !(attr->ct_attr.ct_action & TCA_CT_ACT_CLEAR)) {
if (vf_tun) { if (vf_tun) {
err = mlx5e_tc_add_flow_mod_hdr(priv, parse_attr, flow); err = mlx5e_tc_add_flow_mod_hdr(priv, flow, attr);
if (err) if (err)
goto err_out; goto err_out;
} else { } else {
......
...@@ -243,8 +243,8 @@ int mlx5e_tc_match_to_reg_set_and_get_id(struct mlx5_core_dev *mdev, ...@@ -243,8 +243,8 @@ int mlx5e_tc_match_to_reg_set_and_get_id(struct mlx5_core_dev *mdev,
u32 data); u32 data);
int mlx5e_tc_add_flow_mod_hdr(struct mlx5e_priv *priv, int mlx5e_tc_add_flow_mod_hdr(struct mlx5e_priv *priv,
struct mlx5e_tc_flow_parse_attr *parse_attr, struct mlx5e_tc_flow *flow,
struct mlx5e_tc_flow *flow); struct mlx5_flow_attr *attr);
struct mlx5e_tc_flow; struct mlx5e_tc_flow;
u32 mlx5e_tc_get_flow_tun_id(struct mlx5e_tc_flow *flow); u32 mlx5e_tc_get_flow_tun_id(struct mlx5e_tc_flow *flow);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment