cascardo/ovs.git
9 years agorhel: Remove creation of fake bond interface
Anoob Soman [Tue, 25 Mar 2014 12:32:03 +0000 (12:32 +0000)]
rhel: Remove creation of fake bond interface

fake-iface, option to add-bond, was added for compatibility
reasons and need not be used otherwise.

Signed-off-by: Anoob Soman <anoob.soman@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoFAQ: Add an entry about datapath-id
YAMAMOTO Takashi [Tue, 20 May 2014 02:07:02 +0000 (11:07 +0900)]
FAQ: Add an entry about datapath-id

Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
9 years agonetdev-bsd: Fix a whitespace
YAMAMOTO Takashi [Mon, 19 May 2014 08:06:45 +0000 (17:06 +0900)]
netdev-bsd: Fix a whitespace

Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
9 years agoofproto: Fix comments
YAMAMOTO Takashi [Mon, 19 May 2014 07:57:49 +0000 (16:57 +0900)]
ofproto: Fix comments

Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
9 years agoofproto: Remove per-flow miss hash table from upcall handler.
Ryan Wilson [Wed, 21 May 2014 04:50:19 +0000 (21:50 -0700)]
ofproto: Remove per-flow miss hash table from upcall handler.

The upcall handler keeps a hash table which hashes flow to a list
of corresponding packets.  This used to be necessary as packets with
the same flow had similar actions and calculating actions used to be
a performance bottleneck.  Now that userspace action calculation
performance has improved, there is no need for this hash map.

This patch removes this hash map and each packet has its own upcall.

Signed-off-by: Ryan Wilson <wryan@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
9 years agodatapath: 16bit inner_network_header field in struct ovs_gso_cb
Simon Horman [Tue, 20 May 2014 23:31:47 +0000 (08:31 +0900)]
datapath: 16bit inner_network_header field in struct ovs_gso_cb

The motivation for this is to create a 16bit hole in struct ovs_gso_cb
which may be used for the inner_protocol field which is needed
for the proposed implementation of compatibility for MPLS GSO segmentation.

This should be safe as inner_network_header is now an offset to
the inner_mac_header rather than skb->head.

As pointed out by Thomas Graf simply making both inner offsets 16bis is not
safe as there have been cases of overflow with "with collapsed TCP frames
on IB when the headroom grew beyond 64K. See commit 50bceae9bd ``tcp:
Reallocate headroom if it would overflow csum_start'' for additional
details."

This patch is based on suggestions by Thomas Graf and Jesse Gross.

Cc: Thomas Graf <tgraf@suug.ch>
Cc: Jesse Gross <jesse@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
9 years agocmap: New module for cuckoo hash table.
Ben Pfaff [Tue, 20 May 2014 23:51:42 +0000 (16:51 -0700)]
cmap: New module for cuckoo hash table.

This implements an "optimistic concurrent cuckoo hash", a single-writer,
multiple-reader hash table data structure.  The point of this data
structure is performance, so this commit message focuses on performance.

I tested the performance of cmap with the test-cmap utility included in
this commit.  It takes three parameters for benchmarking:

    - n, the number of elements to insert.

    - n_threads, the number of threads to use for searching and
      mutating the hash table.

    - mutations, the percentage of operations that should modify the
      hash table, from 0% to 100%.

e.g. "test-cmap 1000000 16 1" inserts one million elements, uses 16
threads, and 1% of the operations modify the hash table.

Any given run does the following for both hmap and cmap
implementations:

    - Inserts n elements into a hash table.

    - Iterates over all of the elements.

    - Spawns n_threads threads, each of which searches for each of the
      elements in the hash table, once, and removes the specified
      percentage of them.

    - Removes each of the (remaining) elements and destroys the hash
      table.

and reports the time taken by each step,

The tables below report results for various parameters with a draft version
of this library.  The tests were not formally rerun for the final version,
but the intermediate changes should only have improved performance, and
this seemed to be the case in some informal testing.

n_threads=16 was used each time, on a 16-core x86-64 machine.  The compiler
used was Clang 3.5.  (GCC yields different numbers but similar relative
results.)

The results show:

    - Insertion is generally 3x to 5x faster in an hmap.

    - Iteration is generally about 3x faster in a cmap.

    - Search and mutation is 4x faster with .1% mutations and the
      advantage grows as the fraction of mutations grows.  This is
      because a cmap does not require locking for read operations,
      even in the presence of a writer.

      With no mutations, however, no locking is required in the hmap
      case, and the hmap is somewhat faster.  This is because raw hmap
      search is somewhat simpler and faster than raw cmap search.

    - Destruction is faster, usually by less than 2x, in an hmap.

n=10,000,000:

        .1% mutations    1% mutations    10% mutations     no mutations
          cmap  hmap     cmap   hmap      cmap   hmap       cmap  hmap
insert:   6132  2182     6136   2178      6111   2174       6124  2180
iterate:   370  1203      378   1201       370   1200        371  1202
search:   1375  8692     2393  28197     18402  80379       1281  1097
destroy:  1382  1187     1197   1034       324    241       1405  1205

n=1,000,000:

        .1% mutations    1% mutations    10% mutations     no mutations
          cmap  hmap     cmap   hmap      cmap   hmap       cmap  hmap
