sliver-openvswitch.git
10 years agoMerge commit '259e0b1ad1bfea762a76f0098deb8f8d8db1dfa3'
Giuseppe Lettieri [Thu, 15 Aug 2013 14:11:21 +0000 (16:11 +0200)]
Merge commit '259e0b1ad1bfea762a76f0098deb8f8d8db1dfa3'

10 years agonetdev-linux, netdev-bsd: Make access to AF_INET socket thread-safe.
Ben Pfaff [Sat, 10 Aug 2013 04:14:23 +0000 (21:14 -0700)]
netdev-linux, netdev-bsd: Make access to AF_INET socket thread-safe.

The only uses of 'af_inet_sock', in both drivers, were ioctls, so it seemed
like a good abstraction to write a function that just does such an ioctl,
and to factor out shared code into socket-util.

Signed-off-by: Ben Pfaff <blp@nicira.com>
CC: Ed Maste <emaste@freebsd.org>
10 years agonetdev-dummy: Use netdev_get_devices() instead of a local shash.
Ben Pfaff [Thu, 25 Jul 2013 23:11:52 +0000 (16:11 -0700)]
netdev-dummy: Use netdev_get_devices() instead of a local shash.

When an upcoming commit introduces thread safety into the netdev API, this
allows netdev-dummy to avoid adding more internal locking by taking
advantage of netdev_get_devices() refcounting.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Fix typo in flow validation logic.
Jesse Gross [Fri, 9 Aug 2013 22:27:27 +0000 (15:27 -0700)]
datapath: Fix typo in flow validation logic.

A bit shift operation is using the value '11' instead of '1' as the
starting value. This only makes validation weaker than it should be
so unless userspace is trying to install an invalid flow there will
be no effect.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
10 years agoovs-bugtool: Add config files to the debug bundle.
Gurucharan Shetty [Mon, 22 Jul 2013 19:17:08 +0000 (12:17 -0700)]
ovs-bugtool: Add config files to the debug bundle.

The previously defined config files were never included in
the debug bundle. This will include them.

Also increase the max size for CAP_NETWORK_CONFIG to 5 MB.
A pre-compressed size of 5 MB does not amount to much after
compression for config files.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-bugtool: Collect database through CAP_NETWORK_STATUS.
Gurucharan Shetty [Tue, 23 Jul 2013 21:53:11 +0000 (14:53 -0700)]
ovs-bugtool: Collect database through CAP_NETWORK_STATUS.

Currently the openvswitch database is being collected with
CAP_NETWORK_CONFIG which has a max size of 50 KB. This is
quite low as the database can easily be larger than 50 KB.

Move database collection to CAP_NETWORK_STATUS which does
not have a max size. If database size exceeds 10 MB, create
a compacted version of it and then collect it.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoCodingStyle: Add guide about using thread safety types and annotations.
Alex Wang [Thu, 8 Aug 2013 22:14:21 +0000 (15:14 -0700)]
CodingStyle: Add guide about using thread safety types and annotations.

This commit adds guide about using thread safety types and annotations
to CodingStyle file.

Signed-off-by: Alex Wang <alexw@nicira.com>
[blp@nicira.com edited the advice slightly]
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoclang: Pass objects, not their addresses, to thread-safety macros.
Alex Wang [Thu, 8 Aug 2013 22:14:20 +0000 (15:14 -0700)]
clang: Pass objects, not their addresses, to thread-safety macros.

This commit changes the code such that arguments to thread-safety
macros are not ampersanded.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoclang: Use OVS_REQUIRES() instead of OVS_REQ_WRLOCK() for plain mutex.
Alex Wang [Thu, 8 Aug 2013 22:14:19 +0000 (15:14 -0700)]
clang: Use OVS_REQUIRES() instead of OVS_REQ_WRLOCK() for plain mutex.

This commit changes the code to use OVS_REQUIRES() instead of
OVS_REQ_WRLOCK(), for plain mutex.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-xlate: Avoid MAC learning write lock on fast path.
Ben Pfaff [Wed, 7 Aug 2013 03:35:29 +0000 (20:35 -0700)]
ofproto-dpif-xlate: Avoid MAC learning write lock on fast path.

Most of the trips through update_learning_table() do not actually change
the MAC learning table, but because some do the code there took the
MAC learning table's write lock.  This commit changes the common case to
take only the read lock, falling back to the write lock if a change was
actually necessary.

Ethan reported that this gave a 3.3x performance improvement in one test
case due to reduced lock contention.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoclassifier: Make use of the classifier thread safe.
Ethan Jackson [Thu, 11 Jul 2013 21:19:11 +0000 (14:19 -0700)]
classifier: Make use of the classifier thread safe.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agocompiler: Add OVS_ACQ_BEFORE, OVS_ACQ_AFTER macros.
Ben Pfaff [Fri, 9 Aug 2013 18:18:34 +0000 (11:18 -0700)]
compiler: Add OVS_ACQ_BEFORE, OVS_ACQ_AFTER macros.

An upcoming patch will add the first uses.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Add 'ovs_' prefix to extern symbols.
Jesse Gross [Thu, 8 Aug 2013 02:47:59 +0000 (19:47 -0700)]
datapath: Add 'ovs_' prefix to extern symbols.

