<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/net/openvswitch/flow.c, branch v3.12.55</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v3.12.55</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v3.12.55'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2015-09-30T11:47:40+00:00</updated>
<entry>
<title>openvswitch: Zero flows on allocation.</title>
<updated>2015-09-30T11:47:40+00:00</updated>
<author>
<name>Jesse Gross</name>
<email>jesse@nicira.com</email>
</author>
<published>2015-09-22T03:21:20+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=3b27550cd346974eb3086a3932ea7bdf3c1a566b'/>
<id>urn:sha1:3b27550cd346974eb3086a3932ea7bdf3c1a566b</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: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>net: ovs: flow: fix potential illegal memory access in __parse_flow_nlattrs</title>
<updated>2013-09-11T20:09:58+00:00</updated>
<author>
<name>Daniel Borkmann</name>
<email>dborkman@redhat.com</email>
</author>
<published>2013-09-07T07:41:34+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=3bf4b5b11d381fed6a94a7e487e01c8b3bc436b9'/>
<id>urn:sha1:3bf4b5b11d381fed6a94a7e487e01c8b3bc436b9</id>
<content type='text'>
In function __parse_flow_nlattrs(), we check for condition
(type &gt; OVS_KEY_ATTR_MAX) and if true, print an error, but we do
not return from this function as in other checks. It seems this
has been forgotten, as otherwise, we could access beyond the
memory of ovs_key_lens, which is of ovs_key_lens[OVS_KEY_ATTR_MAX + 1].
Hence, a maliciously prepared nla_type from user space could access
beyond this upper limit.

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

Signed-off-by: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Andy Zhou &lt;azhou@nicira.com&gt;
Acked-by: Jesse Gross &lt;jesse@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>openvswitch: Fix alignment of struct sw_flow_key.</title>
<updated>2013-09-05T19:54:37+00:00</updated>
<author>
<name>Jesse Gross</name>
<email>jesse@nicira.com</email>
</author>
<published>2013-09-05T19:17:05+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=0d40f75bdab241868c0eb6f97aef9f8b3a66f7b3'/>
<id>urn:sha1:0d40f75bdab241868c0eb6f97aef9f8b3a66f7b3</id>
<content type='text'>
sw_flow_key alignment was declared as " __aligned(__alignof__(long))".
However, this breaks on the m68k architecture where long is 32 bit in
size but 16 bit aligned by default. This aligns to the size of a long to
ensure that we can always do comparsions in full long-sized chunks. It
also adds an additional build check to catch any reduction in alignment.

CC: Andy Zhou &lt;azhou@nicira.com&gt;
Reported-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Reported-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>openvswitch: optimize flow compare and mask functions</title>
<updated>2013-08-27T20:13:09+00:00</updated>
<author>
<name>Andy Zhou</name>
<email>azhou@nicira.com</email>
</author>
<published>2013-08-27T20:02:21+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=5828cd9a68873df1340b420371c02c47647878fb'/>
<id>urn:sha1:5828cd9a68873df1340b420371c02c47647878fb</id>
<content type='text'>
Make sure the sw_flow_key structure and valid mask boundaries are always
machine word aligned. Optimize the flow compare and mask operations
using machine word size operations. This patch improves throughput on
average by 15% when CPU is the bottleneck of forwarding packets.

This patch is inspired by ideas and code from a patch submitted by Peter
Klausler titled "replace memcmp() with specialized comparator".
However, The original patch only optimizes for architectures
support unaligned machine word access. This patch optimizes for all
architectures.

Signed-off-by: Andy Zhou &lt;azhou@nicira.com&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</content>
</entry>
<entry>
<title>openvswitch: Rename key_len to key_end</title>
<updated>2013-08-26T21:03:14+00:00</updated>
<author>
<name>Andy Zhou</name>
<email>azhou@nicira.com</email>
</author>
<published>2013-08-22T19:12:57+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=02237373b1c61a09a4db329545e39cffc48910d5'/>
<id>urn:sha1:02237373b1c61a09a4db329545e39cffc48910d5</id>
<content type='text'>
Key_end is a better name describing the ending boundary than key_len.
Rename those variables to make it less confusing.

