Skip to content

Commit 606c7c4

Browse files
Paul Blakeykuba-moo
authored andcommitted
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: Paul Blakey <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Marcelo Ricardo Leitner <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 08a0063 commit 606c7c4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

net/sched/cls_flower.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,15 @@ static struct cls_fl_filter *__fl_get(struct cls_fl_head *head, u32 handle)
529529
return f;
530530
}
531531

532+
static struct tcf_exts *fl_get_exts(const struct tcf_proto *tp, u32 handle)
533+
{
534+
struct cls_fl_head *head = rcu_dereference_bh(tp->root);
535+
struct cls_fl_filter *f;
536+
537+
f = idr_find(&head->handle_idr, handle);
538+
return f ? &f->exts : NULL;
539+
}
540+
532541
static int __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f,
533542
bool *last, bool rtnl_held,
534543
struct netlink_ext_ack *extack)
@@ -2222,7 +2231,8 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
22222231
}
22232232
fnew->handle = handle;
22242233

2225-
err = tcf_exts_init(&fnew->exts, net, TCA_FLOWER_ACT, 0);
2234+
err = tcf_exts_init_ex(&fnew->exts, net, TCA_FLOWER_ACT, 0, tp, handle,
2235+
!tc_skip_hw(fnew->flags));
22262236
if (err < 0)
22272237
goto errout_idr;
22282238

@@ -3444,6 +3454,7 @@ static struct tcf_proto_ops cls_fl_ops __read_mostly = {
34443454
.tmplt_create = fl_tmplt_create,
34453455
.tmplt_destroy = fl_tmplt_destroy,
34463456
.tmplt_dump = fl_tmplt_dump,
3457+
.get_exts = fl_get_exts,
34473458
.owner = THIS_MODULE,
34483459
.flags = TCF_PROTO_OPS_DOIT_UNLOCKED,
34493460
};

0 commit comments

Comments
 (0)