Skip to content

Commit 331a929

Browse files
Alexander Aringdavem330
authored andcommitted
net: sched: act: add extack for lookup callback
This patch adds extack support for act lookup callback api. This prepares to handle extack support inside each specific act implementation. Cc: David Ahern <[email protected]> Signed-off-by: Alexander Aring <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 589dad6 commit 331a929

File tree

18 files changed

+37
-19
lines changed

18 files changed

+37
-19
lines changed

include/net/act_api.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ struct tc_action_ops {
8787
struct tcf_result *);
8888
int (*dump)(struct sk_buff *, struct tc_action *, int, int);
8989
void (*cleanup)(struct tc_action *);
90-
int (*lookup)(struct net *net, struct tc_action **a, u32 index);
90+
int (*lookup)(struct net *net, struct tc_action **a, u32 index,
91+
struct netlink_ext_ack *extack);
9192
int (*init)(struct net *net, struct nlattr *nla,
9293
struct nlattr *est, struct tc_action **act, int ovr,
9394
int bind, struct netlink_ext_ack *extack);

net/sched/act_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ static struct tc_action *tcf_action_get_1(struct net *net, struct nlattr *nla,
901901
goto err_out;
902902
}
903903
err = -ENOENT;
904-
if (ops->lookup(net, &a, index) == 0)
904+
if (ops->lookup(net, &a, index, extack) == 0)
905905
goto err_mod;
906906

907907
module_put(ops->owner);

net/sched/act_bpf.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ static int tcf_bpf_walker(struct net *net, struct sk_buff *skb,
374374
return tcf_generic_walker(tn, skb, cb, type, ops);
375375
}
376376

377-
static int tcf_bpf_search(struct net *net, struct tc_action **a, u32 index)
377+
static int tcf_bpf_search(struct net *net, struct tc_action **a, u32 index,
378+
struct netlink_ext_ack *extack)
378379
{
379380
struct tc_action_net *tn = net_generic(net, bpf_net_id);
380381

net/sched/act_connmark.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ static int tcf_connmark_walker(struct net *net, struct sk_buff *skb,
184184
return tcf_generic_walker(tn, skb, cb, type, ops);
185185
}
186186

187-
static int tcf_connmark_search(struct net *net, struct tc_action **a, u32 index)
187+
static int tcf_connmark_search(struct net *net, struct tc_action **a, u32 index,
188+
struct netlink_ext_ack *extack)
188189
{
189190
struct tc_action_net *tn = net_generic(net, connmark_net_id);
190191

net/sched/act_csum.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,8 @@ static int tcf_csum_walker(struct net *net, struct sk_buff *skb,
638638
return tcf_generic_walker(tn, skb, cb, type, ops);
639639
}
640640

641-
static int tcf_csum_search(struct net *net, struct tc_action **a, u32 index)
641+
static int tcf_csum_search(struct net *net, struct tc_action **a, u32 index,
642+
struct netlink_ext_ack *extack)
642643
{
643644
struct tc_action_net *tn = net_generic(net, csum_net_id);
644645

net/sched/act_gact.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ static int tcf_gact_walker(struct net *net, struct sk_buff *skb,
208208
return tcf_generic_walker(tn, skb, cb, type, ops);
209209
}
210210

211-
static int tcf_gact_search(struct net *net, struct tc_action **a, u32 index)
211+
static int tcf_gact_search(struct net *net, struct tc_action **a, u32 index,
212+
struct netlink_ext_ack *extack)
212213
{
213214
struct tc_action_net *tn = net_generic(net, gact_net_id);
214215

net/sched/act_ife.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,8 @@ static int tcf_ife_walker(struct net *net, struct sk_buff *skb,
831831
return tcf_generic_walker(tn, skb, cb, type, ops);
832832
}
833833

834-
static int tcf_ife_search(struct net *net, struct tc_action **a, u32 index)
834+
static int tcf_ife_search(struct net *net, struct tc_action **a, u32 index,
835+
struct netlink_ext_ack *extack)
835836
{
836837
struct tc_action_net *tn = net_generic(net, ife_net_id);
837838

net/sched/act_ipt.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ static int tcf_ipt_walker(struct net *net, struct sk_buff *skb,
310310
return tcf_generic_walker(tn, skb, cb, type, ops);
311311
}
312312

313-
static int tcf_ipt_search(struct net *net, struct tc_action **a, u32 index)
313+
static int tcf_ipt_search(struct net *net, struct tc_action **a, u32 index,
314+
struct netlink_ext_ack *extack)
314315
{
315316
struct tc_action_net *tn = net_generic(net, ipt_net_id);
316317

@@ -358,7 +359,8 @@ static int tcf_xt_walker(struct net *net, struct sk_buff *skb,
358359
return tcf_generic_walker(tn, skb, cb, type, ops);
359360
}
360361

361-
static int tcf_xt_search(struct net *net, struct tc_action **a, u32 index)
362+
static int tcf_xt_search(struct net *net, struct tc_action **a, u32 index,
363+
struct netlink_ext_ack *extack)
362364
{
363365
struct tc_action_net *tn = net_generic(net, xt_net_id);
364366

net/sched/act_mirred.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ static int tcf_mirred_walker(struct net *net, struct sk_buff *skb,
272272
return tcf_generic_walker(tn, skb, cb, type, ops);
273273
}
274274

275-
static int tcf_mirred_search(struct net *net, struct tc_action **a, u32 index)
275+
static int tcf_mirred_search(struct net *net, struct tc_action **a, u32 index,
276+
struct netlink_ext_ack *extack)
276277
{
277278
struct tc_action_net *tn = net_generic(net, mirred_net_id);
278279

net/sched/act_nat.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ static int tcf_nat_walker(struct net *net, struct sk_buff *skb,
285285
return tcf_generic_walker(tn, skb, cb, type, ops);
286286
}
287287

288-
static int tcf_nat_search(struct net *net, struct tc_action **a, u32 index)
288+
static int tcf_nat_search(struct net *net, struct tc_action **a, u32 index,
289+
struct netlink_ext_ack *extack)
289290
{
290291
struct tc_action_net *tn = net_generic(net, nat_net_id);
291292

0 commit comments

Comments
 (0)