datapath: Fix race.

ovs_vport_cmd_dump() did rcu_read_lock() only after getting the
datapath, which could have been deleted in between.  Resolved by
taking rcu_read_lock() before the get_dp() call.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
ovs-thread: Add support for pthread adaptive mutex

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif: Use adaptive mutex for stats.

Stats critical sections are held for very short time, so it makes
sense to spin on them for a while rather than sleeping immediately.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
util: Make xreadlink a static function.

It is only used in util.c

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
string: strerror_r() for windows.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
util: follow_symlinks() for windows.

Start with not supporting symbolic links for windows.
This is useful for an upcoming commit.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lockfile: Implementation for Windows platform.

Start with a simple implementation that does not support
symbolic links.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
util: Pre-allocate buffer for ovs_lasterror_to_string().

This lets us call ovs_lasterror_to_string() and not having
to do an extra call of LocalFree() on the returned string.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
tests: Add support for automatically running Ryu tests against OVS.

The Ryu controller comes with an extensive library of OpenFlow tests, but
it doesn't seem so easy to me to run all of them against a development
version of Open vSwitch.  This commit introduces a Makefile target so that
one can run all the Ryu tests with a simple "make check-ryu".

This commit adds documentation for the new target to INSTALL.  It also
moves the documentation for the "check-oftest" target and the
--enable-coverage configure option into INSTALL.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
datapath: fix dp check in ovs_dp_reset_user_features

This fixes crash when userspace does "ovs-dpctl add-dp dev" where dev is
existing non-dp netdevice.

Introduced by:
commit 94358dcffbec33cbcfd425e925139fd7e9d6153f
"openvswitch: Drop user features if old user space attempted to create datapath"

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Jesse Gross <jesse@nicira.com>