};
};
+struct mlx5e_tc_flow_parse_attr {
+ struct mlx5_flow_spec spec;
+};
+
enum {
MLX5_HEADER_TYPE_VXLAN = 0x0,
MLX5_HEADER_TYPE_NVGRE = 0x1,
static struct mlx5_flow_handle *
mlx5e_tc_add_nic_flow(struct mlx5e_priv *priv,
- struct mlx5_flow_spec *spec,
+ struct mlx5e_tc_flow_parse_attr *parse_attr,
struct mlx5_nic_flow_attr *attr)
{
struct mlx5_core_dev *dev = priv->mdev;
table_created = true;
}
- spec->match_criteria_enable = MLX5_MATCH_OUTER_HEADERS;
- rule = mlx5_add_flow_rules(priv->fs.tc.t, spec, &flow_act, &dest, 1);
+ parse_attr->spec.match_criteria_enable = MLX5_MATCH_OUTER_HEADERS;
+ rule = mlx5_add_flow_rules(priv->fs.tc.t, &parse_attr->spec,
+ &flow_act, &dest, 1);
if (IS_ERR(rule))
goto err_add_rule;
static struct mlx5_flow_handle *
mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv,
- struct mlx5_flow_spec *spec,
+ struct mlx5e_tc_flow_parse_attr *parse_attr,
struct mlx5_esw_flow_attr *attr)
{
struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
if (err)
return ERR_PTR(err);
- return mlx5_eswitch_add_offloaded_rule(esw, spec, attr);
+ return mlx5_eswitch_add_offloaded_rule(esw, &parse_attr->spec, attr);
}
static void mlx5e_detach_encap(struct mlx5e_priv *priv,
struct tc_cls_flower_offload *f)
{
struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
+ struct mlx5e_tc_flow_parse_attr *parse_attr;
struct mlx5e_tc_table *tc = &priv->fs.tc;
- struct mlx5_flow_spec *spec;
struct mlx5e_tc_flow *flow;
int attr_size, err = 0;
u8 flow_flags = 0;
}
flow = kzalloc(sizeof(*flow) + attr_size, GFP_KERNEL);
- spec = mlx5_vzalloc(sizeof(*spec));
- if (!spec || !flow) {
+ parse_attr = mlx5_vzalloc(sizeof(*parse_attr));
+ if (!parse_attr || !flow) {
err = -ENOMEM;
goto err_free;
}
flow->cookie = f->cookie;
flow->flags = flow_flags;
- err = parse_cls_flower(priv, flow, spec, f);
+ err = parse_cls_flower(priv, flow, &parse_attr->spec, f);
if (err < 0)
goto err_free;
err = parse_tc_fdb_actions(priv, f->exts, flow);
if (err < 0)
goto err_free;
- flow->rule = mlx5e_tc_add_fdb_flow(priv, spec, flow->esw_attr);
+ flow->rule = mlx5e_tc_add_fdb_flow(priv, parse_attr, flow->esw_attr);
} else {
err = parse_tc_nic_actions(priv, f->exts, flow->nic_attr);
if (err < 0)
goto err_free;
- flow->rule = mlx5e_tc_add_nic_flow(priv, spec, flow->nic_attr);
+ flow->rule = mlx5e_tc_add_nic_flow(priv, parse_attr, flow->nic_attr);
}
if (IS_ERR(flow->rule)) {
err_free:
kfree(flow);
out:
- kvfree(spec);
+ kvfree(parse_attr);
return err;
}