Revert DSCP update changes.

This reverts commit cd8fca2ba0a7d036da069a4484d501bdc7a6f611 (jsonrpc:
Correctly setting the dscp value before reconnect.) and commit
b2e18db292cd4962af3248f11e9f17e6eaf9c033 (No need to restart DB / OVS on
changing dscp value.), which on some systems causes numerous unit test
failures that valgrind diagnoses as:

Conditional jump or move depends on uninitialised value(s)
   at 0x805F63F: jsonrpc_session_set_dscp (jsonrpc.c:1061)
   by 0x804F45D: ovsdb_jsonrpc_server_set_remotes (jsonrpc-server.c:417)
   by 0x804B775: reconfigure_from_db (ovsdb-server.c:656)
   by 0x804C231: main (ovsdb-server.c:159)

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif-governor: Wake up only when there is genuinely work to do.

Until now, governor_wait() has awakened the poll loop whenever the
generation timer expires, to allow it to shrink the governor to the next
smaller size in governor_run().  However, if the governor is already the
smallest possible size, then governor_run() will not have anything to do
and will not restart the timer, which means that governor_wait() will again
immediately wake up the poll loop, and we end up using 100% CPU.

This is kind of hard to trigger because normally the client will destroy
a governor in such a case.  However, if there are too many subfacets, the
client will keep even a minimum-size governor, triggering the bug.

Bug #12106.
Reported-by: Alex Yip <alex@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ovs-lib: Add time stamps to Valgrind log messages.

Sometimes it's easier to interpret Valgrind warnings when you can
correlate them with other events.

Suggested-by: James Schmidt <jschmidt@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
FAQ: Add FAQ entries from website.

The openvswitch.org web site has a FAQ.  This commit integrates those
entries into the FAQ file.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
FAQ: Add additional entries.

Does some cleanup and adds entries that cover:

    - OVS isn't Linux-specific.
    - Point out PORTING guide.
    - Explanation of LTS releases.
    - Supported versions of OpenFlow.
    - Missing features from userspace datapath and upstream kernel
      module.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
docs: Add references to the database schema documentation.

I field lots of questions about "where's the documentation?"  Perhaps this
will help.

The changes to ovs-vsctl(8) add a couple of references to
ovs-vswitchd.conf.db(5) but they also rephrase a couple of paragraphs in
what seems to me an easier to understand style.

Signed-off-by: Ben Pfaff <blp@nicira.com>
cfm: Log the start of new fault intervals.

When debugging CFM, it's useful to know exactly when each fault
interval starts in relation to other CFM events.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
cfm: Warn when delayed sending CCMs.

We've recently seen problems where OVS can get delayed sending CCM
probes by several seconds.  This can cause tunnels to flap, and
generally wreak havoc.  It's easy to detect when this is happening,
so minimally, warning should be helpful to those debugging
problems.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
cfm: Minor whitespace cleanup.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
IntegrationGuide: A guide to help platform integrators.

Provide a guide to integrating OVS on new platforms.

Co-authored-by: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
build: automake complains IntegrationGuide is missing

Change set of 502c471406b32e5afcdea62fa8307f9856d05437 added IntegrationGuide,
but it wasn't added to EXTRA_DIST. So automake complains.
This patch adds the file to EXTRA_DIST.

> make[3]: Leaving directory `/openvswitch/build/datapath'
> The distribution is missing the following files:
> IntegrationGuide
> make[2]: *** [dist-hook-git] Error 1
> make[2]: *** Waiting for unfinished jobs....
> make[2]: Leaving directory `/openvswitch/build'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/openvswitch/build'
> make: *** [all] Error 2

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
pinsched: Completely fill the token bucket at initialization.

This code, which dates to August 2008, initially sets the packet-in
scheduler token buckets to 10% full, without any rationale.  I suspect
that this is just a typo for 100% full, which I think would be more
conventional, so this commit switches to that.

Signed-off-by: Ben Pfaff <blp@nicira.com>
sat-math: Introduce macro version of SAT_MUL.

The macro version can be used in a constant expression, such as an
initializer for a variable with static lifetime.  (Otherwise, it's better
to use the function.)

Signed-off-by: Ben Pfaff <blp@nicira.com>
token-bucket: New library for generic rate-limiting.

This commit converts two rate-limiters in the tree to use the library.
I intend to use the library elsewhere in the future.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto: Periodically log a summary of flow table changes.

We expect this to occasionally be useful for debugging.

Signed-off-by: Ben Pfaff <blp@nicira.com>
netdev-linux: Break ethtool coverage counter into "get" and "set" versions.

Reads and writes have difference performance implications so it's better to
separate them.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif: Remove unused coverage counters.

Nothing ever increments these.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif: Add coverage counters for facet revalidation.

Revalidation can be very expensive, so may be useful for performance
monitoring to keep track of how often it is necessary and for what reasons.

Signed-off-by: Ben Pfaff <blp@nicira.com>
odp-util: Include <config.h> first.

Otherwise _GNU_SOURCE doesn't get defined early enough and on some systems
LLONG_MIN is missing when odp-util.c tries to use it indirectly through
token-bucket.h.

Reported-by: Michael Hu <mhu@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Reapplying the dscp changes: No need to restart DB/OVS on changing dscp value.

This patch reapplies the changes that were reverted with the commit 59efa47
(Revert DSCP update changes.). It also addresses the problem introduced by
the original commits, cd8fca2 ((jsonrpc: Correctly setting the dscp value
before reconnect.) and b2e18d (No need to restart DB / OVS on changing
dscp value.), that caused numerous unit test failures on some systems (as
diagnosed by valgrind).
With this change there is no need to restart the DB or OVS on configuring a
different value for the manager or controller connection respectively. On
detecting a change in the dscp value on the socket, the previous socket is
closed and a new socket is created and connection is established with the new
configured dscp value.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>