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]
Message-Id: <1486649888-2786-2-git-send-email-ogerlitz@mellanox.com>
Date:   Thu,  9 Feb 2017 16:18:05 +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,
        Paul Blakey <paulb@...lanox.com>, Roi Dayan <roid@...lanox.com>
Subject: [PATCH net-next 1/4] net/sched: cls_flower: Use skip flags to reflect HW offload status

From: Paul Blakey <paulb@...lanox.com>

Currently there is no way of querying whether a filter is
offloaded to HW or not when using both policy (no flag).

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: Paul Blakey <paulb@...lanox.com>
Signed-off-by: Roi Dayan <roid@...lanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@...lanox.com>
Acked-by: Jiri Pirko <jiri@...lanox.com>
---
 net/sched/cls_flower.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index 0826c8e..90e4490 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -252,7 +252,10 @@ static int fl_hw_replace_filter(struct tcf_proto *tp,
 		if (tcf_exts_get_dev(dev, &f->exts, &f->hw_dev) ||
 		    (f->hw_dev && !tc_can_offload(f->hw_dev, tp))) {
 			f->hw_dev = dev;
-			return tc_skip_sw(f->flags) ? -EINVAL : 0;
+			if (tc_skip_sw(f->flags))
+				return -EINVAL;
+			f->flags |= TCA_CLS_FLAGS_SKIP_HW;
+			return 0;
 		}
 		dev = f->hw_dev;
 		tc->egress_dev = true;
@@ -276,6 +279,8 @@ static int fl_hw_replace_filter(struct tcf_proto *tp,
 
 	if (tc_skip_sw(f->flags))
 		return err;
+	if (err)
+		f->flags |= TCA_CLS_FLAGS_SKIP_HW;
 	return 0;
 }
 
-- 
2.3.7

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