diff mbox series

[RFC,v2,net-next,07/28] net/sched: act_api: add struct p4tc_action_ops as a parameter to lookup callback

Message ID 20230517110232.29349-7-jhs@mojatatu.com (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series Introducing P4TC | expand

Checks

Context Check Description
netdev/series_format fail Series longer than 15 patches (and no cover letter)
netdev/tree_selection success Clearly marked for net-next, async
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 70 this patch: 70
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 11 this patch: 11
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 86 this patch: 86
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 17 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Jamal Hadi Salim May 17, 2023, 11:02 a.m. UTC
For P4TC dynamic actions, we require information from struct tc_action_ops,
specifically the action kind, to find and locate the dynamic 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>
---
 include/net/act_api.h | 3 ++-
 net/sched/act_api.c   | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Marcelo Ricardo Leitner June 2, 2023, 7:43 p.m. UTC | #1
On Wed, May 17, 2023 at 07:02:11AM -0400, Jamal Hadi Salim wrote:
> @@ -115,7 +115,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 ba0315e686bf..788127329d96 100644
> --- a/net/sched/act_api.c
> +++ b/net/sched/act_api.c
> @@ -728,7 +728,7 @@ int __tcf_idr_search(struct net *net, const struct tc_action_ops *ops,
>  	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);

Interesting. I could swear that this patch would break the build if
only up to this patch was applied (like in a git bisect), but then,
currently no action is defining this method. :D

  Marcelo
Jamal Hadi Salim June 3, 2023, 1:17 p.m. UTC | #2
On Fri, Jun 2, 2023 at 3:43 PM Marcelo Ricardo Leitner
<mleitner@redhat.com> wrote:
>
> On Wed, May 17, 2023 at 07:02:11AM -0400, Jamal Hadi Salim wrote:
> > @@ -115,7 +115,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 ba0315e686bf..788127329d96 100644
> > --- a/net/sched/act_api.c
> > +++ b/net/sched/act_api.c
> > @@ -728,7 +728,7 @@ int __tcf_idr_search(struct net *net, const struct tc_action_ops *ops,
> >       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);
>
> Interesting. I could swear that this patch would break the build if
> only up to this patch was applied (like in a git bisect), but then,
> currently no action is defining this method. :D
>

We test every patch individually for compile for git bisect reasons,
so it would be hard to find one that escapes our process ;->

cheers,
jamal
diff mbox series

Patch

diff --git a/include/net/act_api.h b/include/net/act_api.h
index cc392b994844..a0f443990f27 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -115,7 +115,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 ba0315e686bf..788127329d96 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -728,7 +728,7 @@  int __tcf_idr_search(struct net *net, const struct tc_action_ops *ops,
 	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);
 }