[Patch net-next] net_sched: remove internal use of TC_POLICE_*

Subsystems: networking [general], tc subsystem, the rest

STALE3702d

5 messages, 3 authors, 2016-06-15 · open the first message on its own page

[Patch net-next] net_sched: remove internal use of TC_POLICE_*

From: Cong Wang <hidden>
Date: 2016-06-13 17:47:49

These should be gone when we removed CONFIG_NET_CLS_POLICE.
We can not totally remove them since they are exposed
to userspace.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <redacted>
---
 net/sched/act_ipt.c | 2 +-
 net/sched/sch_atm.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
index e7c0f4d..8998a35 100644
--- a/net/sched/act_ipt.c
+++ b/net/sched/act_ipt.c
@@ -243,7 +243,7 @@ static int tcf_ipt(struct sk_buff *skb, const struct tc_action *a,
 	default:
 		net_notice_ratelimited("tc filter: Bogus netfilter code %d assume ACCEPT\n",
 				       ret);
-		result = TC_POLICE_OK;
+		result = TC_ACT_OK;
 		break;
 	}
 	spin_unlock(&ipt->tcf_lock);
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c
index 0785b23..e04ea69 100644
--- a/net/sched/sch_atm.c
+++ b/net/sched/sch_atm.c
@@ -366,7 +366,7 @@ static int atm_tc_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 	int ret = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS;
 
 	pr_debug("atm_tc_enqueue(skb %p,sch %p,[qdisc %p])\n", skb, sch, p);
-	result = TC_POLICE_OK;	/* be nice to gcc */
+	result = TC_ACT_OK;	/* be nice to gcc */
 	flow = NULL;
 	if (TC_H_MAJ(skb->priority) != sch->handle ||
 	    !(flow = (struct atm_flow_data *)atm_tc_get(sch, skb->priority))) {
@@ -403,7 +403,7 @@ static int atm_tc_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 		case TC_ACT_SHOT:
 			kfree_skb(skb);
 			goto drop;
-		case TC_POLICE_RECLASSIFY:
+		case TC_ACT_RECLASSIFY:
 			if (flow->excess)
 				flow = flow->excess;
 			else
-- 
2.1.0

[Patch net-next] act_police: rename tcf_act_police_locate() to tcf_act_police_init()

From: Cong Wang <hidden>
Date: 2016-06-13 17:47:50

This function is just ->init(), rename it to make it obvious.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <redacted>
---
 net/sched/act_police.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index ff34dd3..1e8ede3 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -115,9 +115,9 @@ static const struct nla_policy police_policy[TCA_POLICE_MAX + 1] = {
 	[TCA_POLICE_RESULT]	= { .type = NLA_U32 },
 };
 
-static int tcf_act_police_locate(struct net *net, struct nlattr *nla,
-				 struct nlattr *est, struct tc_action *a,
-				 int ovr, int bind)
+static int tcf_act_police_init(struct net *net, struct nlattr *nla,
+			       struct nlattr *est, struct tc_action *a,
+			       int ovr, int bind)
 {
 	int ret = 0, err;
 	struct nlattr *tb[TCA_POLICE_MAX + 1];
@@ -366,7 +366,7 @@ static struct tc_action_ops act_police_ops = {
 	.owner		=	THIS_MODULE,
 	.act		=	tcf_act_police,
 	.dump		=	tcf_act_police_dump,
-	.init		=	tcf_act_police_locate,
+	.init		=	tcf_act_police_init,
 	.walk		=	tcf_act_police_walker,
 	.lookup		=	tcf_police_search,
 };
-- 
2.1.0

Re: [Patch net-next] net_sched: remove internal use of TC_POLICE_*

From: Jamal Hadi Salim <jhs@mojatatu.com>
Date: 2016-06-13 21:54:04

On 16-06-13 01:47 PM, Cong Wang wrote:
These should be gone when we removed CONFIG_NET_CLS_POLICE.
We can not totally remove them since they are exposed
to userspace.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <redacted>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

Re: [Patch net-next] act_police: rename tcf_act_police_locate() to tcf_act_police_init()

From: Jamal Hadi Salim <jhs@mojatatu.com>
Date: 2016-06-13 21:54:37

On 16-06-13 01:47 PM, Cong Wang wrote:
This function is just ->init(), rename it to make it obvious.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <redacted>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

cheers,
jamal

Re: [Patch net-next] net_sched: remove internal use of TC_POLICE_*

From: David Miller <davem@davemloft.net>
Date: 2016-06-15 07:06:40

From: Cong Wang <redacted>
Date: Mon, 13 Jun 2016 10:47:43 -0700
These should be gone when we removed CONFIG_NET_CLS_POLICE.
We can not totally remove them since they are exposed
to userspace.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help