From: Jiri Pirko <jiri@resnulli.us>
To: Paul Blakey <paulb@mellanox.com>
Cc: Jiri Pirko <jiri@mellanox.com>,
Cong Wang <xiyou.wangcong@gmail.com>,
Jamal Hadi Salim <jhs@mojatatu.com>,
David Miller <davem@davemloft.net>,
netdev@vger.kernel.org, Yevgeny Kliteynik <kliteyn@mellanox.com>,
Roi Dayan <roid@mellanox.com>,
Shahar Klein <shahark@mellanox.com>,
Mark Bloch <markb@mellanox.com>,
Or Gerlitz <ogerlitz@mellanox.com>
Subject: Re: [PATCH net-next] cls_flower: Support multiple masks per priority
Date: Mon, 30 Apr 2018 11:44:37 +0200 [thread overview]
Message-ID: <20180430094437.GJ23854@nanopsycho.orion> (raw)
In-Reply-To: <1525076909-8767-1-git-send-email-paulb@mellanox.com>
Mon, Apr 30, 2018 at 10:28:29AM CEST, paulb@mellanox.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@mellanox.com>
Looks good to me.
One small nit below.
Feel free to append my tag to v2:
Signed-off-by: Jiri Pirko <jiri@mellanox.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));
> }
[...]
prev parent reply other threads:[~2018-04-30 9:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-30 8:28 [PATCH net-next] cls_flower: Support multiple masks per priority Paul Blakey
2018-04-30 9:44 ` Jiri Pirko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180430094437.GJ23854@nanopsycho.orion \
--to=jiri@resnulli.us \
--cc=davem@davemloft.net \
--cc=jhs@mojatatu.com \
--cc=jiri@mellanox.com \
--cc=kliteyn@mellanox.com \
--cc=markb@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=paulb@mellanox.com \
--cc=roid@mellanox.com \
--cc=shahark@mellanox.com \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox