bond: raise minimal bond distribution per interface

Raise the minimal per interface packet distribution from 7 to 24.

With 256 packet distributing to 3 interfaces, the expected packets per
interface should be 256/3 = 85.3

Tested with 200 runs, the average number of packet sent to a single
interface is 85.9. close to the expected number, standard deviation
within the 200 run is 24.4. Tested with 2x standard deviation with
10K test runs, got around 0.1% failure rate. 2.5x standard deviation
passes 100K test runs without failure.

Using 2.5x for the unit test, 83.5 - 2.5 * 24.4, Round down to the
whole number of 24.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Reviewed-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
ovs-thread: Issue better diagnostics for locking uninitialized mutexes.

This makes the message issued refer to the file and line that called
ovs_mutex_lock(), instead of to the file and line *inside*
ovs_mutex_lock().

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
ofp-util: compile group stats with visual studio

Visual studio supports zero-size array within a struct or union,
but has to be the last element. GCC does not have this restriction.

Commits 644cfd84772eb7d8 and 6fdaa45a6f6c9 make use of 0 size array.
Remove them so that visual studio can compile them as well.

Reported-by: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
util: Remove duplicate CACHE_LINE_SIZE definition.

Reported-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
ofp-util: Fix definition of OFPUTIL_P_OF13_UP.

It should include OF1.4.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofp-msgs: New functions ofpmp_version() and ofpmp_decode_raw().

Each of these allows code in ofp-util.c to be simplified.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofp-util: Remove ofputil_count_phy_ports().

It's harder to calculate the number of ports in a given amount of space in
OpenFlow 1.4 and later, because the ofp_port structure becomes variable
length in those versions.  This commit removes the one caller, replacing
it by a version that doesn't need to know the number of ports in advance.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofp-util: Generalize functions for parsing OF1.3+ properties.

The main effect is to move these functions a little earlier in the file.
A secondary effect is to make it possible to use different error codes for
different kinds of properties.  In particular, table features has different
error codes from other properties (yeah, terrible design, tell me about
it).

While we're at it, add the error codes that other properties use to
ofp-errors.h.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofp-util: Reduce duplicate code.

ofputil_put_phy_port() and ofputil_append_port_desc_stats_reply() had a
lot of code duplication.  This reduces it: it deletes some specialized
code from ofputil_put_phy_port(), moving it into its caller
ofputil_put_switch_features_port() that actually needed it.  That change
then allows ofputil_append_port_desc_stats_reply() to become a simple
wrapper around ofputil_put_phy_port().

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofp-util: Implement OpenFlow 1.4 port status and port desc reply messages.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Add skeleton for OF1.5 support.

This allows OF1.5 prototyping to take place in a natural way.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Implement OpenFlow 1.5 group desc stats request.

OpenFlow 1.4 and earlier always send the description of every group in
response to an OFPMP_GROUP_DESC request.  OpenFlow 1.5 proposes allowing
the controller to request a description of a single group.  This commit
implements a prototype.

EXT-69.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Implement OpenFlow 1.5 port desc stats request.

OpenFlow 1.4 and earlier always send the description of every port in
response to an OFPMP_PORT_DESC request.  OpenFlow 1.5 proposes allowing
the controller to request a description of a single port.  This commit
implements a prototype.

EXT-69.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Implement OpenFlow 1.4 port_mod messages.