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>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 30 Apr 2018 11:44:37 +0200
From:   Jiri Pirko <jiri@...nulli.us>
To:     Paul Blakey <paulb@...lanox.com>
Cc:     Jiri Pirko <jiri@...lanox.com>,
        Cong Wang <xiyou.wangcong@...il.com>,
        Jamal Hadi Salim <jhs@...atatu.com>,
        David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
        Yevgeny Kliteynik <kliteyn@...lanox.com>,
        Roi Dayan <roid@...lanox.com>,
        Shahar Klein <shahark@...lanox.com>,
        Mark Bloch <markb@...lanox.com>,
        Or Gerlitz <ogerlitz@...lanox.com>
Subject: Re: [PATCH net-next] cls_flower: Support multiple masks per priority

Mon, Apr 30, 2018 at 10:28:29AM CEST, paulb@...lanox.com wrote:
>Currently flower doesn't support inserting filters with different masks
>on a single priority, even if the actual flows (key + mask) inserted
>aren't overlapping, as with the use case of offloading openvswitch
>datapath flows. Instead one must go up one level, and assign different
>priorities for each mask, which will create a different flower
>instances.
>
>This patch opens flower to support more than one mask per priority,
>and a single flower instance. It does so by adding another hash table
>on top of the existing one which will store the different masks,
>and the filters that share it.
>
>The user is left with the responsibilty of ensuring non overlapping

s/responsibilty/responsibility


>flows, otherwise precedence is not guaranteed.
>
>Signed-off-by: Paul Blakey <paulb@...lanox.com>

Looks good to me.

One small nit below.
Feel free to append my tag to v2:
Signed-off-by: Jiri Pirko <jiri@...lanox.com>


[...]

>@@ -103,15 +113,22 @@ static void fl_mask_update_range(struct fl_flow_mask *mask)
> {
> 	const u8 *bytes = (const u8 *) &mask->key;
> 	size_t size = sizeof(mask->key);
>-	size_t i, first = 0, last = size - 1;
>+	size_t i, first = 0, last;
> 
>-	for (i = 0; i < sizeof(mask->key); i++) {
>+	for (i = 0; i < size; i++) {
>+		if (bytes[i]) {
>+			first = i;
>+			break;
>+		}
>+	}
>+	last = first;
>+	for (i = size - 1; i != first; i--) {
> 		if (bytes[i]) {
>-			if (!first && i)
>-				first = i;
> 			last = i;
>+			break;
> 		}
> 	}
>+

Remove this newline.


> 	mask->range.start = rounddown(first, sizeof(long));
> 	mask->range.end = roundup(last + 1, sizeof(long));
> }

[...]

Powered by blists - more mailing lists