Message ID | 20240122194801.152658-5-jhs@mojatatu.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Introducing P4TC | expand |
On Mon, Jan 22, 2024 at 02:47:50PM -0500, Jamal Hadi Salim wrote: > For P4 actions, we require information from struct tc_action_ops, > specifically the action kind, to find and locate the P4 action information > for the lookup operation. > > Signed-off-by: Victor Nogueira <victor@mojatatu.com> > Signed-off-by: Pedro Tammela <pctammela@mojatatu.com> > Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com> > Reviewed-by: Vlad Buslov <vladbu@nvidia.com> Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
diff --git a/include/net/act_api.h b/include/net/act_api.h index bfded7ec6..c60f3ccf2 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h @@ -116,7 +116,8 @@ struct tc_action_ops { struct tcf_result *); /* called under RCU BH lock*/ int (*dump)(struct sk_buff *, struct tc_action *, int, int); void (*cleanup)(struct tc_action *); - int (*lookup)(struct net *net, struct tc_action **a, u32 index); + int (*lookup)(struct net *net, const struct tc_action_ops *ops, + struct tc_action **a, u32 index); int (*init)(struct net *net, struct nlattr *nla, struct nlattr *est, struct tc_action **act, struct tcf_proto *tp, diff --git a/net/sched/act_api.c b/net/sched/act_api.c index c6a783a71..869a38570 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -726,7 +726,7 @@ static int __tcf_idr_search(struct net *net, struct tc_action_net *tn = net_generic(net, ops->net_id); if (unlikely(ops->lookup)) - return ops->lookup(net, a, index); + return ops->lookup(net, ops, a, index); return tcf_idr_search(tn, a, index); }