ovs-ofctl: Correct typo in documentation.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
nx-match: Reject bad wildcard combinations.

A log message has warned that this was going to happen for some time, and
newer OpenFlow versions require this behavior.

The test updates fix this behavior in our testsuite.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
ofp-actions, nx-match: Use mf_oxm_header() instead of explicit constants.

Following this change, only meta-flow.c uses any explicit NXM_* or OXM_*
constants.  An upcoming commit will actually remove the definitions of
these constants, hiding them behind a functional interface, for better
abstraction.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
nx-match: Encode dp_hash and recirc_id in OXM also.

dp_hash and recirc_id are specific to OVS, but that doesn't mean that we
shouldn't encode them into flow matches when OXM is used in OpenFlow 1.2
and later.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
revalidator: Distinguish new and duplicate flows.

We previously counted flows that have been installed during the current
dump as duplicates, rather than recognising them as new flows. This
patch separates the counters out for these two cases.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
tests: Mention binomial coefficient in hash tests.

This just makes it a bit easier for someone coming in fresh to do some
searches and figure out what the description means.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
pstream-unix: Increase listen count to 64 in punix_open().

In my test with openstack setup, ovs-ofctl executes failed when there are
many flow rules to be added by multiple threads.
The error like this:
ovs-ofctl: /var/run/openvswitch/br1.mgmt: failed to open socket (Protocol
error)

In the function listen(fd, 10) in punix_open(), the number 10 should be
modified to more bigger, such as 64 maybe a proper value.

Signed-off-by: Lilijun <jerry.lilijun@huawei.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ovs-vswitchd: Better diagnose errors in DPDK command-line options.

With DPDK compiled in, when the --dpdk option was given other than as the
first command-line argument, ovs-vswitchd silently ignored it.  Without
DPDK compiled in, when the --dpdk option was given anywhere, ovs-vswitchd
silently ignored it.  However, in each case any options following --dpdk
were not ignored, and since --dpdk is normally followed by additional
DPDK-specific options, this caused even more confusing trouble.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Daniele Di Proietto <ddiproietto@vmware.com>
Tested-by: Daniele Di Proietto <ddiproietto@vmware.com>
INSTALL.DPDK: Update DPDK related documentation.

This commit updates the DPDK related documentation to reflect
the pmd thread multi-threading work.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Daniele Di Proietto <ddiproietto@vmware.com>
CodingStyle: Mention our assumption about conversions to bool

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: Ben Pfaff <blp@nicira.com>
bridge: Fix high cpu utilization.

When there are more than one ovs-vswitchd processes started,
only one process is enabled.  The disabled processes should
just sleep.  However, a bug in ovs makes the disabled processes
keep waking up on global connectivity sequence number which is
never sync'ed.  Consequently, those processes use 100% cpu.

This commit fixes the bug by always sync up the connectivity
sequence number for disabled processes.

Reported-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
ovs-vswitchd.at: Fix "start additional ovs-vswitchd process" test

NetBSD implementation of wc command outputs extra whitespaces
like the following.  Tweak the test to success on such environments.

    % echo hoge|wc -l|hexdump -C
    00000000  20 20 20 20 20 20 20 31  0a                       |       1.|
    00000009
    %

The failing test was introduced by
commit 6bef3c7ca859f208239ca61ec3b25c09a3571553
("bridge: Fix high cpu utilization.")

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: Joe Stringer <joestringer@nicira.com>
README: Adding github markup and travis-ci build status to github readme page.

Signed-off-by: Pritesh Kothari <pritesh.kothari@cisco.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
configure: Disable strict aliasing.

The C standard allows compilers to do type-based alias analysis, which
means that the compiler is allowed to assume that pointers to objects of
different types are pointers to different objects.  For example, a compiler
may assume that "uint16_t *a" and "uint32_t *b" point to different and
nonoverlapping locations because the pointed-to types are different.  This
can lead to surprising "optimizations" with compilers that by default do
this kind of analysis, which includes GCC and Clang.

The one escape clause that the C standard gives us is that character types
must be assumed to alias any other object.  We've always tried to use this
escape clause to avoid problems with type-based alias analysis in the past.
I think that we should continue to try to do this in the future.  It's hard
to tell what compiler we might want to use in the future, and one never
knows what kind of control that compiler allows over alias analysis.

However, recently I helped another developer debug a nasty and confusing
issue, which turned out to be the result of a surprising compiler
optimization due to alias analysis.  I've seen enough of these that I don't
think it's worthwhile to risk more problems than we have to.  Thus, this
commit turns off type-based alias analysis in GCC and Clang.

Linus Torvalds thinks that type-base alias analysis is not sane, at least
as GCC implements it: https://lkml.org/lkml/2003/2/26/158

The GCC manual says that -Wstrict-aliasing is only effective without
-fno-strict-aliasing, otherwise I'd keep -Wstrict-aliasing also.

Indications are that MSVC doesn't do type-based alias analysis by default.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>