<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/openvswitch/flow_table.c, branch v4.1</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=v4.1</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.1'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-02-08T08:51:14Z</updated>
<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://git.shady.money/linux/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://git.shady.money/linux/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://git.shady.money/linux/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://git.shady.money/linux/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://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>
</feed>
