Commit 606c7c43 authored by Paul Blakey's avatar Paul Blakey Committed by Jakub Kicinski

net/sched: flower: Support hardware miss to tc action

To support hardware miss to tc action in actions on the flower
classifier, implement the required getting of filter actions,
and setup filter exts (actions) miss by giving it the filter's
handle and actions.
Signed-off-by: default avatarPaul Blakey <paulb@nvidia.com>
Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Reviewed-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 08a0063d
...@@ -529,6 +529,15 @@ static struct cls_fl_filter *__fl_get(struct cls_fl_head *head, u32 handle) ...@@ -529,6 +529,15 @@ static struct cls_fl_filter *__fl_get(struct cls_fl_head *head, u32 handle)
return f; return f;
} }
static struct tcf_exts *fl_get_exts(const struct tcf_proto *tp, u32 handle)
{
struct cls_fl_head *head = rcu_dereference_bh(tp->root);
struct cls_fl_filter *f;
f = idr_find(&head->handle_idr, handle);
return f ? &f->exts : NULL;
}
static int __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f, static int __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f,
bool *last, bool rtnl_held, bool *last, bool rtnl_held,
struct netlink_ext_ack *extack) struct netlink_ext_ack *extack)
...@@ -2222,7 +2231,8 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, ...@@ -2222,7 +2231,8 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
} }
fnew->handle = handle; fnew->handle = handle;
err = tcf_exts_init(&fnew->exts, net, TCA_FLOWER_ACT, 0); err = tcf_exts_init_ex(&fnew->exts, net, TCA_FLOWER_ACT, 0, tp, handle,
!tc_skip_hw(fnew->flags));
if (err < 0) if (err < 0)
goto errout_idr; goto errout_idr;
...@@ -3444,6 +3454,7 @@ static struct tcf_proto_ops cls_fl_ops __read_mostly = { ...@@ -3444,6 +3454,7 @@ static struct tcf_proto_ops cls_fl_ops __read_mostly = {
.tmplt_create = fl_tmplt_create, .tmplt_create = fl_tmplt_create,
.tmplt_destroy = fl_tmplt_destroy, .tmplt_destroy = fl_tmplt_destroy,
.tmplt_dump = fl_tmplt_dump, .tmplt_dump = fl_tmplt_dump,
.get_exts = fl_get_exts,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.flags = TCF_PROTO_OPS_DOIT_UNLOCKED, .flags = TCF_PROTO_OPS_DOIT_UNLOCKED,
}; };
......
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