cascardo/ovs.git
9 years agodatapath-windows Release lock on HVUpdateNIC
Alin Serdean [Mon, 6 Apr 2015 17:22:06 +0000 (17:22 +0000)]
datapath-windows Release lock on HVUpdateNIC

Release switchContext->dispatchLock in case the vport has not been found.

Acked-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agodatapath-windows: Allow NdisSwitchPortTypeSynthetic to be updated
Alin Serdean [Mon, 6 Apr 2015 17:28:42 +0000 (17:28 +0000)]
datapath-windows: Allow NdisSwitchPortTypeSynthetic to be updated

Allow the port to be updated if it the type is only:
NdisSwitchPortTypeSynthetic

Acked-by: Nithin Raju <nithin@vmware.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoovs-dev.py: Remove vport-*.ko at same time as openvswitch.ko.
Ben Pfaff [Sun, 5 Apr 2015 19:12:14 +0000 (12:12 -0700)]
ovs-dev.py: Remove vport-*.ko at same time as openvswitch.ko.

My guess is that this is the intent.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
9 years agorhel: Package vport-*.ko in Fedora kernel package.
Ben Pfaff [Sun, 5 Apr 2015 19:12:13 +0000 (12:12 -0700)]
rhel: Package vport-*.ko in Fedora kernel package.

Fixes a presumed build break due to unpackaged files.  (Only "presumed" at
this point because it is masked in the VMware build system by the similar
XenServer build failure.)

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
9 years agoxenserver: Package vport-*.ko with kernel module.
Ben Pfaff [Sun, 5 Apr 2015 19:12:12 +0000 (12:12 -0700)]
xenserver: Package vport-*.ko with kernel module.

Fixes a build error due to unpackaged files.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
9 years agoovs-sandbox: Tell gdb to start the daemon.
Russell Bryant [Fri, 3 Apr 2015 20:04:14 +0000 (16:04 -0400)]
ovs-sandbox: Tell gdb to start the daemon.

The current gdb support launches gdb but doesn't start the daemon.
If you start ovsdb-server with gdb, ovs-sandbox produces an error as
it tries to run ovs-vsctl before ovsdb-server is running.  Telling gdb
to start the daemon immediately avoids this error.

There are cases where it's useful to go straight to the gdb prompt,
too.  For example, someone may want to set a breakpoint.  In that
case, it's easy enough to just kill it, set a breakpoint, and execute
'run' again.

In passing, fix indentation to use spaces instead of tabs.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoMakefile.am: Clarify error message about missing distribution files.
Justin Pettit [Sat, 4 Apr 2015 23:30:44 +0000 (16:30 -0700)]
Makefile.am: Clarify error message about missing distribution files.

The error message did not make it clear that the problem was due to
files being in git but not the distribution.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoAUTHORS: Add Kevin Lo.
Ben Pfaff [Sun, 5 Apr 2015 16:58:06 +0000 (09:58 -0700)]
AUTHORS: Add Kevin Lo.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agonetdev-bsd: Fix sign extension bug in ifr_flags on FreeBSD.
Kevin Lo [Sat, 4 Apr 2015 16:59:26 +0000 (00:59 +0800)]
netdev-bsd: Fix sign extension bug in ifr_flags on FreeBSD.

FreeBSD fills the int return value with ifr_flagshigh in the high
16 bits and ifr_flags in the low 16 bits rather than blindly promoting
ifr_flags to an int, which will preserve the sign.
This commit makes sure the flags returned isn't negative and apply mask
0xffff to flags.

Signed-off-by: Kevin Lo <kevlo@FreeBSD.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agodatapath: Turn vports with dependencies into separate modules
Thomas Graf [Sat, 4 Apr 2015 06:24:13 +0000 (08:24 +0200)]
datapath: Turn vports with dependencies into separate modules

Upstream commit:
    The internal and netdev vport remain part of openvswitch.ko. Encap
    vports including vxlan, gre, and geneve can be built as separate
    modules and are loaded on demand. Modules can be unloaded after use.
    Datapath ports keep a reference to the vport module during their
    lifetime.

    Allows to remove the error prone maintenance of the global list
    vport_ops_list.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Also folds in the follow-up commits 9ba559d9ca3 to turned the non-GPL
symbol exports to GPL exports, and fa2d8ff4e35 which fixes a module
reference release bug.

Exports various backwards compat functions linked into the main
openvswitch module as GPL symbols to ensure vport modules can use them.

Some fiddling with the Makefile was needed to work around the fact
that Makefile variables can't contain '-' characters needed to define
'vport-xxx' module sources. Also, Kbuild complains heavily if a
$(module)-y = $(module).o is defined which is actually backed with a .c
file of the same name. Therefore, a new $(build_multi_modules) variable
is defined which lists all module which consist of more than one source
file.

Upstream: 62b9c8d0372 ("ovs: Turn vports with dependencies into separate modules")
Upstream: 9ba559d9ca3 ("openvswitch: Export symbols as GPL symbols.")
Upstream: fa2d8ff4e35 ("openvswitch: Return vport module ref before destruction")
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agoacinclude: Always assume buggy strtok_r() for glibc < 2.8.
Ben Pfaff [Fri, 3 Apr 2015 22:10:57 +0000 (15:10 -0700)]
acinclude: Always assume buggy strtok_r() for glibc < 2.8.

Lately our internal build system has been seeing intermittent failures that
I can't explain.  With old glibc versions, the "configure" time check will
pass, but the equivalent (almost identical) "make check" test will fail.
One possibility, I guess, is that occasionally address space randomization
will put valid data at the 0xc0ffee address that the test assumes will
segfault, and another is that some change in compiler optimization flags
is making a difference.  At any rate, I think it's safe to just always
assume that this strtok_r() bug is present whenever glibc before 2.8 is
in use.

Specifically we've seen this happen intermittently when building against
the XenServer DDK 5.6.100 build 39265, which uses glibc 2.5.

Reported-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
9 years agoINSTALL.md: Add note about EXTRA_CFLAGS.
Russell Bryant [Thu, 2 Apr 2015 21:51:49 +0000 (17:51 -0400)]
INSTALL.md: Add note about EXTRA_CFLAGS.