insert:    311    25      310     60       311     59        310    60
iterate:    25    62       25     64        25     57         25    60
search:    115   637      197   2266      1803   7284        101    67
destroy:   103    64       90     59        25     13        104    66

n=100,000:

        .1% mutations    1% mutations    10% mutations     no mutations
          cmap  hmap     cmap   hmap      cmap   hmap       cmap  hmap
insert:     25     6       26      5        25      5         25     5
iterate:     1     3        1      3         1      3          2     3
search:     12    57       27    219       164    735         10     5
destroy:     5     3        6      3         2      1          6     4

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
9 years agoovs-ctl: Raise the limit on the number of open file descriptors.
Alex Wang [Tue, 20 May 2014 21:16:54 +0000 (14:16 -0700)]
ovs-ctl: Raise the limit on the number of open file descriptors.

Since the removal of dispatcher thread, OVS creates 'n-handler-threads'
file descriptors for each bridge port.  To allow more bridge ports
be supported, this commit raises the limit on the number of open file
descriptors from 7500 to 65535.

Bug #1254038.

Signed-off-by: Alex Wang <alexw@nicira.com>
9 years agodpif: Refactor flow dumping interface to make better sense for batching.
Ben Pfaff [Tue, 20 May 2014 18:37:02 +0000 (11:37 -0700)]
dpif: Refactor flow dumping interface to make better sense for batching.

Commit a6ce4b9d251 (ofproto-dpif-upcall: Avoid use-after-free in
revalidate() corner case.) showed that it is somewhat tricky to correctly
use the existing dpif flow dumping interface to obtain batches of flows.
One has to be careful about calling dpif_flow_dump_next_may_destroy_keys()
before going on to the next flow.

A better interface is possible, one that is naturally oriented toward
retrieving batches when that is a useful optimization.  This commit
replaces the dpif interface by such a design, and updates both the
implementations and the callers to adopt it.

This is a fairly large change, but I think that the code in
ofproto-dpif-upcall is easier to understand after the change.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoAUTHORS: Fix spelling of Anoob Soman's name.
Ben Pfaff [Tue, 20 May 2014 18:22:11 +0000 (11:22 -0700)]
AUTHORS: Fix spelling of Anoob Soman's name.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoofproto-dpif-xlate: Add xlate_normal_flood()
Flavio Leitner [Fri, 11 Apr 2014 21:34:15 +0000 (18:34 -0300)]
ofproto-dpif-xlate: Add xlate_normal_flood()

This is also needed for multicast snooping.

Acked-by: Thomas Graf <tgraf@redhat.com>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoofproto/xlate: Move is_admissible() up
Flavio Leitner [Fri, 11 Apr 2014 21:34:14 +0000 (18:34 -0300)]
ofproto/xlate: Move is_admissible() up

No functional changes.  This is just for better readability
when the multicast snooping learning and sending functions
are added to the code.

Acked-by: Thomas Graf <tgraf@redhat.com>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agodpif: Comestic indentation fixes
Flavio Leitner [Fri, 11 Apr 2014 21:34:13 +0000 (18:34 -0300)]
dpif: Comestic indentation fixes

No functionality is changed. This is needed on
a further commit adding REV_MCAST_SNOOPING.

Acked-by: Thomas Graf <tgraf@redhat.com>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agopacket: Add function ip_is_local_multicast()
Flavio Leitner [Fri, 11 Apr 2014 21:34:08 +0000 (18:34 -0300)]
packet: Add function ip_is_local_multicast()

RFC4541- IGMP and MLD Snooping Switches Considerations
recommends to have different actions for local and
non-local multicast traffic.

Acked-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agopackets: Add igmp header definitions
Daniel Borkmann [Fri, 11 Apr 2014 21:34:07 +0000 (18:34 -0300)]
packets: Add igmp header definitions

Add basic header structure and definitions into packet.h.

Acked-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agonetinet: Add IPPROTO_IGMP definition
Daniel Borkmann [Fri, 11 Apr 2014 21:34:06 +0000 (18:34 -0300)]
netinet: Add IPPROTO_IGMP definition

Add the definition of Internet Group Management Protocol.

Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoovs-vsctl: Add error column to show command
Thomas Graf [Thu, 10 Apr 2014 10:50:11 +0000 (12:50 +0200)]
ovs-vsctl: Add error column to show command

a425a102-c317-4743-b0ba-79d59ff04a74
    Bridge "br0"
        [...]
        Port test
            Interface test
                type: vxlan
                options: {unknown="1"}
                error: "test: could not set configuration (Invalid argument)"
    ovs_version: "2.1.90"

Signed-off-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agovswitchd: Add error column to Interface table to store error condition
Thomas Graf [Thu, 10 Apr 2014 10:50:10 +0000 (12:50 +0200)]
vswitchd: Add error column to Interface table to store error condition

Store the error condition of a failed port configuration in a new
column 'error' in the Interface table.

Example:
$ ovs-vsctl add-port br0 test -- \
     set Interface test type=vxlan options:unknown=1
ovs-vsctl: Error detected while setting up 'test'.  [...]

$ ovs-vsctl list Interface test | grep error
error         : "test: could not set configuration (Invalid argument)"

Fixing the error will clear the error column:
$ ovs-vsctl set Interface test options:remote_ip=1.1.1.1
$ ovs-vsctl list Interface test | grep error
error         : []
$

