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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <161921235266.33234.11141506572174881.stgit@anambiarhost.jf.intel.com>
Date:   Fri, 23 Apr 2021 14:12:32 -0700
From:   Amritha Nambiar <amritha.nambiar@...el.com>
To:     netdev@...r.kernel.org, stephen@...workplumber.org,
        dsahern@...nel.org
Cc:     jhs@...atatu.com, jiri@...nulli.us, xiyou.wangcong@...il.com,
        john.fastabend@...il.com, alexander.duyck@...il.com,
        vinicius.gomes@...el.com, vedang.patel@...el.com,
        sridhar.samudrala@...el.com, amritha.nambiar@...el.com
Subject: [iproute2-next,
 RFC PATCH] tc/mqprio: Extend TC limit beyond 16 to 255

Extend the max limit of TCs to 255 from current max of 16. This
requires the size of certain netlink messages to be increased to
2048 from 1024 to support the additional attribute options (that
depends on the number of TCs).

Signed-off-by: Amritha Nambiar <amritha.nambiar@...el.com>
---
 include/uapi/linux/pkt_sched.h |    6 +++---
 tc/q_mqprio.c                  |   12 ++++++------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
index 79a699f1..b5d73313 100644
--- a/include/uapi/linux/pkt_sched.h
+++ b/include/uapi/linux/pkt_sched.h
@@ -692,8 +692,8 @@ struct tc_drr_stats {
 };
 
 /* MQPRIO */
-#define TC_QOPT_BITMASK 15
-#define TC_QOPT_MAX_QUEUE 16
+#define TC_QOPT_BITMASK 255
+#define TC_QOPT_MAX_QUEUE 255
 
 enum {
 	TC_MQPRIO_HW_OFFLOAD_NONE,	/* no offload requested */
@@ -721,7 +721,7 @@ enum {
 
 struct tc_mqprio_qopt {
 	__u8	num_tc;
-	__u8	prio_tc_map[TC_QOPT_BITMASK + 1];
+	__u8	prio_tc_map[TC_QOPT_BITMASK];
 	__u8	hw;
 	__u16	count[TC_QOPT_MAX_QUEUE];
 	__u16	offset[TC_QOPT_MAX_QUEUE];
diff --git a/tc/q_mqprio.c b/tc/q_mqprio.c
index 706452d0..59960020 100644
--- a/tc/q_mqprio.c
+++ b/tc/q_mqprio.c
@@ -182,7 +182,7 @@ static int mqprio_parse_opt(struct qdisc_util *qu, int argc,
 	}
 
 	tail = NLMSG_TAIL(n);
-	addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt));
+	addattr_l(n, 2048, TCA_OPTIONS, &opt, sizeof(opt));
 
 	if (flags & TC_MQPRIO_F_MODE)
 		addattr_l(n, 1024, TCA_MQPRIO_MODE,
@@ -194,11 +194,11 @@ static int mqprio_parse_opt(struct qdisc_util *qu, int argc,
 	if (flags & TC_MQPRIO_F_MIN_RATE) {
 		struct rtattr *start;
 
-		start = addattr_nest(n, 1024,
+		start = addattr_nest(n, 2048,
 				     TCA_MQPRIO_MIN_RATE64 | NLA_F_NESTED);
 
 		for (idx = 0; idx < TC_QOPT_MAX_QUEUE; idx++)
-			addattr_l(n, 1024, TCA_MQPRIO_MIN_RATE64,
+			addattr_l(n, 2048, TCA_MQPRIO_MIN_RATE64,
 				  &min_rate64[idx], sizeof(min_rate64[idx]));
 
 		addattr_nest_end(n, start);
@@ -207,11 +207,11 @@ static int mqprio_parse_opt(struct qdisc_util *qu, int argc,
 	if (flags & TC_MQPRIO_F_MAX_RATE) {
 		struct rtattr *start;
 
-		start = addattr_nest(n, 1024,
+		start = addattr_nest(n, 2048,
 				     TCA_MQPRIO_MAX_RATE64 | NLA_F_NESTED);
 
 		for (idx = 0; idx < TC_QOPT_MAX_QUEUE; idx++)
-			addattr_l(n, 1024, TCA_MQPRIO_MAX_RATE64,
+			addattr_l(n, 2048, TCA_MQPRIO_MAX_RATE64,
 				  &max_rate64[idx], sizeof(max_rate64[idx]));
 
 		addattr_nest_end(n, start);
@@ -243,7 +243,7 @@ static int mqprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 
 	print_uint(PRINT_ANY, "tc", "tc %u ", qopt->num_tc);
 	open_json_array(PRINT_ANY, is_json_context() ? "map" : "map ");
-	for (i = 0; i <= TC_PRIO_MAX; i++)
+	for (i = 0; i < qopt->num_tc; i++)
 		print_uint(PRINT_ANY, NULL, "%u ", qopt->prio_tc_map[i]);
 	close_json_array(PRINT_ANY, "");
 	open_json_array(PRINT_ANY, is_json_context() ? "queues" : "\n             queues:");

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