The external symbols in the OVS kernel module are prefixed with
'ovs_' with the exception of ipv4_tun_to/from_nlattr(). This adds
the prefix and makes the out of tree version consistent with
upstream.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agoofproto-dpif-xlate: Require a lock for reconfiguration.
Ethan Jackson [Sun, 21 Jul 2013 18:31:32 +0000 (11:31 -0700)]
ofproto-dpif-xlate: Require a lock for reconfiguration.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-thread: Remove superfluous semicolons in macro definitions.
Ben Pfaff [Thu, 8 Aug 2013 22:53:28 +0000 (15:53 -0700)]
ovs-thread: Remove superfluous semicolons in macro definitions.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: Hide rule_dpif_miss_rule().
Ethan Jackson [Fri, 26 Jul 2013 00:20:53 +0000 (17:20 -0700)]
ofproto-dpif: Hide rule_dpif_miss_rule().

It's simpler to hide it than to make it thread safe and ensure it
stays that way in the long term.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Lock the expirable list.
Ethan Jackson [Thu, 8 Aug 2013 00:41:17 +0000 (17:41 -0700)]
ofproto-dpif: Lock the expirable list.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Lock hard_timeout and idle_timeout of struct rule.
Ethan Jackson [Wed, 7 Aug 2013 20:06:49 +0000 (13:06 -0700)]
ofproto: Lock hard_timeout and idle_timeout of struct rule.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-thread: New function xpthread_join().
Ethan Jackson [Tue, 6 Aug 2013 23:47:43 +0000 (16:47 -0700)]
ovs-thread: New function xpthread_join().

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-xlate: Fix rare segfault on switch exit.
Ethan Jackson [Thu, 8 Aug 2013 18:08:03 +0000 (11:08 -0700)]
ofproto-dpif-xlate: Fix rare segfault on switch exit.

Not all 'xport's have 'xbundle's, so this dereference is unsafe.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-thread: New function ovsthread_id_self().
Ben Pfaff [Tue, 6 Aug 2013 21:57:19 +0000 (14:57 -0700)]
ovs-thread: New function ovsthread_id_self().

I foresee a need for possibly large numbers of instances of "struct
seq" (which is introduced in an upcoming patch).  Each struct seq
needs some per-thread data.  POSIX has pthread_key_t for this, but
the number of keys can be fairly limited, to as few as 128.  It is
reasonable to work around this by using a hash table indexed on the
current thread.  That only works if one can get a thread identifier
that is hashable (pthread_t is not).  This patch introduces a
hashable thread identifier.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-thread: Add support for globally visible per-thread data.
Ben Pfaff [Tue, 6 Aug 2013 21:40:25 +0000 (14:40 -0700)]
ovs-thread: Add support for globally visible per-thread data.

DEFINE_PER_THREAD_DATA always declared its data item as "static", meaning
that it was only directly visible within a single translation unit.
This commit adds additional forms of per-thread data that allow the data
to be accessible from multiple translation units.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-thread: New function xpthread_setspecific().
Ben Pfaff [Tue, 6 Aug 2013 21:30:01 +0000 (14:30 -0700)]
ovs-thread: New function xpthread_setspecific().

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Make packet_ins thread safe.
Ethan Jackson [Sat, 3 Aug 2013 17:04:57 +0000 (10:04 -0700)]
ofproto-dpif: Make packet_ins thread safe.

This patch makes packet_ins thread safe by handing responsibility for
them to ofproto-dpif.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoMerge branch 'master' of git://openvswitch.org/openvswitch
Giuseppe Lettieri [Thu, 8 Aug 2013 14:42:27 +0000 (16:42 +0200)]
Merge branch 'master' of git://openvswitch.org/openvswitch

10 years agonetdev: Make netdev_from_name() take a reference to its returned netdev.
Ben Pfaff [Fri, 26 Jul 2013 00:05:46 +0000 (17:05 -0700)]
netdev: Make netdev_from_name() take a reference to its returned netdev.

This API change is necessary for thread safety, to be added in an upcoming
commit.  Otherwise, the client would not be able to safely use the returned
netdev because it could already have been destroyed.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agonetdev: Make netdev_get_devices() take a reference to each netdev.
Ben Pfaff [Thu, 25 Jul 2013 23:27:39 +0000 (16:27 -0700)]
netdev: Make netdev_get_devices() take a reference to each netdev.

This API change is necessary for thread safety, to be added in an upcoming
commit.  Otherwise, the client would not be able to actually use any of
the returned netdevs because they could already have been destroyed.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agonetdev-provider: Remove unused function netdev_assert_class().
Ben Pfaff [Sat, 27 Jul 2013 00:16:08 +0000 (17:16 -0700)]
netdev-provider: Remove unused function netdev_assert_class().

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agonetdev-bsd: Use xmemdup0() to simplify netdev_bsd_get_next_hop().
Ben Pfaff [Thu, 25 Jul 2013 22:38:29 +0000 (15:38 -0700)]
netdev-bsd: Use xmemdup0() to simplify netdev_bsd_get_next_hop().