For now, the high level error messages when opening and configuring
the netdev are used. Further patches can extend passing the error
pointer into the individual netdev implementations to allow for more
fine grained error messages to be stored.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agovlog: Provide convenience macros to additionally store log messages in buffer
Thomas Graf [Thu, 10 Apr 2014 10:50:09 +0000 (12:50 +0200)]
vlog: Provide convenience macros to additionally store log messages in buffer

Signed-off-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolib/classifier: Rename 'cls_subtable_cache' as 'cls_subtables'.
Jarno Rajahalme [Mon, 19 May 2014 17:41:03 +0000 (10:41 -0700)]
lib/classifier: Rename 'cls_subtable_cache' as 'cls_subtables'.

'cache' gives an inexact connotation, as the list is always expected
to be in order and contain pointers to all the subtables.

The struct cls_subtables fields are are also renamed to be more readable.

struct cls_classifier fields 'subtables' is remamed to 'subtables_map' and
'subtables_priority' is renamed to 'subtables',

There are no functional changes in this patch.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
9 years agoovs-rcu: Fix typo in comment.
Ben Pfaff [Thu, 8 May 2014 23:47:35 +0000 (16:47 -0700)]
ovs-rcu: Fix typo in comment.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoovs-rcu: Add OVSRCU_TYPE_INITIALIZER which initializes OVSRCU_TYPE variables to NULL.
Ryan Wilson [Mon, 19 May 2014 07:09:24 +0000 (00:09 -0700)]
ovs-rcu: Add OVSRCU_TYPE_INITIALIZER which initializes OVSRCU_TYPE variables to NULL.

Signed-off-by: Ryan Wilson <wryan@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoacinclude.m4: Fix "sparse", via detection of GNU make "if" directive.
Ben Pfaff [Mon, 19 May 2014 14:52:21 +0000 (07:52 -0700)]
acinclude.m4: Fix "sparse", via detection of GNU make "if" directive.

Make treats tabs very differently from spaces at the beginning of a line,
so this test must use a tab instead of a space.  This partially reverts
commit a0903134d2d60 (acinclude.m4: Expand tabs).

Without this commit, the build system never enables checking with sparse
because it never detects that GNU make "if" works.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
9 years agotests: Check dpif-netdev odp_actions consistency.
Joe Stringer [Thu, 8 May 2014 00:37:52 +0000 (12:37 +1200)]
tests: Check dpif-netdev odp_actions consistency.

Ensure that upcall key matches flow install and flow_dump for userspace
datapath. This was previously assumed, but not tested. This makes the
assumption more explicit.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
9 years agotests: Create dpif-netdev.at.
Joe Stringer [Tue, 13 May 2014 02:45:30 +0000 (14:45 +1200)]
tests: Create dpif-netdev.at.

Shift datapath flow test macros and "ofproto-dpif - dummy interface" out
into a separate file.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
9 years agoodp-util: Always serialise recirculation in upcall key.
Joe Stringer [Fri, 9 May 2014 01:58:32 +0000 (13:58 +1200)]
odp-util: Always serialise recirculation in upcall key.

The userspace and kernel datapaths previously differed on their
treatment of the recirc_id and dp_hash fields when sending upcalls.
While the kernel datapath would always serialise these fields, the
userspace would not. When using the userspace datapath, this would cause
a mismatch between the odp flow key in an upcall compared to the one
that is serialised upon flow_dump.

This patch brings the userspace datapath behaviour back in line with the
kernel datapath by always serialising recirc_id and dp_hash to odp.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
9 years agotests: Remove duplicate STRIP_USED definition.
Joe Stringer [Tue, 13 May 2014 03:08:58 +0000 (15:08 +1200)]
tests: Remove duplicate STRIP_USED definition.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
9 years agoodp-util: Improve formatting of ND export to odp.
Joe Stringer [Thu, 15 May 2014 03:56:30 +0000 (15:56 +1200)]
odp-util: Improve formatting of ND export to odp.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agoUse prefix trie lookup for IPv4 by default.
Jarno Rajahalme [Fri, 16 May 2014 19:51:11 +0000 (12:51 -0700)]
Use prefix trie lookup for IPv4 by default.

Unless otherwise configured, the prefix trie lookup is enabled for
IPv4 destination and source address fields.  A new keyword "none" is
accepted as the value of "prefixes" in the OVSDB Flow_Table column.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agonetdev: Remove netdev from global shash when the user is changing interface configura...
Ryan Wilson [Fri, 16 May 2014 09:17:58 +0000 (02:17 -0700)]
netdev: Remove netdev from global shash when the user is changing interface configuration.

When the user changes port type (i.e. changing p0 from type 'internal' to
'gre'), the netdev must first be deleted, then re-created with the new type.
Deleting the netdev requires there exist no more references to the netdev.
However, the xlate cache holds references to netdevs and the cache is only
invalidated by revalidator threads. Thus, if cache is not invalidated prior to
the netdev being re-created, the netdev will not be able to be re-created and
the configuration change will fail.

This patch always removes the netdev from the global netdev shash when the
user changes port type. This ensures that the new netdev can always be created
while handler and revalidator threads can retain references to the old netdev
until they are finished.

Signed-off-by: Ryan Wilson <wryan@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Install internal rule should not change the match content.
Andy Zhou [Sat, 10 May 2014 02:13:47 +0000 (19:13 -0700)]
ofproto-dpif: Install internal rule should not change the match content.