Add a note about the use of EXTRA_CFLAGS to provide custom CFLAGS for
the build of the Linux kernel module.

This addition is technically in the "configuring the sources" section
of the document.  However, it's the spot where custom CFLAGS is
discussed already, so that seemed like the best place to put it.
Alternatively, it could go in the "Building the Sources" section
instead.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agodpif-netdev: Remove support for DPIF_FP_ZERO_STATS flag
Daniele Di Proietto [Wed, 1 Apr 2015 16:20:57 +0000 (17:20 +0100)]
dpif-netdev: Remove support for DPIF_FP_ZERO_STATS flag

Since flow statistics are thread local and updated without any lock,
it is not correct to do a memset from another thread.

This commit simply removes the support for the flag.  It is not needed
by ofproto-dpif, it is only exposed by dpctl commands.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
9 years agoINSTALL.md: Document how to add custom compiler flags.
Ben Pfaff [Thu, 2 Apr 2015 16:52:03 +0000 (09:52 -0700)]
INSTALL.md: Document how to add custom compiler flags.

CC: Mark B Kavanagh <mark.b.kavanagh@intel.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
9 years agodatapath-windows: Make GET_PID a separate IOCTL
Sorin Vinturis [Thu, 2 Apr 2015 19:35:32 +0000 (19:35 +0000)]
datapath-windows: Make GET_PID a separate IOCTL

Added a new IOCTL in order to retrieve the PID from the kernel datapath.
The new method uses a direct and cleaner way, as opposed to the old way
of using a Netlink transaction, avoiding the unnecessary overhead.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/31
Acked-by: Nithin Raju <nithin@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agobridge: Execute bridge_run() only after retrieving db contents.
Alex Wang [Wed, 1 Apr 2015 23:11:19 +0000 (16:11 -0700)]
bridge: Execute bridge_run() only after retrieving db contents.

During upgrade of ovs-vswitchd, we do not want to recreate the already
configured kernel interfaces.  Especially when IP address is assigned to
the internal port, the recreation will cause the lost of connection.
Therefore, ovs-vswitchd should read current ovsdb content first and then
reuse the existing kernel interfaces that are configured in ovsdb.  In
terms of the code language, ovs-vswitchd should only execute bridge_run()
after it finishes reading the ovsdb content.

However, this expected behavior is broken by the recent commit d18e52e
(ovsdb-idl: Tolerate missing tables and columns.) which causes the
execution of bridge_run() before getting the hint of configured interfaces
from ovsdb.

To fix the issue, this commit makes sure that the execution of bridge_run()
happens only after retrieving the ovsdb contents.

VMware-BZ: #1424342

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoovsdb-server: Correct malformed error replies to certain JSON-RPC requests.
Ben Pfaff [Fri, 20 Mar 2015 04:00:46 +0000 (21:00 -0700)]
ovsdb-server: Correct malformed error replies to certain JSON-RPC requests.

I realized that this bug existed only a few weeks ago, but it has been
there since the earliest ovsdb-server code.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
9 years agoovsdb-idl: Tolerate missing tables and columns.
Ben Pfaff [Fri, 20 Mar 2015 06:45:42 +0000 (23:45 -0700)]
ovsdb-idl: Tolerate missing tables and columns.

Until now, if ovs-vsctl (or another client of the C ovsdb-idl library) was
compiled against a schema that had a column or table that was not in the
database actually being used (e.g. during an upgrade), and the column or
table was selected for monitoring, then ovsdb-idl would fail to get any
data at all because ovsdb-server would report an error due to a request
about a column or a table it didn't know about.

This commit fixes the problem by making ovsdb-idl retrieve the database
schema from the database server and omit any tables or columns that don't
exist from its monitoring request.  This works OK for the kinds of upgrades
that OVSDB otherwise supports gracefully because it will simply make the
missing columns or tables appear empty, which clients of the ovsdb-idl
library already have to tolerate.

VMware-BZ: #1413562
Reported-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
9 years agovswitch.xml: Improve description of forward-bpdu.
Ben Pfaff [Wed, 1 Apr 2015 00:08:49 +0000 (17:08 -0700)]
vswitch.xml: Improve description of forward-bpdu.

The description was at best incomplete and difficult to understand.

Reported-by: Brian Field <Brian_Field@cable.comcast.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
9 years agolockfile: Support \-delimited file names in lockfile_name().
Alin Serdean [Tue, 31 Mar 2015 19:16:58 +0000 (19:16 +0000)]
lockfile: Support \-delimited file names in lockfile_name().

Currently paths that have only forward slashes like the following
"C:/package/binaries/conf.db" work seamlessly.

If we try the native windows filepaths i.e. "C:\package\binaries\conf.db" we
will hit the following problem:
2015-03-31T15:54:17Z|00001|lockfile|WARN|.c:\package\binaries\conf.db.~lock~:
failed to open lock file: Invalid argument

2015-03-31T15:54:17Z|00002|lockfile|WARN|.c:\package\binaries\conf.db.~lock~:
failed to lock file: Invalid argument
ovsdb-server: I/O error: c:\package\binaries\conf.db: failed to lock lockfile
(Invalid argument)

In this patch we update the lockfile_name function to also look for
backslashes, and also accommodate if we have a mix of backslashes and forward
slashes.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
[blp@nicira.com simplified the code]
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agohmap: Don't include ovs-atomic.h unnecessarily.
Ben Pfaff [Sun, 29 Mar 2015 22:49:29 +0000 (15:49 -0700)]
hmap: Don't include ovs-atomic.h unnecessarily.

GNU C++ isn't too happy with ovs-atomic.h.  We could fix that (maybe we
should) but the report I received from a C++ user implied to me that it
would be just as useful to just drop the unnecessary #include
"ovs-atomic.h" from hmap.h.

Reported-by: Michael Hu <humichael@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
9 years agoovsdb-idl: Add function comments.
Ben Pfaff [Tue, 31 Mar 2015 18:28:39 +0000 (11:28 -0700)]
ovsdb-idl: Add function comments.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
9 years agojsonrpc: Add function comments.
Ben Pfaff [Tue, 31 Mar 2015 18:28:27 +0000 (11:28 -0700)]
jsonrpc: Add function comments.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
9 years agodatapath: Use alternate name for udp_sock_create() backport
Thomas Graf [Mon, 30 Mar 2015 10:21:09 +0000 (12:21 +0200)]
datapath: Use alternate name for udp_sock_create() backport