Signed-off-by: Ben Pfaff <blp@nicira.com>
CC: Ed Maste <emaste@freebsd.org>
CC: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
10 years agonetdev-linux: Move variable declaration inward in netdev_linux_cache_cb().
Ben Pfaff [Fri, 26 Jul 2013 19:42:02 +0000 (12:42 -0700)]
netdev-linux: Move variable declaration inward in netdev_linux_cache_cb().

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agonetdev-linux: Remove useless member 'peer', which was always zero.
Ben Pfaff [Wed, 24 Jul 2013 17:44:42 +0000 (10:44 -0700)]
netdev-linux: Remove useless member 'peer', which was always zero.

Always, correct a comment on netdev_linux_get_features().

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agonetdev-linux: Remove unused struct netdev_linux member.
Ben Pfaff [Wed, 24 Jul 2013 17:37:37 +0000 (10:37 -0700)]
netdev-linux: Remove unused struct netdev_linux member.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agonetdev-linux: Remove pointless layers of indirection for tap devices.
Ben Pfaff [Fri, 26 Jul 2013 00:04:30 +0000 (17:04 -0700)]
netdev-linux: Remove pointless layers of indirection for tap devices.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agonetdev-linux: Remove unneeded struct forward declarations from header.
Ben Pfaff [Fri, 26 Jul 2013 18:20:09 +0000 (11:20 -0700)]
netdev-linux: Remove unneeded struct forward declarations from header.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agonetdev-vport: Use ovs_mutex rather than a raw pthread_mutex_t.
Ben Pfaff [Wed, 31 Jul 2013 21:15:05 +0000 (14:15 -0700)]
netdev-vport: Use ovs_mutex rather than a raw pthread_mutex_t.

I'd forgotten even to use the xpthread variants here.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agonetdev-bsd: Don't assume 'struct netdev' has offset 0.
Ben Pfaff [Fri, 2 Aug 2013 19:19:49 +0000 (12:19 -0700)]
netdev-bsd: Don't assume 'struct netdev' has offset 0.

The data items returned by netdev_get_devices() are "struct netdev *"s.
The code fixed up by this commit used them as "struct netdev_bsd *",
which happens to work because struct netdev happens to be at offset 0 in
each struct but it's better to do a proper cast in case someday
struct netdev gets moved to a nonzero offset.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agonetdev-bsd: Correctly handle IPv4 netmasks.
Ben Pfaff [Wed, 31 Jul 2013 22:22:12 +0000 (15:22 -0700)]
netdev-bsd: Correctly handle IPv4 netmasks.

netdev_bsd_get_in4() did not set anything in its 'netmask' output argument
if the IPv4 address was cached, leaving it indeterminate.  It would also
mark the cache as valid even if there was an error retrieving the netmask.
This fixes both problems.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
CC: Ed Maste <emaste@freebsd.org>
10 years agonetdev-bsd: Fix fd leak on error path.
Ben Pfaff [Thu, 25 Jul 2013 21:41:12 +0000 (14:41 -0700)]
netdev-bsd: Fix fd leak on error path.

Signed-off-by: Ben Pfaff <blp@nicira.com>
CC: Ed Maste <emaste@freebsd.org>
10 years agonetdev-bsd: Fix typo in label name.
Ben Pfaff [Thu, 25 Jul 2013 21:14:09 +0000 (14:14 -0700)]
netdev-bsd: Fix typo in label name.

Signed-off-by: Ben Pfaff <blp@nicira.com>
CC: Ed Maste <emaste@freebsd.org>
10 years agonetdev-bsd: Fix memory leak on error path.
Ben Pfaff [Thu, 25 Jul 2013 21:03:32 +0000 (14:03 -0700)]
netdev-bsd: Fix memory leak on error path.

Signed-off-by: Ben Pfaff <blp@nicira.com>
CC: Ed Maste <emaste@freebsd.org>
10 years agobfd: Fix build on netbsd-6.
YAMAMOTO Takashi [Thu, 8 Aug 2013 00:33:24 +0000 (09:33 +0900)]
bfd: Fix build on netbsd-6.

ip.h requires in_systm.h here.

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoUpdate OPENFLOW-1.1+ to differentiate optional and required features
Simon Horman [Wed, 7 Aug 2013 00:28:00 +0000 (09:28 +0900)]
Update OPENFLOW-1.1+ to differentiate optional and required features

The purpose of this patch is primarily to provide details on which
unimplemented features are optional and which are required as this
may be of interest to those working on OpenFlow 1.1+ coverage.

This patch also:
* Clarifies the text of some entries which seemed difficult to understand
  for the authors of this patch.
* Adds entries for features that were missing from the existing list.
  N.B: It is entirely possible that there are still missing entries.
* Expands some entries into sub-entries where some portions of
  a feature are required and others are optional

Co-authored-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-ofctl: Add "ofp-parse" command for printing OpenFlow from a file.
Ben Pfaff [Tue, 6 Aug 2013 16:45:07 +0000 (09:45 -0700)]
ovs-ofctl: Add "ofp-parse" command for printing OpenFlow from a file.

Test provided by Alex Wang <alexw@nicira.com>.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoodp-util: Always export the priority and skb_mark netlink attributes.
Andy Zhou [Sat, 3 Aug 2013 19:23:15 +0000 (12:23 -0700)]
odp-util: Always export the priority and skb_mark netlink attributes.

