cascardo/ovs.git
8 years agoofp-print: Abbreviate duplicated table features.
Ben Pfaff [Tue, 7 Jul 2015 05:15:40 +0000 (22:15 -0700)]
ofp-print: Abbreviate duplicated table features.

I spent some time recently looking at the results of "ovs-ofctl
dump-table-features".  It was really distressing because of the volume of
information.  Every table yielded well over 100 lines of output and for 253
(visible) tables that meant over 25,300 lines of output total, which is
basically unusable.

This commit cuts the volume of output greatly by eliminating most of the
duplication from one table to the next.  The command now prints the full
output only for table 0, and for each subsequent table prints only the
parts that differ.  That reduces the output volume for tables after the
first to only 9 lines each (one of which is blank), for a total of more
like 2,400 lines, which is still not short but reasonably manageable.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
8 years agodpdk: Fix detection of vhost_cuse in dpdk rte_config.h
Gary Mussar [Thu, 23 Jul 2015 17:48:53 +0000 (10:48 -0700)]
dpdk: Fix detection of vhost_cuse in dpdk rte_config.h

Dpdk allows users to create a config that includes other config files and
then override values.

Eg.
defconfig_x86_64-native_vhost_cuse-linuxapp-gcc:

CONFIG_RTE_BUILD_COMBINE_LIBS=y
CONFIG_RTE_BUILD_SHARED_LIB=n
CONFIG_RTE_LIBRTE_VHOST=y
CONFIG_RTE_LIBRTE_VHOST_USER=n

This allows you to have both a vhostuser and vhostcuse config in the same
source tree without the need to replicate everything in those config files
just to change a couple of settings. The resultant .config file has all of
the settings from the included files with the updated settings at the end.
The resultant rte_config.h contains multiple undefs and defines for the
overridden settings.

Eg.
  > grep RTE_LIBRTE_VHOST_USER x86_64-native_vhost_cuse-linuxapp-gcc/include/rte_config.h
  #undef RTE_LIBRTE_VHOST_USER
  #define RTE_LIBRTE_VHOST_USER 1
  #undef RTE_LIBRTE_VHOST_USER

The current mechanism to detect the RTE_LIBRTE_VHOST_USER setting merely
greps the rte_config.h file for the string "define RTE_LIBRTE_VHOST_USER 1"
rather than the final setting of RTE_LIBRTE_VHOST_USER. The following patch
changes this test to detect the final setting of RTE_LIBRTE_VHOST_USER.

Signed-off-by: Gary Mussar <gmussar@ciena.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com
8 years agoofctrl: Fix use of uninitialized hash value in ofctrl_add_flow().
Ben Pfaff [Tue, 28 Jul 2015 18:25:59 +0000 (11:25 -0700)]
ofctrl: Fix use of uninitialized hash value in ofctrl_add_flow().

When ofctrl_add_flow() called ovn_flow_lookup(), the latter used the hash
from the flow's hmap_node, but the former hadn't initialized it at that
point.  This commit fixes the problem.

Reported-by: Russell Bryant <rbryant@redhat.com>
Reported-at: http://openvswitch.org/pipermail/dev/2015-July/057851.html
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
8 years agoovn: Make column comparisons more generic.
Russell Bryant [Tue, 21 Jul 2015 16:59:13 +0000 (12:59 -0400)]
ovn: Make column comparisons more generic.

The logic in ovn-northd's parents_equal() and tags_equal() is useful
for other columns, so convert them into more generic functions that
can be reused.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agoovn-controller: Pass 'br_int' explicitly to functions that need it.
Ben Pfaff [Sat, 18 Jul 2015 19:32:20 +0000 (12:32 -0700)]
ovn-controller: Pass 'br_int' explicitly to functions that need it.

I found it hard otherwise to see what code depended on this.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
8 years agoovn-controller: Explicitly pass the flow table from function to function.
Ben Pfaff [Sat, 18 Jul 2015 19:25:16 +0000 (12:25 -0700)]
ovn-controller: Explicitly pass the flow table from function to function.

As I was working in ovn-controller, I found it hard to tell what code
produced and what code consumed the OpenFlow flow table, because it was
all implicit.  This commit makes the data structure an explicit variable
in the main loop, which makes it easier to see.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
8 years agoovn-controller: Avoid blocking to commit OVSDB transactions.
Ben Pfaff [Sun, 19 Jul 2015 17:56:57 +0000 (10:56 -0700)]
ovn-controller: Avoid blocking to commit OVSDB transactions.

Until now, ovn-controller has been full of loops that commit a transaction
to the OVS or OVN Southbound database.  These blocking loops delay other
work within ovn-controller.  They also make it unsafe to keep pointers to
database records within a single ovn-controller main loop, since calls
to ovsdb_idl_run() can cause IDL records to be destroyed.  This commit
drops all of the blocking calls, instead doing a single commit to the
databases at the end of each main loop.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
8 years agoovn-controller: Drop unnecessary checks for ovsdb_idl_is_alive().
Ben Pfaff [Mon, 13 Jul 2015 00:20:42 +0000 (17:20 -0700)]
ovn-controller: Drop unnecessary checks for ovsdb_idl_is_alive().

The IDLs as created by ovn-controller always retry failed connections,
which means that ovsdb_idl_is_alive() will always report that they are
alive.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
8 years agoovn-controller: Fix potential use-after-free in get_core_config().
Ben Pfaff [Tue, 28 Jul 2015 15:33:42 +0000 (08:33 -0700)]
ovn-controller: Fix potential use-after-free in get_core_config().

It's unsafe to hold a pointer to a row in the IDL across calls to
ovsdb_idl_run() for that IDL.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
8 years agonetdev-linux: Cache the result of previous reading of in4 address.
Alex Wang [Fri, 24 Jul 2015 21:28:42 +0000 (14:28 -0700)]
netdev-linux: Cache the result of previous reading of in4 address.