Without this patch, the match passed into to
ofproto_dpif_add_internal_flow() are modified. The mask of dl_type will
always be converted from wildcarded match into exact match due to
calling rule_dpif_lookup_in_table(). The fix makes sure
ofproto_dpif_add_internal_flow() does not change the original match,
and makes the match passed as const in the
ofproto_dpif_add_internal_flow() API.

This bug prevents bond module from properly tracking the post
recirculation rules installed in the internal table. The existing rule
is always deleted followed by reinstalling of the same rule.

The observable behavior of the bug is that bond module losses track
of the slave's stats, after the slave is rebalanced. Although traffic
flows through the slave just fine.

Bug #1229225

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-atomic: Remove atomic_uint64_t and atomic_int64_t.
Simon Horman [Wed, 14 May 2014 07:19:35 +0000 (16:19 +0900)]
ovs-atomic: Remove atomic_uint64_t and atomic_int64_t.

Some concern has been raised by Ben Pfaff that atomic_uint64_t may not
be portable. In particular on 32bit platforms that do not have atomic
64bit integers.

Now that there are no longer any users of atomic_uint64_t remove it
entirely. Also remove atomic_int64_t which has no users.

Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-upcall: Use atomic_long in struct udpif
Simon Horman [Wed, 14 May 2014 07:19:34 +0000 (16:19 +0900)]
ofproto-dpif-upcall: Use atomic_long in struct udpif

Some concern has been raised by Ben Pfaff that atomic_uint64_t may not
be portable. Accordingly, use atomic_ulong instead of atomic_uint64_t
in struct ofproto.

This is in preparation for removing atomic_uint64_t entirely.

Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Break out MPLS controller tests into their own test
Simon Horman [Fri, 16 May 2014 02:30:25 +0000 (11:30 +0900)]
ofproto-dpif: Break out MPLS controller tests into their own test

This makes maintaining the controller test slightly easier
by splitting it in two.

Based on a similar patch by Joe Stringer.

Cc: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-upcall: Avoid use-after-free in revalidate() corner cases.
Ben Pfaff [Thu, 15 May 2014 22:52:17 +0000 (15:52 -0700)]
ofproto-dpif-upcall: Avoid use-after-free in revalidate() corner cases.

The loop in revalidate() needs to ensure that any data obtained from
dpif_flow_dump_next() is used before it is destroyed, as indicated by
dpif_flow_dump_next_may_destroy_keys().  In the common case, where
processing reaches the end of the main "while" loop, it does this, but
in two corner cases the code in the loop execute "continue;", which skipped
the check.  This commit fixes the problem.

Bug #1249988.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
10 years agodatapath: sample action without side effects
Simon Horman [Thu, 15 May 2014 00:05:03 +0000 (09:05 +0900)]
datapath: sample action without side effects

The sample action is rather generic, allowing arbitrary actions to be
executed based on a probability. However its use, within the Open vSwitch
code-base is limited: only a single user-space action is ever nested.

A consequence of the current implementation of sample actions is that
depending on weather the sample action executed (due to its probability)
any side-effects of nested actions may or may not be present before
executing subsequent actions.  This has the potential to complicate
verification of valid actions by the (kernel) datapath. And indeed adding
support for push and pop MPLS actions inside sample actions is one case
where such case.

In order to allow all supported actions to be continue to be nested inside
sample actions without the potential need for complex verification code
this patch changes the implementation of the sample action in the kernel
datapath so that sample actions are more like a function call and any side
effects of nested actions are not present when executing subsequent
actions.

With the above in mind the motivation for this change is twofold:

* To contain side-effects the sample action in the hope of making it
  easier to deal with in the future and;
* To avoid some rather complex verification code introduced in the MPLS
  datapath patch.

Some notes about the implementation:

* This patch silently changes the behaviour of sample actions whose nested
  actions have side-effects. There are no known users of such sample
  actions.

* sample() does not clone the skb for the only known use-case of the sample
  action: a single nested userspace action. In such a case a clone is not
  needed as the userspace action has no side effects.

  Given that there are no known users of other nested actions and in order
  to avoid the complexity of predicting if other sequences of actions have
  side-effects in such cases the skb is cloned.

* As sample() provides a cloned skb in the unlikely case where there are
  nested actions other than a single userspace action it is no longer
  necessary to clone the skb in do_execute_actions() when executing a
  recirculation action just because the keep_skb parameter is set: this
  parameter was only set when processing the nested actions of a sample
  action.  Moreover it is possible to remove the keep_skb parameter of
  do_execute_actions entirely.

* As sample() provides either a cloned skb or one that has had a
  reference taken (using keep_skb) to do_execute_actions()
  the original skb passed to sample() is never consumed. Thus the
  caller of sample() (also do_execute_actions()) can use its generic
  error handling to free the skb on error.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agotests: Change to parse dynamically allocated ports on windows.
Gurucharan Shetty [Mon, 12 May 2014 22:30:41 +0000 (15:30 -0700)]
tests: Change to parse dynamically allocated ports on windows.

