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-next>] [day] [month] [year] [list]
Message-Id: <1514281725-47488-1-git-send-email-yuvalm@mellanox.com>
Date:   Tue, 26 Dec 2017 11:48:45 +0200
From:   Yuval Mintz <yuvalm@...lanox.com>
To:     netdev@...r.kernel.org, stephen@...workplumber.org
Cc:     mlxsw@...lanox.com, Yuval Mintz <yuvalm@...lanox.com>
Subject: [PATCH iproute] qdisc: Print offload indication

Use the newly added TCA_HW_OFFLOAD indication from kernel
to print a consistent 'offloaded' message to user when listing qdiscs.

Signed-off-by: Yuval Mintz <yuvalm@...lanox.com>
---
 include/uapi/linux/rtnetlink.h | 1 +
 tc/tc_qdisc.c                  | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index b8335b5..13bf56f 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -557,6 +557,7 @@ enum {
 	TCA_PAD,
 	TCA_DUMP_INVISIBLE,
 	TCA_CHAIN,
+	TCA_HW_OFFLOAD,
 	__TCA_MAX
 };
 
diff --git a/tc/tc_qdisc.c b/tc/tc_qdisc.c
index 4431d5f..70279b9 100644
--- a/tc/tc_qdisc.c
+++ b/tc/tc_qdisc.c
@@ -266,6 +266,10 @@ int print_qdisc(const struct sockaddr_nl *who,
 	if (t->tcm_info != 1)
 		print_uint(PRINT_ANY, "refcnt", "refcnt %u ", t->tcm_info);
 
+	if (tb[TCA_HW_OFFLOAD] &&
+	    (rta_getattr_u8(tb[TCA_HW_OFFLOAD])))
+		print_bool(PRINT_ANY, "offloaded", "offloaded ", true);
+
 	/* pfifo_fast is generic enough to warrant the hardcoding --JHS */
 	if (strcmp("pfifo_fast", RTA_DATA(tb[TCA_KIND])) == 0)
 		q = get_qdisc_kind("prio");
-- 
2.4.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