datapath: Resolve external module dependencies.

The Open vSwitch kernel module now has dependencies on symbols
exported by other kernel modules (currently just for GRE). In
order for it to load, the dependencies must be correctly resolved
ahead of time. This runs depmod as part of the module installation
process and updates the installation instructions.

Reported-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
ovs-appctl: allow ofproto/trace to take mega flow input

ofproto/trace command was not updated to take mega flow input, which made
it hard to use by cutting and pasting output from "ovs-dpctl dump-flows".

(The mask is not actually used for tracing.)

Bug #18267.
Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
tunnel: Use ofport_dpif instead of ofport.

Necessary in a future patch.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
tunnel: Hide 'struct tnl_port' internally.

This simplifies the tunnel module's interface and prevents us from
having to sync 'struct tnl_port' once ofproto-dpif and
ofproto-dpif-xlate are disentangled.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ovs-atomic: New library for atomic operations.

This library should prove useful for the threading changes coming up.
The following commit introduces one (very simple) user.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ovs-thread: Add support for convenient once-only initializers.

pthread_once() is portable but it does not allow passing any parameters to
the initialization function, which is often inconvenient, because it means
that the function can only access data declared at file scope.  This commit
introduces an alternative with a more convenient interface.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ovs-thread: Add support for various thread-related assertions.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
New function ovs_strerror() as a thread-safe replacement for strerror().

Signed-off-by: Ben Pfaff <blp@nicira.com>
Replace all uses of strerror() by ovs_strerror(), for thread safety.

Signed-off-by: Ben Pfaff <blp@nicira.com>
random: Make thread-safe.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Use random_*() instead of rand(), for thread safety.

None of these test programs are threaded, but has little cost and means
that "grep" doesn't turn up any instances of these thread-unsafe functions
in our tree.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Makefile: Blacklist functions that threaded programs cannot use safely.

Some functions that POSIX says cannot be used safely in multithreaded
programs are not on the initial blacklist:

    - getenv() should be safe in real implementations in the absence of
      changes to the environment.  (putenv() and setenv() are blacklisted.)

    - We only use getopt() before spawning extra threads, and I expect this
      to continue to be true.

Signed-off-by: Ben Pfaff <blp@nicira.com>
flow: Don't assume non-IPv4 is IPv6 for un-wildcarding.

When determinining what fields to un-wildcard for the symmetric L4 hash,
don't include the IPv6 address fields if the packet isn't IPv6.

Reported-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ofproto-dpif: Add ability to disable megaflows.

Add new "dpif/disable-megaflows" and "dpif/enable-megaflows" commands to
ovs-appctl to disable and enable megaflows, respectively.  By default,
megaflows are enabled, and these commands should only be used for
debugging.

Feature #18265.

Requested-by: Ronghua Zhang <rzhang@vmware.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
vconn: Fix formatting of user message.

This corrects "version 0x03and earlier" to "version 0x03 and earlier".

Signed-off-by: Ben Pfaff <blp@nicira.com>
tests: Fix typo in test name.

Other test names use a space here, so this one should also.

Signed-off-by: Ben Pfaff <blp@nicira.com>
OPENFLOW-1.1+: Remove items that I've verified to be implemented already.

Signed-off-by: Ben Pfaff <blp@nicira.com>