The current Netlink protocol allows a default value of zero if either mark
or priority is not specified (this is part of the ABI).  Until now, when
userspace serializes either the value or mask, it looked at the value and
omitted the netlink attribute if it is zero.  This is a bug because an
exact match on zero turns into a wildcard of the field.

These two fields (plus input port and EtherType) are special because they
can be omitted whereas most other values are required to be fully
specified.  These protocol variations tend to cause bugs (as above) when we
evolve the protocol because an exception that makes sense in one context
might not be logical in another.  Since the default value for mark and
priority are merely shorthands, we can push the protocol in a more
consistent direction by ignoring the shortcut and always serializing the
values.  This is what this commits does.

Signed-off-by: Andy Zhou <azhou@nicira.com>
[blp@nicira.com added Jesse's text to the commit message]
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agocfm: update remote opstate only when a CCM is received.
Paul Ingram [Sat, 3 Aug 2013 07:12:36 +0000 (07:12 +0000)]
cfm: update remote opstate only when a CCM is received.

The remote opstate for a CFM interface is presumed to be up unless a CCM is
received which signals opstate down. This means than an interface configured
for CFM demand mode may incorrectly appear to be opstate up if it has not
received a CCM within the last fault interval.

We should remember the last remote opstate for a CFM interface and only
change it when a CCM arrives signaling a change.

Bug #18806
Signed-off-by: Paul Ingram <pingram@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agobfd: Optimize BFD for Megaflows.
Gurucharan Shetty [Sat, 3 Aug 2013 13:46:26 +0000 (13:46 +0000)]
bfd: Optimize BFD for Megaflows.

The current situation is that whenever any packet enters the
userspace, bfd_should_process_flow() looks at the UDP destination
port to figure out whether that is a BFD packet. This means that
UDP destination port cannot be wildcarded for all the other flows
too.

To optimize BFD for megaflows, we introduce a new
'bfd:bfd_dst_mac' field in the database. Whenever this field is set
by a controller, it is assumed that all the BFD packets to/from
this interface will have the destination mac address set as the one
specified in the bfd:bfd_dst_mac field. If this field is set, we
first look at the destination mac address of a packet and if it
does not match the mac address set in bfd:bfd_dst_mac, we do not
process that packet as bfd. If the field does match, we go ahead
and look at the UDP destination port too.

Also, change the default BFD destination mac address to
"00:23:20:00:00:01".

Feature #18850.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoBFD: Populate ToS field in BFD packets.
Pavithra Ramesh [Sat, 20 Jul 2013 07:17:47 +0000 (07:17 +0000)]
BFD: Populate ToS field in BFD packets.

Signed-off-by: Pavithra Ramesh <paramesh@vmware.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoBFD: Edit the unit test time/stop command
Pavithra Ramesh [Thu, 1 Aug 2013 09:55:22 +0000 (09:55 +0000)]
BFD: Edit the unit test time/stop command

Run the ovs-appctl time/stop command after OVS_VSWITCHD_START.
Also increase the wait time before checking if BFD session is up in
test 4.

Signed-off-by: Pavithra Ramesh <paramesh@vmware.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif-xlate: Take responsibility for ofproto_receive().
Ethan Jackson [Fri, 2 Aug 2013 19:43:03 +0000 (12:43 -0700)]
ofproto-dpif-xlate: Take responsibility for ofproto_receive().

ofproto_receive() is a slightly odd function which doesn't fit
perfectly in either ofproto-dpif or ofproto-dpif-xlate.  However, it's
much easier to reason about its thread safety in ofproto-dpif-xlate,
so this patch moves it there and renames it xlate_receive().

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-xlate: Cleanup lookup functions.
Ethan Jackson [Sat, 3 Aug 2013 02:31:02 +0000 (19:31 -0700)]
ofproto-dpif-xlate: Cleanup lookup functions.

This patch allows the lookup functions to take NULL as an argument as
a convenience.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Make vlan splinters thread safe.
Ethan Jackson [Fri, 26 Jul 2013 00:42:24 +0000 (17:42 -0700)]
ofproto-dpif: Make vlan splinters thread safe.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Guard rule statistics with a mutex.
Ethan Jackson [Sat, 3 Aug 2013 20:13:26 +0000 (13:13 -0700)]
ofproto-dpif: Guard rule statistics with a mutex.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-xlate: Maintain a pointer to struct dpif.
Ethan Jackson [Sat, 6 Jul 2013 18:46:48 +0000 (11:46 -0700)]
ofproto-dpif-xlate: Maintain a pointer to struct dpif.

This allows us to move some minor functionality from ofproto-dpif to
ofproto-dpif-xlate, where it's easier to ensure it's thread safe.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoodp-util: add verbose mode for displaying dp flow.
Andy Zhou [Sat, 3 Aug 2013 19:23:14 +0000 (12:23 -0700)]
odp-util: add verbose mode for displaying dp flow.

When verbose mode tuned on, all dp flow fields described by the netlink
attributes are displayed, including fully wildcarded attributes.
Otherwise, the fully wildcarded attributes are omitted for brevity.

Added -m option to "ovs-dpctl dump-flows" to enable verbose mode. It is
off by default.

Signed-off-by: Andy Zhou <azhou@nicira.com>
[blp@nicira.com added documentation]
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-xlate: Don't trace on deep resubmit.
Ethan Jackson [Fri, 2 Aug 2013 03:52:01 +0000 (20:52 -0700)]
ofproto-dpif-xlate: Don't trace on deep resubmit.

While this code is useful for debugging, removing it allows us to hide
ofproto_trace() in ofproto-dpif. ofproto_trace() is a complex function
which could be difficult to make "obviously" thread safe.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-xlate: Refactor stp_get_port() calls.
Ethan Jackson [Fri, 2 Aug 2013 21:55:31 +0000 (14:55 -0700)]
ofproto-dpif-xlate: Refactor stp_get_port() calls.

I had intended to fold this into a previous patch.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: avoid losing track of kernel flows upon reinstallation
Andy Zhou [Sat, 3 Aug 2013 03:22:17 +0000 (20:22 -0700)]
ofproto-dpif: avoid losing track of kernel flows upon reinstallation

This commit fixes a problem whereby userspace can lose track of a
flow installed in the kernel, instead believing that the flow is
not installed.  The most visible consequence of this bug was a
message in the ovs-vswitchd log warning about an unexpected flow
in the kernel.  Other possible consequences included loss of
statistics and failure to updates actions when the OpenFlow flow
table changed.

The problem arose in the following scenario.  Suppose userspace
sets up a kernel flow due to an arriving packet.  Before kernel
flow setup completes, another packet for that flow arrives.  The
kernel sends the new packet to userspace after userspace has
completed processing the batch of packets that set up the flow.
Userspace then attempts to reinstall the kernel flow.  This fails
with EEXIST, so userspace then marked the flow as not-installed,
even though it was successfully installed before and remains
installed.  The next time userspace dumped the kernel flow
table to gather statistics, it would complain about an unexpected
flow and delete it.

In practice, we have seen these messages with netperf TCP_CRR tests and
UDP stream tests.

This patch fixes the problem by changing userspace so that, once
it successfully installs a flow in the kernel, it will not reinstall
it when it sees another packet for the flow in userspace.  This
has the downside that, if something goes wrong and a flow
disappears from the kernel (e.g. ovs-dpctl del-flows), then userspace
won't reinstall it (until it tries to delete it).  (This is in fact
the reason why until now userspace reinstalled flows it knew it
already installed.)

