<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/openvswitch/flow_table.c, branch v3.19</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.19</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.19'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2014-12-10T20:17:45Z</updated>
<entry>
<title>net: replace remaining users of arch_fast_hash with jhash</title>
<updated>2014-12-10T20:17:45Z</updated>
<author>
<name>Daniel Borkmann</name>
<email>dborkman@redhat.com</email>
</author>
<published>2014-12-10T15:33:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=87545899b52f9c8b1621be4347f443890c0cb196'/>
<id>urn:sha1:87545899b52f9c8b1621be4347f443890c0cb196</id>
<content type='text'>
This patch effectively reverts commit 500f80872645 ("net: ovs: use CRC32
accelerated flow hash if available"), and other remaining arch_fast_hash()
users such as from nfsd via commit 6282cd565553 ("NFSD: Don't hand out
delegations for 30 seconds after recalling them.") where it has been used
as a hash function for bloom filtering.

While we think that these users are actually not much of concern, it has
been requested to remove the arch_fast_hash() library bits that arose
from [1] entirely as per recent discussion [2]. The main argument is that
using it as a hash may introduce bias due to its linearity (see avalanche
criterion) and thus makes it less clear (though we tried to document that)
when this security/performance trade-off is actually acceptable for a
general purpose library function.

Lets therefore avoid any further confusion on this matter and remove it to
prevent any future accidental misuse of it. For the time being, this is
going to make hashing of flow keys a bit more expensive in the ovs case,
but future work could reevaluate a different hashing discipline.

  [1] https://patchwork.ozlabs.org/patch/299369/
  [2] https://patchwork.ozlabs.org/patch/418756/

Cc: Neil Brown &lt;neilb@suse.de&gt;
Cc: Francesco Fusco &lt;fusco@ntop.org&gt;
Cc: Jesse Gross &lt;jesse@nicira.com&gt;
Cc: Thomas Graf &lt;tgraf@suug.ch&gt;
Signed-off-by: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>openvswitch: Constify various function arguments</title>
<updated>2014-11-10T02:58:44Z</updated>
<author>
<name>Thomas Graf</name>
<email>tgraf@noironetworks.com</email>
</author>
<published>2014-11-06T14:58:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=12eb18f7115884b0c1513dda31b0051121116b3a'/>
<id>urn:sha1:12eb18f7115884b0c1513dda31b0051121116b3a</id>
<content type='text'>
Help produce better optimized code.

Signed-off-by: Thomas Graf &lt;tgraf@noironetworks.com&gt;
Signed-off-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
</content>
</entry>
<entry>
<title>openvswitch: Move table destroy to dp-rcu callback.</title>
<updated>2014-11-06T07:52:34Z</updated>
<author>
<name>Pravin B Shelar</name>
<email>pshelar@nicira.com</email>
</author>
<published>2014-05-07T01:41:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9b996e544a6bc7d201060fdcbdb5d4a9b734aa1b'/>
<id>urn:sha1:9b996e544a6bc7d201060fdcbdb5d4a9b734aa1b</id>
<content type='text'>
Ths simplifies flow-table-destroy API. No need to pass explicit
parameter about context.

Signed-off-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Acked-by: Thomas Graf &lt;tgraf@redhat.com&gt;
</content>
</entry>
<entry>
<title>openvswitch: Use exact lookup for flow_get and flow_del.</title>
<updated>2014-07-01T03:47:15Z</updated>
<author>
<name>Alex Wang</name>
<email>alexw@nicira.com</email>
</author>
<published>2014-07-01T03:30:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4a46b24e147dfa9b858026da02cad0bdd4e149d2'/>
<id>urn:sha1:4a46b24e147dfa9b858026da02cad0bdd4e149d2</id>
<content type='text'>
Due to the race condition in userspace, there is chance that two
overlapping megaflows could be installed in datapath.  And this
causes userspace unable to delete the less inclusive megaflow flow
even after it timeout, since the flow_del logic will stop at the
first match of masked flow.

This commit fixes the bug by making the kernel flow_del and flow_get
logic check all masks in that case.

Introduced by 03f0d916a (openvswitch: Mega flow implementation).

Signed-off-by: Alex Wang &lt;alexw@nicira.com&gt;
Acked-by: Andy Zhou &lt;azhou@nicira.com&gt;
Signed-off-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
</content>
</entry>
<entry>
<title>openvswitch: Fix typo.</title>
<updated>2014-05-22T23:27:35Z</updated>
<author>
<name>Jarno Rajahalme</name>
<email>jrajahalme@nicira.com</email>
</author>
<published>2014-05-05T21:15:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eb07265904d6ee95497aba0f3cbd2ae6d9c39a97'/>
<id>urn:sha1:eb07265904d6ee95497aba0f3cbd2ae6d9c39a97</id>
<content type='text'>
Incorrect struct name was confusing, even though otherwise
inconsequental.

Signed-off-by: Jarno Rajahalme &lt;jrajahalme@nicira.com&gt;
Signed-off-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
</content>
</entry>
<entry>
<title>openvswitch: Make flow mask removal symmetric.</title>
<updated>2014-05-22T23:27:35Z</updated>
<author>
<name>Jarno Rajahalme</name>
<email>jrajahalme@nicira.com</email>
</author>
<published>2014-05-05T20:24:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=56c19868e115fcf8d62d843e1b9616bb9837d0db'/>
<id>urn:sha1:56c19868e115fcf8d62d843e1b9616bb9837d0db</id>
<content type='text'>
Masks are inserted when flows are inserted to the table, so it is
logical to correspondingly remove masks when flows are removed from
the table, in ovs_flow_table_remove().

This allows ovs_flow_free() to be called without locking, which will
be used by later patches.

Signed-off-by: Jarno Rajahalme &lt;jrajahalme@nicira.com&gt;
Signed-off-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
</content>
</entry>
<entry>
<title>openvswitch: Per NUMA node flow stats.</title>
<updated>2014-05-16T20:40:29Z</updated>
<author>
<name>Jarno Rajahalme</name>
<email>jrajahalme@nicira.com</email>
</author>
<published>2014-03-27T19:42:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=63e7959c4b9bd6f791061c460a22d9ee32ae2240'/>
<id>urn:sha1:63e7959c4b9bd6f791061c460a22d9ee32ae2240</id>
<content type='text'>
Keep kernel flow stats for each NUMA node rather than each (logical)
CPU.  This avoids using the per-CPU allocator and removes most of the
kernel-side OVS locking overhead otherwise on the top of perf reports
and allows OVS to scale better with higher number of threads.

With 9 handlers and 4 revalidators netperf TCP_CRR test flow setup
rate doubles on a server with two hyper-threaded physical CPUs (16
logical cores each) compared to the current OVS master.  Tested with
non-trivial flow table with a TCP port match rule forcing all new
connections with unique port numbers to OVS userspace.  The IP
addresses are still wildcarded, so the kernel flows are not considered
as exact match 5-tuple flows.  This type of flows can be expected to
appear in large numbers as the result of more effective wildcarding
made possible by improvements in OVS userspace flow classifier.

Perf results for this test (master):

Events: 305K cycles
+   8.43%     ovs-vswitchd  [kernel.kallsyms]   [k] mutex_spin_on_owner
+   5.64%     ovs-vswitchd  [kernel.kallsyms]   [k] __ticket_spin_lock
+   4.75%     ovs-vswitchd  ovs-vswitchd        [.] find_match_wc
+   3.32%     ovs-vswitchd  libpthread-2.15.so  [.] pthread_mutex_lock
+   2.61%     ovs-vswitchd  [kernel.kallsyms]   [k] pcpu_alloc_area
+   2.19%     ovs-vswitchd  ovs-vswitchd        [.] flow_hash_in_minimask_range
+   2.03%          swapper  [kernel.kallsyms]   [k] intel_idle
+   1.84%     ovs-vswitchd  libpthread-2.15.so  [.] pthread_mutex_unlock
+   1.64%     ovs-vswitchd  ovs-vswitchd        [.] classifier_lookup
+   1.58%     ovs-vswitchd  libc-2.15.so        [.] 0x7f4e6
+   1.07%     ovs-vswitchd  [kernel.kallsyms]   [k] memset
+   1.03%          netperf  [kernel.kallsyms]   [k] __ticket_spin_lock
+   0.92%          swapper  [kernel.kallsyms]   [k] __ticket_spin_lock
...

And after this patch:

Events: 356K cycles
+   6.85%     ovs-vswitchd  ovs-vswitchd        [.] find_match_wc
+   4.63%     ovs-vswitchd  libpthread-2.15.so  [.] pthread_mutex_lock
+   3.06%     ovs-vswitchd  [kernel.kallsyms]   [k] __ticket_spin_lock
+   2.81%     ovs-vswitchd  ovs-vswitchd        [.] flow_hash_in_minimask_range
+   2.51%     ovs-vswitchd  libpthread-2.15.so  [.] pthread_mutex_unlock
+   2.27%     ovs-vswitchd  ovs-vswitchd        [.] classifier_lookup
+   1.84%     ovs-vswitchd  libc-2.15.so        [.] 0x15d30f
+   1.74%     ovs-vswitchd  [kernel.kallsyms]   [k] mutex_spin_on_owner
+   1.47%          swapper  [kernel.kallsyms]   [k] intel_idle
+   1.34%     ovs-vswitchd  ovs-vswitchd        [.] flow_hash_in_minimask
+   1.33%     ovs-vswitchd  ovs-vswitchd        [.] rule_actions_unref
+   1.16%     ovs-vswitchd  ovs-vswitchd        [.] hindex_node_with_hash
+   1.16%     ovs-vswitchd  ovs-vswitchd        [.] do_xlate_actions
+   1.09%     ovs-vswitchd  ovs-vswitchd        [.] ofproto_rule_ref
+   1.01%          netperf  [kernel.kallsyms]   [k] __ticket_spin_lock
...

There is a small increase in kernel spinlock overhead due to the same
spinlock being shared between multiple cores of the same physical CPU,
but that is barely visible in the netperf TCP_CRR test performance
(maybe ~1% performance drop, hard to tell exactly due to variance in
the test results), when testing for kernel module throughput (with no
userspace activity, handful of kernel flows).

On flow setup, a single stats instance is allocated (for the NUMA node
0).  As CPUs from multiple NUMA nodes start updating stats, new
NUMA-node specific stats instances are allocated.  This allocation on
the packet processing code path is made to never block or look for
emergency memory pools, minimizing the allocation latency.  If the
allocation fails, the existing preallocated stats instance is used.
Also, if only CPUs from one NUMA-node are updating the preallocated
stats instance, no additional stats instances are allocated.  This
eliminates the need to pre-allocate stats instances that will not be
used, also relieving the stats reader from the burden of reading stats
that are never used.

Signed-off-by: Jarno Rajahalme &lt;jrajahalme@nicira.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</content>
</entry>
<entry>
<title>openvswitch: Remove 5-tuple optimization.</title>
<updated>2014-05-16T20:40:29Z</updated>
<author>
<name>Jarno Rajahalme</name>
<email>jrajahalme@nicira.com</email>
</author>
<published>2014-03-27T19:35:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=23dabf88abb48a866fdb19ee08ebcf1ddd9b1840'/>
<id>urn:sha1:23dabf88abb48a866fdb19ee08ebcf1ddd9b1840</id>
<content type='text'>
The 5-tuple optimization becomes unnecessary with a later per-NUMA
node stats patch.  Remove it first to make the changes easier to
grasp.

Signed-off-by: Jarno Rajahalme &lt;jrajahalme@nicira.com&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</content>
</entry>
<entry>
<title>openvswitch: use const in some local vars and casts</title>
<updated>2014-05-16T20:40:28Z</updated>
<author>
<name>Daniele Di Proietto</name>
<email>daniele.di.proietto@gmail.com</email>
</author>
<published>2014-01-23T18:56:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7085130bab2f9c5b8d61bff73b01dc8195d0f974'/>
<id>urn:sha1:7085130bab2f9c5b8d61bff73b01dc8195d0f974</id>
<content type='text'>
In few functions, const formal parameters are assigned or cast to
non-const.
These changes suppress warnings if compiled with -Wcast-qual.

Signed-off-by: Daniele Di Proietto &lt;daniele.di.proietto@gmail.com&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</content>
</entry>
<entry>
<title>openvswitch: Fix ovs_flow_free() ovs-lock assert.</title>
<updated>2014-02-05T06:21:45Z</updated>
<author>
<name>Pravin B Shelar</name>
<email>pshelar@nicira.com</email>
</author>
<published>2014-01-31T17:43:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e4c6d7595403e943a3afc334eb8c0efcd840043a'/>
<id>urn:sha1:e4c6d7595403e943a3afc334eb8c0efcd840043a</id>
<content type='text'>
ovs_flow_free() is not called under ovs-lock during packet
execute path (ovs_packet_cmd_execute()). Since packet execute
does not touch flow-&gt;mask, there is no need to take that
lock either. So move assert in case where flow-&gt;mask is checked.

Found by code inspection.

Signed-off-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</content>
</entry>
</feed>
