提交 7a155fa3 编写于 作者: V Vladimir Oltean 提交者: David S. Miller

net: mscc: ocelot: parse flower action before key

When we'll make the switch to multiple chain offloading, we'll want to
know first what VCAP block the rule is offloaded to. This impacts what
keys are available. Since the VCAP block is determined by what actions
are used, parse the action first.
Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d732e9ce
...@@ -44,8 +44,8 @@ static int ocelot_flower_parse_action(struct flow_cls_offload *f, ...@@ -44,8 +44,8 @@ static int ocelot_flower_parse_action(struct flow_cls_offload *f,
return 0; return 0;
} }
static int ocelot_flower_parse(struct flow_cls_offload *f, static int ocelot_flower_parse_key(struct flow_cls_offload *f,
struct ocelot_vcap_filter *filter) struct ocelot_vcap_filter *filter)
{ {
struct flow_rule *rule = flow_cls_offload_flow_rule(f); struct flow_rule *rule = flow_cls_offload_flow_rule(f);
struct flow_dissector *dissector = rule->match.dissector; struct flow_dissector *dissector = rule->match.dissector;
...@@ -179,9 +179,22 @@ static int ocelot_flower_parse(struct flow_cls_offload *f, ...@@ -179,9 +179,22 @@ static int ocelot_flower_parse(struct flow_cls_offload *f,
} }
/* else, a filter of type OCELOT_VCAP_KEY_ANY is implicitly added */ /* else, a filter of type OCELOT_VCAP_KEY_ANY is implicitly added */
return 0;
}
static int ocelot_flower_parse(struct flow_cls_offload *f,
struct ocelot_vcap_filter *filter)
{
int ret;
filter->prio = f->common.prio; filter->prio = f->common.prio;
filter->id = f->cookie; filter->id = f->cookie;
return ocelot_flower_parse_action(f, filter);
ret = ocelot_flower_parse_action(f, filter);
if (ret)
return ret;
return ocelot_flower_parse_key(f, filter);
} }
static struct ocelot_vcap_filter static struct ocelot_vcap_filter
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册