Signed-off-by: Andy Zhou &lt;azhou@nicira.com&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</content>
</entry>
<entry>
<title>openvswitch: Add SCTP support</title>
<updated>2013-08-26T21:03:13+00:00</updated>
<author>
<name>Joe Stringer</name>
<email>joe@wand.net.nz</email>
</author>
<published>2013-08-22T19:30:48+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=a175a723301a8a4a9fedf9ce5b8ca586e7a97b40'/>
<id>urn:sha1:a175a723301a8a4a9fedf9ce5b8ca586e7a97b40</id>
<content type='text'>
This patch adds support for rewriting SCTP src,dst ports similar to the
functionality already available for TCP/UDP.

Rewriting SCTP ports is expensive due to double-recalculation of the
SCTP checksums; this is performed to ensure that packets traversing OVS
with invalid checksums will continue to the destination with any
checksum corruption intact.

Reviewed-by: Simon Horman &lt;horms@verge.net.au&gt;
Signed-off-by: Joe Stringer &lt;joe@wand.net.nz&gt;
Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</content>
</entry>
<entry>
<title>openvswitch: Mega flow implementation</title>
<updated>2013-08-23T23:43:07+00:00</updated>
<author>
<name>Andy Zhou</name>
<email>azhou@nicira.com</email>
</author>
<published>2013-08-08T03:01:00+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=03f0d916aa0317592dda11bd17c7357858719b6c'/>
<id>urn:sha1:03f0d916aa0317592dda11bd17c7357858719b6c</id>
<content type='text'>
Add wildcarded flow support in kernel datapath.

Wildcarded flow can improve OVS flow set up performance by avoid sending
matching new flows to the user space program. The exact performance boost
will largely dependent on wildcarded flow hit rate.

In case all new flows hits wildcard flows, the flow set up rate is
within 5% of that of linux bridge module.

Pravin has made significant contributions to this patch. Including API
clean ups and bug fixes.

Signed-off-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: Andy Zhou &lt;azhou@nicira.com&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</content>
</entry>
<entry>
<title>openvswitch: Use non rcu hlist_del() flow table entry.</title>
<updated>2013-08-23T23:38:00+00:00</updated>
<author>
<name>Pravin B Shelar</name>
<email>pshelar@nicira.com</email>
</author>
<published>2013-07-30T22:45:59+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=76a66c7e7f6bec35bbdb0ca91db327c7c56d8c45'/>
<id>urn:sha1:76a66c7e7f6bec35bbdb0ca91db327c7c56d8c45</id>
<content type='text'>
Flow table destroy is done in rcu call-back context.  Therefore
there is no need to use rcu variant of hlist_del().

Signed-off-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</content>
</entry>
<entry>
<title>openvswitch: Use correct type while allocating flex array.</title>
<updated>2013-08-14T22:48:17+00:00</updated>
<author>
<name>Pravin B Shelar</name>
<email>pshelar@nicira.com</email>
</author>
<published>2013-07-30T22:44:14+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=42415c90ceaf50c792e29823e359463bc6d4ee05'/>
<id>urn:sha1:42415c90ceaf50c792e29823e359463bc6d4ee05</id>
<content type='text'>
Flex array is used to allocate hash buckets which is type struct
hlist_head, but we use `struct hlist_head *` to calculate
array size.  Since hlist_head is of size pointer it works fine.

Following patch use correct type.

Signed-off-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</content>
</entry>
<entry>
<title>openvswitch: Optimize flow key match for non tunnel flows.</title>
<updated>2013-06-20T01:07:41+00:00</updated>
<author>
<name>Pravin B Shelar</name>
<email>pshelar@nicira.com</email>
</author>
<published>2013-06-18T00:50:28+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=a3e82996a8874c4cfe8c7f1be4d552018d8cba7e'/>
<id>urn:sha1:a3e82996a8874c4cfe8c7f1be4d552018d8cba7e</id>
<content type='text'>
Following patch adds start offset for sw_flow-key, so that we can
skip tunneling information in key for non-tunnel flows.

Signed-off-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Acked-by: Jesse Gross &lt;jesse@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