This commit makes netdev_linux_set_in4() cache the result of previous
reading of in4 address (successful or not).

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agonetdev-linux: Make netdev_linux_get_in6() conform to API definition.
Alex Wang [Thu, 23 Jul 2015 23:25:32 +0000 (16:25 -0700)]
netdev-linux: Make netdev_linux_get_in6() conform to API definition.

The get_in6() API defined in netdev-provider.h requires the return
of error values when the 'netdev' has no assigned IPv6 address or
the 'netdev' does not support IPv6.  However, the netdev_linux_get_in6()
implementation does not follow this (always return 0).  And this
causes the a bug in deleting vlan interfaces created for vlan
splinter.

This commit makes netdev_linux_get_in6() conform to the API definition
and returns the specified error value when failing to get IPv6 address.

VMware-BZ: #1485521
Reported-by: Ronald Lee <ronaldlee@vmware.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agonetdev-linux: Make netdev_linux_notify_sock join RTNLGRP_IPV4_IFADDR
Alex Wang [Tue, 28 Jul 2015 06:43:27 +0000 (23:43 -0700)]
netdev-linux: Make netdev_linux_notify_sock join RTNLGRP_IPV4_IFADDR
and RTNLGRP_IPV6_IFADDR.

Currently the netdev_linux_notify_sock only joins multicast group
RTNLGRP_LINK for link status change notification.  Some ovs features
also require the detection of ip addresses changes and update of the
netdev-linux's cache.  To achieve this, we need to make
netdev_linux_notify_sock join the multicast group RTNLGRP_IPV4_IFADDR
and RTNLGRP_IPV6_IFADDR.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agortnetlink: Extend rtnetlink to support RTNLGRP_IPV4_IFADDR and
Alex Wang [Fri, 24 Jul 2015 21:03:06 +0000 (14:03 -0700)]
rtnetlink: Extend rtnetlink to support RTNLGRP_IPV4_IFADDR and
RTNLGRP_IPV6_IFADDR.

This commit renames the rtnetlink-link.{c,h} to rtnetlink.{c,h}
and extends the module to support RTNLGRP_IPV4_IFADDR and
RTNLGRP_IPV4_IFADDR multicast groups.  A later patch will start
using this module to react to interface address changes.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agodatapath-windows: Avoid BSOD when cleaning up a tunnel vport
Sorin Vinturis [Tue, 28 Jul 2015 10:04:07 +0000 (10:04 +0000)]
datapath-windows: Avoid BSOD when cleaning up a tunnel vport

If an error appears when creating a tunnel vport the cleanup is performed
twice, which causes the tunnel vport to be released also twice and
generate a BSOD.

This patch modifies the tunnel filter cleanup logic to avoid this issue.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/97
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agoofproto-dpif.at: Skip a sflow test.
Gurucharan Shetty [Mon, 27 Jul 2015 20:43:16 +0000 (13:43 -0700)]
ofproto-dpif.at: Skip a sflow test.

sflow is not supported on Windows. So skip the
test.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agortbsd: Include necessary headers on rtbsd.h.
Thadeu Lima de Souza Cascardo [Mon, 27 Jul 2015 17:24:18 +0000 (14:24 -0300)]
rtbsd: Include necessary headers on rtbsd.h.

rtbsd.h requires net/if.h for IF_NAMESIZE. This was not caught because rtbsd.c
did not include rtbsd.h as its first header.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agocollectors: Use closesocket() to close sockets.
Gurucharan Shetty [Mon, 27 Jul 2015 20:41:31 +0000 (13:41 -0700)]
collectors: Use closesocket() to close sockets.

