<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/net/openvswitch/flow_table.c, branch linux-4.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.1.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.1.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2015-10-27T00:51:50Z</updated>
<entry>
<title>ovs: do not allocate memory from offline numa node</title>
<updated>2015-10-27T00:51:50Z</updated>
<author>
<name>Konstantin Khlebnikov</name>
<email>khlebnikov@yandex-team.ru</email>
</author>
<published>2015-10-02T10:18:22Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=bc845f677c04e09fa988ac95ce3f335df9d2ba0b'/>
<id>urn:sha1:bc845f677c04e09fa988ac95ce3f335df9d2ba0b</id>
<content type='text'>
[ Upstream commit 598c12d0ba6de9060f04999746eb1e015774044b ]

When openvswitch tries allocate memory from offline numa node 0:
stats = kmem_cache_alloc_node(flow_stats_cache, GFP_KERNEL | __GFP_ZERO, 0)
It catches VM_BUG_ON(nid &lt; 0 || nid &gt;= MAX_NUMNODES || !node_online(nid))
[ replaced with VM_WARN_ON(!node_online(nid)) recently ] in linux/gfp.h
This patch disables numa affinity in this case.

Signed-off-by: Konstantin Khlebnikov &lt;khlebnikov@yandex-team.ru&gt;
Acked-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>openvswitch: Zero flows on allocation.</title>
<updated>2015-10-03T11:49:16Z</updated>
<author>
<name>Jesse Gross</name>
<email>jesse@nicira.com</email>
</author>
<published>2015-09-22T03:21:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6d80e35071740489cf3b4d7a0d33bf732dd8ab75'/>
<id>urn:sha1:6d80e35071740489cf3b4d7a0d33bf732dd8ab75</id>
<content type='text'>
[ Upstream commit ae5f2fb1d51fa128a460bcfbe3c56d7ab8bf6a43 ]

When support for megaflows was introduced, OVS needed to start
installing flows with a mask applied to them. Since masking is an
expensive operation, OVS also had an optimization that would only
take the parts of the flow keys that were covered by a non-zero
mask. The values stored in the remaining pieces should not matter
because they are masked out.

While this works fine for the purposes of matching (which must always
look at the mask), serialization to netlink can be problematic. Since
the flow and the mask are serialized separately, the uninitialized
portions of the flow can be encoded with whatever values happen to be
present.

In terms of functionality, this has little effect since these fields
will be masked out by definition. However, it leaks kernel memory to
userspace, which is a potential security vulnerability. It is also
possible that other code paths could look at the masked key and get
uninitialized data, although this does not currently appear to be an
issue in practice.

This removes the mask optimization for flows that are being installed.
This was always intended to be the case as the mask optimizations were
really targetting per-packet flow operations.

Fixes: 03f0d916 ("openvswitch: Mega flow implementation")
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>openvswitch: Initialize unmasked key and uid len</title>
<updated>2015-02-08T08:51:14Z</updated>
<author>
<name>Pravin B Shelar</name>
<email>pshelar@nicira.com</email>
</author>
<published>2015-02-06T19:17:13Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ca539345f8767cca221b5aa77bf4329c725d0d7e'/>
<id>urn:sha1:ca539345f8767cca221b5aa77bf4329c725d0d7e</id>
<content type='text'>
Flow alloc needs to initialize unmasked key pointer. Otherwise
it can crash kernel trying to free random unmasked-key pointer.