Some more background may be warranted.  There are two EEXIST error
cases:

       1. A subfacet was installed successfully in a previous (recent)
          batch.  Now we've attempted to reinstall exactly the same
          subfacet in this batch.

       2. A subfacet was installed successfully in a previous (recent)
          batch or earlier in the current batch.  We've attempted to
          install a subfacet for an overlapping megaflow.

Before megaflows, installation errors were ignored completely.
Since megaflows were introduced, they have been handled by
considering on any installation error that the given subfacet is
not installed.  This works well for case #2 but causes case #1 to
yield unexpected flows, as described at the top of the commit
message.

This commit adds the wrinkle that we never try to reinstall
exactly the same subfacet that we know we installed successfully
earlier (and haven't deleted) unless its actions change.  This
ought to work just as well for case #2, and avoids the problem
with case #1.

Prepared with assistance from Ethan.

Signed-off-by: Andy Zhou <azhou@nicira.com>
[blp@nicira.com rewrote the commit message]
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Always un-wildcard fields that are being set.
Justin Pettit [Sat, 3 Aug 2013 04:17:31 +0000 (21:17 -0700)]
ofproto-dpif: Always un-wildcard fields that are being set.

The ODP library has an optimization to not set a header if the field was
not changed, regardless of whether an action to set the field was
present.  That library is also responsible for un-wildcarding fields
that are bieng modified.  This leads to a problem where a packet matches
a flow that updates a field, but that particular packet's field already
has that value.  As such, an overly loose megaflow will be generated
that doesn't match on that field and the actions won't update it.  A
second packet that should have the field set will match that flow and
will not be modified.

This commit changes the behavior to always un-wildcard fields that are
being modified.  Since the ODP library updates the entire header if a
field in it is modified, and all those fields will be un-wildcarded, the
generated flows may be different.  However, they should be correct.

Bug #18946.

Reported-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoasync-append: Refactor to avoid requiring enabling while single threaded.
Ben Pfaff [Sat, 3 Aug 2013 00:32:25 +0000 (17:32 -0700)]
async-append: Refactor to avoid requiring enabling while single threaded.

Until now, the async append interface has required async_append_enable()
to be called while the process was still single-threaded, with the
rationale being that async_append_enable() could race with
async_append_write() on some existing async_append object.  This was a
difficult problem when the async append interface was introduced, because
at the time Open vSwitch did not have any infrastructure for inter-thread
synchronization.

Now it is easy to solve, by introducing synchronization into the
async append module.  However, that's more or less wasted, because the
client is already required to serialize access to async append objects.
Moreover, vlog, the only existing client, needs to serialize access for
other reasons, so it wouldn't even be possible to just drop the client's
synchronization.

This commit therefore takes another approach.  It drops the
async_append_enable() interface entirely.  Now any existing async_append
object is always enabled.  The responsibility for "enabling", then, now
rests in whether the client creates and uses an async_append object, and
so vlog now takes care of that by itself.  Also, since vlog now has to
deal with sometimes having an async_append and sometimes not having one,
we might as well allow creating an async_append to fail, thereby slightly
simplifying the "no async I/O" implementation from "write synchronously"
to "always fail creating an async_append".

Reported-by: Shih-Hao Li <shihli@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Handle learn action flow mods asynchronously.
Ethan Jackson [Fri, 12 Jul 2013 00:17:00 +0000 (17:17 -0700)]
ofproto-dpif: Handle learn action flow mods asynchronously.

Once we have multiple threads running, having each execute flow mods
created by the learn action won't be tenable.  It essentially will
require us to make the core ofproto module thread safe, which is not
the direction we want to go.  This patch punts on the problem by
handing flow mods to ofproto-dpif to handle later.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-xlate: Take control of the qdscp map.
Ethan Jackson [Sat, 6 Jul 2013 17:25:06 +0000 (10:25 -0700)]
ofproto-dpif-xlate: Take control of the qdscp map.

This will make locking easier in future patches.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-xlate: Pull STP xlation into ofproto-dpif-xlate.
Ethan Jackson [Sat, 6 Jul 2013 16:31:35 +0000 (09:31 -0700)]
ofproto-dpif-xlate: Pull STP xlation into ofproto-dpif-xlate.

This patch pulls the STP xlation code into ofproto-dpif-xlate where it
will be easier to guard.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agotag: Retire the venerable tag library.
Ethan Jackson [Fri, 2 Aug 2013 00:07:08 +0000 (17:07 -0700)]
tag: Retire the venerable tag library.

This patch retires a venerable library whose inception dates before
the first patch of the current repository: tags.  They have served us
well, but their time has come for the reasons listed below.

1) They don't actually help much.
In theory, tags had been used to reduce revalidation necessary when
using bonds, mac-learning, and frequently changing flow tables.  With
bonds and mac-learning, things change happen so rarely that tagging
isn't worth it.  That leaves flow table changes. With the complex flow
tables in my testing, the revalidate_set gets so overwhelmed with
tags, that we end up revalidating every facet every time through the
run loop.  In other words, they tags are giving us no benefit.

