netdev-vport: Warn about invalid TOS.

Otherwise the kernel will reject it later and the result is no tunnel,
whereas a tunnel with an unexpected TOS seems like a better result.

Bug #12566.
Reported-by: Luca Giraudo <lgiraudo@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
cfm: Improve logging.

This patch makes a two improvements to CFM logging which should
make debugging connectivity problems a bit more intuitive.  First,
when a remote_mp disappears, the length of time since its last CCM
reception is logged.  Second, the "CFM fault status changed"
message is reformatted in a more intuitive way.  Instead of
prefixing additions and deletions with pluses and minuses, the full
old fault status and new fault status are logged.

Requested-by: Ben Basler <bbasler@nicira.com>,
Signed-off-by: Ethan Jackson <ethan@nicira.com>
cfm: Clear RDI on new CFM configurations.

When CFM is first configured, it detects no remote endpoints, and
thus sets RDI on its CCMs.  This can cause the receiver of these
CCMs to think there is a problem when really things are simply
initializing.  This patch fixes the issue by not setting the RDI
bit in CCMs until at least one fault interval has passed.

Bug #12610.
Reported-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
ofp-print: Print the type of truncated messages, when available.

The function ofputil_decode_msg_type_partial() can figure out the type of
a truncated OpenFlow message, if the message is long enough that its type
can be determined, so we should print this information.   This is
especially valuable for printing OFPT_ERROR messages, in which the inner
OpenFlow message is often truncated to 64 bytes.

Signed-off-by: Ben Pfaff <blp@nicira.com>
tests: Remove daemon tests that have been skipped forever.

The daemon code works fine, these tests didn't.  No one has debugged them
over a period of years so we might as well remove them.

Signed-off-by: Ben Pfaff <blp@nicira.com>
tests: Remove bit-rotted support for "lcov".

At one point I got the "lcov" utilities to work well with OVS.  Then I
didn't try to use them again for a year or so, and when I did I found that
it didn't work at all.  I wasn't able to fix the problem easily, so it
seems better to remove the feature than to leave around broken code.

Signed-off-by: Ben Pfaff <blp@nicira.com>
debian: Remove controller keys on openvswitch-controller package purge.

A Debian package is expected to remove all its configuration files (which
includes all files in /etc) when it is purged, but the
openvswitch-controller package wasn't doing that.  This fixes the problem.

Debian bug #682187.
CC: 682187@bugs.debian.org
Reported-by: Andreas Beckmann <debian@abeckmann.de>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofp-util: Add OFPUTIL_P_OF12 and NXFF_OPENFLOW12

Add OFPUTIL_P_OF12 and NXFF_OPENFLOW12 for Open Flow 1.2

OFPUTIL_P_OF12_TID and in turn OFPUTIL_P_OF12_ANY is not provided as
OFPUTIL_P_OF12 supports the use of table ids in modify flow messages.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
meta-flow: Rename MFF_VLAN_VID->MFF_DL_VLAN, MFF_VLAN_PCP->MFF_DL_VLAN_PCP.

Giving these fields names that are the same as the OpenFlow 1.0 struct
member names should help make it clear what they are for.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Simon Horman <horms@verge.net.au>
flow: Rename flow_set_vlan_vid() to flow_set_dl_vlan().

This function is specific to the OF1.0 dl_vlan field, so name it
consistently.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Simon Horman <horms@verge.net.au>
meta-flow: Add OF1.2-like MFF_VLAN_VID and MFF_VLAN_PCP.

OpenFlow 1.0 and 1.2 have notions of VLAN that are different
enough to warrant separate "meta-flow" fields, which this commit
adds.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Simon Horman <horms@verge.net.au>
OXM: Add encoding of VLAN VID and VLAN PCP

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
OXM: Add VLAN VID as a prerequisite for VLAN PCP

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
tests: OXM VLAN match encoding and decoding

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
OXM: Add tests for masked VLAN VID match

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ovs-ofctl: Avoid printing false differences on "ovs-ofctl diff-flows".

It is possible for "struct ofpact"s to differ bytewise even if they are
equivalent when converted to another representation, such as OpenFlow 1.0
action format or a string representation.  This can cause "ovs-ofctl
diff-flows" to print surprising false "differences", e.g. as in the bug
report:

    - actions=resubmit(,1)
    + actions=resubmit(,1)

This commit fixes the problem by comparing not just the ofpacts but also
the string representation and printing a difference only if both differ.

Bug #8899.
Reported-by: Luca Giraudo <lgiraudo@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
vswitch.xml: Fix typo in documentation.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Fix race condition in parallel execution of "make install".

ovs-vsctl is listed, incorrectly, in both bin_PROGRAMS and bin_SCRIPTS.
This meant that "make install" with the -j option could try to install
ovs-vsctl two times in parallel, a race that occasionally caused a build
failure, e.g.:
http://buildd.debian.org/status/fetch.php?pkg=openvswitch&arch=s390&ver=1.4.2%2Bgit20120612-5&stamp=1342851603

Debian bug #682384.
CC: 682384@bugs.debian.org
Reported-by: Bastian Blank <waldi@debian.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif: Add more details to "ofproto/trace" output.

There are many reasons why OFPP_NORMAL translation can drop packets, and
it's often far from obvious why.  This should make it easier to debug.

Bug #12618.
Signed-off-by: Ben Pfaff <blp@nicira.com>
meta-flow: Fix "sparse" warning in mf_are_prereqs_ok().

This fixes the following warning from "sparse":

meta-flow.c:830:31: warning: incorrect type in return expression (different
base types)
meta-flow.c:830:31:    expected bool
meta-flow.c:830:31:    got restricted __be16

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