datapath: Improve net-namespace compat code.

Following patch improves compat net-namespace code which is mostly
targeted for 2.6.32 kernel. upcoming vxlan restructuring patch
needs this patch.

Signed-off-by: Pravin Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath: Restructure vxlan tunneling.

Following patch restructures vxlan tunneling so that it is more
in sync with upstream vxlan tunneling code.

Signed-off-by: Pravin Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath: Conditionally define skb_unclone in datapath compat code

Recent versions of Fedora have skb_unclone included in their
kernels. This patch adds a conditional check into the compat directory so as
not to error out by defining it twice. This allows the latest OVS kernel
module to build on Fedora 19.

Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
dpif-netdev: Make 'max_mtu' a per-dp feature, for thread safety.

This ensures that an external lock around a dpif_netdev will allow
thread-safe access to it.

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

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

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

Signed-off-by: Ben Pfaff <blp@nicira.com>
memory: Add note about threaded usage to comment.

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

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

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

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

Signed-off-by: Ben Pfaff <blp@nicira.com>
ovsdb-data: Make ovsdb_atom_default() thread-safe.

Signed-off-by: Ben Pfaff <blp@nicira.com>
clang: Fix segfault in unit tests.

It seems that 'clang' compiler applies strict protection on pointer
dereference. And it causes unexpected execution in macro functions
like "HMAP_FOR_EACH()" and unit test failures. This commit fixes
this issue and pass all unit tests.

Co-authored-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
clang: Fix the "expression result unused" warning.

This commit makes macro function "ASSIGN_CONTAINER()" evaluates
to "(void)0". This is to avoid the 'clang' warning: "expression
result unused", since most of time, the final evaluated value
is not used.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
configure: Remove -Wno-override-init, add -Wextra to compile options.

The build is clean against -Wextra at least with GCC 4.4.

(-Wextra includes -Woverride-init.)

Suggested-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
sparse: Avoid sparse warnings for additional pthread initializers.

Reported-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath: remove RCU annotation from flow->mask

After a mask is assigned to a flow, it will not change for the life of
the flow. Since flow access is protected by RCU lock, access to
flow->mask after getting a flow is always safe.

Suggested-by: Jesse Gross <jesse@nicira.com>
Reported-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>