From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, jhs@mojatatu.com, xiyou.wangcong@gmail.com,
dsa@cumulusnetworks.com, edumazet@google.com,
stephen@networkplumber.org, daniel@iogearbox.net,
alexander.h.duyck@intel.com, simon.horman@netronome.com,
mlxsw@mellanox.com
Subject: [patch net-next v3 09/10] net: sched: push tp down to action init
Date: Tue, 16 May 2017 19:28:01 +0200 [thread overview]
Message-ID: <20170516172802.1317-10-jiri@resnulli.us> (raw)
In-Reply-To: <20170516172802.1317-1-jiri@resnulli.us>
From: Jiri Pirko <jiri@mellanox.com>
Tp pointer will be needed by the next patch in order to get the chain.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
include/net/act_api.h | 12 ++++++------
net/sched/act_api.c | 15 ++++++++-------
net/sched/cls_api.c | 9 +++++----
3 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/include/net/act_api.h b/include/net/act_api.h
index cfa2ae3..b22c6f3 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -180,12 +180,12 @@ int tcf_unregister_action(struct tc_action_ops *a,
int tcf_action_destroy(struct list_head *actions, int bind);
int tcf_action_exec(struct sk_buff *skb, struct tc_action **actions,
int nr_actions, struct tcf_result *res);
-int tcf_action_init(struct net *net, struct nlattr *nla,
- struct nlattr *est, char *n, int ovr,
- int bind, struct list_head *);
-struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla,
- struct nlattr *est, char *n, int ovr,
- int bind);
+int tcf_action_init(struct net *net, struct tcf_proto *tp, struct nlattr *nla,
+ struct nlattr *est, char *name, int ovr, int bind,
+ struct list_head *actions);
+struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
+ struct nlattr *nla, struct nlattr *est,
+ char *name, int ovr, int bind);
int tcf_action_dump(struct sk_buff *skb, struct list_head *, int, int);
int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int);
int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int);
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index a90e8f3..e389eb4 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -570,9 +570,9 @@ static struct tc_cookie *nla_memdup_cookie(struct nlattr **tb)
return c;
}
-struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla,
- struct nlattr *est, char *name, int ovr,
- int bind)
+struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
+ struct nlattr *nla, struct nlattr *est,
+ char *name, int ovr, int bind)
{
struct tc_action *a;
struct tc_action_ops *a_o;
@@ -680,8 +680,9 @@ static void cleanup_a(struct list_head *actions, int ovr)
a->tcfa_refcnt--;
}
-int tcf_action_init(struct net *net, struct nlattr *nla, struct nlattr *est,
- char *name, int ovr, int bind, struct list_head *actions)
+int tcf_action_init(struct net *net, struct tcf_proto *tp, struct nlattr *nla,
+ struct nlattr *est, char *name, int ovr, int bind,
+ struct list_head *actions)
{
struct nlattr *tb[TCA_ACT_MAX_PRIO + 1];
struct tc_action *act;
@@ -693,7 +694,7 @@ int tcf_action_init(struct net *net, struct nlattr *nla, struct nlattr *est,
return err;
for (i = 1; i <= TCA_ACT_MAX_PRIO && tb[i]; i++) {
- act = tcf_action_init_1(net, tb[i], est, name, ovr, bind);
+ act = tcf_action_init_1(net, tp, tb[i], est, name, ovr, bind);
if (IS_ERR(act)) {
err = PTR_ERR(act);
goto err;
@@ -1020,7 +1021,7 @@ static int tcf_action_add(struct net *net, struct nlattr *nla,
int ret = 0;
LIST_HEAD(actions);
- ret = tcf_action_init(net, nla, NULL, NULL, ovr, 0, &actions);
+ ret = tcf_action_init(net, NULL, nla, NULL, NULL, ovr, 0, &actions);
if (ret)
return ret;
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 9dcb5c5..1112a2b 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -826,8 +826,9 @@ int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb,
struct tc_action *act;
if (exts->police && tb[exts->police]) {
- act = tcf_action_init_1(net, tb[exts->police], rate_tlv,
- "police", ovr, TCA_ACT_BIND);
+ act = tcf_action_init_1(net, tp, tb[exts->police],
+ rate_tlv, "police", ovr,
+ TCA_ACT_BIND);
if (IS_ERR(act))
return PTR_ERR(act);
@@ -838,8 +839,8 @@ int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb,
LIST_HEAD(actions);
int err, i = 0;
- err = tcf_action_init(net, tb[exts->action], rate_tlv,
- NULL, ovr, TCA_ACT_BIND,
+ err = tcf_action_init(net, tp, tb[exts->action],
+ rate_tlv, NULL, ovr, TCA_ACT_BIND,
&actions);
if (err)
return err;
--
2.9.3
next prev parent reply other threads:[~2017-05-16 17:28 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-16 17:27 [patch net-next v3 00/10] net: sched: introduce multichain support for filters Jiri Pirko
2017-05-16 17:27 ` [patch net-next v3 01/10] net: sched: move tc_classify function to cls_api.c Jiri Pirko
2017-05-16 20:25 ` Cong Wang
2017-05-16 21:00 ` Jiri Pirko
2017-05-16 21:03 ` Cong Wang
2017-05-16 21:05 ` Jiri Pirko
2017-05-16 17:27 ` [patch net-next v3 02/10] net: sched: introduce tcf block infractructure Jiri Pirko
2017-05-16 20:51 ` Cong Wang
2017-05-16 20:57 ` Jiri Pirko
2017-05-16 21:34 ` David Miller
2017-05-16 22:34 ` Cong Wang
2017-05-17 5:42 ` Jiri Pirko
2017-05-16 17:27 ` [patch net-next v3 03/10] net: sched: rename tcf_destroy_chain helper Jiri Pirko
2017-05-16 17:27 ` [patch net-next v3 04/10] net: sched: replace nprio by a bool to make the function more readable Jiri Pirko
2017-05-16 17:27 ` [patch net-next v3 05/10] net: sched: move TC_H_MAJ macro call into tcf_auto_prio Jiri Pirko
2017-05-16 21:01 ` Cong Wang
2017-05-16 21:03 ` Jiri Pirko
2017-05-16 22:38 ` Cong Wang
2017-05-17 5:47 ` Jiri Pirko
2017-05-17 12:47 ` Jamal Hadi Salim
2017-05-17 12:53 ` Jiri Pirko
2017-05-16 17:27 ` [patch net-next v3 06/10] net: sched: introduce helpers to work with filter chains Jiri Pirko
2017-05-16 22:17 ` Cong Wang
2017-05-17 5:50 ` Jiri Pirko
2017-05-16 17:27 ` [patch net-next v3 07/10] net: sched: push chain dump to a separate function Jiri Pirko
2017-05-16 17:28 ` [patch net-next v3 08/10] net: sched: introduce multichain support for filters Jiri Pirko
2017-05-16 17:28 ` Jiri Pirko [this message]
2017-05-16 17:28 ` [patch net-next v3 10/10] net: sched: add termination action to allow goto chain Jiri Pirko
2017-05-16 17:29 ` [patch iproute2 v2 repost 1/3] tc_filter: add support for chain index Jiri Pirko
2017-05-16 18:16 ` Stephen Hemminger
2017-05-16 19:47 ` Jiri Pirko
2017-05-22 20:33 ` Stephen Hemminger
2017-05-23 13:40 ` Jiri Pirko
2017-05-26 19:48 ` Daniel Borkmann
2017-05-27 0:11 ` Stephen Hemminger
2017-05-27 0:24 ` Daniel Borkmann
2017-05-16 17:29 ` [patch iproute2 v2 repost 2/3] tc: actions: add helpers to parse and print control actions Jiri Pirko
2017-06-14 18:32 ` Jiri Benc
2017-06-14 19:18 ` Jiri Pirko
2017-06-14 19:28 ` Jiri Benc
2017-06-14 20:10 ` Jiri Pirko
2017-05-16 17:29 ` [patch iproute2 v2 repost 3/3] tc/actions: introduce support for goto chain action Jiri Pirko
2017-05-31 12:27 ` Jiri Benc
2017-06-02 8:15 ` Jiri Pirko
2017-06-02 8:22 ` Jiri Benc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170516172802.1317-10-jiri@resnulli.us \
--to=jiri@resnulli.us \
--cc=alexander.h.duyck@intel.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dsa@cumulusnetworks.com \
--cc=edumazet@google.com \
--cc=jhs@mojatatu.com \
--cc=mlxsw@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=simon.horman@netronome.com \
--cc=stephen@networkplumber.org \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).