lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 19 Nov 2018 15:03:34 -0800
From:   Jakub Kicinski <jakub.kicinski@...ronome.com>
To:     dsahern@...il.com, stephen@...workplumber.org
Cc:     oss-drivers@...ronome.com, netdev@...r.kernel.org,
        Jakub Kicinski <jakub.kicinski@...ronome.com>
Subject: [PATCH iproute2-next 7/8] tc: gred: support controlling RED flags

Kernel GRED qdisc supports ECN marking, and the harddrop flag
but setting and dumping this flag is not possible with iproute2.
Add the support.

Signed-off-by: Jakub Kicinski <jakub.kicinski@...ronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@...ronome.com>
---
 bash-completion/tc | 2 +-
 tc/q_gred.c        | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/bash-completion/tc b/bash-completion/tc
index 29bca5d9354d..007e1c2e30bf 100644
--- a/bash-completion/tc
+++ b/bash-completion/tc
@@ -302,7 +302,7 @@ _tc_qdisc_options()
             ;;
         gred)
             _tc_once_attr 'setup vqs default grio vq prio limit min max avpkt \
-                burst probability bandwidth'
+                burst probability bandwidth ecn harddrop'
             return 0
             ;;
         hhf)
diff --git a/tc/q_gred.c b/tc/q_gred.c
index fda41a5704a9..dfa3252bc2a8 100644
--- a/tc/q_gred.c
+++ b/tc/q_gred.c
@@ -37,7 +37,7 @@
 static void explain(void)
 {
 	fprintf(stderr, "Usage: tc qdisc { add | replace | change } ... gred setup vqs NUMBER\n");
-	fprintf(stderr, "           default DEFAULT_VQ [ grio ] [ limit BYTES ]\n");
+	fprintf(stderr, "           default DEFAULT_VQ [ grio ] [ limit BYTES ] [ecn] [harddrop]\n");
 	fprintf(stderr, "       tc qdisc change ... gred vq VQ [ prio VALUE ] limit BYTES\n");
 	fprintf(stderr, "           min BYTES max BYTES avpkt BYTES [ burst PACKETS ]\n");
 	fprintf(stderr, "           [ probability PROBABILITY ] [ bandwidth KBPS ]\n");
@@ -87,6 +87,10 @@ static int init_gred(struct qdisc_util *qu, int argc, char **argv,
 				fprintf(stderr, "Illegal \"limit\"\n");
 				return -1;
 			}
+		} else if (strcmp(*argv, "ecn") == 0) {
+			opt.flags |= TC_RED_ECN;
+		} else if (strcmp(*argv, "harddrop") == 0) {
+			opt.flags |= TC_RED_HARDDROP;
 		} else if (strcmp(*argv, "help") == 0) {
 			explain();
 			return -1;
@@ -452,6 +456,8 @@ static int gred_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 			     sprint_size(*limit, b1));
 	}
 
+	tc_red_print_flags(sopt->flags);
+
 	open_json_array(PRINT_JSON, "vqs");
 	for (i = 0; i < MAX_DPs; i++, qopt++) {
 		if (qopt->DP >= MAX_DPs)
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