We should use closesocket() while closing sockets so that
closing sockets work fine on both POSIX and Windows.
(In POSIX, we #define closesocket close)

Without this change, sflow unit tests would cause ovs-vswitchd
to crash in Windows.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agoofproto-dpif-mirror: Fix insane waste of memory and time in checking VLANs.
Ben Pfaff [Fri, 24 Jul 2015 22:30:58 +0000 (15:30 -0700)]
ofproto-dpif-mirror: Fix insane waste of memory and time in checking VLANs.

When a mirror was restricted to particular VLANs, this code was allocating,
copying, and freeing a 512-byte block of memory just to check the value of
a single bit in the block.  This fixes the problem.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
8 years agoofproto: Implement OF1.4 Set/Get asynchronous configuration messages.
Niti Rohilla [Thu, 23 Jul 2015 11:35:44 +0000 (17:05 +0530)]
ofproto: Implement OF1.4 Set/Get asynchronous configuration messages.

This patch adds support for Openflow1.4 set/get asynchronous configuration
messages. OpenVSwitch already supports set/get asynchronous configuration
messages for Openflow1.3. In this patch OFPT_SET_ASYNC_CONFIG message
allows the controllers to set the configuration for OFPT_ROLE_STATUS,
OFPT_TABLE_STATUS and OFPT_REQUESTFORWARD in addition to the Openflow1.3
messages. In a OFPT_SET_ASYNC, only the properties that shall be changed
need to be included, properties that are omitted from the message are
unchanged.

The OFPT_GET_ASYNC_CONFIG is used to query the asynchronous configuration
of switch. In a OFPT_GET_ASYNC_REPLY message, all properties must be
included.

According to Openflow1.4 the initial configuration shall be:

   - In the “master” or “equal” role, enable all OFPT_PACKET_IN messages,
     except those with reason OFPR_INVALID_TTL, enable all OFPT_PORT_STATUS
     and OFPT_FLOW_REMOVED messages, and disable all OFPT_ROLE_STATUS,
     OFPT_TABLE_STATUS and OFPT_REQUESTFORWARD messages.

   - In the “slave” role, enable all OFPT_PORT_STATUS messages and disable
     all OFPT_PACKET_IN, OFPT_FLOW_REMOVED, OFPT_ROLE_STATUS,
     OFPT_TABLE_STATUS and OFPT_REQUESTFORWARD messages.

Signed-off-by: Niti Rohilla <niti.rohilla@tcs.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agotunnel: Drop 'base_flow' parameter from tnl_xlate_init().
Ben Pfaff [Thu, 23 Jul 2015 23:22:39 +0000 (16:22 -0700)]
tunnel: Drop 'base_flow' parameter from tnl_xlate_init().

At the point when tnl_xlate_init() is called, all of the members that
tnl_xlate_init() examines in 'base_flow' have the same values in 'flow',
so there's no point in passing both.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
8 years agoofproto-dpif-xlate: Fix handling of write_actions(group(5),output(10)).
Ben Pfaff [Thu, 23 Jul 2015 22:45:05 +0000 (15:45 -0700)]
ofproto-dpif-xlate: Fix handling of write_actions(group(5),output(10)).

This keeps actset_output as OFPP_UNSET in the special case where a single
write_actions() contains a group action followed by an output action.  The
presumably more common case where instructions in separate action lists
contained output and group actions was already properly handled.

Without the fix added by this commit, the test case as updated by this
commit fails.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
8 years agoofproto-dpif-upcall: Fix typo in comment.
Ben Pfaff [Wed, 22 Jul 2015 23:38:18 +0000 (16:38 -0700)]
ofproto-dpif-upcall: Fix typo in comment.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
8 years agoofproto-dpif-upcall: Indentation fix.
Ben Pfaff [Wed, 22 Jul 2015 22:49:51 +0000 (15:49 -0700)]
ofproto-dpif-upcall: Indentation fix.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
8 years agoofproto-dpif-xlate: Remove unused function xlate_out_copy().
Ben Pfaff [Wed, 22 Jul 2015 23:23:33 +0000 (16:23 -0700)]
ofproto-dpif-xlate: Remove unused function xlate_out_copy().

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
8 years agoperf-counter: Fix segfaults on non-Linux platforms.
Thadeu Lima de Souza Cascardo [Fri, 24 Jul 2015 15:22:56 +0000 (12:22 -0300)]
perf-counter: Fix segfaults on non-Linux platforms.

Commit 0eee08dbddea520536197657da7a0b (perf-counter: simplify the
performance macro) introduces the PERF macro, which is empty for non-linux
platforms.

Added to commit bc487aeff2d6823c088d6e4499e0f53e6651523b (ovsdb: Add per
transaction commit instruction counter), that uses such macro, it causes
segfaults, since it makes ovsdb_txn_commit return an uninitialized pointer as
error.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
[blp@nicira.com added {} around the macro expansion]
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agonetflow: Mark some function parameters 'const'.
Ben Pfaff [Wed, 22 Jul 2015 19:16:42 +0000 (12:16 -0700)]
netflow: Mark some function parameters 'const'.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
8 years agodb-ctl-base: make cmd_show_table private
Andy Zhou [Fri, 17 Jul 2015 23:56:02 +0000 (16:56 -0700)]
db-ctl-base: make cmd_show_table private

Instead of requiring user to declare a global variable, pass the value
via ctl_init().

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agodb-ctl-base: remove the recurse member from struct cmd_show_table
Andy Zhou [Fri, 17 Jul 2015 23:39:07 +0000 (16:39 -0700)]
db-ctl-base: remove the recurse member from struct cmd_show_table

The 'recurse' is used during run time to suppress duplicated prints.
It is not essential to describe how show command should work.

This patch remove the 'recurse' member. Duplicated prints is now
suppressed by maintaining an 'sset' of tables that have been printed
at run time.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agoINSTALL.Windows.md: Update the minimum required compiler.
Gurucharan Shetty [Tue, 14 Jul 2015 18:49:57 +0000 (11:49 -0700)]
INSTALL.Windows.md: Update the minimum required compiler.

MSVC 2013 update 4 was released in Nov 2014. Its release notes
says that it has fixed the problem wherein using designated
initializers to initialize unions within structs would
fail to compile.

Using designated initializers is useful in OVS and so this commit
updates the minimum required compiler for Windows.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agodatapath: allocate nr_node_ids flow_stats instead of num_possible_nodes
Chris J Arges [Wed, 22 Jul 2015 11:39:11 +0000 (04:39 -0700)]
datapath: allocate nr_node_ids flow_stats instead of num_possible_nodes

Some architectures like POWER can have a NUMA node_possible_map that
contains sparse entries. This causes memory corruption with openvswitch
since it allocates flow_cache with a multiple of num_possible_nodes()
and
assumes the node variable returned by for_each_node will index into
flow->stats[node].

Use nr_node_ids to allocate a maximal sparse array instead of
num_possible_nodes().

The crash was noticed after 3af229f2 was applied as it changed the
node_possible_map to match node_online_map on boot.
Fixes: 3af229f2071f5b5cb31664be6109561fbe19c861

Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
8 years agoMakefiles: Clean and do not distribute IDL-generated files.
Ben Pfaff [Tue, 21 Jul 2015 18:15:06 +0000 (11:15 -0700)]
Makefiles: Clean and do not distribute IDL-generated files.

IDL-generated files don't need to be distributed, and distributing them
puts them in the source directory rather than the build directory, which
causes "make distcheck" to fail if any of them need to be remade.  To
prevent this, this commit this removes them from ..._SOURCES, moving them
into nodist_..._SOURCES.

IDL-generated files all need to be cleaned, so this commit adds all of
them to CLEANFILES wholesale via a single CLEANFILES += $(OVSIDL_BUILT)
line in ovsdb/automake.mk, removing the individual additions from various
makefiles.

With this commit, "make distcheck" passes for me.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Aaron Conole <aaron@bytheb.org>
8 years agotreewide: Change doubled ";;" to single ";" in C code.
Ben Pfaff [Wed, 22 Jul 2015 15:30:15 +0000 (08:30 -0700)]
treewide: Change doubled ";;" to single ";" in C code.

Except in "for (;;)".

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
8 years agotnl-arp-cache: Remove spurious OVS_UNUSED from tnl_arp_cache_flush().
Ben Pfaff [Tue, 21 Jul 2015 23:04:54 +0000 (16:04 -0700)]
tnl-arp-cache: Remove spurious OVS_UNUSED from tnl_arp_cache_flush().

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
8 years agotnl-arp-cache: Indentation fixes.
Ben Pfaff [Tue, 21 Jul 2015 23:03:49 +0000 (16:03 -0700)]
tnl-arp-cache: Indentation fixes.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
8 years agoAdd 'name' field to logical router port NB schema
Gal Sagie [Tue, 21 Jul 2015 06:11:12 +0000 (09:11 +0300)]
Add 'name' field to logical router port NB schema

Signed-off-by: Gal Sagie <gal.sagie@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agoExtend sFlow agent to report tunnel and MPLS structures
Neil McKee [Sat, 18 Jul 2015 04:37:02 +0000 (21:37 -0700)]
Extend sFlow agent to report tunnel and MPLS structures

Packets are still sampled at ingress only, so the egress
tunnel and/or MPLS structures are only included when there is just 1 output
port.  The actions are either provided by the datapath in the sample upcall
or looked up in the userspace cache.  The former is preferred because it is
more reliable and does not present any new demands or constraints on the
userspace cache, however the code falls back on the userspace lookup so that
this solution can work with existing kernel datapath modules. If the lookup
fails it is not critical: the compiled user-action-cookie is still available
and provides the essential output port and output VLAN forwarding information
just as before.

The openvswitch actions can express almost any tunneling/mangling so the only
totally faithful representation would be to somehow encode the whole list of
flow actions in the sFlow output.  However the standard sFlow tunnel structures
can express most common real-world scenarios, so in parsing the actions we
look for those and skip the encoding if we see anything unusual. For example,
a single set(tunnel()) or tnl_push() is interpreted,  but if a second such
action is encountered then the egress tunnel reporting is suppressed.

The sFlow standard allows "best effort" encoding so that if a field is not
knowable or too onerous to look up then it can be left out. This is often
the case for the layer-4 source port or even the src ip address of a tunnel.
The assumption is that monitoring is enabled everywhere so a missing field
can typically be seen at ingress to the next switch in the path.

This patch also adds unit tests to check the sFlow encoding of set(tunnel()),
tnl_push() and push_mpls() actions.

The netlink attribute to request that actions be included in the upcall
from the datapath is inserted for sFlow sampling only.  To make that option
be explicit would require further changes to the printing and parsing of
actions in lib/odp-util.c, and to scripts in the test suite.

Further enhancements to report on 802.1AD QinQ, 64-bit tunnel IDs, and NAT
transformations can follow in future patches that make only incremental
changes.

Signed-off-by: Neil McKee <neil.mckee@inmon.com>
[blp@nicira.com made stylistic and semantic changes]
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agonetdev-dpdk: Restore txq/rxq number if initialization fails.
Daniele Di Proietto [Thu, 16 Jul 2015 18:48:23 +0000 (19:48 +0100)]
netdev-dpdk: Restore txq/rxq number if initialization fails.

netdev_dpdk_set_multiq() should not set the number of configured rxq
and txq if the driver initialization fails (meaning that the driver
failed to setup the queues).  Otherwise, on a subsequent call to
netdev_dpdk_set_multiq(), the code may believe that the queues have
already been setup and there's no work to be done.

This commit fixes the problem by restoring the old values if
dpdk_eth_dev_init() fails.

Reported-by: Ian Stokes <ian.stokes@intel.com>
Tested-by: Ian Stokes <ian.stokes@intel.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
8 years agorhel: Fix ifup-ovs to delete ports first.
Flavio Leitner [Fri, 17 Jul 2015 16:56:21 +0000 (13:56 -0300)]
rhel: Fix ifup-ovs to delete ports first.

When ifdown isn't executed (system didn't shut down properly),
the interfaces remain in the openvswitch's database.  For the
internal ports or devices that are available when openvswitch
service starts that's not an issue.

