From: Joe Stringer <joestringer@nicira.com>
To: Pravin Shelar <pshelar@nicira.com>
Cc: Joe Stringer <joestringer@nicira.com>,
"dev@openvswitch.org" <dev@openvswitch.org>,
netdev <netdev@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [ovs-dev] [PATCHv11 net-next 2/2] openvswitch: Add support for unique flow IDs.
Date: Wed, 10 Dec 2014 10:15:27 -0800 [thread overview]
Message-ID: <CAOftzPjp3++6X50m27fhnAqVPsNRRfrhtmWGoeVi_8v3KCHWhA@mail.gmail.com> (raw)
In-Reply-To: <CALnjE+pnJqHFaKZAGgN2Q_q-sAfuGYOb6fX0utkb-J1-JFv7dg@mail.gmail.com>
On 9 December 2014 at 22:11, Pravin Shelar <pshelar@nicira.com> wrote:
> On Tue, Dec 9, 2014 at 4:25 PM, Joe Stringer <joestringer@nicira.com> wrote:
>> On 9 December 2014 at 10:32, Pravin Shelar <pshelar@nicira.com> wrote:
>>> On Tue, Dec 2, 2014 at 6:56 PM, Joe Stringer <joestringer@nicira.com> wrote:
>>>> @@ -424,10 +475,9 @@ static struct sw_flow *masked_flow_lookup(struct table_instance *ti,
>>>> ovs_flow_mask_key(&masked_key, unmasked, mask);
>>>> hash = flow_hash(&masked_key, key_start, key_end);
>>>> head = find_bucket(ti, hash);
>>>> - hlist_for_each_entry_rcu(flow, head, hash_node[ti->node_ver]) {
>>>> - if (flow->mask == mask && flow->hash == hash &&
>>>> - flow_cmp_masked_key(flow, &masked_key,
>>>> - key_start, key_end))
>>>> + hlist_for_each_entry_rcu(flow, head, flow_hash.node[ti->node_ver]) {
>>>> + if (flow->mask == mask && flow->flow_hash.hash == hash &&
>>>> + flow_cmp_masked_key(flow, &masked_key, key_start, key_end))
>>>> return flow;
>>>> }
>>>> return NULL;
>>>> @@ -469,7 +519,40 @@ struct sw_flow *ovs_flow_tbl_lookup_exact(struct flow_table *tbl,
>>>> /* Always called under ovs-mutex. */
>>>> list_for_each_entry(mask, &tbl->mask_list, list) {
>>>> flow = masked_flow_lookup(ti, match->key, mask);
>>>> - if (flow && ovs_flow_cmp_unmasked_key(flow, match)) /* Found */
>>>> + if (flow && !flow->ufid &&
>>> why not NULL check for flow->unmasked_key here rather than ufid?
>>
>> In this version, I tried to consistently use flow->ufid as the switch
>> for whether UFID exists or not. In the next version, this statement
>> would refer to flow->id->ufid_len.
>>
>> The current approach means that ovs_flow_tbl_lookup_exact() is really
>> ovs_flow_tbl_lookup_unmasked_key(). Do you think this should remain
>> specific to unmasked key or should it be made to check that the
>> identifier (ufid OR unmasked key) is the same?
>
> It is easier to read code if we check for flow->unmasked_key here.
> ovs_flow_cmp_unmasked_key() has assert on ufid anyways.
With the change to put UFID/unmasked key in the same struct, there
will be no such pointer to check, only ufid_len.
However, we could shift this check at the start of the function instead.
next prev parent reply other threads:[~2014-12-10 18:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-03 2:56 [PATCHv11 net-next 1/2] openvswitch: Refactor ovs_nla_fill_match() Joe Stringer
2014-12-03 2:56 ` [PATCHv11 net-next 2/2] openvswitch: Add support for unique flow IDs Joe Stringer
2014-12-03 18:47 ` Joe Stringer
2014-12-03 19:45 ` Pravin Shelar
2014-12-03 21:02 ` Joe Stringer
2014-12-09 18:32 ` Pravin Shelar
2014-12-09 18:47 ` David Miller
[not found] ` <CALnjE+o4tbQVTyVkzdOG8zj=qxPZ8Dv3vGHbYkBmghxsLgKkkw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-10 0:25 ` Joe Stringer
2014-12-10 6:11 ` Pravin Shelar
2014-12-10 18:15 ` Joe Stringer [this message]
2014-12-10 18:29 ` [ovs-dev] " Pravin Shelar
2014-12-03 19:37 ` [PATCHv11 net-next 1/2] openvswitch: Refactor ovs_nla_fill_match() Pravin Shelar
[not found] ` <CALnjE+pNbwtGPsHfTJ0FXxdSpXT=AKgtfHPqT5matCx+PGcXbA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-03 21:42 ` Joe Stringer
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=CAOftzPjp3++6X50m27fhnAqVPsNRRfrhtmWGoeVi_8v3KCHWhA@mail.gmail.com \
--to=joestringer@nicira.com \
--cc=dev@openvswitch.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pshelar@nicira.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;
as well as URLs for NNTP newsgroup(s).