2) They complicate the code.
This patch simplifies the code and removes a couple of rather ugly
kludges.

3) They complicated locking once threading hits.
Because of the calculate_flow_tag() function, the table_dpif structure
would require locking in a multi-threaded OVS.  Though this problem
isn't insurmountable, it's annoying and probably would cause lock
contention.

Of course, we could try to work around these problems with a more
advanced tagging infrastructure, but this moves in the opposite of the
direction we should be.  Ideally we'll have a more-or-less stateless
ofproto-dpif supporting a massive number of datapath flows.  Tags (or
facets for that matter) aren't going to work in this new world.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agobond: Stop using tags.
Ethan Jackson [Fri, 2 Aug 2013 01:23:13 +0000 (18:23 -0700)]
bond: Stop using tags.

This patch transitions bonding away from using tags as required by
future patches.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agomac-learning: Stop using tags.
Ethan Jackson [Fri, 2 Aug 2013 01:04:07 +0000 (18:04 -0700)]
mac-learning: Stop using tags.

This patch transitions mac learning away from using tags as required
by future patches.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agonetdev: Minor formatting improvements.
Ben Pfaff [Wed, 24 Jul 2013 21:20:43 +0000 (14:20 -0700)]
netdev: Minor formatting improvements.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agonetdev-linux: Don't assume 'struct netdev' has offset 0.
Ben Pfaff [Fri, 2 Aug 2013 19:19:49 +0000 (12:19 -0700)]
netdev-linux: Don't assume 'struct netdev' has offset 0.

The data items returned by netdev_get_devices() are "struct netdev *"s.
The code fixed up by this commit used them as "struct netdev_linux *",
which happens to work because struct netdev happens to be at offset 0 in
each struct but it's better to do a proper cast in case someday
struct netdev gets moved to a nonzero offset.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agonetdev-dummy: Fix memory leak on error path in netdev_rx_dummy_recv().
Ben Pfaff [Tue, 30 Jul 2013 19:26:08 +0000 (12:26 -0700)]
netdev-dummy: Fix memory leak on error path in netdev_rx_dummy_recv().

This code failed to free the packet if it was too big for the caller.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agonetdev-linux: Initialize change_seq for tap devices too.
Ben Pfaff [Fri, 26 Jul 2013 23:27:19 +0000 (16:27 -0700)]
netdev-linux: Initialize change_seq for tap devices too.

change_seq is supposed to always be nonzero but tap devices got this wrong.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agonetdev-linux: Fix fd leak on error path.
Ben Pfaff [Fri, 26 Jul 2013 00:03:03 +0000 (17:03 -0700)]
netdev-linux: Fix fd leak on error path.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodpif-linux: Fix theoretical memory leak on error path.
Ben Pfaff [Thu, 1 Aug 2013 21:07:35 +0000 (14:07 -0700)]
dpif-linux: Fix theoretical memory leak on error path.

If a notification is bigger than 4 kB (I doubt it one would be), then the
lack of ofpbuf_uninit() would cause a memory leak.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoodp-util: Always serialize tunnel mask attributes.
Jesse Gross [Thu, 1 Aug 2013 23:17:47 +0000 (16:17 -0700)]
odp-util: Always serialize tunnel mask attributes.