However, ovs-vsctl won't do anything for devices created later
(Linux vlan devices for instance) since they are already in the
database. That leaves a inconsistency behind because they will
be left out of the kernel's datapath.

The ifup/ifdown will operate only on configured interfaces, so
this patch fixes the issue by deleting the interface from the
database before attempt to configure it.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Acked-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agoovs-sim: Don't install man page.
Russell Bryant [Mon, 20 Jul 2015 21:34:09 +0000 (17:34 -0400)]
ovs-sim: Don't install man page.

The build system was set up to install the ovs-sim manpage, but not
ovs-sim itself.  I noticed this because the fedora rpm build is
currently broken because the man page was installed but not packaged
yet.  Fix this up by not installing the manpage.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agovtep/automake.mk: Changes to support make distcheck.
Aaron Conole [Mon, 20 Jul 2015 23:13:51 +0000 (19:13 -0400)]
vtep/automake.mk: Changes to support make distcheck.

Add autogenerated files to the CLEANFILES so that they are not kept around
after clean/distclean.

Signed-off-by: Aaron Conole <aaron@bytheb.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agotests/automake.mk: Changes to support make distcheck.
Aaron Conole [Mon, 20 Jul 2015 23:13:50 +0000 (19:13 -0400)]
tests/automake.mk: Changes to support make distcheck.

Add autogenerated files to the CLEANFILES so that they are not kept around
after clean/distclean.

Signed-off-by: Aaron Conole <aaron@bytheb.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agolib/automake.mk: Changes to support make distcheck.
Aaron Conole [Mon, 20 Jul 2015 23:13:49 +0000 (19:13 -0400)]
lib/automake.mk: Changes to support make distcheck.

Eliminate the $(srcdir) requirement on vswitch-idl.ovsidl.  Also, add
autogenerated files to the CLEANFILES so that they are not kept around
after clean/distclean.

Signed-off-by: Aaron Conole <aaron@bytheb.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agodatapath-windows/include/automake.mk: Only build for WIN32 builds
Aaron Conole [Mon, 20 Jul 2015 23:13:48 +0000 (19:13 -0400)]
datapath-windows/include/automake.mk: Only build for WIN32 builds