general protection fault: 0000 [#1] SMP
3.19.0-rc6-net-next+ #457
Hardware name: Supermicro X7DWU/X7DWU, BIOS  1.1 04/30/2008
RIP: 0010:[&lt;ffffffff8111df0e&gt;] [&lt;ffffffff8111df0e&gt;] kfree+0xac/0x196
Call Trace:
 [&lt;ffffffffa060bd87&gt;] flow_free+0x21/0x59 [openvswitch]
 [&lt;ffffffffa060bde0&gt;] ovs_flow_free+0x21/0x23 [openvswitch]
 [&lt;ffffffffa0605b4a&gt;] ovs_packet_cmd_execute+0x2f3/0x35f [openvswitch]
 [&lt;ffffffffa0605995&gt;] ? ovs_packet_cmd_execute+0x13e/0x35f [openvswitch]
 [&lt;ffffffff811fe6fb&gt;] ? nla_parse+0x4f/0xec
 [&lt;ffffffff8139a2fc&gt;] genl_family_rcv_msg+0x26d/0x2c9
 [&lt;ffffffff8107620f&gt;] ? __lock_acquire+0x90e/0x9aa
 [&lt;ffffffff8139a3be&gt;] genl_rcv_msg+0x66/0x89
 [&lt;ffffffff8139a358&gt;] ? genl_family_rcv_msg+0x2c9/0x2c9
 [&lt;ffffffff81399591&gt;] netlink_rcv_skb+0x3e/0x95
 [&lt;ffffffff81399898&gt;] ? genl_rcv+0x18/0x37
 [&lt;ffffffff813998a7&gt;] genl_rcv+0x27/0x37
 [&lt;ffffffff81399033&gt;] netlink_unicast+0x103/0x191
 [&lt;ffffffff81399382&gt;] netlink_sendmsg+0x2c1/0x310
 [&lt;ffffffff811007ad&gt;] ? might_fault+0x50/0xa0
 [&lt;ffffffff8135c773&gt;] do_sock_sendmsg+0x5f/0x7a
 [&lt;ffffffff8135c799&gt;] sock_sendmsg+0xb/0xd
 [&lt;ffffffff8135cacf&gt;] ___sys_sendmsg+0x1a3/0x218
 [&lt;ffffffff8113e54b&gt;] ? get_close_on_exec+0x86/0x86
 [&lt;ffffffff8115a9d0&gt;] ? fsnotify+0x32c/0x348
 [&lt;ffffffff8115a720&gt;] ? fsnotify+0x7c/0x348
 [&lt;ffffffff8113e5f5&gt;] ? __fget+0xaa/0xbf
 [&lt;ffffffff8113e54b&gt;] ? get_close_on_exec+0x86/0x86
 [&lt;ffffffff8135cccd&gt;] __sys_sendmsg+0x3d/0x5e
 [&lt;ffffffff8135cd02&gt;] SyS_sendmsg+0x14/0x16
 [&lt;ffffffff81411852&gt;] system_call_fastpath+0x12/0x17

Fixes: 74ed7ab9264("openvswitch: Add support for unique flow IDs.")
CC: Joe Stringer &lt;joestringer@nicira.com&gt;
Reported-by: Or Gerlitz &lt;ogerlitz@mellanox.com&gt;
Signed-off-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Acked-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>openvswitch: Add support for unique flow IDs.</title>
<updated>2015-01-26T23:45:50Z</updated>
<author>
<name>Joe Stringer</name>
<email>joestringer@nicira.com</email>
</author>
<published>2015-01-22T00:42:52Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=74ed7ab9264c54471c7f057409d352052820d750'/>
<id>urn:sha1:74ed7ab9264c54471c7f057409d352052820d750</id>
<content type='text'>
Previously, flows were manipulated by userspace specifying a full,
unmasked flow key. This adds significant burden onto flow
serialization/deserialization, particularly when dumping flows.

This patch adds an alternative way to refer to flows using a
variable-length "unique flow identifier" (UFID). At flow setup time,
userspace may specify a UFID for a flow, which is stored with the flow
and inserted into a separate table for lookup, in addition to the
standard flow table. Flows created using a UFID must be fetched or
deleted using the UFID.

All flow dump operations may now be made more terse with OVS_UFID_F_*
flags. For example, the OVS_UFID_F_OMIT_KEY flag allows responses to
omit the flow key from a datapath operation if the flow has a
corresponding UFID. This significantly reduces the time spent assembling
and transacting netlink messages. With all OVS_UFID_F_OMIT_* flags
enabled, the datapath only returns the UFID and statistics for each flow
during flow dump, increasing ovs-vswitchd revalidator performance by 40%
or more.

Signed-off-by: Joe Stringer &lt;joestringer@nicira.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>openvswitch: Use sw_flow_key_range for key ranges.</title>
<updated>2015-01-26T23:45:50Z</updated>
<author>
<name>Joe Stringer</name>
<email>joestringer@nicira.com</email>
</author>
<published>2015-01-22T00:42:50Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=272c2cf84152eb7fba11407d1649c85eee243e21'/>
<id>urn:sha1:272c2cf84152eb7fba11407d1649c85eee243e21</id>
<content type='text'>
These minor tidyups make a future patch a little tidier.

Signed-off-by: Joe Stringer &lt;joestringer@nicira.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>openvswitch: Refactor ovs_flow_tbl_insert().</title>
<updated>2015-01-26T23:45:49Z</updated>
<author>
<name>Joe Stringer</name>
<email>joestringer@nicira.com</email>
</author>
<published>2015-01-22T00:42:49Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d29ab6f8a92eceb00d6085f028b6e05213faa72d'/>
<id>urn:sha1:d29ab6f8a92eceb00d6085f028b6e05213faa72d</id>
<content type='text'>
Rework so that ovs_flow_tbl_insert() calls flow_{key,mask}_insert().
This tidies up a future patch.

Signed-off-by: Joe Stringer &lt;joestringer@nicira.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<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://universe.0xinfinity.dev/distro/kernel/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://universe.0xinfinity.dev/distro/kernel/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://universe.0xinfinity.dev/distro/kernel/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://universe.0xinfinity.dev/distro/kernel/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>
</feed>