Account for kernels which provide udp_sock_create() in an
insufficient version.

Avoids the following error when inserting openvswitch.ko on
respective kernels:

openvswitch: exports duplicate symbol udp_sock_create (owned by udp_tunnel)

Fixes: eb6eebd28 ("datapath: Account for "udp: Add udp_sock_create for UDP tunnels to open listener socket")
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Cc: Jesse Gross <jesse@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
9 years agodpif-netdev: Account for and free lost packets.
Daniele Di Proietto [Fri, 27 Mar 2015 16:29:50 +0000 (16:29 +0000)]
dpif-netdev: Account for and free lost packets.

Packets for which an upcall has failed (lost packets) must be deleted.
We also need to count them as MISS and LOST.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
9 years agobuild-aux/cccl: Enhance --with-debug option
Alin Serdean [Mon, 30 Mar 2015 15:34:28 +0000 (15:34 +0000)]
build-aux/cccl: Enhance --with-debug option

This patch changes the behaviour in case the configure argument: --with-debug
was specified.

Currently the optimization flag in the case of debugging is the following:
https://msdn.microsoft.com/en-us/library/f9534wye.aspx
which does not fully disable optimization, that is why it was changed with
the following flag:
https://msdn.microsoft.com/en-us/library/aafb762y.aspx
which disables all code optimization.

Also this patch includes the definition of the following preprocessor
definitions:
_DEBUG - in case --with-debug is specified

The above definitions usually are defined when compiling with the following
flags:
https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
Since we are not compiling with the above flag, mimic the behaviour the
debug becahviour.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoofproto-dpif: Set need_revalidate when removing cfm from ofport.
Alex Wang [Sat, 28 Mar 2015 06:19:22 +0000 (23:19 -0700)]
ofproto-dpif: Set need_revalidate when removing cfm from ofport.

When cfm is deleted from a port, all modules should release their
reference so that the cfm struct can be removed from the global hmap
and freed.  Therein, the reference held by xlate module can only be
released when the need_revalidate flag is set (e.g set to
REV_RECONFIGURE).  And this flag should be set while removing cfm
from ofport.  Unfortunately, this has never been done before and the
bug was hidden by another bug fixed in recent commit a190839
(netdev-vport: Do not update netdev when there is no config change.)

To fix this issue, this commit makes the code set need_revalidate
when removing cfm from ofport.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agonetdev-linux: Make htb quantum always no less than mtu.
Alex Wang [Fri, 27 Mar 2015 18:34:53 +0000 (11:34 -0700)]
netdev-linux: Make htb quantum always no less than mtu.

Currently, ovs uses hardcoded rate2quantum = 10 for each htb qdisc.
When qdisc class's rate is small, the resulting quantum (calculated
by min_rate / rate2quantum) will be smaller than MTU.  This is not
recommended and tc will keep complaining the following in syslog.

localhost kernel: HTB: quantum of class 10003 is small. Consider r2q change.
localhost kernel: HTB: quantum of class 10004 is small. Consider r2q change.
localhost kernel: HTB: quantum of class 10005 is small. Consider r2q change.
localhost kernel: HTB: quantum of class 10006 is small. Consider r2q change.

To fix the issue, this commit makes ovs always use htb quantum no less
than the MTU.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agonetdev-dpdk: Put cuse thread into quiescent state.
Kevin Traynor [Fri, 27 Mar 2015 18:06:57 +0000 (11:06 -0700)]
netdev-dpdk: Put cuse thread into quiescent state.

ovsrcu_synchronize() is used when setting virtio_dev to NULL.
This results in an ovsrcu_quiesce_end() call which means the
cuse thread may not go into quiescent state again for an
indefinite time. Add an ovsrcu_quiesce_start() call to prevent
this.

Signed-off-by: Kevin Traynor <kevin.traynor@intel.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agonetdev-vport: Do not update netdev when there is no config change.
Alex Wang [Fri, 27 Mar 2015 00:35:32 +0000 (17:35 -0700)]
netdev-vport: Do not update netdev when there is no config change.

When there is any update from ovsdb, ovs will call netdev_set_config()
for every vport.  Even though the change is not related to vport, the
current implementation will always increment the per-netdev sequence
number.  Subsequently this could cause even more unwanted effects,
e.g. the recreation of 'struct tnl_port' in ofproto level.

This commit fixes the issue by only updating the netdev when there
is actual configuration change.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoopenvswitch-fedora: remove requires to kernel
Flavio Leitner [Fri, 27 Mar 2015 00:12:17 +0000 (21:12 -0300)]
openvswitch-fedora: remove requires to kernel

That RPM requires helped to work around a bug in
the kernel that was triggered by userspace package.

However, it doesn't force the kernel to be running,
so it's a weak solution.  Also, it makes difficult
to re-use the same spec on other RPM distros.

This patch comments out the requires.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoovs-sandbox: Initialize database before starting ovs-vswitchd.
Ben Pfaff [Thu, 26 Mar 2015 05:25:50 +0000 (22:25 -0700)]
ovs-sandbox: Initialize database before starting ovs-vswitchd.

Otherwise ovs-vswitchd can't immediately start working (until some other
call to ovs-vsctl initializes the database).  This is most obvious if one
runs "ovs-vsctl list Open_vSwitch ." as the first command, because the
output will not show the changes that ovs-vswitchd will make to the
database at startup (in particular initializing datapath_types and
iface_types), which is confusing.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
9 years agonetdev: Fix user space tunneling for set_tunnel action.
Ricky Li [Thu, 26 Mar 2015 13:11:28 +0000 (06:11 -0700)]
netdev: Fix user space tunneling for set_tunnel action.

e.g. Set tunnel id for encapsulated VxLAN packet (out_key=flow):

ovs-vsctl add-port int-br vxlan0 -- set interface vxlan0 \
    type=vxlan options:remote_ip=172.168.1.2 options:out_key=flow