Signed-off-by: Aaron Conole <aaron@bytheb.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years ago.travis.yml: Tell travis-ci that sudo support is required
Aaron Conole [Mon, 20 Jul 2015 23:13:47 +0000 (19:13 -0400)]
.travis.yml: Tell travis-ci that sudo support is required

.travis/prepare.sh calls sudo.

Signed-off-by: Aaron Conole <aaron@bytheb.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agoofproto-macros: Remove stray garbage from file.
Ben Pfaff [Mon, 20 Jul 2015 20:49:00 +0000 (13:49 -0700)]
ofproto-macros: Remove stray garbage from file.

Due to the way that Autotest works, this text was ignored, but it's still
useless and looks weird and we might as well remove it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
8 years agoacinclude: Silence OVS_FIND_FIELD_IFELSE.
Joe Stringer [Thu, 16 Jul 2015 23:34:03 +0000 (16:34 -0700)]
acinclude: Silence OVS_FIND_FIELD_IFELSE.

Fields found using OVS_FIND_FIELD_IFELSE would previously be printed in
the console during configure. Clean up the output.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agodb-ctl-base: Add "static" to definition of ctl_exit().
Ben Pfaff [Mon, 20 Jul 2015 18:20:05 +0000 (11:20 -0700)]
db-ctl-base: Add "static" to definition of ctl_exit().

The prototype said "static" but the definition did not.

Reported by sparse.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
8 years agoofproto-dpif: Remove prototype for unimplemented function.
Ben Pfaff [Sun, 10 May 2015 20:56:00 +0000 (13:56 -0700)]
ofproto-dpif: Remove prototype for unimplemented function.

The function was removed some time ago, but not the prototype.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
8 years agoofpbuf: Update msg when resizing ofpbuf.
Alex Wang [Mon, 20 Jul 2015 06:13:14 +0000 (23:13 -0700)]
ofpbuf: Update msg when resizing ofpbuf.

Commit 6fd6ed7 (ofpbuf: Simplify ofpbuf API.) introduced the
'header' and 'msg' pointers to 'struct ofpbuf'.  However, we
forget to update the 'msg' pointer when resizing ofpbuf.

This bug could cause serious issue.  For example, in the function
ofputil_encode_nx_packet_in(), the 'msg' pointer is populated in
ofpraw_alloc_xid() when creating the ofpbuf .  Later, the ofpbuf
memory can be reallocated due to the writing to the ofpbuf.
However, since the 'msg' pointer is not updated, the later use of
the 'ofpbuf->msg' will end up writing to either free'ed memory or
memory allocated for other struct.

This commit fixes the bug by always updating the 'header' and
'msg' pointers when the ofpbuf is resized.  Also, a simple test
is added.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agoofp-util: Allow out-of-range indexes in ofputil_decode_geneve_table_reply().
Ben Pfaff [Sun, 12 Jul 2015 18:58:22 +0000 (11:58 -0700)]
ofp-util: Allow out-of-range indexes in ofputil_decode_geneve_table_reply().

Otherwise, if some future version of OVS supports more Geneve options than
the current version, and any of these extras are in use, then one would be
unable to dump them with "ovs-ofctl dump-geneve-map", and any other
OVS-based software that wants to dump the Geneve map to work with the
existing options (i.e. ovn-controller) would fail entirely, instead of
being able to work with at least a subset.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
8 years agoflow: Split miniflow's map.
Jarno Rajahalme [Fri, 17 Jul 2015 22:18:43 +0000 (15:18 -0700)]
flow: Split miniflow's map.

Use two maps in miniflow to allow for expansion of struct flow past
512 bytes.  We now have one map for tunnel related fields, and another
for the rest of the packet metadata and actual packet header fields.
This split has the benefit that for non-tunneled packets the overhead
should be minimal.

Some miniflow utilities now exist in two variants, new ones operating
over all the data, and the old ones operating only on a single 64-bit
map at a time.  The old ones require doubling of code but should
execute faster, so those are used in the datapath and classifier's
lookup path.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agodpif-netdev: Skip also xregs when building a mask.
Jarno Rajahalme [Fri, 17 Jul 2015 22:18:43 +0000 (15:18 -0700)]
dpif-netdev: Skip also xregs when building a mask.

When no mask is passed in, dpif_netdev_mask_from_nlattrs() builds a
mask from all possible fields whose prerequisites are met.  OpenFlow
metadata is not relevant for a datapath flow, so we skip registers and
metadata.  Do this for XREGs as well.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agodatapath: Include datapath actions with sampled-packet upcall to userspace.
Neil McKee [Thu, 11 Jun 2015 16:43:58 +0000 (09:43 -0700)]
datapath: Include datapath actions with sampled-packet upcall to userspace.

If new optional attribute OVS_USERSPACE_ATTR_ACTIONS is added to an
OVS_ACTION_ATTR_USERSPACE action, then include the datapath actions
in the upcall.

This Directly associates the sampled packet with the path it takes
through the virtual switch. Path information currently includes mangling,
encapsulation and decapsulation actions for tunneling protocols GRE,
VXLAN, Geneve, MPLS and QinQ, but this extension requires no further
changes to accommodate datapath actions that may be added in the
future.

Adding path information enhances visibility into complex virtual
networks.

Signed-off-by: Neil McKee <neil.mckee@inmon.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
8 years agotype-props: Avoid a MSVC warning.
Gurucharan Shetty [Fri, 17 Jul 2015 15:48:23 +0000 (08:48 -0700)]
type-props: Avoid a MSVC warning.

Currently, MSVC complains when you have a macro of the
form TYPE_MAXIMUM(uint64_t) because a part of macro becomes
~(uint64_t)0 << 64 with a warning:

C4293: '<<' : shift count negative or too big, undefined behavior.

This commit makes changes to the macro to prevent that warning.

Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agodb-ctl-base: make use of user supplied exit function
Andy Zhou [Tue, 14 Jul 2015 06:24:11 +0000 (23:24 -0700)]
db-ctl-base: make use of user supplied exit function

The user is required to expose the_idl and the_idl_txn global variables,
so that memory can be cleaned up on fatal errors. This patch changes to
ask user to supply an exit function via ctl_init(). What user needs to
do on exit can now remain private.