A tunnel value attribute is not allowed to have an empty IP destination
address but this is legal for masks. This drops both the checks for
serializing masks and also the sanity checks on them.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agodatapath: Introduce is_mask when serializing netlink attributes.
Jesse Gross [Thu, 1 Aug 2013 23:17:46 +0000 (16:17 -0700)]
datapath: Introduce is_mask when serializing netlink attributes.

The intention is clearer than if we rederive it in every location.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agoofproto-dpif-xlate: Unmask mark when used for tunnels.
Jesse Gross [Thu, 1 Aug 2013 20:31:28 +0000 (13:31 -0700)]
ofproto-dpif-xlate: Unmask mark when used for tunnels.

The tunnel lookup uses the skb_mark as part of the port find process
but it isn't unmasked along with the other fields. This adds it to
the list of significant fields.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agoofproto-dpif: Hide rule_calculate_tag().
Ethan Jackson [Thu, 1 Aug 2013 23:05:11 +0000 (16:05 -0700)]
ofproto-dpif: Hide rule_calculate_tag().

No one uses it except ofproto-dpif.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoINSTALL, CodingStyle: Recognize that Clang is an acceptable compiler.
Ben Pfaff [Thu, 1 Aug 2013 22:27:52 +0000 (15:27 -0700)]
INSTALL, CodingStyle: Recognize that Clang is an acceptable compiler.

Clang has nice static analysis and works well as an Open vSwitch compiler,
so mention it more explicitly.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif-xlate: Don't try to optimize goto table.
Ethan Jackson [Sat, 27 Jul 2013 19:24:15 +0000 (12:24 -0700)]
ofproto-dpif-xlate: Don't try to optimize goto table.

This patch reverts commit 5559942 (ofproto-dpif: GOTO_TABLE recursion
removal.) by reintroducing the recursion through xlate_table_action().
The main reason to do this is the introduction of new rule locking in
future patches.  The code before this patch was relatively difficult
to lock in a clean straight-forward manner.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agodatapath: Accept any 802.2 eth_type mask but override to be exact match
Andy Zhou [Thu, 1 Aug 2013 17:49:46 +0000 (10:49 -0700)]
datapath: Accept any 802.2 eth_type mask but override to be exact match

When key.eth_type is absent it is interpreted to be 802.2, which is
represented by a special value. In order to prevent inadvertant matches
on this opaque value, the mask is forced to be either fully wildcarded
or fully exact.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: Accept any in_port mask but override to be exact match
Andy Zhou [Thu, 1 Aug 2013 17:49:45 +0000 (10:49 -0700)]
datapath: Accept any in_port mask but override to be exact match

Pre mega flow, netlink allows the in_port key attribute
to be missing. Missing in_port is interpreted as DP_MAX_PORTS.

For backward compatibility, mega flow implementation will always allow
the mask of in_port to be specified, as if the in_port key attribute
is always specified.

To prevent accidental match of the DP_MAX_PORTS, which value is opaque to
the user space, we will always force the mask to be exact match,
regardless of the value supplied by the netline message. Missing
in_port mask continue to mean wildcarded match, same as other masks.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agomac-learning: Make the mac-learning module thread safe.
Ethan Jackson [Mon, 22 Jul 2013 18:11:54 +0000 (11:11 -0700)]
mac-learning: Make the mac-learning module thread safe.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agobond: Make the bond module thread safe.
Ethan Jackson [Tue, 23 Jul 2013 01:17:23 +0000 (18:17 -0700)]
bond: Make the bond module thread safe.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agobfd: Make the BFD module thread safe.
Ethan Jackson [Fri, 26 Jul 2013 23:18:00 +0000 (16:18 -0700)]
bfd: Make the BFD module thread safe.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agocfm: Make the CFM module thread safe.
Ethan Jackson [Tue, 23 Jul 2013 20:09:38 +0000 (13:09 -0700)]
cfm: Make the CFM module thread safe.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agostp: Make the STP module thread safe.
Ethan Jackson [Sat, 6 Jul 2013 16:34:34 +0000 (09:34 -0700)]
stp: Make the STP module thread safe.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoconfigure: Distinguish glibc and NetBSD pthread_setname_np() variants.
Ben Pfaff [Thu, 1 Aug 2013 16:35:56 +0000 (09:35 -0700)]
configure: Distinguish glibc and NetBSD pthread_setname_np() variants.

Reported-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Tested-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Always allow tunnel mask to be specified in the netlink
Andy Zhou [Thu, 1 Aug 2013 03:39:49 +0000 (20:39 -0700)]
datapath: Always allow tunnel mask to be specified in the netlink

Netlink message usually only accpets a mask when there is a
corresponding key attribute. Tunnel mask and eth_type are the
only two expections so far.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agoovs-atomic-pthreads: Fix "has incomplete type" error.
Alex Wang [Wed, 31 Jul 2013 23:09:11 +0000 (16:09 -0700)]
ovs-atomic-pthreads: Fix "has incomplete type" error.

Commit 97be153858b4cd175cbe7862b8e1624bf22ab98a (clang: Add
annotations for thread safety check.) defined 'struct ovs_mutex'
variable in 'atomic_flag' in 'ovs-atomic-pthreads.h'. This
casued "mutex: has incomplete type" error in compilation when
'ovs-atomic-pthreads.h' is included.

