tests: Add $(check_DATA) to check-valgrind dependencies.

Otherwise if you run "check-valgrind" in a tree where you've never run
"check", you get some test failures because some data files don't get
generated before the tests run.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto: Remove member whose value is always -1 from struct ofoperation.

Signed-off-by: Ben Pfaff <blp@nicira.com>
bridge: Simplify VLAN splinter memory management.

Before this patch, the VLAN splinter memory management operated on
blocks of memory instead of ovsrec_ports.  This strategy is
problematic in future patches when more than simply calling
'free()' needs to be done to destroy splinter ports.  This patch
solves the problem by keeping track of entire ovsrec_ports instead
of just the memory allocated to create them.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
lib: New data structure - smap.

A smap is a string to string hash map.  It has a cleaner interface
than shash's which were traditionally used for the same purpose.
This patch implements the data structure, and changes netdev and
its providers to use it.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
lib: Utilize smaps in the idl.

String to string maps are used all over the Open vSwitch database.
Before this patch, they were implemented in the idl as parallel
string arrays.  This strategy has proven a bit cumbersome.  With
this patch, string to string maps are implemented using the smap
library.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
openflow: Add ofp11_group

OFPG11_ANY may be used as the out_group for ofp11_flow_mod and
ofp11_flow_stats_request.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ovs-ctl: Document --ovs-brcompatd-priority.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ovs-ctl: Add support for running daemons under valgrind or strace.

This is occasionally useful for debugging.

Signed-off-by: Ben Pfaff <blp@nicira.com>
debian: Enable passing extra options to ovs-ctl from init scripts.

This is useful for passing wrapper script options and possibly for other
purposes.

Bug #11889.
Signed-off-by: Ben Pfaff <blp@nicira.com>
xenserver, rhel: Enable extra ovs-ctl options from init scripts.

This is useful for passing wrapper script options and possibly for other
purposes.

Bug #11889.
Signed-off-by: Ben Pfaff <blp@nicira.com>
debian: Make DKMS automatically build for running kernel.

By default DKMS doesn't build on demand for each kernel booted or updated.
Adding AUTOINSTALL=yes gives it this behavior.  Based on a small sample of
Debian packages and how-to guides for Ubuntu, AUTOINSTALL=yes is what most
packages use and what users expect.

Fix-suggested-by: Kirill Kabardin
Reported-by: Ralf Heiringhoff <ralf@frosty-geek.net>
Reported-at: https://bugs.launchpad.net/bugs/962189
Signed-off-by: Ben Pfaff <blp@nicira.com>
No need to restart DB / OVS on changing dscp value.

With this change there is no need to restart the DB or OVS on configuring a
different value for the manager or controller connection respectively. On
detecting a change in the dscp value on the socket, the previous socket is
closed and a new socket is created and connection is established with the new
configured dscp value.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
lib: Minor const tweak in smap library.

The source argument of smap_clone() isn't modified, and thus can be
declared const.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
datapath: Make 'struct work_struct' consistent with kernel definition.

From kernel 3.4 netdevice structure has delayed_work in
net_device->pm_qos_req. delayed_work needs work_struct definition.
OVS has its own workq implementation which redefines work_struct.
So we need to make it consistent with work_struct defined
in kernel workqueue.h to have correct net_device definition.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath: Support for kernel 3.4.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
jsonrpc: Correctly setting the dscp value before reconnect.

In commit b2e18d(No need to restart DB / OVS on changing dscp value.), the
dscp value was wrongly set after the reconnect.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
Reported-by: Ravi Kerur <rkerur@gmail.com>
Revert DSCP update changes.

This reverts commit cd8fca2ba0a7d036da069a4484d501bdc7a6f611 (jsonrpc:
Correctly setting the dscp value before reconnect.) and commit
b2e18db292cd4962af3248f11e9f17e6eaf9c033 (No need to restart DB / OVS on
changing dscp value.), which on some systems causes numerous unit test
failures that valgrind diagnoses as:

Conditional jump or move depends on uninitialised value(s)
   at 0x805F63F: jsonrpc_session_set_dscp (jsonrpc.c:1061)
   by 0x804F45D: ovsdb_jsonrpc_server_set_remotes (jsonrpc-server.c:417)
   by 0x804B775: reconfigure_from_db (ovsdb-server.c:656)
   by 0x804C231: main (ovsdb-server.c:159)

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif-governor: Wake up only when there is genuinely work to do.

Until now, governor_wait() has awakened the poll loop whenever the
generation timer expires, to allow it to shrink the governor to the next
smaller size in governor_run().  However, if the governor is already the
smallest possible size, then governor_run() will not have anything to do
and will not restart the timer, which means that governor_wait() will again
immediately wake up the poll loop, and we end up using 100% CPU.

This is kind of hard to trigger because normally the client will destroy
a governor in such a case.  However, if there are too many subfacets, the
client will keep even a minimum-size governor, triggering the bug.

Bug #12106.
Reported-by: Alex Yip <alex@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ovs-lib: Add time stamps to Valgrind log messages.

Sometimes it's easier to interpret Valgrind warnings when you can
correlate them with other events.

Suggested-by: James Schmidt <jschmidt@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
FAQ: Add FAQ entries from website.

The openvswitch.org web site has a FAQ.  This commit integrates those
entries into the FAQ file.

Signed-off-by: Justin Pettit <jpettit@nicira.com>