bfd: Notify connectivity_seq on rmt_state changes.

The bfd module did not previously change the global connectivity_seq
when the remote state changed, which means that such state changes may
not be propagated to the database. This is particularly bad if this is
the last state transition to happen in an otherwise stable environment.
This patch checks for transitions in remote state, and ensures that the
main thread will update the database when these happen.

Bug #22136.

Co-authored-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Add common definitions for Windows builds.

Signed-off-by: Alin Serdean <aserdean at cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Makefile.am: Always use C locale for "sort" and "comm".

Otherwise, if the user changes locales between running the "dist-hook-git"
and "distfiles" targets (e.g. in different invocations of "make"), then
the "dist-hook-git" target might falsely report that the distribution is
missing files.

Reported-by: John Darrington <john@darrington.wattle.id.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
tests: Remove \r from source tree.

An ovsdb-server test had a literal carriage return in a check that
validates a directory name.  It isn't really necessary (who puts a carriage
return in a directory name?) and it does cause problems for passing around
patches via email, so just delete it.

CC: Arun Sharma <arun.sharma@calsoftinc.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif-monitor: Remove monitor_init().

Commit 881d47a9fa9 (monitor: Replace monitor_seq with periodic
wakeup.) removes the global "struct seq" in ofproto-dpif-monitor
module.  This change makes the monitor_init() no longer needed.

This commit removes the monitor_init() from ofproto-dpif-monitor.c.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
netdev-linux: Drop support for pre-2.6.19 kernels.

The OVS kernel module requires 2.6.32 or later, so there's no reason for
userspace to support older kernels.  This commit removes the special
fallback code for retrieving Linux netdev stats in pre-2.6.19 kernels,
which should no longer be useful.

Signed-off-by: Ben Pfaff <blp@nicira.com>
netdev-linux: Simplify get_stats_via_netlink().

There's no need to obtain the ifindex, because RTM_GETLINK is happy to take
the interface name.  There's no need to do a full nl_policy_parse(),
because we only need a single attribute.

Signed-off-by: Ben Pfaff <blp@nicira.com>
connmgr: Log when a packet-in is dropped due to queue overflow.

Reported-by: Anton Matsiuk <anton.matsiuk@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
bridge: Fix reversed string parsing in bridge_configure_flow_miss_model().

This commit fixes a command matching error introduced by commit
7155fa52f (ofproto-dpif: Add 'force-miss-model' configuration).

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif: Enable NXAST_SAMPLE only if the datapath supports it.

This prevents using an older datapath from breaking forwarding.

CC: Romain Lenglet <rlenglet@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
bfd: Make bfd decay test robust.

With ovs multithreading implementation, the bfd decay test
becomes fragile due to its high dependency on timing sequence.
This commit removes these dependencies and makes the test robust.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
tests: Make some tests more robust.

These tests break if OVS internal hash function is changed.  Some of
this is due to dependency on the order in which elements are iterated
from hash maps, or the algorithm used is just dependent on the
specific hash values produced for specific inputs (groups).  These
changes make these test cases more robust, so that they will not break
so easily due to OVS internal hash function implementation changes.

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

Use one callback instead of many, helps in adding new functionality
later on.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
dpif: Use explicit packet metadata.

This helps reduce confusion about when a flow is a flow and when it is
just metadata.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
odp-util: Avoid null dereference in parse_8021q_onward().

For parsing a mask, this code in parse_8021q_onward() always read out
the OVS_KEY_ATTR_VLAN attribute without first checking whether it existed.
The correct behavior, implemented by this commit, appears to be treating
the VLAN as wildcarded and to continue parsing the flow.

Bug #22312.
Reported-by: Krishna Miriyala <miriyalak@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
odp-util: Simplify logic in odp_flow_key_to_flow__().

Simplify (a && b) || (!a && c) to just a ? b : c.

Signed-off-by: Ben Pfaff <blp@nicira.com>
FAQ: Add entry on GRE module conflicts.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
datapath: Check for backported sctp_compute_cksum().

This is backported by RHEL7.

Reported-by: Ashok Byahatti <ashok.byahatti@embrane.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>