This commit goes back to use 'pthread_mutex_t' for that variable
and adds test for the 'atomic_flag' related functions.

Reported-by: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoodp-util: fix bug in setting ipv4 frag flag mask
Andy Zhou [Wed, 31 Jul 2013 20:54:12 +0000 (13:54 -0700)]
odp-util: fix bug in setting ipv4 frag flag mask

This bug causes the flag mask to always mask only 1 bit, not the 2 bits
possible. While at it, make the top 6 bits exact match.

Bug #18834.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: Support for Linux kernel 3.9.
Kyle Mestery [Wed, 31 Jul 2013 21:18:19 +0000 (17:18 -0400)]
datapath: Support for Linux kernel 3.9.

In certain cases we need to ensure we save off skb->cb before
calling __skb_gso_segment() since in kernels >= 3.9 skb->cb is
used by this routine.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agobfd: Downgrade long delay messages to INFO level.
Ethan Jackson [Wed, 31 Jul 2013 18:29:28 +0000 (11:29 -0700)]
bfd: Downgrade long delay messages to INFO level.

On my system the long delay messages can cause a transient BFD unit
test failure due to the log checking.  These messages don't *really*
need to be at WARN level, so this patch downgrades them.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoMerge remote-tracking branch 'ovs-dev/master'
Giuseppe Lettieri [Wed, 31 Jul 2013 20:17:34 +0000 (22:17 +0200)]
Merge remote-tracking branch 'ovs-dev/master'

Conflicts:
.gitignore

10 years agoofproto-dpif-ipfix: Make the ofproto-dpif-ipfix module thread safe.
Ethan Jackson [Tue, 23 Jul 2013 00:39:14 +0000 (17:39 -0700)]
ofproto-dpif-ipfix: Make the ofproto-dpif-ipfix module thread safe.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-sflow: Make the ofproto-dpif-sflow module thread safe.
Ethan Jackson [Mon, 22 Jul 2013 19:32:19 +0000 (12:32 -0700)]
ofproto-dpif-sflow: Make the ofproto-dpif-sflow module thread safe.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agotunnel: Make the ofproto-dpif tunnel module thread safe.
Ethan Jackson [Tue, 23 Jul 2013 19:03:37 +0000 (12:03 -0700)]
tunnel: Make the ofproto-dpif tunnel module thread safe.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agolacp: Make the LACP module thread safe.
Ethan Jackson [Tue, 23 Jul 2013 01:35:28 +0000 (18:35 -0700)]
lacp: Make the LACP module thread safe.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agocompiler: Fix OVS_LOCKS_EXCLUDED on non clang compilers.
Ethan Jackson [Wed, 31 Jul 2013 17:49:34 +0000 (10:49 -0700)]
compiler: Fix OVS_LOCKS_EXCLUDED on non clang compilers.

This patch renames OVS_LOCKS_EXCLUDED to simply OVS_EXCLUDED so it's
more consistent with the other thread safety annotations.  It also
adds it to the non-clang compilers.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agodatapath: always export priority and skb_mark in netlink message
Andy Zhou [Wed, 31 Jul 2013 02:49:12 +0000 (19:49 -0700)]
datapath: always export priority and skb_mark in netlink message

Handling of missing attributes in netlink can be tricky and turns out
to be error prone. The value (savings in netlink bandwidth) does not
seem to be significant enough to justify allowing them. This patch
series make both kernel and userspace always export priority and
skb_mark attribute. There will be follow on patches in the
direction of making all attributes explicit.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agoovsdb-doc: Add ovsdb-doc to distribution tar ball.
Gurucharan Shetty [Wed, 31 Jul 2013 16:24:46 +0000 (09:24 -0700)]
ovsdb-doc: Add ovsdb-doc to distribution tar ball.

Certain platforms like xenserver do not have the latest
python libraries that are needed by ovsdb-doc (which in-turn
creates ovs-vswitchd.conf.db.5). When we run 'make dist' and
copy over the tar ball to xenserver ddk environemt, we
already include ovs-vswitchd.conf.db.5. But the absence of
ovsdb-doc results in an attempt to regenerate ovs-vswitchd.conf.db.5
and that fails because of the missing python libraries.

Instead of producing ovsdb-doc from ovsdb-doc.in dynamically, we
statically provide ovsdb-doc and pass on the version information
to it through the command line option --version.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agotest-atomic: Re-enable atomic read-write-modify tests.
Ben Pfaff [Mon, 15 Jul 2013 21:14:05 +0000 (14:14 -0700)]
test-atomic: Re-enable atomic read-write-modify tests.

This reverts commit 05d299e0ccca80736cd4438c3224540c5448a7d4 (test-atomic:
Drop atomic read-modify-write tests for the moment.) because the
test for detecting whether GCC support atomic operation built-ins has
been fixed.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoconfigure: Add configure-time check for GCC 4.0+ atomic built-ins.
Ben Pfaff [Mon, 15 Jul 2013 21:13:53 +0000 (14:13 -0700)]
configure: Add configure-time check for GCC 4.0+ atomic built-ins.

We found out earlier that GCC sometimes produces an error only at link time
for atomic built-ins that are not supported on a platform.  This actually
tries the link at configure time and should thus reliably detect whether
the atomic built-ins are really supported.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>