In Windows, we use kernel assigned TCP port for ssl/tcp and
unixctl. In tests, we parse the log files of ovsdb-server.log,
test-sflow.log and test-netflow.log to get this port. In all
the above cases, tcp port is allocated first and then the unixctl port.
So a 'head -1' on the result should be safe.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovsdb-server.at: Skip transient transaction tests for Windows.
Gurucharan Shetty [Mon, 12 May 2014 16:48:36 +0000 (09:48 -0700)]
ovsdb-server.at: Skip transient transaction tests for Windows.

Windows port does not yet implement ovsdb-server's "--run" option.
Till it is implemented, skip the tests.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoPrepare for post-2.3.0 (2.3.90).
Justin Pettit [Thu, 15 May 2014 21:12:06 +0000 (14:12 -0700)]
Prepare for post-2.3.0 (2.3.90).

Signed-off-by: Justin Pettit <jpettit@nicira.com>
10 years agoPrepare for 2.3.0.
Justin Pettit [Thu, 15 May 2014 21:09:39 +0000 (14:09 -0700)]
Prepare for 2.3.0.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
10 years agolib/classifier: Simpilify array ordering.
Jarno Rajahalme [Thu, 15 May 2014 02:53:51 +0000 (19:53 -0700)]
lib/classifier: Simpilify array ordering.