Signed-off-by: Andy Zhou <azhou@nicira.com>
8 years agodb-ctl-base: remove ctl_get_all_commands() function
Andy Zhou [Tue, 14 Jul 2015 05:18:35 +0000 (22:18 -0700)]
db-ctl-base: remove ctl_get_all_commands() function

all_commands currently is some times accessed directly, some times via
a function call. Change to always access it directly.

Signed-off-by: Andy Zhou <azhou@nicira.com>
8 years agodb-ctl-base: remove db_ctl_show_command table
Andy Zhou [Mon, 13 Jul 2015 21:59:34 +0000 (14:59 -0700)]
db-ctl-base: remove db_ctl_show_command table

It is not clear why "show" command needs its own command table.
Remove it for simplicity.

Signed-off-by: Andy Zhou <azhou@nicira.com>
8 years agoovsdb: Add per transaction commit instruction counter
Andy Zhou [Mon, 1 Jun 2015 21:48:24 +0000 (14:48 -0700)]
ovsdb: Add per transaction commit instruction counter

Measure user space only instruction counters for commit each
transaction. This measurement is mainly useful for
tuning OVSDB internal implementation, such as how OVSDB scales over
number of client connections.

A simple usage example:

ovs-appctl -t ovsdb-server ovsdb-server/perf-counters-clear
ovs-vsctl add-port br0 p3
ovs-appctl -t ovsdb-server ovsdb-server/perf-counters-show
ovsdb_txn_commit            2      906922 453461.0

The commands above show that the 'add-port br p3' command caused ovsdb
to execute 2 transactions. Each transaction takes 453461 instructions,
total 906922 instructions. The number will vary based on number of
ovsdb clients connected.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agoperf-counter: simplify the performance macro
Andy Zhou [Wed, 8 Jul 2015 21:06:12 +0000 (14:06 -0700)]
perf-counter: simplify the performance macro

Replace the original PERF_FUNCTION_BEGIN and PERF_FUNCTION_END
pair with a single PERF macro. This design is also more flexible,
removing the restriction of have only one measurement per function.

The next patch will make use of this macro.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agoperf-counter: initialize perf counter shash before use
Andy Zhou [Wed, 15 Jul 2015 20:22:00 +0000 (13:22 -0700)]
perf-counter: initialize perf counter shash before use

Private variable perf_counters needs to be initialized before
use. Otherwise,  perf_counter_init() call will cause crashes.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agoovn: Fix extra token detection.
Joe Stringer [Tue, 14 Jul 2015 01:19:03 +0000 (18:19 -0700)]
ovn: Fix extra token detection.

This code attempts to first check whether another error was detected for
the string it is parsing, then if it's not at the end of the tokens,
report an error. However, 'errorp' is always a valid pointer to a
'char *', so the first check in this statement always evaluates false.

Furthermore, this undefined behaviour may be optimised out by modern
compilers due to the prior dereference in expr_parse(). Fix this to
check the actual value of *errorp. Also add a test to check this case.

Found by MIT STACK undefined behaviour checker.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agoovs-vsctl: Remove redundant checks.
Joe Stringer [Tue, 14 Jul 2015 00:33:22 +0000 (17:33 -0700)]
ovs-vsctl: Remove redundant checks.

In several places, "br" is dereferenced just before a check such as
"if (br ...)". These checks may be optimised out, and they provide no
additional safety, so this patch removes them.

Found by MIT STACK undefined behaviour checker.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agovtep-ctl: Remove extraneous NULL pointer check.
Joe Stringer [Thu, 9 Jul 2015 22:32:14 +0000 (15:32 -0700)]
vtep-ctl: Remove extraneous NULL pointer check.

OVS will exit if the allocations in this function fail, so this check is
pointless.

Found by MIT STACK undefined behaviour checker.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agoofp-parse: Fix typo in consistency check.
Joe Stringer [Thu, 9 Jul 2015 21:40:53 +0000 (14:40 -0700)]
ofp-parse: Fix typo in consistency check.

This check in parse_ofp_str__() attempted to detect inconsistencies
between matches and actions, or inconsistencies within the actions. In
this case, ofpacts_check() would effectively zero the "usable_protocols"
and return 0 (ie, OK). However, when checking the return parameter, it
checks the pointer rather than the value.

In practice, this seems to only come up for fields which are used
internally in OVS and not exposed for matching from the controller, like
tunnel flags or skb_priority.

Found by MIT STACK undefined behaviour checker.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agoflow: Make compile with MSVC.
Jarno Rajahalme [Fri, 17 Jul 2015 00:42:24 +0000 (17:42 -0700)]
flow: Make compile with MSVC.

MSVC does not like zero sized arrays in structs.  Hence, remove the
'values' member from struct miniflow and add back the getters
miniflow_values() and miniflow_get_values().

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agoovn: Convert tabs to spaces in ovn-sb.xml.
Russell Bryant [Thu, 16 Jul 2015 22:06:09 +0000 (18:06 -0400)]
ovn: Convert tabs to spaces in ovn-sb.xml.

This file used mixed indentation.  Fix it up to be consistent.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agoacinclude: Require libfuse only for DPDK with vhost-cuse.
Daniele Di Proietto [Thu, 25 Jun 2015 14:46:55 +0000 (07:46 -0700)]
acinclude: Require libfuse only for DPDK with vhost-cuse.

DPDK with vhost-user doesn't require libfuse, so we shouldn't link OVS
with libfuse unless DPDK is built with vhost-cuse support.

CC: Rapelly, Varun <vrapelly@sonusnet.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
8 years agoovs-appctl: register unixctl commands in the beginning
Huanle Han [Wed, 15 Jul 2015 15:41:05 +0000 (23:41 +0800)]
ovs-appctl: register unixctl commands in the beginning

Some commands of ovs-appctl were lazily registered when first
bridg or bfd was added. Before that, calling these commands raised a
error("xxx is not a valid command"). The problem commangs included
"bfd/...", "upcall/...","dpif/...","fdb/..." and so on.

