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:   Thu,  9 Feb 2017 16:18:06 +0200
From:   Or Gerlitz <ogerlitz@...lanox.com>
To:     "David S. Miller" <davem@...emloft.net>
Cc:     Daniel Borkmann <daniel@...earbox.net>,
        Jakub Kicinski <jakub.kicinski@...ronome.com>,
        John Fastabend <john.r.fastabend@...el.com>,
        Amir Vadai <amirva@...ai.me>, netdev@...r.kernel.org,
        Or Gerlitz <ogerlitz@...lanox.com>
Subject: [PATCH net-next 2/4] net/sched: cls_matchall: Dump skip flags and use them to reflect HW offload status

Currently there is no way of querying whether a filter is offloaded
to HW or not, as the flags are not dumped to user-space, fix that.

Also, reuse the skip flags to show the insertion status by
setting the skip_hw flag in case the filter wasn't offloaded.

Signed-off-by: Or Gerlitz <ogerlitz@...lanox.com>
Acked-by: Jiri Pirko <jiri@...lanox.com>
---
 net/sched/cls_matchall.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c
index f2141cb..9dda12d 100644
--- a/net/sched/cls_matchall.c
+++ b/net/sched/cls_matchall.c
@@ -189,8 +189,10 @@ static int mall_change(struct net *net, struct sk_buff *in_skb,
 		if (err) {
 			if (tc_skip_sw(flags))
 				goto err_replace_hw_filter;
-			else
+			else {
+				new->flags |= TCA_CLS_FLAGS_SKIP_HW;
 				err = 0;
+			}
 		}
 	}
 
@@ -244,6 +246,8 @@ static int mall_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
 	    nla_put_u32(skb, TCA_MATCHALL_CLASSID, head->res.classid))
 		goto nla_put_failure;
 
+	nla_put_u32(skb, TCA_MATCHALL_FLAGS, head->flags);
+
 	if (tcf_exts_dump(skb, &head->exts))
 		goto nla_put_failure;
 
-- 
2.3.7

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