ofproto-dpif: More responsive average subfacet statistics.

Before this patch, statistics about subfacet average life span,
and count in the datapath, were calculated over the entire lifetime
of the ofproto.  Furthermore, the subfacet lifespan was only
updated when a subfacet was removed from the datapath causing long
lived subfacets to be ignored.  It's far more useful to know these
numbers averaged over all subfacets in the recent past.  This patch
changes the code to implement an exponentially weighted moving
average updated every time statistics are pulled from the datapath.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
ofproto: Track subfacet stats in the backer.

Subfacets being per-datapath entities, their statistics are really
only interesting at per-datapath granularity.  This patch moves
them to the dpif_backer and makes some related simplifications.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
ofproto-dpif: Set flow-eviction-threshold globally.

With the single datapath, it no longer makes sense to have a per
ofproto flow eviction threshold.  This patch moves the flow
eviction threshold to the Open_vSwitch table making the setting
global, though still treated separately for each ofproto.  A future
patch will unify flow eviction on a per datapath basis.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
ofproto-dpif: Maintain subfacets in dpif_backer.

Conceptually, a subfacet represents a datapath flow key, and
therefore belongs more to a datapath more than it does to a bridge.
This patch moves the subfacet hmap from 'struct ofproto_dpif' to
'struct dpif_backer', simplifying the code in the process.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
ofproto-dpif-governor: Dispense with governor name.

In almost all cases, ovs-vswitchd runs with a single datapath, and
therefore a single governor.  Therefore, it's usually clear from
context what governor log messages are referring to making the name
redundant.  This patch removes it.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
ovsdb-idlc: Write a new-line at the end of "annotate" output.

Some tools do not like text files that lack a trailing new-line.  In
particular, Debian's dpkg-source utility complains about a missing new-line
in the file generated by ovsdb-idlc:

    dpkg-source: warning: file
    openvswitch-1.9.2+git20130605/lib/vswitch-idl.ovsidl has no final
    newline (either original or modified version)

This commit fixes the problem.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ofp-actions: Add comments to struct ofpact_learn_spec.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ansis Atteka <aatteka@nicira.com>
odp-util: Avoid returning static data in ovs_key_attr_to_string().

Returning a static data buffer makes code more brittle and definitely
not thread-safe, so this commit switches to using a caller-provided
buffer instead.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ansis Atteka <aatteka@nicira.com>
ofp-util: Don't return static data in ofputil_packet_in_reason_to_string().

Returning a static data buffer makes code more brittle and definitely
not thread-safe, so this commit switches to using a caller-provided
buffer instead.

Signed-off-by: Ben Pfaff <blp@nicira.com>
netdev-vport: Make netdev_vport_get_dpif_port() code less confusing.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif: Fix incorrect printf format specifiers.

    cc1: warnings being treated as errors
    ../ofproto/ofproto-dpif.c: In function ‘dpif_show_backer’:
    ../ofproto/ofproto-dpif.c:8305: error: format ‘%llu’ expects type ‘long
    long unsigned int’, but argument 4 has type ‘size_t’
    ../ofproto/ofproto-dpif.c:8305: error: format ‘%llu’ expects type ‘long
    long unsigned int’, but argument 5 has type ‘size_t’

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
process: Remove process_run(), process_run_capture(), and related code.

They are unused.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ansis Atteka <aatteka@nicira.com>
process: Remove unused features from process_start().

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
process: Make signal handling thread-safe.

Signed-off-by: Ben Pfaff <blp@nicira.com>
process: Add thread safety comments.

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