The terminology we used for subtable ordering ('splice', 'right
before') was inherited from an earlier use of a linked list, and
turned out to be confusing when applied to an array.  Also, we only
ever move one subtable earlier or later within the array, so we can
simplify the code as well.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-pki: Workaround lack of /dev/stdin in Windows.
Gurucharan Shetty [Mon, 12 May 2014 20:08:35 +0000 (13:08 -0700)]
ovs-pki: Workaround lack of /dev/stdin in Windows.

This lets us generate certs for unit tests on Windows

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
10 years agoodp-util: Fix a comment.
Joe Stringer [Mon, 12 May 2014 22:07:18 +0000 (10:07 +1200)]
odp-util: Fix a comment.

The comment was very specific to one user of the function, and had a
typo. This change reflects the wider effect of the case.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agotest-ovsdb: Fix setvbuf incompatibility on Windows.
Gurucharan Shetty [Mon, 12 May 2014 16:38:48 +0000 (09:38 -0700)]
test-ovsdb: Fix setvbuf incompatibility on Windows.

setvbuf() in Windows treats _IOLBF to be the same as _IOFBF. So
we cannot have size as zero (otherwise, there is a crash).

Workaround is to set _IONBF. I don't see unit test failures
because of the change.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoutil: set_program_name() can be called twice with different names.
Gurucharan Shetty [Mon, 12 May 2014 21:55:46 +0000 (14:55 -0700)]
util: set_program_name() can be called twice with different names.

Ex: ovstest.c

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoutil: Disable popups while asserting in windows.
Gurucharan Shetty [Mon, 12 May 2014 21:49:58 +0000 (14:49 -0700)]
util: Disable popups while asserting in windows.

The default behavior for programs is to display a popup
after an assert/abort etc. This is not an ideal behavior because
this needs user intervention.

set_program_name, though not an ideal place to disable this, is
a useful place because it is called by all programs including
unit test binaries.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agotests/library.at: Disable unix socket tests on Windows.
Gurucharan Shetty [Fri, 9 May 2014 19:46:54 +0000 (12:46 -0700)]
tests/library.at: Disable unix socket tests on Windows.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-pki: Pass correct argument to 'sign' command.
Gurucharan Shetty [Mon, 12 May 2014 20:01:02 +0000 (13:01 -0700)]
ovs-pki: Pass correct argument to 'sign' command.

The first argument passed to 'sign' command is used as prefix
for both req.pem and cert.pem.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agotimeval: Workaround strftime bug in VS 2013.
Gurucharan Shetty [Mon, 12 May 2014 19:55:24 +0000 (12:55 -0700)]
timeval: Workaround strftime bug in VS 2013.

Visual Studio 2013's behavior is to crash when 0 is passed as second
argument to strftime.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
10 years agoovsdb: Open database in binary mode.
Gurucharan Shetty [Thu, 8 May 2014 20:31:18 +0000 (13:31 -0700)]
ovsdb: Open database in binary mode.

Some ovsdb-tool related unit tests fail with bad checksum errors
while reading transactions from database. It is most likely because
of the CR at the end of line. Using binary mode solves the problem.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agometa-flow: Use OXM-defined constant for TCP flags in OpenFlow 1.5.
Ben Pfaff [Wed, 14 May 2014 17:33:35 +0000 (10:33 -0700)]
meta-flow: Use OXM-defined constant for TCP flags in OpenFlow 1.5.

This also adds the definitions of a few other OXM headers we didn't have
yet.

EXT-109.
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agometa-flow: Encode OXM version information into struct mf_field.
Ben Pfaff [Sat, 10 May 2014 01:18:17 +0000 (18:18 -0700)]
meta-flow: Encode OXM version information into struct mf_field.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agonx-match: Refactor nxm_put_ip() to handle all IPv4 and IPv6 fields.
Ben Pfaff [Sat, 10 May 2014 01:16:38 +0000 (18:16 -0700)]
nx-match: Refactor nxm_put_ip() to handle all IPv4 and IPv6 fields.

Until now, some fields have been handled in the caller, and the caller has
been responsible for distinguishing ICMPv4 from ICMPv6.  This
implementation seems to make the code a little easier to understand.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoImplement OpenFlow 1.5 port desc stats request.
Ben Pfaff [Thu, 8 May 2014 06:18:46 +0000 (23:18 -0700)]
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>
10 years agoImplement OpenFlow 1.5 group desc stats request.
Ben Pfaff [Thu, 8 May 2014 06:49:00 +0000 (23:49 -0700)]
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>
10 years agoAdd skeleton for OF1.5 support.
Ben Pfaff [Wed, 7 May 2014 20:42:24 +0000 (13:42 -0700)]
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>
10 years agoRemove --enable-of14 option because the implementation is now safe.
Ben Pfaff [Fri, 9 May 2014 20:45:03 +0000 (13:45 -0700)]
Remove --enable-of14 option because the implementation is now safe.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-util: Remove ofputil_get_phy_port_size().
Ben Pfaff [Fri, 9 May 2014 21:12:06 +0000 (14:12 -0700)]
ofp-util: Remove ofputil_get_phy_port_size().

The size is not fixed for OpenFLow 1.4 and later, so it's a little
deceptive to return any particular value.  This function was only used in
one place, so move it inline there.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-util: Simplify ofputil_decode_switch_features().
Ben Pfaff [Fri, 9 May 2014 19:36:30 +0000 (12:36 -0700)]
ofp-util: Simplify ofputil_decode_switch_features().

It does not need to check the size, because the decoder in ofp-msgs.c
checks for a valid size.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoImplement OpenFlow 1.4 queue statistics.
Ben Pfaff [Fri, 9 May 2014 19:28:09 +0000 (12:28 -0700)]
Implement OpenFlow 1.4 queue statistics.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoImplement OpenFlow 1.4 port statistics.
Ben Pfaff [Fri, 9 May 2014 20:35:27 +0000 (13:35 -0700)]
Implement OpenFlow 1.4 port statistics.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoImplement basic OpenFlow 1.4 table-mod message.
Ben Pfaff [Fri, 9 May 2014 16:11:05 +0000 (09:11 -0700)]
Implement basic OpenFlow 1.4 table-mod message.

Vacancy events and eviction are not yet implemented--see OPENFLOW-1.1+.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoImplement OpenFlow 1.4 port_mod messages.
Ben Pfaff [Fri, 9 May 2014 15:57:31 +0000 (08:57 -0700)]
Implement OpenFlow 1.4 port_mod messages.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-util: Implement OpenFlow 1.4 port status and port desc reply messages.
Ben Pfaff [Tue, 13 May 2014 01:15:28 +0000 (18:15 -0700)]
ofp-util: Implement OpenFlow 1.4 port status and port desc reply messages.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-util: Reduce duplicate code.
Ben Pfaff [Thu, 8 May 2014 06:35:35 +0000 (23:35 -0700)]
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>
10 years agoofp-util: Generalize functions for parsing OF1.3+ properties.
Ben Pfaff [Sat, 10 May 2014 02:29:56 +0000 (19:29 -0700)]
ofp-util: Generalize functions for parsing OF1.3+ properties.

The main effect is to move these functions a little earlier in the file.

Also, OpenFlow 1.4 changed the table-features specific error codes to new
values that apply to all property sets, so this commit updates the error
code names and adds the appropriate OpenFlow 1.4+ codes.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-util: Remove ofputil_count_phy_ports().
Ben Pfaff [Thu, 8 May 2014 04:39:00 +0000 (21:39 -0700)]
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>
10 years agoofp-msgs: New functions ofpmp_version() and ofpmp_decode_raw().
Ben Pfaff [Wed, 7 May 2014 22:11:28 +0000 (15:11 -0700)]
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>
10 years agoofp-util: Fix definition of OFPUTIL_P_OF13_UP.
Ben Pfaff [Wed, 7 May 2014 20:46:39 +0000 (13:46 -0700)]
ofp-util: Fix definition of OFPUTIL_P_OF13_UP.

It should include OF1.4.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-ofctl: Fix port lookup and "ovs-ofctl" behavior for OpenFlow 1.3+.
Ben Pfaff [Fri, 9 May 2014 04:20:22 +0000 (21:20 -0700)]
ovs-ofctl: Fix port lookup and "ovs-ofctl" behavior for OpenFlow 1.3+.

ovs-ofctl supports using port names in commands that operate on ports.  It
does this by connecting to the switch, listing the ports, and picking out
the one with the specified name.  However, this didn't work properly for
OpenFlow 1.3+, because it always used an OFPT_FEATURES_REQUEST to list the
ports, and in OpenFlow 1.3+ the reply to this request does not include a
list of ports.  This commit fixes the problem (using code that previously
was just a fallback when there were too many ports to fit in an
OFPT_FEATURES_REPLY).

For similar reasons, "ovs-ofctl show" wasn't listing the switch's ports
when it connected to a switch over OpenFlow 1.3 or later.  This commit
fixes that bug also.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Conflicts:
utilities/ovs-ofctl.c

10 years agoAUTHORS: Add Ashwin Swaminathan.
Ben Pfaff [Wed, 14 May 2014 17:25:11 +0000 (10:25 -0700)]
AUTHORS: Add Ashwin Swaminathan.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-xlate: Fix null pointer dereference
Anoob Soman [Wed, 14 May 2014 13:32:16 +0000 (14:32 +0100)]
ofproto-dpif-xlate: Fix null pointer dereference

actions (in xlate_actions__) would be NULL when xlate_actions()
is called from packet_out()->ofproto_dpif_execute_actions().
This causes a NULL pointer to be dereferenced when
ctx.xbridge->netflow is set.

Signed-off-by: Anoob Soman <anoob.soman@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Free skb(s) on recirculation error
Simon Horman [Tue, 13 May 2014 05:46:18 +0000 (14:46 +0900)]
datapath: Free skb(s) on recirculation error

This patch attempts to ensure that skb(s) are always freed (once)
if if an error occurs in execute_recirc(). It does so in two ways:

1. Ensure that execute_recirc() always consimes skb passed to it.
   Specifically, free the skb if the call to ovs_flow_extract() fails.

2. Return from the recirc case in execute_recirc() whenever
   the skb has not been cloned immediately above.

   This is only the case if the action is both the last action and the
   keep_skb parameter of execute_recirc is not true.  As it is the last
   action and the skb is consumed one way or another by execute_recirc() it
   is correct to return here.  In particular this avoids the possibility of
   the skb, which has been consumed by execute_recirc() from being freed.

   Conversely if this is not the case then the skb has been cloned
   and the clone has been consumed by execute_recirc().
   This leads to three sub-cases:
   * If execute_recirc() returned an error code then the original skb
     will be freed by the error handling code below the case statement in
     do_execute_actions().
   * If this is not the last action then action processing will continue,
     using the original skb.
   * If this is the last action then it must also be the case that keep_skb
     is true (otherwise the skb would not have been cloned). Thus
     do_execute_actions() will return without freeing the original skb.

Signed-off-by: Simon Horman <horms@verge.net.au>
[jesse: use kfree_skb instead of consume_skb on error path]
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agolib/classifier: Fix array splicing.
Jarno Rajahalme [Mon, 12 May 2014 06:38:44 +0000 (23:38 -0700)]
lib/classifier: Fix array splicing.

Array splicing was broken when multiple elements were being moved,
resulting in the priority order being mixed.  This came up when the
highest priority rule from a subtable was removed and the subtable
needed to be moved down the priority list by more than one position.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoINSTALL: Describe how to use a separate build directory.
Ben Pfaff [Tue, 13 May 2014 01:20:39 +0000 (18:20 -0700)]
INSTALL: Describe how to use a separate build directory.

CC: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
CC: Andy Zhou <azhou@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
10 years agoofproto-dpif.at: Fix a race in "ofproto-dpif - patch ports" test
YAMAMOTO Takashi [Fri, 25 Apr 2014 04:25:36 +0000 (13:25 +0900)]
ofproto-dpif.at: Fix a race in "ofproto-dpif - patch ports" test

Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
10 years agoofproto-dpif.h: Fix a comment
YAMAMOTO Takashi [Wed, 16 Apr 2014 09:27:37 +0000 (18:27 +0900)]
ofproto-dpif.h: Fix a comment

Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
10 years agodpif-netdev: Remove unused members
YAMAMOTO Takashi [Tue, 15 Apr 2014 05:59:30 +0000 (14:59 +0900)]
dpif-netdev: Remove unused members

Simplify code and update comments after commit 61e7deb1.
("dpif-netdev: Use RCU to protect data.")

Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
10 years agoofproto-dpif: Whitespace fixes
YAMAMOTO Takashi [Fri, 11 Apr 2014 04:39:37 +0000 (13:39 +0900)]
ofproto-dpif: Whitespace fixes

Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
10 years agoofproto-dpif.at: Fix races in dpif/dump-flows test
YAMAMOTO Takashi [Thu, 10 Apr 2014 11:46:08 +0000 (11:46 +0000)]
ofproto-dpif.at: Fix races in dpif/dump-flows test

Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
10 years agoofproto-dpif.at: Use OVS_APP_EXIT_AND_WAIT where appropriate
YAMAMOTO Takashi [Thu, 10 Apr 2014 11:10:38 +0000 (11:10 +0000)]
ofproto-dpif.at: Use OVS_APP_EXIT_AND_WAIT where appropriate

Leftover of commit 0c473314.
("ofproto-dpif.at: Wait for the monitor's pidfile disappears where necessary")

Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
10 years agoofproto-dpif.at: Fix some races
YAMAMOTO Takashi [Thu, 10 Apr 2014 10:57:58 +0000 (10:57 +0000)]
ofproto-dpif.at: Fix some races

These races were exposed on my environment by commit c2a77f33.
("tests/ofproto-dpif: Use vlog to test dpif behaviour.")

Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
10 years agoFix a typo in lib/vconn-provider.h.
Rami Rosen [Mon, 12 May 2014 15:44:04 +0000 (08:44 -0700)]
Fix a typo in lib/vconn-provider.h.

This trivial patch fixes a typo in lib/vconn-provider.h.

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agolib/classifier: Add subtable cache diagnostics.
Jarno Rajahalme [Mon, 12 May 2014 04:26:28 +0000 (21:26 -0700)]
lib/classifier: Add subtable cache diagnostics.

Assert failures that should not happen have been reported on some
(non-OVS) test cases.  This patch adds diagnostics to analyze what
goes wrong.

None of the OVS unit tests trigger these, so there is no performance
penalty.

This could be moved to test-classifier once it has served it's
purpose.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agoacinclude.m4: Fix a typo in a help message
YAMAMOTO Takashi [Fri, 9 May 2014 04:29:11 +0000 (13:29 +0900)]
acinclude.m4: Fix a typo in a help message

Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
10 years agoacinclude.m4: Expand tabs
YAMAMOTO Takashi [Fri, 9 May 2014 04:28:49 +0000 (13:28 +0900)]
acinclude.m4: Expand tabs

Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
10 years agoofproto-dpif-upcall: Do not call dpif_handlers_set() when there is no
Alex Wang [Fri, 9 May 2014 21:42:30 +0000 (14:42 -0700)]
ofproto-dpif-upcall: Do not call dpif_handlers_set() when there is no
handler/revalidator configuration change.

dpif_handlers_set(), which dumps all vport from datapath, should not be
called constantly.

Found by inspection.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-ctl: Don't decrease max open fds if already set higher
Thomas Graf [Thu, 8 May 2014 18:45:25 +0000 (20:45 +0200)]
ovs-ctl: Don't decrease max open fds if already set higher

A user may set LimitNOFILE through systemd or other means to set
the maximum number of open file descriptors. Only modify the ulimit
if not already set to a higher value by the user.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Gospodarek <gospo@redhat.com>
10 years agoMakefiles: Fix invocation of dot2pic when builddir != srcdir.
Ben Pfaff [Fri, 9 May 2014 04:36:42 +0000 (21:36 -0700)]
Makefiles: Fix invocation of dot2pic when builddir != srcdir.

CC: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
10 years agodot2pic: Stop assuming the path of the interpreter
YAMAMOTO Takashi [Thu, 8 May 2014 01:44:08 +0000 (10:44 +0900)]
dot2pic: Stop assuming the path of the interpreter

On NetBSD, perl is usually installed as /usr/pkg/bin/perl.

Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
10 years agodot2pic: Use "> $@; mv $@.tmp $@" notation to make this reliably fail
YAMAMOTO Takashi [Thu, 8 May 2014 01:39:17 +0000 (10:39 +0900)]
dot2pic: Use "> $@; mv $@.tmp $@" notation to make this reliably fail

Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
10 years agoRevert commit 74622b44b ("Fix dot2pic make dependencies")
YAMAMOTO Takashi [Thu, 8 May 2014 01:35:54 +0000 (10:35 +0900)]
Revert commit 74622b44b ("Fix dot2pic make dependencies")

It turned out to be non-problem.

Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
10 years agoovs-dev.py: Add support for dpdk builds.
Ethan Jackson [Wed, 7 May 2014 19:56:23 +0000 (12:56 -0700)]
ovs-dev.py: Add support for dpdk builds.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoutil: Remove duplicate CACHE_LINE_SIZE definition.
Ben Pfaff [Thu, 8 May 2014 23:42:24 +0000 (16:42 -0700)]
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>
10 years agoofp-util: compile group stats with visual studio
Andy Zhou [Fri, 25 Apr 2014 08:34:09 +0000 (08:34 +0000)]
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>
10 years agoovs-thread: Issue better diagnostics for locking uninitialized mutexes.
Ben Pfaff [Thu, 8 May 2014 16:20:09 +0000 (09:20 -0700)]
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>
10 years agobond: raise minimal bond distribution per interface
Andy Zhou [Wed, 7 May 2014 05:31:00 +0000 (22:31 -0700)]
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>
10 years agoFAQ: Mention packet filter incompatibility
YAMAMOTO Takashi [Mon, 5 May 2014 00:11:07 +0000 (09:11 +0900)]
FAQ: Mention packet filter incompatibility

Co-authored-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Pritesh Kothari <pritesh.kothari@cisco.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
10 years agotunnel: Fix bug where misconfiguration persists.
Joe Stringer [Sun, 4 May 2014 22:14:18 +0000 (10:14 +1200)]
tunnel: Fix bug where misconfiguration persists.

Previously, misconfiguring a tunnel port to use the exact same settings
would cause the corresponding netdev to never be destroyed. When
attempting to re-use the port as a different type, this would fail and
result in a discrepancy between reported port type and actual netdev in
use.

An example configuration that would previously give unexpected behaviour:

ovs-vsctl add-port br0 p0 -- set int p0 type=gre options:remote_ip=1.2.3.4
ovs-vsctl add-port br0 p1 -- set int p1 type=internal
ovs-vsctl set int p1 type=gre options:remote_ip=1.2.3.4
ovs-vsctl set int p1 type=internal

The final command would report in the ovs-vswitchd logs that it is
attempting to configure the port with the same gre settings as p0,
despite the command specifying the type as internal. Even after
deleting and re-adding the port, the message would reappear.

This patch fixes the bug by dereferencing the netdev in the failure
case of tnl_port_add__(), and ensures that the tnl_port structure is
freed in that case as well.

Bug #1198386.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ryan Wilson <wryan@vmware.com>
Acked-by: Alex Wang <alexw@nicira.com>
10 years agonetdev: Allow netdev_change_seq_changed() to accept const pointers.
Ethan Jackson [Wed, 7 May 2014 20:00:11 +0000 (13:00 -0700)]
netdev: Allow netdev_change_seq_changed() to accept const pointers.

This fixes the following warning in the DPDK code.

../lib/netdev-dpdk.c:790:31: error: passing 'const struct netdev *' to
parameter of type 'struct netdev *' discards qualifiers

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>