* [iproute2 1/1] RFC: obsolete direct invocation of police
@ 2014-10-06 11:46 Jamal Hadi Salim
2014-10-06 17:01 ` Stephen Hemminger
0 siblings, 1 reply; 4+ messages in thread
From: Jamal Hadi Salim @ 2014-10-06 11:46 UTC (permalink / raw)
To: stephen; +Cc: netdev, xiyou.wangcong, john.r.fastabend, Jamal Hadi Salim
From: Jamal Hadi Salim <jhs@mojatatu.com>
I realize this may be controversial. I dont think people are still using
the 1990s syntax anymore. This is one way to test it.
We want to eventually phase out the kernel hacks for backward compat.
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
tc/f_basic.c | 9 +++------
tc/f_bpf.c | 9 +++------
tc/f_cgroup.c | 9 +++------
tc/f_flow.c | 9 +++------
tc/f_fw.c | 9 +++------
tc/f_route.c | 9 +++------
tc/f_rsvp.c | 9 +++------
tc/f_tcindex.c | 9 +++------
tc/f_u32.c | 10 +++-------
9 files changed, 27 insertions(+), 55 deletions(-)
diff --git a/tc/f_basic.c b/tc/f_basic.c
index 1c33ca3..6137f83 100644
--- a/tc/f_basic.c
+++ b/tc/f_basic.c
@@ -86,12 +86,9 @@ static int basic_parse_opt(struct filter_util *qu, char *handle,
continue;
} else if (matches(*argv, "police") == 0) {
- NEXT_ARG();
- if (parse_police(&argc, &argv, TCA_BASIC_POLICE, n)) {
- fprintf(stderr, "Illegal \"police\"\n");
- return -1;
- }
- continue;
+ fprintf(stderr, "Obsolete \"police\"\n");
+ fprintf(stderr, "use \"action police ...\"\n");
+ return -1;
} else if (strcmp(*argv, "help") == 0) {
explain();
return -1;
diff --git a/tc/f_bpf.c b/tc/f_bpf.c
index 48635a7..4d86f38 100644
--- a/tc/f_bpf.c
+++ b/tc/f_bpf.c
@@ -227,12 +227,9 @@ static int bpf_parse_opt(struct filter_util *qu, char *handle,
}
continue;
} else if (matches(*argv, "police") == 0) {
- NEXT_ARG();
- if (parse_police(&argc, &argv, TCA_BPF_POLICE, n)) {
- fprintf(stderr, "Illegal \"police\"\n");
- return -1;
- }
- continue;
+ fprintf(stderr, "Obsolete \"police\"\n");
+ fprintf(stderr, "use \"action police ...\"\n");
+ return -1;
} else if (strcmp(*argv, "help") == 0) {
explain();
return -1;
diff --git a/tc/f_cgroup.c b/tc/f_cgroup.c
index 53f7406..092050c 100644
--- a/tc/f_cgroup.c
+++ b/tc/f_cgroup.c
@@ -60,12 +60,9 @@ static int cgroup_parse_opt(struct filter_util *qu, char *handle,
continue;
} else if (matches(*argv, "police") == 0) {
- NEXT_ARG();
- if (parse_police(&argc, &argv, TCA_CGROUP_POLICE, n)) {
- fprintf(stderr, "Illegal \"police\"\n");
- return -1;
- }
- continue;
+ fprintf(stderr, "Obsolete \"police\"\n");
+ fprintf(stderr, "use \"action police ...\"\n");
+ return -1;
} else if (strcmp(*argv, "help") == 0) {
explain();
return -1;
diff --git a/tc/f_flow.c b/tc/f_flow.c
index b454a65..d021f6f 100644
--- a/tc/f_flow.c
+++ b/tc/f_flow.c
@@ -220,12 +220,9 @@ static int flow_parse_opt(struct filter_util *fu, char *handle,
}
addattr32(n, 4096, TCA_FLOW_PERTURB, tmp);
} else if (matches(*argv, "police") == 0) {
- NEXT_ARG();
- if (parse_police(&argc, &argv, TCA_FLOW_POLICE, n)) {
- fprintf(stderr, "Illegal \"police\"\n");
- return -1;
- }
- continue;
+ fprintf(stderr, "Obsolete \"police\"\n");
+ fprintf(stderr, "use \"action police ...\"\n");
+ return -1;
} else if (matches(*argv, "action") == 0) {
NEXT_ARG();
if (parse_action(&argc, &argv, TCA_FLOW_ACT, n)) {
diff --git a/tc/f_fw.c b/tc/f_fw.c
index 165f489..4b15cce1 100644
--- a/tc/f_fw.c
+++ b/tc/f_fw.c
@@ -78,12 +78,9 @@ static int fw_parse_opt(struct filter_util *qu, char *handle, int argc, char **a
}
addattr_l(n, 4096, TCA_FW_CLASSID, &handle, 4);
} else if (matches(*argv, "police") == 0) {
- NEXT_ARG();
- if (parse_police(&argc, &argv, TCA_FW_POLICE, n)) {
- fprintf(stderr, "Illegal \"police\"\n");
- return -1;
- }
- continue;
+ fprintf(stderr, "Obsolete \"police\"\n");
+ fprintf(stderr, "use \"action police ...\"\n");
+ return -1;
} else if (matches(*argv, "action") == 0) {
NEXT_ARG();
if (parse_action(&argc, &argv, TCA_FW_ACT, n)) {
diff --git a/tc/f_route.c b/tc/f_route.c
index 23c4ecc..7603c0e 100644
--- a/tc/f_route.c
+++ b/tc/f_route.c
@@ -99,12 +99,9 @@ static int route_parse_opt(struct filter_util *qu, char *handle, int argc, char
}
addattr_l(n, 4096, TCA_ROUTE4_CLASSID, &handle, 4);
} else if (matches(*argv, "police") == 0) {
- NEXT_ARG();
- if (parse_police(&argc, &argv, TCA_ROUTE4_POLICE, n)) {
- fprintf(stderr, "Illegal \"police\"\n");
- return -1;
- }
- continue;
+ fprintf(stderr, "Obsolete \"police\"\n");
+ fprintf(stderr, "use \"action police ...\"\n");
+ return -1;
} else if (matches(*argv, "action") == 0) {
NEXT_ARG();
if (parse_action(&argc, &argv, TCA_ROUTE4_ACT, n)) {
diff --git a/tc/f_rsvp.c b/tc/f_rsvp.c
index cb7b8fb..b1af8fb 100644
--- a/tc/f_rsvp.c
+++ b/tc/f_rsvp.c
@@ -269,12 +269,9 @@ static int rsvp_parse_opt(struct filter_util *qu, char *handle, int argc, char *
}
continue;
} else if (matches(*argv, "police") == 0) {
- NEXT_ARG();
- if (parse_police(&argc, &argv, TCA_RSVP_POLICE, n)) {
- fprintf(stderr, "Illegal \"police\"\n");
- return -1;
- }
- continue;
+ fprintf(stderr, "Obsolete \"police\"\n");
+ fprintf(stderr, "use \"action police ...\"\n");
+ return -1;
} else if (strcmp(*argv, "help") == 0) {
explain();
return -1;
diff --git a/tc/f_tcindex.c b/tc/f_tcindex.c
index b1847c8..e7a08d9 100644
--- a/tc/f_tcindex.c
+++ b/tc/f_tcindex.c
@@ -99,12 +99,9 @@ static int tcindex_parse_opt(struct filter_util *qu, char *handle, int argc,
addattr_l(n, 4096, TCA_TCINDEX_CLASSID, &handle, 4);
}
else if (!strcmp(*argv,"police")) {
- NEXT_ARG();
- if (parse_police(&argc, &argv, TCA_TCINDEX_POLICE, n)) {
- fprintf(stderr, "Illegal \"police\"\n");
- return -1;
- }
- continue;
+ fprintf(stderr, "Obsolete \"police\"\n");
+ fprintf(stderr, "use \"action police ...\"\n");
+ return -1;
}
else if (!strcmp(*argv,"action")) {
NEXT_ARG();
diff --git a/tc/f_u32.c b/tc/f_u32.c
index 80a5097..a7b3da6 100644
--- a/tc/f_u32.c
+++ b/tc/f_u32.c
@@ -1131,13 +1131,9 @@ static int u32_parse_opt(struct filter_util *qu, char *handle,
continue;
} else if (matches(*argv, "police") == 0) {
- NEXT_ARG();
- if (parse_police(&argc, &argv, TCA_U32_POLICE, n)) {
- fprintf(stderr, "Illegal \"police\"\n");
- return -1;
- }
- terminal_ok++;
- continue;
+ fprintf(stderr, "Obsolete \"police\"\n");
+ fprintf(stderr, "use \"action police ...\"\n");
+ return -1;
} else if (strcmp(*argv, "help") == 0) {
explain();
return -1;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [iproute2 1/1] RFC: obsolete direct invocation of police
2014-10-06 11:46 [iproute2 1/1] RFC: obsolete direct invocation of police Jamal Hadi Salim
@ 2014-10-06 17:01 ` Stephen Hemminger
2014-10-07 11:32 ` Jamal Hadi Salim
0 siblings, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2014-10-06 17:01 UTC (permalink / raw)
To: Jamal Hadi Salim; +Cc: netdev, xiyou.wangcong, john.r.fastabend
On Mon, 6 Oct 2014 07:46:00 -0400
Jamal Hadi Salim <jhs@mojatatu.com> wrote:
> From: Jamal Hadi Salim <jhs@mojatatu.com>
>
> I realize this may be controversial. I dont think people are still using
> the 1990s syntax anymore. This is one way to test it.
> We want to eventually phase out the kernel hacks for backward compat.
>
> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
I think iproute utilities needs to accept the old syntax and warn about
deprecated syntax use. Later (like 2yr +) the code can be removed.
The old syntax can be removed from all documentation and help messages
now though.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [iproute2 1/1] RFC: obsolete direct invocation of police
2014-10-06 17:01 ` Stephen Hemminger
@ 2014-10-07 11:32 ` Jamal Hadi Salim
2014-10-07 16:04 ` Stephen Hemminger
0 siblings, 1 reply; 4+ messages in thread
From: Jamal Hadi Salim @ 2014-10-07 11:32 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, xiyou.wangcong, john.r.fastabend
On 10/06/14 13:01, Stephen Hemminger wrote:
> I think iproute utilities needs to accept the old syntax and warn about
> deprecated syntax use. Later (like 2yr +) the code can be removed.
>
> The old syntax can be removed from all documentation and help messages
> now though.
Ok, so ignore that one patch. I will send another one.
Fair to put a date for when the obsoletion notice went out?
Example:
"As of October 10, 2014 this syntax is obsolete. Please use instead ..."
Maybe also mention when the approximate cutoff date is.
cheers,
jamal
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [iproute2 1/1] RFC: obsolete direct invocation of police
2014-10-07 11:32 ` Jamal Hadi Salim
@ 2014-10-07 16:04 ` Stephen Hemminger
0 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2014-10-07 16:04 UTC (permalink / raw)
To: Jamal Hadi Salim; +Cc: netdev, xiyou.wangcong, john.r.fastabend
On Tue, 07 Oct 2014 07:32:09 -0400
Jamal Hadi Salim <jhs@mojatatu.com> wrote:
> On 10/06/14 13:01, Stephen Hemminger wrote:
>
> > I think iproute utilities needs to accept the old syntax and warn about
> > deprecated syntax use. Later (like 2yr +) the code can be removed.
> >
> > The old syntax can be removed from all documentation and help messages
> > now though.
>
> Ok, so ignore that one patch. I will send another one.
> Fair to put a date for when the obsoletion notice went out?
> Example:
> "As of October 10, 2014 this syntax is obsolete. Please use instead ..."
> Maybe also mention when the approximate cutoff date is.
Don't put a date in, it either will look silly, or will be ignored.
Make message a short direct one liner.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-10-07 16:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-06 11:46 [iproute2 1/1] RFC: obsolete direct invocation of police Jamal Hadi Salim
2014-10-06 17:01 ` Stephen Hemminger
2014-10-07 11:32 ` Jamal Hadi Salim
2014-10-07 16:04 ` Stephen Hemminger
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).