ovs-ofctl add-flow int-br in_port=LOCAL, icmp,\
    actions=set_tunnel:3, output:1 (1 is the port# of vxlan0)

Output tunnel ID should be modified to 3 with this patch.

Signed-off-by: Ricky Li <ricky.li@intel.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agoflow_format: Do not format "in_port=0".
Jarno Rajahalme [Thu, 26 Mar 2015 22:32:45 +0000 (15:32 -0700)]
flow_format: Do not format "in_port=0".

flow_format() is used mainly for formating the headers of packets
embedded in OpenFlow PACKET_IN messages.  In this case the flow does
not have a valid port number, and printing out "in_port=0" only
confuses the resulting output.  Besides, 0 is not a valid OpenFlow
port number.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agodatapath-windows: Added specific pool tag for vport code
Sorin Vinturis [Thu, 26 Mar 2015 19:59:38 +0000 (19:59 +0000)]
datapath-windows: Added specific pool tag for vport code

All memory allocations within vport code have 'PSVO' pool tag.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/56
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agodatapath-windows: Added specific pool tag for user code
Sorin Vinturis [Thu, 26 Mar 2015 19:59:38 +0000 (19:59 +0000)]
datapath-windows: Added specific pool tag for user code

All memory allocations within user code have 'USVO' pool tag.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/56
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agodatapath-windows: Added specific pool tag for switch code
Sorin Vinturis [Thu, 26 Mar 2015 19:59:37 +0000 (19:59 +0000)]
datapath-windows: Added specific pool tag for switch code

All memory allocations within switch code have 'SSVO' pool tag.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/56
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agodatapath-windows: Added specific pool tag for oid code
Sorin Vinturis [Thu, 26 Mar 2015 19:59:37 +0000 (19:59 +0000)]
datapath-windows: Added specific pool tag for oid code

All memory allocations within oid code have 'ASVO' pool tag.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/56
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agodatapath-windows: Added specific pool tag for iphelper code
Sorin Vinturis [Thu, 26 Mar 2015 19:59:37 +0000 (19:59 +0000)]
datapath-windows: Added specific pool tag for iphelper code

All memory allocations within iphelper code have 'HSVO' pool tag.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/56
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agodatapath-windows: Added specific pool tag for vxlan code
Sorin Vinturis [Thu, 26 Mar 2015 19:59:37 +0000 (19:59 +0000)]
datapath-windows: Added specific pool tag for vxlan code

All memory allocations within vxlan code have 'XSVO' pool tag.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/56
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agodatapath-windows: Added specific pool tag for flow code
Sorin Vinturis [Thu, 26 Mar 2015 19:59:37 +0000 (19:59 +0000)]
datapath-windows: Added specific pool tag for flow code

All memory allocations within flow code have 'LSVO' pool tag.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/56
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agodatapath-windows: Added specific pool tag for event code
Sorin Vinturis [Thu, 26 Mar 2015 19:59:36 +0000 (19:59 +0000)]
datapath-windows: Added specific pool tag for event code

All memory allocations within event code have 'ESVO' pool tag.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/56
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agodatapath-windows: Added specific pool tag for buffermgmt code
Sorin Vinturis [Thu, 26 Mar 2015 19:59:36 +0000 (19:59 +0000)]
datapath-windows: Added specific pool tag for buffermgmt code

All MDL memory allocations within buffermgmt code have 'BSVO' pool
tag.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/56
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agodatapath-windows: Added specific pool tag for datapath code
Sorin Vinturis [Thu, 26 Mar 2015 19:59:36 +0000 (19:59 +0000)]
datapath-windows: Added specific pool tag for datapath code

All memory allocations within datapath code have 'DSVO' pool tag.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/56
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agodatapath-windows: Support for allocating/releasing memory with tag
Sorin Vinturis [Thu, 26 Mar 2015 19:59:36 +0000 (19:59 +0000)]
datapath-windows: Support for allocating/releasing memory with tag

Added functions for allocating and releasing memory with specified
tag.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/56
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoofproto-dpif-xlate: Fix MPLS recirculation.
Jarno Rajahalme [Thu, 26 Mar 2015 18:18:17 +0000 (11:18 -0700)]
ofproto-dpif-xlate: Fix MPLS recirculation.

Prior to this patch MPLS recirculation was not performed on a table
lookup following an MPLS_POP action.  This patch refactors MPLS
recirculation triggering so that a table action can be re-done after
recirculation if that table action follows an MPLS_POP action.

Recirculation for a patch port traversal (which also does a table
lookup) after an MPLS_POP action does not need to store the output
action, as recirculation without any post-recirculation actions causes
the table lookup to happen anyway.

Furthermore, the stack actions now have the same post-MPLS_POP
optimization as the SET_FIELD and MOVE actions had already:
recirculation is triggered only if the register in the action is L3 or
higher.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoofproto-dpif: Restore metadata and registers on recirculation.
Jarno Rajahalme [Thu, 26 Mar 2015 18:18:16 +0000 (11:18 -0700)]
ofproto-dpif: Restore metadata and registers on recirculation.

xlate_actions() now considers an optional recirculation context (via
'xin') and restores OpenFlow pipeline metadata (registers, 'metadata',
etc.) based on it.  The recirculation context may contain an action
set and stack to be restored and further actions to be executed upon
recirculation.  It also contains a table_id number to be used for rule
lookup in cases where no post-recirculation actions are used.

The translation context internal metadata is restored using a new
internal action: UNROLL_XLATE action stores the translation context
data visible to OpenFlow controllers via PACKET_IN messages.  This
includes the current table number and the current rule cookie.
UNROLL_XLATE actions are inserted only when the remaining actions may
generate PACKET_IN messages.

These changes allow the post-MPLS recirculation to properly continue
with the pipeline metadata that existed at the time of recirculation.

The internal table is still consulted for bonds.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agocompat: Fix RHEL7 build.
Joe Stringer [Tue, 24 Mar 2015 23:16:18 +0000 (16:16 -0700)]
compat: Fix RHEL7 build.

Tested against 3.10.0-229.el7.x86_64.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agonetdev-dpdk: create smaller mempools in case of failure
Daniele Di Proietto [Thu, 12 Mar 2015 18:04:32 +0000 (18:04 +0000)]
netdev-dpdk: create smaller mempools in case of failure

If rte_mempool_create() fails with ENOMEM, try asking for a smaller
mempools. This patch enables OVS DPDK to run on systems without 1GB
hugepages

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
9 years agonetdev-linux: Fix build with old kernel headers.
Ben Pfaff [Tue, 24 Mar 2015 17:51:56 +0000 (10:51 -0700)]
netdev-linux: Fix build with old kernel headers.

Commit 677d9158fc0a (netdev-linux: Support for SFQ, FQ_CoDel and CoDel
qdiscs.) added support for new qdiscs.  The commit uses TCA_CODEL_* and
TCA_FQ_CODEL_* not in old kernel headers, causing a build failure against
such headers.  This commit should fix the problem by defining these values
ourselves.  (I haven't tested it against old headers, so I might have
missed something, but it's a straightforward change and at worst won't do
harm.)

It appears that sfq (also added by the same commit) was in Linux before
2.6.32, so it seems unlikely that we need any compatibility code there.

CC: Jonathan Vestin <jonavest@kau.se>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agotunnels: Enable UDP checksum computation for Geneve and VXLAN.
Jesse Gross [Tue, 24 Mar 2015 14:42:47 +0000 (07:42 -0700)]
tunnels: Enable UDP checksum computation for Geneve and VXLAN.

The kernel module can already support outer UDP checksums for
Geneve and VXLAN using the standard checksum flag in tunnel
metadata. This makes userspace aware of the capability so that
users can enable it on tunnel ports.

There is a complication in that there is no way for userspace to
probe or detect if the kernel does not support this capability
in order to warn the user. In this case, connectivity will appear
to function normally but packets will not be checksum protected.
This is mainly an issue for VXLAN which has existed in the kernel
for a some time without checksum support - while there are also
a few kernel versions that support Geneve only without checksums,
they are much less common.

There isn't a particularly good solution to the compatibility
issue without introducing a larger capabilities structure. However,
UDP checksums are likely to be used only rarely at this point in
time and the VXLAN spec (where the main problem lies) recommends
against them. Therefore, this is considered to be an advanced user
feature and we settle for just documenting the issue.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pritesh Kothari <pritesh.kothari@cisco.com>
9 years agoofproto-dpif-xlate: More robust wildcarding for select group.
Jarno Rajahalme [Thu, 19 Mar 2015 22:39:48 +0000 (15:39 -0700)]
ofproto-dpif-xlate: More robust wildcarding for select group.

The flow key should be the same regardless of whether a live bucket is
found or not, as it would be confusing that the flow key would be
different (different mask bits) after the last group bucket goes dead.

In general, the megaflow algorithm expects the mask bits be set as
soon as we read the header bits, regardless of what happens
afterwards.

Also, use flow_mask_hash_fields() instead of individually setting mask
fields. This immediately brings in IPv6 support, and helps keeping
masks in sync with potential algorithm changes to flow hashing
functions.

Found by inspection.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoofproto-dpif-xlate: Roll back group bucket actions after every bucket.
Jarno Rajahalme [Thu, 19 Mar 2015 22:20:21 +0000 (15:20 -0700)]
ofproto-dpif-xlate: Roll back group bucket actions after every bucket.

We used to roll back group bucket changes only for 'all' and
'indirect' group types, but the expected semantics of all group types
is that any changes by the group bucket are not visible after the
group has been executed.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoofproto-dpif-xlate: Remove bond recirculation parameters from context.
Jarno Rajahalme [Thu, 12 Mar 2015 20:02:07 +0000 (13:02 -0700)]
ofproto-dpif-xlate: Remove bond recirculation parameters from context.

The bond recirculation parameters in the translation context are short
lived and only carry parameters to immediate downstream functions.  As
such they are better served as normal function parameters.  This
simplifies the translation context, which needs to be essentially
restored after traversing patch ports.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoofproto-dpif-xlate: Restore was_mpls after a patch port.
Jarno Rajahalme [Tue, 24 Mar 2015 18:14:43 +0000 (11:14 -0700)]
ofproto-dpif-xlate: Restore was_mpls after a patch port.

The peer bridge popping MPLS should have no effect on the original
bridge.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoImplement hash fields select group
Simon Horman [Fri, 20 Mar 2015 04:50:34 +0000 (13:50 +0900)]
Implement hash fields select group

This is intended as a usable demonstration of how
the NTR selection method extension might may be used.

NTR selection method
Signed-off-by: Simon Horman <simon.horman@netronome.com>
[blp@nicira.com added a NEWS entry]
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoSupport NTR selection method in ovs-ofctl group commands
Simon Horman [Fri, 20 Mar 2015 04:50:33 +0000 (13:50 +0900)]
Support NTR selection method in ovs-ofctl group commands

NTR selection method
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoSupport translation of NTR selection method
Simon Horman [Fri, 20 Mar 2015 04:50:32 +0000 (13:50 +0900)]
Support translation of NTR selection method

Only the default existing behaviour is translated.
All other methods are rejected for now.

NTR selection method
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoSupport encoding of NTR selection method
Simon Horman [Fri, 20 Mar 2015 04:50:31 +0000 (13:50 +0900)]
Support encoding of NTR selection method

Include NTR selection method experimenter group property in
in group mod request and group desc reply.

NTR selection method
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoSupport decoding of NTR selection method
Simon Horman [Fri, 20 Mar 2015 04:50:30 +0000 (13:50 +0900)]
Support decoding of NTR selection method

This is in preparation for supporting group mod and desc reply
messages with an NTR selection method group experimenter property.

Currently decoding always fails as it only allows properties for known
selection methods and no selection methods are known yet. A subsequent
patch will propose a hash selection method.

NTR selection method
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoAdd types for NTR selection method
Simon Horman [Fri, 20 Mar 2015 04:50:29 +0000 (13:50 +0900)]
Add types for NTR selection method

NTR selection method
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoDocumentation: Add documentation of group selection method property
Simon Horman [Fri, 20 Mar 2015 04:50:28 +0000 (13:50 +0900)]
Documentation: Add documentation of group selection method property

NTR selection method
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agorhel: Fix RPM build errors.
Oleg Gashev [Mon, 23 Mar 2015 21:54:48 +0000 (21:54 +0000)]
rhel: Fix RPM build errors.

On exec rpmbuild -ba openvswitch-fedora.spec displayed:

error: Installed (but unpackaged) file(s) found:
   /etc/bash_completion.d/ovs-appctl-bashcomp.bash
   /etc/bash_completion.d/ovs-vsctl-bashcomp.bash

RPM build errors:
    Installed (but unpackaged) file(s) found:
   /etc/bash_completion.d/ovs-appctl-bashcomp.bash
   /etc/bash_completion.d/ovs-vsctl-bashcomp.bash

/etc/bash_completion.d/ovs-appctl-bashcomp.bash and
/etc/bash_completion.d/ovs-vsctl-bashcomp.bash added to files list.

Signed-off-by: Oleg Gashev <oleg@gashev.net>
Acked-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agovswitch.ovsschema: Add datapath_types and port_types.
Mark D. Gray [Tue, 24 Mar 2015 10:39:11 +0000 (10:39 +0000)]
vswitch.ovsschema: Add datapath_types and port_types.

At startup enumerate datapath and port types and add this information to
the datapath_types and port_types columns in the ovsdb.

This allows an ovsdb client to query the datapath in order to determine
if certain datapath and port types exist. For example, by querying the
port_types column, an ovsdb client will be able to determine if this
instance of ovs-vswitchd was compiled with DPDK support.

Signed-off-by: Mark D. Gray <mark.d.gray@intel.com>
Signed-off-by: Billy O'Mahony <billy.o.mahony@intel.com>
[blp@nicira.com made several changes]
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agodatapath-windows: Updated WFP system provider handling
Sorin Vinturis [Tue, 24 Mar 2015 14:53:11 +0000 (14:53 +0000)]
datapath-windows: Updated WFP system provider handling

If the Base Filtering Engine (BFE) is not started, the WFP system
provider failed to be added because no session to the engine could
be acquired.

The solution for this was to registered a BFE notification callback
that is called whenever the BFE's state changes. Only if the BFE's
state is running the WFP system provider is added.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/65
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agonetdev-linux: Support for SFQ, FQ_CoDel and CoDel qdiscs.
Jonathan Vestin [Wed, 18 Mar 2015 16:13:01 +0000 (17:13 +0100)]
netdev-linux: Support for SFQ, FQ_CoDel and CoDel qdiscs.

This patch adds support for SFQ, CoDel and FQ_CoDel classless qdiscs to Open vSwitch. It also removes the requirement for a QoS to have at least one Queue (as this makes no sense when using classless qdiscs). I have also not implemented class_{get,set,delete,get_stats,dump_stats} because they are meant for qdiscs with classes.

Signed-off-by: Jonathan Vestin <jonavest@kau.se>
[blp@nicira.com mostly applied stylistic changes]
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoauto-attach: Support latest version of auto-attach LLDP TLVs
Dennis Flynn [Wed, 18 Mar 2015 18:47:14 +0000 (14:47 -0400)]
auto-attach: Support latest version of auto-attach LLDP TLVs

The following enhancements to the auto-attach feature are provided

- Support recent modifications to the AA element discovery TLV
- Support recent Avaya Organizationally Unique ID (OUI) change.
  (This will change to IEEE assigned OUI once AA standard has been ratified)
- Remove some Avaya specific #defines

The primary purpose of this commit is to catch up with the latest changes made
to the auto attach TLVs as the Auto Attach feature progresses through the
802.1Q IEEE standards committee. Most notably this includes some minor rework
of the AA element discovery TLV and a recent change to the Avaya OUI value.

Signed-off-by: Dennis Flynn <drflynn@avaya.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoINSTALL.DPDK.md: Terminate code section.
Russell Bryant [Mon, 23 Mar 2015 17:49:10 +0000 (13:49 -0400)]
INSTALL.DPDK.md: Terminate code section.

Add a missing terminator for a code section.  Without this, the
rendering on github at least shows the rest of the file as a code
block.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agobashcomp: Install and package completion scripts.
Alex Wang [Wed, 18 Mar 2015 21:32:23 +0000 (14:32 -0700)]
bashcomp: Install and package completion scripts.

This commit makes the bash completion scripts be installed to
$(sysconfdir)/bash_completion.d/ through 'make install' and to
/etc/bash_completion.d/ through package installation.  This will
make the scripts available for each bash session.

An alternative is to put scripts to /usr/share/bash_completion/
directory.  However, this is not supported by earlier version of
bash completion.

Signed-off-by: Alex Wang <alexw@nicira.com>
9 years agoovs-vsctl-bashcomp: Avoid setting the COMP_WORDBREAKS.
Alex Wang [Fri, 13 Mar 2015 21:47:25 +0000 (14:47 -0700)]
ovs-vsctl-bashcomp: Avoid setting the COMP_WORDBREAKS.

Modifying $COMP_WORDBREAKS in completion script is not the recommended
as it is a global variable and the modification could affect the behavior
of other completion scripts.  As a workaround, this commit uses the
_get_comp_words_by_ref which allows user to exclude characters out of
$COMP_WORDBREAKS and reassemble input command line.  However, as a side
effect, the bash completion module cannot handle characters defined in
$COMP_WORDBREAKS (e.g. ':' and '=') correctly in the resulting completions.
Thusly, we need to trim the colon-word and equal-word prefixes from reply.

Signed-off-by: Alex Wang <alexw@nicira.com>
9 years agoDPDK: Update documentation and travis build for vhost.
Daniele Di Proietto [Fri, 20 Mar 2015 13:02:14 +0000 (06:02 -0700)]
DPDK: Update documentation and travis build for vhost.

DPDK vhost support is mandatory to compile OVS with DPDK.  This commit
updates INSTALL.DPDK.md and the travis build procedure to reflect that.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agoacinclude.m4: Restore --whole-archive option for DPDK.
Daniele Di Proietto [Fri, 20 Mar 2015 13:02:13 +0000 (06:02 -0700)]
acinclude.m4: Restore --whole-archive option for DPDK.

The --whole-archive option is required to link vswitchd with DPDK,
otherwise the PMD drivers are not going to be included.  Omitting the
option is not going to cause build failures, but OVS won't be able to
use most physical NICs.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agoovs-vsctl: Only monitor AutoAttach columns when useful.
Ben Pfaff [Fri, 20 Mar 2015 06:39:30 +0000 (23:39 -0700)]
ovs-vsctl: Only monitor AutoAttach columns when useful.

Otherwise this creates a gratuitous incompatibility with older databases,
which can be a problem in upgrade situations.

VMware-BZ: #1413562
Reported-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
9 years agoovs-vsctl: Create AutoAttach records on demand, for backward compatibility.
Ben Pfaff [Fri, 20 Mar 2015 06:22:05 +0000 (23:22 -0700)]
ovs-vsctl: Create AutoAttach records on demand, for backward compatibility.

The AutoAttach table is new in OVS 2.3.90, but ovs-vsctl was creating a
record in the table unconditionally whenever it created a new bridge.
This caused a gratuitous incompatibility with older databases, which can
be a problem during upgrade.  This commit switches to creating the
AutoAttaach record for a bridge lazily, only when the first mapping is
created for the bridge.

VMware-BZ: #1413562
CC: Dennis Flynn <drflynn@avaya.com>
Reported-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
9 years agonetdev-dpdk: add dpdk vhost-cuse ports
Kevin Traynor [Thu, 5 Mar 2015 21:42:04 +0000 (13:42 -0800)]
netdev-dpdk: add dpdk vhost-cuse ports

This patch adds support for a new port type to userspace datapath
called dpdkvhost. This allows KVM (QEMU) to offload the servicing
of virtio-net devices to its associated dpdkvhost port. Instructions
for use are in INSTALL.DPDK.

This has been tested on Intel multi-core platforms and with clients
that have virtio-net interfaces.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Signed-off-by: Kevin Traynor <kevin.traynor@intel.com>
Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
9 years agoautomake.mk: Improve schema checksum error message.
Mark D. Gray [Wed, 18 Mar 2015 17:09:06 +0000 (17:09 +0000)]
automake.mk: Improve schema checksum error message.

Signed-off-by: Mark D. Gray <mark.d.gray@intel.com>
Signed-off-by: Billy O'Mahony <billy.o.mahony@intel.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoovs-appctl-bashcomp: Use better function to complete file.
Alex Wang [Wed, 18 Mar 2015 17:44:27 +0000 (10:44 -0700)]
ovs-appctl-bashcomp: Use better function to complete file.

This commit uses the _filedir function defined in bash_completion
module for file completion.  It will take care of the '/' suffix
for directory.

Signed-off-by: Alex Wang <alexw@nicira.com>
9 years agonetdev-linux: Avoid RTM_GETQDISC bug workaround on new-enough kernels.
Ben Pfaff [Fri, 13 Mar 2015 21:46:23 +0000 (14:46 -0700)]
netdev-linux: Avoid RTM_GETQDISC bug workaround on new-enough kernels.

Otherwise we can't detect classless qdiscs.

This has no useful effect for the currently supported qdiscs, which all
have classes, but it makes it possible to add support for new classless
qdiscs.

This suddenly makes netdev-linux complain about qdiscs it doesn't know
about (e.g. pfifo_fast), which isn't too useful, so this commit also
demotes that INFO message to DBG level.

Reported-by: Jonathan Vestin <jonavest@kau.se>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoINSTALL.Windows.md: Mention the easy way to get into bash.
Gurucharan Shetty [Tue, 17 Mar 2015 22:23:22 +0000 (15:23 -0700)]
INSTALL.Windows.md: Mention the easy way to get into bash.

Just typing 'bash' from MSVC developers command prompt _can_ cause
MSYS to use the Windows version of 'sort' instead of the GNU sort.

Reported-by: Hemanth Kumar Mantri <mantri@nutanix.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
9 years agoinclude/openflow: Simplify structure checking for OpenFlow headers.
Ben Pfaff [Tue, 17 Mar 2015 21:39:27 +0000 (14:39 -0700)]
include/openflow: Simplify structure checking for OpenFlow headers.

This means that anyone who adds another openflow include file automatically
gets it checked.  It does mean that changing any of the OpenFlow headers
causes all of them to be checked, but that doesn't seem like a big deal
(it's quick).

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
9 years agoUse NTR rather than NTR as prefix for Netronome vendor id
Simon Horman [Mon, 9 Mar 2015 01:10:56 +0000 (10:10 +0900)]
Use NTR rather than NTR as prefix for Netronome vendor id

As pointed out by Ben Pfaff NTR (NetronoMe eXtension) is confusingly
similar to NXM (Nicira eXtended Match?) which is already used widely
in the Open vSwitch tree.

To get ease future eye strain use NTR (NeTRonome) instead of NTR,
starting with the only instance currently present in the tree,
the Netronome vendor id.

This is in preparation for actually using the Netronome vendor id.

Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoofproto-dpif-xlate: Do not exit if peer bridge exits.
Jarno Rajahalme [Thu, 12 Mar 2015 16:47:31 +0000 (09:47 -0700)]
ofproto-dpif-xlate: Do not exit if peer bridge exits.

The fact that the peer bridge exits (for any reason) does not mean
that the original bridge should exit.  Specifically, if the peer
bridge recirculates (which typically modifies the packet), the
original bridge must continue processing with the original, not the
recirculated packet!

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoofproto-dpif-xlate: Preserve and execute action_set on a patch port.
Jarno Rajahalme [Thu, 12 Mar 2015 01:01:51 +0000 (18:01 -0700)]
ofproto-dpif-xlate: Preserve and execute action_set on a patch port.

Prevent a peer bridge from seeing or modifying the action_set of the
first bridge.

Also execute the accumulated action set on the peer bridge, if any.

Found by inspection.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agonetdev-linux: Be more careful about integer overflow in policing.
Ben Pfaff [Fri, 13 Mar 2015 18:30:18 +0000 (11:30 -0700)]
netdev-linux: Be more careful about integer overflow in policing.

Otherwise the policing limits could make no sense if large rates were
specified.

Reported-by: Zhangguanghui <zhang.guanghui@h3c.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ansis Atteka <aatteka@nicira.com>
9 years agoINSTALL.md: Note that Clang and ccache aren't completely compatible.
Ben Pfaff [Tue, 17 Mar 2015 17:04:47 +0000 (10:04 -0700)]
INSTALL.md: Note that Clang and ccache aren't completely compatible.

CC: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
9 years agoINSTALL.md: Add a few notes for Windows builds.
Ben Pfaff [Tue, 17 Mar 2015 17:04:34 +0000 (10:04 -0700)]
INSTALL.md: Add a few notes for Windows builds.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Gurucharan Shetty <gshetty@nicira.com>
9 years agocommand-line: add ovs_cmdl_context
Russell Bryant [Tue, 17 Mar 2015 14:35:26 +0000 (10:35 -0400)]
command-line: add ovs_cmdl_context

I started working on a new command line utility that used this shared
code.  I wanted the ability to pass some data from common
initialization code to all of the commands.  You can find a similar
pattern in ovs-vsctl.

This patch updates the command handler to take a new struct,
ovs_cmdl_context, instead of argc and argv directly.  It includes argc
and argv, but also includes an opaque type (void *), where the user of
this API can attach its custom data it wants passed along to command
handlers.

This patch affected the ovstest sub-programs, as well.  The patch
includes a bit of an odd hack to OVSTEST_REGISTER() to avoid making
the main() function of the sub-programs take a ovs_cmdl_context.
The test main() functions still receive argc and argv directly, as
that seems more natural.  The test-subprograms themselves are able to
make use of a context internally, though.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoofproto-dpif-xlate: Preserve stack across patch port.
Jarno Rajahalme [Tue, 17 Mar 2015 00:33:16 +0000 (17:33 -0700)]
ofproto-dpif-xlate: Preserve stack across patch port.

Prevent a peer patch port bridge from popping data off or pushing data
to the stack of the first bridge.

Found by inspection.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agomatch: Do not skip formatting a zero dp_hash.
Jarno Rajahalme [Fri, 13 Mar 2015 19:22:51 +0000 (12:22 -0700)]
match: Do not skip formatting a zero dp_hash.

The dp_hash match should be printed whenever it is being matched.  We
keep the old behavior for flow_format(), which is mostly used to
format PACKET_IN messages. This keeps those messages tidier and avoids
changing a lot of test cases.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoRevert "ofp-actions: Align struct ofpact to OFPACT_ALIGNTO."
Jarno Rajahalme [Mon, 16 Mar 2015 22:04:52 +0000 (15:04 -0700)]
Revert "ofp-actions: Align struct ofpact to OFPACT_ALIGNTO."

This reverts commit 18287cd35ebaffb9122e08b29832bc52e1608cda.

The alignment, while correct, made also all derived ofpact structs bigger,
which was not intended.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
9 years agoAdd testsuite.tmp.orig to .gitignore
Alin Serdean [Mon, 16 Mar 2015 20:47:31 +0000 (20:47 +0000)]
Add testsuite.tmp.orig to .gitignore

Adding the file: tests/testsuite.tmp.orig to tests/.gitignore

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agotest-hash: Improve comments.
Alex Wang [Sun, 1 Mar 2015 06:27:35 +0000 (22:27 -0800)]
test-hash: Improve comments.

This commit tries to simplify and further clarify the test cases
in test-hash.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agocommand-line: add ovs_cmdl_ prefix
Russell Bryant [Mon, 16 Mar 2015 16:01:55 +0000 (12:01 -0400)]
command-line: add ovs_cmdl_ prefix

The coding style guidelines include the following:

  - Pick a unique name prefix (ending with an underscore) for each
    module, and apply that prefix to all of that module's externally
    visible names.  Names of macro parameters, struct and union members,
    and parameters in function prototypes are not considered externally
    visible for this purpose.

This patch adds the new prefix to the externally visible names.  This
makes it a bit more obvious what code is coming from common command
line handling code.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoovstest: Fix a typo in a comment.
Russell Bryant [Mon, 16 Mar 2015 16:01:54 +0000 (12:01 -0400)]
ovstest: Fix a typo in a comment.

Fix a typo in an example of invoking 'ovstest' in a comment.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoofproto-dpif-xlate: Honor skip_wildcards in translation.
Jarno Rajahalme [Fri, 13 Mar 2015 20:27:19 +0000 (13:27 -0700)]
ofproto-dpif-xlate: Honor skip_wildcards in translation.

There is no need to do anything with wildcards when skip_wildcards is true.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoofproto-dpif-xlate: Add rule cookie to the tranlation context.
Jarno Rajahalme [Fri, 13 Mar 2015 20:27:19 +0000 (13:27 -0700)]
ofproto-dpif-xlate: Add rule cookie to the tranlation context.

This is needed for unrolling resubmits for after-recirculation actions
introduced by the following patch.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoofp-actions: Align struct ofpact to OFPACT_ALIGNTO.
Jarno Rajahalme [Fri, 13 Mar 2015 20:27:19 +0000 (13:27 -0700)]
ofp-actions: Align struct ofpact to OFPACT_ALIGNTO.

We already assume this alignment, let the compiler know it, too.

As a side-effect the sizeof(struct ofpact) also changes to
OFPACT_ALIGNTO, which should be fine.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoodp-util: Fix scanning of recirc_id.
Jarno Rajahalme [Fri, 13 Mar 2015 20:27:19 +0000 (13:27 -0700)]
odp-util: Fix scanning of recirc_id.

Recirculation id was scanned without a mask, which led to it being
ignored.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoFAQ.md: Add a few more details on how to support a new field.
Ben Pfaff [Fri, 13 Mar 2015 20:02:52 +0000 (13:02 -0700)]
FAQ.md: Add a few more details on how to support a new field.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
9 years agoovs-vsctl-bashcomp: Fix build failure when bash version < 4.0.
Alex Wang [Fri, 13 Mar 2015 17:28:07 +0000 (10:28 -0700)]
ovs-vsctl-bashcomp: Fix build failure when bash version < 4.0.

The ovs-vsctl-bashcomp script does not work properly on bash (version
 < 4.0).  This commit adds test for the bash version and avoids running
the script/test when the bash version is not supported.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>