Fix this by moving the register into the "bridge_init" and
"bridge_init_ofproto". All commands are registered at the moment
ovs-vswitchd starts.

Signed-off-by: Huanle Han <hanxueluo@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agodatapath-windows: Fixed spelling errors in OVS
Sorin Vinturis [Wed, 15 Jul 2015 08:30:09 +0000 (08:30 +0000)]
datapath-windows: Fixed spelling errors in OVS

Solved some spelling errors observed in the datapath code.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agoovn-nb: Add per-port IP addresses to routers.
Ben Pfaff [Tue, 14 Jul 2015 22:08:40 +0000 (15:08 -0700)]
ovn-nb: Add per-port IP addresses to routers.

A router needs one IP address per port, not just one for the whole router.

Reported-by: Gal Sagie <gal.sagie@gmail.com>
Reported-at: http://openvswitch.org/pipermail/dev/2015-July/057242.html
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agonetdev-linux: do not warn when getting stats for netdev with no vport
Thadeu Lima de Souza Cascardo [Tue, 7 Jul 2015 18:38:51 +0000 (15:38 -0300)]
netdev-linux: do not warn when getting stats for netdev with no vport

When there is no vport for a given netdev, dpif_netlink_vport_get might return
ENODEV. Do not warn a failure to get port stats when that's the case.

This happens when the userspace switch is used.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agotunneling: Allow matching and setting tunnel 'OAM' flag.
Jesse Gross [Wed, 8 Jul 2015 23:02:30 +0000 (16:02 -0700)]
tunneling: Allow matching and setting tunnel 'OAM' flag.

Several encapsulation formats have the concept of an 'OAM' bit
which typically is used with networking tracing tools to
distinguish test packets from real traffic. OVS already internally
has support for this, however, it doesn't do anything with it
and it also isn't exposed for controllers to use. This enables
support through OpenFlow.

There are several other tunnel flags which are consumed internally
by OVS. It's not clear that it makes sense to use them externally
so this does not expose those flags - although it should be easy
to do so if necessary in the future.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agoflow: Factor out flag parsing and formatting routines.
Jesse Gross [Sun, 12 Jul 2015 03:48:29 +0000 (20:48 -0700)]
flow: Factor out flag parsing and formatting routines.

There are several implementations of functions that parse/format
flags and their binary representation. This factors them out into
common routines. In addition to reducing code, it also makes things
more consistent across different parts of OVS.

Signed-off-by: Jesse Gross <jesse@nicira.com>
8 years agoofproto-macros.at: Make check_logs() check all *.log files.
Alex Wang [Wed, 24 Jun 2015 20:51:34 +0000 (13:51 -0700)]
ofproto-macros.at: Make check_logs() check all *.log files.

As we have more daemons with OVN that can be tested using ovs autotest
framework, it is convenient to extend check_logs() to check all *.log
files, except testsuite.log.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agoflow: Eliminate miniflow_clone() and minimask_clone().
Jarno Rajahalme [Wed, 15 Jul 2015 20:17:01 +0000 (13:17 -0700)]
flow: Eliminate miniflow_clone() and minimask_clone().

miniflow_clone() and minimask_clone() are no longer used, remove them
from the API.

Now that miniflow data is always inlined, it makes sense to rename
miniflow_clone_inline() miniflow_clone().

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agomatch: Single malloc minimatch.
Jarno Rajahalme [Wed, 15 Jul 2015 20:17:01 +0000 (13:17 -0700)]
match: Single malloc minimatch.

Allocate the miniflow and minimask in struct minimatch at once, so
that they are consecutive in memory.  This halves the number of
allocations, and allows smaller minimatches to share the same cache
line.

After this a minimatch has one heap allocation for all it's data.
Previously it had either none (when data was small enough to fit in
struct miniflow's inline buffer), or two (when the inline buffer was
insufficient).  Hopefully always having one performs almost the same
as none or two, in average.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agoflow: Always inline miniflows.
Jarno Rajahalme [Wed, 15 Jul 2015 20:17:01 +0000 (13:17 -0700)]
flow: Always inline miniflows.

Now that performance critical code already inlines miniflows and
minimasks, we can simplify struct miniflow by always dynamically
allocating miniflows and minimasks to the correct size.  This changes
the struct minimatch to always contain pointers to its miniflow and
minimask.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agometa-flow: Add a missing break statement.
Jarno Rajahalme [Wed, 15 Jul 2015 20:17:01 +0000 (13:17 -0700)]
meta-flow: Add a missing break statement.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
8 years agodatapath-windows: Fix broken break by distributing resource.h.
Ben Pfaff [Wed, 15 Jul 2015 18:27:16 +0000 (11:27 -0700)]
datapath-windows: Fix broken break by distributing resource.h.

Commit e19a0c6 (datapath-windows: update extension information) added
resource.h but did not distribute it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agodatapath-windows: update extension information
Alin Gabriel Serdean [Wed, 15 Jul 2015 17:44:14 +0000 (10:44 -0700)]
datapath-windows: update extension information

This patch sets additional information about the driver used by various
applications.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agodatapath-windows: Update VXLAN header information
Alin Serdean [Mon, 13 Jul 2015 16:59:26 +0000 (16:59 +0000)]
datapath-windows: Update VXLAN header information

Use tunnel key information on the IP header preceding the VXLAN header.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agodatapath-windows: Solved BSOD when cleaning up the VXLAN tunnel
Sorin Vinturis [Fri, 10 Jul 2015 08:26:51 +0000 (08:26 +0000)]
datapath-windows: Solved BSOD when cleaning up the VXLAN tunnel

