From: Jesse Gross <jesse@nicira.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, dev@openvswitch.org,
Pravin B Shelar <pshelar@nicira.com>,
Jesse Gross <jesse@nicira.com>
Subject: [PATCH net-next 11/11] openvswitch: Use flow hash during flow lookup operation.
Date: Sat, 2 Nov 2013 00:43:50 -0700 [thread overview]
Message-ID: <1383378230-59624-12-git-send-email-jesse@nicira.com> (raw)
In-Reply-To: <1383378230-59624-1-git-send-email-jesse@nicira.com>
From: Pravin B Shelar <pshelar@nicira.com>
Flow->hash can be used to detect hash collisions and avoid flow key
compare in flow lookup.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
---
net/openvswitch/flow_table.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c
index 536b4d2..e425427 100644
--- a/net/openvswitch/flow_table.c
+++ b/net/openvswitch/flow_table.c
@@ -421,7 +421,7 @@ static struct sw_flow *masked_flow_lookup(struct table_instance *ti,
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 &&
+ if (flow->mask == mask && flow->hash == hash &&
flow_cmp_masked_key(flow, &masked_key,
key_start, key_end))
return flow;
--
1.8.3.2
next prev parent reply other threads:[~2013-11-02 21:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-02 7:43 [GIT net-next] Open vSwitch Jesse Gross
[not found] ` <1383378230-59624-1-git-send-email-jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
2013-11-02 7:43 ` [PATCH net-next 01/11] openvswitch: Move flow table rehashing to flow install Jesse Gross
2013-11-02 7:43 ` [PATCH net-next 02/11] openvswitch: remove duplicated include from vport-vxlan.c Jesse Gross
2013-11-02 7:43 ` [PATCH net-next 03/11] openvswitch: remove duplicated include from vport-gre.c Jesse Gross
2013-11-02 7:43 ` [PATCH net-next 04/11] openvswitch: Restructure datapath.c and flow.c Jesse Gross
2013-11-02 7:43 ` [PATCH net-next 05/11] openvswitch: Move mega-flow list out of rehashing struct Jesse Gross
2013-11-02 7:43 ` [PATCH net-next 06/11] openvswitch: Simplify mega-flow APIs Jesse Gross
2013-11-02 7:43 ` [PATCH net-next 07/11] openvswitch: collect mega flow mask stats Jesse Gross
2013-11-02 7:43 ` [PATCH net-next 08/11] openvswitch: Enable all GSO features on internal port Jesse Gross
2013-11-02 7:43 ` [PATCH net-next 09/11] openvswitch: Widen TCP flags handling Jesse Gross
2013-11-02 7:43 ` [PATCH net-next 10/11] openvswitch: TCP flags matching support Jesse Gross
2013-11-02 7:43 ` Jesse Gross [this message]
2013-11-04 21:26 ` [GIT net-next] Open vSwitch David Miller
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=1383378230-59624-12-git-send-email-jesse@nicira.com \
--to=jesse@nicira.com \
--cc=davem@davemloft.net \
--cc=dev@openvswitch.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).