When removing vport also remove the vxlan tunnel port.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/94
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agoovn: Minor cleanups in "physical" component comments.
Justin Pettit [Fri, 10 Jul 2015 23:30:52 +0000 (16:30 -0700)]
ovn: Minor cleanups in "physical" component comments.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Gal Sagie <gal.sagie@gmail.com>
8 years agoovs-ofctl.8: Specify correct variable in "snoop" description.
Justin Pettit [Wed, 15 Jul 2015 00:24:50 +0000 (17:24 -0700)]
ovs-ofctl.8: Specify correct variable in "snoop" description.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agolib/automake.mk: Fix dependency typos.
Kyle Upton [Thu, 9 Jul 2015 19:22:46 +0000 (15:22 -0400)]
lib/automake.mk: Fix dependency typos.

Fix dependency issues with lib/ofp-errors.lo and lib/ofp-msgs.lo that
caused problems when building debian packages.

Signed-off-by: Kyle Upton <kupton@baymicrosystems.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agoovn-nb: Add 'name' field to Logical Router
Gal Sagie [Wed, 8 Jul 2015 06:44:33 +0000 (09:44 +0300)]
ovn-nb: Add 'name' field to Logical Router

Adding a name identifier will increase convinence
for Openstack (or Other CMS) that want to identify
the logical router (or store the CMS id in the router name)

Signed-off-by: Gal Sagie <gal.sagie@gmail.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agoRevert "ofctrl: Don't use designated initializers."
Ben Pfaff [Tue, 14 Jul 2015 19:42:43 +0000 (12:42 -0700)]
Revert "ofctrl: Don't use designated initializers."

This reverts commit 0b090f2263807e25be14f90a287c4bfdee2d82ec.  When that
commit was applied, we did not know of a fix for the MSVC bug that it
avoided, but now we know that sufficiently new MSVC 2013 supports this
feature.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Gurucharan Shetty <gshetty@nicira.com>
8 years agotests: Skip IPv6 tests if the system does not support IPv6.
Ben Pfaff [Thu, 9 Jul 2015 15:08:52 +0000 (08:08 -0700)]
tests: Skip IPv6 tests if the system does not support IPv6.

This is only for the tests that actually create IPv6 sockets.  The tests
that merely use IPv6 addresses in flow entries, etc., do not depend on
kernel support.

Reported-by: 俊 赵 <zhaojun12@outlook.com>
Reported-at: http://openvswitch.org/pipermail/discuss/2015-July/018173.html
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
8 years agodebian: Rationalize packaging using new debhelper.
James Page [Tue, 7 Jul 2015 15:04:43 +0000 (16:04 +0100)]
debian: Rationalize packaging using new debhelper.

Newer debhelper versions support overrides, making rules files simpler and
easier to extend.

Requires some changes in how files are installed (_debian build folder
dropped).

Signed-off-by: James Page <james.page@ubuntu.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agodpif-netlink: Fix compiler warning.
Alin Serdean [Mon, 13 Jul 2015 14:15:33 +0000 (14:15 +0000)]
dpif-netlink: Fix compiler warning.

warning C4098: 'dpif_netlink_init_flow_del' : 'void' function returning a value

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agodb-ctl-base: group static functions together
Andy Zhou [Thu, 9 Jul 2015 20:06:57 +0000 (13:06 -0700)]
db-ctl-base: group static functions together

This file follows a convention that all static functions are grouped
towards the beginning, ahead of public functions. Re-arrange the code
to confirm to this convention.  No functional changes.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
8 years agodb-ctl-base: do not require client to expose the "tables" variable
Andy Zhou [Wed, 8 Jul 2015 02:38:42 +0000 (19:38 -0700)]
db-ctl-base: do not require client to expose the "tables" variable

Instead, client now pass it via the modified ctl_init() API.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
8 years agodb-ctl-base: do not expose get_table() API
Andy Zhou [Wed, 8 Jul 2015 02:34:28 +0000 (19:34 -0700)]
db-ctl-base: do not expose get_table() API

Both get_table() and set_cloum() APIs are mostly used within db-ctl-base
library. This patch makes both private to the library.

Add a new ctl_set_colum() API for library client.

The changes are cleanups. No functional changes.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
8 years agohmap: Fix bad advice in comment (plus a typo).
Ben Pfaff [Mon, 13 Jul 2015 04:28:19 +0000 (21:28 -0700)]
hmap: Fix bad advice in comment (plus a typo).

This dates to 2010!

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
8 years agoxml2nroff: Allow comments in block XML.
Ben Pfaff [Sun, 12 Jul 2015 18:59:17 +0000 (11:59 -0700)]
xml2nroff: Allow comments in block XML.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
8 years agonicira-ext: Fix typo in comment.
Ben Pfaff [Sun, 12 Jul 2015 18:54:48 +0000 (11:54 -0700)]
nicira-ext: Fix typo in comment.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
8 years agoUndefined symbol make_unix_socket
Alin Serdean [Wed, 1 Jul 2015 19:01:44 +0000 (19:01 +0000)]
Undefined symbol make_unix_socket

syslog_direct_create defined in (lib/syslog-direct.c) uses make_unix_socket
which is currently undefined on the windows build.

We either can remove the new file from the chain but this patch proposes
to define a wrapper to make_unix_socket in which we return EINVAL.

This will avoid this kind of problems in the future.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
8 years agodb-ctl-base: fix a few typos
Andy Zhou [Wed, 8 Jul 2015 01:59:13 +0000 (18:59 -0700)]
db-ctl-base: fix a few typos

Minor typo and style fixes.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
8 years agohash: Add symmetric L3/L4 hash functions for multipath, bundle hashing.
Jeroen van Bemmel [Mon, 6 Jul 2015 17:58:24 +0000 (12:58 -0500)]
hash: Add symmetric L3/L4 hash functions for multipath, bundle hashing.

Signed-off-by: Jeroen van Bemmel <jvb127@gmail.com>
[blp@nicira.com made code style fixes, expanded documentation]
Signed-off-by: Ben Pfaff <blp@nicira.com>
8 years agodebian: wrap-and-sort
James Page [Tue, 7 Jul 2015 15:04:42 +0000 (16:04 +0100)]
debian: wrap-and-sort

Wrap long lines and sort items in the Debian packaging files.

Signed-off-by: James Page <james.page@ubuntu.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>