cascardo/ovs.git
9 years agoxenserver: Use kernel uname version for XenServer 6.5
Edwin Chiu [Tue, 28 Apr 2015 22:15:54 +0000 (15:15 -0700)]
xenserver: Use kernel uname version for XenServer 6.5

In XenServer 6.5, multiple kernel packages with different
rpm versions can have the same uname.  So, it is not
necessary for openvswitch kernel module to require the
exact rpm version.  Instead, the kernel module package
should check the uname version.

This commit will add a new variable %{kernel_uname} to
specify whether to use kernel uname version or kernel
rpm version as requirement.

When %{kernel_name} is used, openvswitch-module will have
"Requires: kernel-uname-r = <uname version>" set instead of
"Requires: kernel = <version>".

Reported-by: Gosen Chien <astgosen@ccu.edu.tw>
Signed-off-by: Edwin Chiu <echiu@vmware.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
9 years agodatapath: gre: Reset fix_segment pointer.
Pravin B Shelar [Sat, 2 May 2015 00:30:44 +0000 (17:30 -0700)]
datapath: gre: Reset fix_segment pointer.

For kernel version 3.12 to 3.18, GRE uses compat code to
transmit packets which used fix_segment to segment packets.
but ovs_gso_cb->fix_segment is not initialized for GRE tunnels.
Following patches fixes it by resetting fix_segment.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
9 years agodpctl: cleaner dpctl output for tunnel ports.
Pravin B Shelar [Fri, 1 May 2015 18:02:02 +0000 (11:02 -0700)]
dpctl: cleaner dpctl output for tunnel ports.

Currently dont-fragment and TTL are initialized to zero, but
those are not default config for tunnel ports.  dpctl
does not show default config of a port.  So by setting these
values to default we can get cleaner `dpctl show` output.

% ovs-dpctl show
system@ovs-system:
port 0: ovs-system (internal)
port 1: br0 (internal)
port 4: gre_sys (gre: df_default=false, ttl=0)

% ovs-dpctl show # After initializing default values.
system@ovs-system:
port 0: ovs-system (internal)
port 1: br0 (internal)
port 4: gre_sys (gre)

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
9 years agoDPDK: add support for v2.0.0
Mark Kavanagh [Mon, 20 Apr 2015 19:37:14 +0000 (12:37 -0700)]
DPDK: add support for v2.0.0

Update relevant artifacts to add support for DPDK v2.0.0
 - INSTALL.DPDK.md
 - travis build script
 - acinclude.m4: add 'mssse3' flag to OVS_CFLAGS
 - netdev-dpdk: fix build with unified offload types in DPDK v2.0.0

Note that this breaks compatibility with DPDK v1.8.0

Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agogitignore: Add file to .gitignore
Alin Serdean [Tue, 28 Apr 2015 22:36:29 +0000 (22:36 +0000)]
gitignore: Add file to .gitignore

Add testsuite.tmp.orig to .gitignore

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
9 years agodatapath: Tidy up duplicate symbol detection.
Joe Stringer [Wed, 29 Apr 2015 20:33:25 +0000 (13:33 -0700)]
datapath: Tidy up duplicate symbol detection.

Don't print each symbol that is iterated.
Make the error message more clear by prefixing "error: ".

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agotest-ovsdb: Fix conditional statement.
Alex Wang [Wed, 29 Apr 2015 17:41:39 +0000 (10:41 -0700)]
test-ovsdb: Fix conditional statement.

Old version of python does not support the following conditional
statement syntax in one assignment:

   var = value1 if cond else value2

This commit fixes it by convert it back to use two assignments.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
9 years agodatapath: Add Stateless TCP Tunneling protocol.
Pravin B Shelar [Fri, 10 Apr 2015 03:12:32 +0000 (20:12 -0700)]
datapath: Add Stateless TCP Tunneling protocol.

The Stateless TCP Tunnel (STT) protocol encapsulates traffic in
IPv4/TCP packets.
STT uses TCP segmentation offload available in most of NIC. On
packet xmit STT driver appends STT header along with TCP header
to the packet. For GSO packet GSO parameters are set according
to tunnel configuration and packet is handed over to networking
stack. This allows use of segmentation offload available in NICs

The protocol is documented at
http://www.ietf.org/archive/id/draft-davie-stt-06.txt

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
9 years agoovs-hyperv: make kernel return values netlink socket like
Nithin Raju [Tue, 28 Apr 2015 21:35:37 +0000 (14:35 -0700)]
ovs-hyperv: make kernel return values netlink socket like

In this patch, we make changes to usersapce as well as
kernel datapath on hyperv to make it more netlink socket
like. Previously, the kernel datapath did not distinguish
between "transport errors" and other errors. Netlink
semantics dictate that netlink functions should only
return an error only in the case of a "transport error"
which is generally something fatal. Eg. failure to
communicate with the OVS module, or an invalid command
altogether. Other errors such as an unsupported action,
or an invalid flow key is not considered a "transport
error", and in such cases, netlink functions are to return
success with a 'struct nlmsgerr' populated in the output
buffer.

This patch implements these semantics.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/72
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agodatapath-windows: Enable extension after rrestart
Sorin Vinturis [Wed, 29 Apr 2015 12:58:16 +0000 (12:58 +0000)]
datapath-windows: Enable extension after rrestart

The extension failed to be activated during booting due to the
failure to initialize tunnel filter. This happened because the Base
Filtering Engine (BFE) is not started and 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 tunnel filter is initialized.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/77
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
9 years agodatapath-windows: Removed duplicate instance pid removal
Sorin Vinturis [Thu, 23 Apr 2015 20:37:02 +0000 (20:37 +0000)]
datapath-windows: Removed duplicate instance pid removal

Instance PID is already deleted in the OvsCleanupPacketQueue function.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
9 years agodatapath: Fix check-export-symbol for non-bash shells
YAMAMOTO Takashi [Mon, 27 Apr 2015 05:48:46 +0000 (14:48 +0900)]
datapath: Fix check-export-symbol for non-bash shells

Avoid using a bash construct (=~) in the target.

An alternative would be to make the configure script require
bash explicitly.  (Currently it doesn't and on NetBSD /bin/ksh
is likely used.)

The code in question was introduced by
commit b296b82a87326e68773b970284b8e012def0e3ba .
("datapath: Check the export of public functions in linux/compat/linux/.")

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: Alex Wang <alexw@nicira.com>
9 years agodatapath: Stop using __DATE__ and __TIME__ in startup string.
Jesse Gross [Mon, 27 Apr 2015 19:28:55 +0000 (12:28 -0700)]
datapath: Stop using __DATE__ and __TIME__ in startup string.

An increasing number of distributions ship with GCC 4.9 (including
Fedora and Ubuntu) that has -Werror=date-time. This causes kernel
compilation to fail because the builds are not exactly reproducible.

This simply removes the use of those constants, which was already
done for the upstream Linux version of the module. It retains the
version string, however, which should provide the same information
in most cases.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoAllow subclasses of Idl to define a notification hook
Terry Wilson [Sat, 25 Apr 2015 19:57:44 +0000 (14:57 -0500)]
Allow subclasses of Idl to define a notification hook

It is useful to make the notification events that Idl processes
accessible to users of the library. This will make it possible to
keep external systems in sync, but does not impose any particular
notification pattern.

The Row.from_json() call is added to be able to convert the 'old'
JSON response on an update to a Row object to make it easy for
users of notify() to see what changed, though this usage of Row
is quite different than Idl's typical use.

Signed-off-by: Terry Wilson <twilson@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoofp-parse: Correctly report error parsing selection method parameter.
Ben Pfaff [Sun, 26 Apr 2015 17:17:27 +0000 (10:17 -0700)]
ofp-parse: Correctly report error parsing selection method parameter.

Found by LLVM scan-build.

Reported-by: Kevin Lo <kevlo@FreeBSD.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Simon Horman <simon.horman@netronome.com>
Acked-by: Kevin Lo <kevlo@FreeBSD.org>
9 years agodatapath: Use kernel Geneve implementation on 4.0 and above.
Jesse Gross [Sun, 26 Apr 2015 00:00:11 +0000 (17:00 -0700)]
datapath: Use kernel Geneve implementation on 4.0 and above.

When Geneve was originally backported, it wasn't available as part
of a released kernel version but it is now, so we can take advantage
of the native implementation.

Note that Geneve was actually first available as part of the 3.18
kernel release but some drivers erroreously try to offload it as
if it were VXLAN, which was fixed in the 4.0 release. Since our
UDP tunnel compat layer already takes care of this, we continue
using the OVS Geneve implementation until 4.0.

Reported-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
9 years agoudptunnel: Kernel 3.20 doesn't exist.
Jesse Gross [Sat, 25 Apr 2015 23:28:23 +0000 (16:28 -0700)]
udptunnel: Kernel 3.20 doesn't exist.

When the UDP tunnel compat code was written, it backported some
functions that were slated to be in the next kernel release, then
called 3.20. However, this was ultimately released as 4.0 instead.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
9 years agodatapath: Check the export of public functions in linux/compat/linux/.
Alex Wang [Mon, 20 Apr 2015 03:54:50 +0000 (20:54 -0700)]
datapath: Check the export of public functions in linux/compat/linux/.

This commit adds check in datapath/Makefile to make sure that all public
functions and exported symbols in linux/compat/ are either rpl_ or ovs_
prefixed, except those defined in compat/build-aux/export-check-whitelist.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
9 years agodatapath: Prevent linker error of unknown symbol.
Alex Wang [Tue, 21 Apr 2015 01:19:53 +0000 (18:19 -0700)]
datapath: Prevent linker error of unknown symbol.

With the latest change of separating vports into their own modules,
it is necessary to export all public functions in linux/compat/
directory.  Also, we should prefix functions which replace the
upstream ones with 'rpl_' and others with 'ovs_'.  This will prevent
the linker error when vport modules use those functions in the future.
e.g., the to be merged vport-stt module will use the flex_array_*
functions which are not currently exported.

Co-authored-by: Tuan Nguyen <tuan.nguyen@veriksystems.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
9 years agodatapath: Remove linux/compat/include/linux/log2.h.
Alex Wang [Tue, 21 Apr 2015 21:03:31 +0000 (14:03 -0700)]
datapath: Remove linux/compat/include/linux/log2.h.

No longer need this compat file, we can use the upstream version
of the function.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
9 years agodatapath-windows: Removed gOvsCtrlLock global spinlock
Sorin Vinturis [Thu, 23 Apr 2015 20:27:53 +0000 (20:27 +0000)]
datapath-windows: Removed gOvsCtrlLock global spinlock

There is no need to use gOvsCtrlLock spinlock to guard the switch
context, as there is now the switch context's reference count used
for this purpose.

Now the gOvsCtrlLock spinlock guards only one shared resource, the
OVS_OPEN_INSTANCE global instance array.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
9 years agoRemove compiler warning
Alin Serdean [Thu, 23 Apr 2015 18:46:39 +0000 (18:46 +0000)]
Remove compiler warning

When linking executables on windows the following argument is passed
to the linker -Qunused-arguments.
This results in the following warning:
Command line warning D9002 : ignoring unknown option '-Qunused-arguments'

This patch removes that warning.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
9 years agodatapath-windows: don't free switch cxt until ref == 0
Nithin Raju [Thu, 23 Apr 2015 00:10:10 +0000 (17:10 -0700)]
datapath-windows: don't free switch cxt until ref == 0

This is a hard to hit corner case, because currently we recommend that
all handles to the kernel datapath be closed before trying to unload the
OVS extension.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agotestsuite: Don't apply the testsuite.patch on non-Windows platforms.
Gurucharan Shetty [Thu, 23 Apr 2015 14:13:04 +0000 (07:13 -0700)]
testsuite: Don't apply the testsuite.patch on non-Windows platforms.

On CentOS machines which use autoconf version 2.63, the patch
application would fail.

Reported-by: Ian Stokes <ian.stokes@intel.com>
Tested-by: Ian Stokes <ian.stokes@intel.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
9 years agonetdev-dpdk: Reset RSS hash on transmit
Mark D. Gray [Mon, 13 Apr 2015 13:36:56 +0000 (06:36 -0700)]
netdev-dpdk: Reset RSS hash on transmit

When using DPDK rings (dpdkr port type), packet buffers get shared
to consumers of the rings (e.g. Virtual Machines). The packet buffers
also include the RSS hash. This is a hash of a number of fields
in the packet and is used in order to do a fast lookup in the EMC.

However, if a consumer of the packet modifies the packet without
regenerating the RSS hash, the EMC will use the same hash for lookup
even though the packet may belong to a different flow. This would
cause unnecessary collisions in the EMC reducing performance in the
presence of multiple flows.

To avoid receiving an incorrect RSS hash on reception from a DPDK
ring, the RSS hash needs to be reset on transmission. This will reduce
performance of the forwarding path as the RSS hash will need to
calculated for every packet received from an dpdkr but will behave
correctly in the presence of a large number of flows that get
modified by the consumer of a DPDK ring

Signed-off-by: Mark D. Gray <mark.d.gray@intel.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agotests: Avoid Windows unit tests from hanging.
Gurucharan Shetty [Wed, 8 Apr 2015 00:17:39 +0000 (17:17 -0700)]
tests: Avoid Windows unit tests from hanging.

It has been observed that sometimes Windows unit tests hang.
This happens when a daemon is started but does not get terminated
when the test ends.

In one particular case, OVS_VSWITCHD_STOP is called which inturn
calls 'ovs-appctl exit'. This causes ovs-vswitchd's atexit handler
to cleanup the pidfiles. After this, the pthread destructurs get
called and a deadlock happens in there. This results in the
daemons not getting force killed resulting in the tests hanging
because the cleanup file tries to run the command
"kill `cat ovs-vswitchd.pid`" and ovs-vswitchd.pid no longer exists.

With this commit, we write the pid value of the daemons in the
cleanup file (instead of asking it to 'cat' the value later from
the pidfile). This way, even if the pidfiles get deleted, we can
still kill the daemons.

This commit also changes the way daemons are force killed in
Windows. It was observed that 'taskkill //F ' failed to kill
a deadlocked daemon running its pthread destructor. But
tskill succeeds.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
(ON_EXIT_UNQUOTED macro provided by Ben.)
Co-authored-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoovs-ctl.8: Add a missing synopsis.
Gurucharan Shetty [Wed, 22 Apr 2015 12:17:43 +0000 (05:17 -0700)]
ovs-ctl.8: Add a missing synopsis.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agodpctl.at: tap devices don't exist on Windows.
Gurucharan Shetty [Wed, 22 Apr 2015 02:22:44 +0000 (19:22 -0700)]
dpctl.at: tap devices don't exist on Windows.

The tests fail on Windows because tap device is not
a valid device on Windows. Use "dummy" device instead.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoovs-dev: Load all available vport modules on modinst
Thomas Graf [Wed, 22 Apr 2015 07:49:43 +0000 (09:49 +0200)]
ovs-dev: Load all available vport modules on modinst

Automatically load all vport modules upon 'modinst' in case
they are not properly installed and thus not autoloaded.

Suggested-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
9 years agoNEWS: Leave a comment that vports are now separate kernel modules
Thomas Graf [Wed, 22 Apr 2015 07:49:43 +0000 (09:49 +0200)]
NEWS: Leave a comment that vports are now separate kernel modules

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
9 years agoovs-dev: Hint that vport modules may need to be loaded manually
Thomas Graf [Wed, 22 Apr 2015 07:49:43 +0000 (09:49 +0200)]
ovs-dev: Hint that vport modules may need to be loaded manually

In case the openvswitch.ko is loaded manually without dependencies
built, the vport modules need to be loaded manually as well.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
9 years agoovs-ctl: Unload & reload vport modules on force-reload-kmod
Thomas Graf [Wed, 22 Apr 2015 07:49:43 +0000 (09:49 +0200)]
ovs-ctl: Unload & reload vport modules on force-reload-kmod

We manually rmmod the loaded vports as using modprobe -r
only works if the modules are available through modules.dep

We do not treat failures to load vports as a fatal error in case
the vport module has been renamed. Bringing the bridge back up is
considered more important. The error is still reported though.

Reported-by: Pravin Shelar <pshelar@nicira.com>
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
9 years agoofp-parse: Properly report error for invalid group ID.
Ben Pfaff [Thu, 16 Apr 2015 20:56:46 +0000 (13:56 -0700)]
ofp-parse: Properly report error for invalid group ID.

The inner 'error' shadowed an outer one, so that the error, when set, was
never returned to the caller.

Found by LLVM scan-build.

Reported-by: Kevin Lo <kevlo@FreeBSD.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
9 years agoofp-util: Add missing 'break;' in bad_group_cmd().
Ben Pfaff [Wed, 22 Apr 2015 03:00:50 +0000 (20:00 -0700)]
ofp-util: Add missing 'break;' in bad_group_cmd().

Otherwise you get an assertion failure in place of a helpful error message.

Also fix typo where the "remove-bucket" command was output as
"insert-bucket".

Also fix a nearby style violation and add a pair of tests to prevent
regression.

Found by LLVM scan-build.

Reported-by: Kevin Lo <kevlo@FreeBSD.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
9 years agonetdev-dummy: Fix null pointer deref in dummy_packet_conn_set_config().
Ben Pfaff [Thu, 16 Apr 2015 21:38:36 +0000 (14:38 -0700)]
netdev-dummy: Fix null pointer deref in dummy_packet_conn_set_config().

This would trigger if someone tried to switch a dummy device between
active and passive connections.  It's not very important because dummy
devices are only enabled during testing.

Found by LLVM scan-build.

Reported-by: Kevin Lo <kevlo@FreeBSD.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
9 years agodpctl.at: Ignore string representation of error messages in output.
Ben Pfaff [Mon, 20 Apr 2015 19:11:23 +0000 (12:11 -0700)]
dpctl.at: Ignore string representation of error messages in output.

Different C libraries represent the same error code (particularly ENODEV)
differently.  This caused spurious test failures on BSD.  This commit
avoids the problem by ignoring the error string representations entirely.

Reported-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
9 years agobridge: Remove redundant call to discover_types().
Ben Pfaff [Thu, 26 Mar 2015 05:25:51 +0000 (22:25 -0700)]
bridge: Remove redundant call to discover_types().

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
9 years agoFAQ: Refine discussion of how to get a kernel module.
Ben Pfaff [Thu, 16 Apr 2015 17:49:38 +0000 (10:49 -0700)]
FAQ: Refine discussion of how to get a kernel module.

This has come up a couple of times lately.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
9 years agobridge: Remove unused macro OFP_PORT_ACTION_WINDOW.
Ben Pfaff [Thu, 16 Apr 2015 16:01:54 +0000 (09:01 -0700)]
bridge: Remove unused macro OFP_PORT_ACTION_WINDOW.

I guess that this was missed when the corresponding feature was removed.

Reported-by: David Evans <davidjoshuaevans@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
9 years agoin-band: Mention ofproto name in the VLOG.
Alex Wang [Mon, 20 Apr 2015 22:33:08 +0000 (15:33 -0700)]
in-band: Mention ofproto name in the VLOG.

This will help the debugging of in-band module.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoin-band: Do not use manager with loopback address for in-band control.
Alex Wang [Mon, 20 Apr 2015 22:01:40 +0000 (15:01 -0700)]
in-band: Do not use manager with loopback address for in-band control.

If the manager resides on the same host as ovs, the manager target will
be the loopback address.  Then, if in-band is enabled on a bridge, the
in-band module will constantly checks the connection to the manager to
make sure the manager is reachable.  However, the connection checking
implementation cannot identify the route for the loopback address and
will keep issuing the following warning:

|in_band|WARN|cannot find route for controller (127.0.0.1): No such
device or address.

To fix this, this commit makes ovs not consider manager with loopback
for in-band control at all, since the manager is always reachable
on the same host.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agodatapath-windows: Removed assert from FilterNetPnPEvent handler
Sorin Vinturis [Wed, 15 Apr 2015 17:30:26 +0000 (17:30 +0000)]
datapath-windows: Removed assert from FilterNetPnPEvent handler

I have removed an inappropriate assert from the FilterNetPnPEvent
routine, OvsExtNetPnPEvent. When NDIS calls the FilterNetPnPEvent
routine, the extension is in paused state and, obviously, the
switch is not active. The switch becomes active after FilterRestart
routine is called and the restart is successfully complete.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agodpif-netdev: Batch packets when recirculating.
Daniele Di Proietto [Wed, 15 Apr 2015 18:11:49 +0000 (19:11 +0100)]
dpif-netdev: Batch packets when recirculating.

Now that we have per packet metadata, there's no need to split packet
batches when recirculating.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
9 years agodp-packet: Rename 'dp_hash' in 'rss_hash'.
Daniele Di Proietto [Wed, 15 Apr 2015 18:11:48 +0000 (19:11 +0100)]
dp-packet: Rename 'dp_hash' in 'rss_hash'.

We already have the 'dp_hash' embedded in the metadata.  This caused
confusion in the code.  With this commit it should be clear that
'rss_hash' is the packet hash used for internal purposes, while
'md.dp_hash' is part of the flow, computed during the execution of
certain actions.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
9 years agodpif-netdev: Cache time_msec() calls for each received batch.
Daniele Di Proietto [Wed, 15 Apr 2015 18:11:47 +0000 (19:11 +0100)]
dpif-netdev: Cache time_msec() calls for each received batch.

Calling time_msec() (which calls clock_gettime()) too often might be
expensive.  With this commit OVS makes only one call per received
batch and caches the result.

Suggested-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
9 years agodpif-netdev: Store actions data and size contiguously.
Daniele Di Proietto [Wed, 15 Apr 2015 18:11:46 +0000 (19:11 +0100)]
dpif-netdev: Store actions data and size contiguously.

As stated by the comment above the structure, the 'action' pointer does not
change during the 'dp_netdev_actions' lifetime: we might as well embed
the pointed memory into the structure.

The commit also updates the description of dp_netdev_actions_create().

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
9 years agonetlink-socket: Exit NL transaction loop when EINVAL is returned
Ben Pfaff [Mon, 20 Apr 2015 19:43:37 +0000 (12:43 -0700)]
netlink-socket: Exit NL transaction loop when EINVAL is returned

The nl_sock_transact_multiple function enters in an infinite loop,
when invalid error, EINVAL, is returned by nl_sock_transact_multiple__.
EINVAL is the error returned by the latter function when a driver
request fails.

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/57
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoauto-attach: Implement interface lldp disable and re-enable
Dennis Flynn [Wed, 15 Apr 2015 15:53:56 +0000 (11:53 -0400)]
auto-attach: Implement interface lldp disable and re-enable

This commit completes the implementation of the lldp enable
option. Specifically after enabling lldp on a particular interface, lldp can
now be disabled and subsequently re-enabled. OVS will not transmit or receive
lldp packets if lldp is disabled on the interface.

Signed-off-by: Dennis Flynn <drflynn@avaya.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoconfigure.ac: Fix pthread linking on FreeBSD.
Kevin Lo [Sat, 18 Apr 2015 17:48:06 +0000 (01:48 +0800)]
configure.ac: Fix pthread linking on FreeBSD.

The configure script checks for the existence of pthread_sigmask.
However, on FreeBSD, libc contains no-op stubs for many of the
pthread_* functions.  As a result, the AC_SEARCH_LIBS macro returns
"none required".

As an alternative to checking pthread_sigmask, a solution is to check
pthread_create.

Signed-off-by: Kevin Lo <kevlo@FreeBSD.org>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoovs-ofctl: Fix documentation of burst_size.
Ben Pfaff [Mon, 20 Apr 2015 15:45:27 +0000 (08:45 -0700)]
ovs-ofctl: Fix documentation of burst_size.

Reported-by: Kentaro Ebisawa <ebiken.g@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
9 years agoconfigure: Fix -Werror build for NetBSD + clang
YAMAMOTO Takashi [Fri, 17 Apr 2015 08:14:38 +0000 (17:14 +0900)]
configure: Fix -Werror build for NetBSD + clang

On NetBSD, clang (clang-3.5.0 from pkgsrc) complains
when "clang -g" is used for linking.  Specify -Qunused-arguments
to suppress the warning.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoconfigure.ac: Avoid using non-ascii characters in a comment
YAMAMOTO Takashi [Fri, 17 Apr 2015 07:03:14 +0000 (16:03 +0900)]
configure.ac: Avoid using non-ascii characters in a comment

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agodkms.conf.in: Install all kernel modules.
Alex Wang [Fri, 17 Apr 2015 18:30:18 +0000 (11:30 -0700)]
dkms.conf.in: Install all kernel modules.

With the latest change of separating vports into their own modules,
we need to update the dkms.conf.in and make dkms install all vport
modules.  So, this commit modifies the debian/rules to read all
kernel module names and sets the dkms.conf correctly.

Signed-off-by: Alex Wang <alexw@nicira.com>
9 years agoperf-counter: Remove unused vlog module.
Ben Pfaff [Fri, 17 Apr 2015 17:06:17 +0000 (10:06 -0700)]
perf-counter: Remove unused vlog module.

Otherwise Clang warns about an unused variable.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
9 years agobridge: Fix use-after-free in bridge_aa_refresh_queue().
Ben Pfaff [Thu, 16 Apr 2015 21:49:23 +0000 (14:49 -0700)]
bridge: Fix use-after-free in bridge_aa_refresh_queue().

Found by LLVM scan-build.

Reported-by: Kevin Lo <kevlo@FreeBSD.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Dennis Flynn <drflynn@avaya.com>
9 years agoovs-lldp: Avoid use-after-free in aa_mapping_unregister().
Ben Pfaff [Thu, 16 Apr 2015 21:46:27 +0000 (14:46 -0700)]
ovs-lldp: Avoid use-after-free in aa_mapping_unregister().

Found by LLVM scan-build.

Reported-by: Kevin Lo <kevlo@FreeBSD.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Dennis Flynn <drflynn@avaya.com>
9 years agonetdev-bsd: Fix netdev_bsd_get_mtu() return value.
Ben Pfaff [Thu, 16 Apr 2015 21:19:37 +0000 (14:19 -0700)]
netdev-bsd: Fix netdev_bsd_get_mtu() return value.

When netdev_bsd_get_mtu() failed, it didn't report the error to the caller,
so the caller couldn't work around not knowing the MTU, and ended up using
an uninitialized 'mtu' value.

Found by LLVM scan-build.

Reported-by: Kevin Lo <kevlo@FreeBSD.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Kevin Lo <kevlo@FreeBSD.org>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
9 years agonx-match: Avoid null pointer dereference in nx_pull_header__() error case.
Ben Pfaff [Thu, 16 Apr 2015 21:04:47 +0000 (14:04 -0700)]
nx-match: Avoid null pointer dereference in nx_pull_header__() error case.

Found by LLVM scan-build.

Reported-by: Kevin Lo <kevlo@FreeBSD.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
9 years agoofp-actions: Remove dead store in ofpacts_pull_openflow_instructions().
Ben Pfaff [Thu, 16 Apr 2015 20:48:09 +0000 (13:48 -0700)]
ofp-actions: Remove dead store in ofpacts_pull_openflow_instructions().

Found by LLVM scan-build.

Reported-by: Kevin Lo <kevlo@FreeBSD.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
9 years agoovs-lldp: Remove unused variable 'lldp_size'.
Ben Pfaff [Thu, 16 Apr 2015 20:44:53 +0000 (13:44 -0700)]
ovs-lldp: Remove unused variable 'lldp_size'.

Doesn't seem to be good for anything.

Found by LLVM scan-build.

Reported-by: Kevin Lo <kevlo@FreeBSD.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kevin Lo <kevlo@FreeBSD.org>
Acked-by: Dennis Flynn <drflynn@avaya.com>
9 years agoofp-parse: Properly report error for invalid bucket ID.
Ben Pfaff [Thu, 16 Apr 2015 20:40:04 +0000 (13:40 -0700)]
ofp-parse: Properly report error for invalid bucket ID.

The inner 'error' shadowed an outer one, so that the error, when set, was
never returned to the caller.

Found by LLVM scan-build.

Reported-by: Kevin Lo <kevlo@FreeBSD.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
9 years agoperf-counter: remove initial VLOG_INFO message when performance counter is not available
Andy Zhou [Thu, 16 Apr 2015 22:19:56 +0000 (15:19 -0700)]
perf-counter: remove initial VLOG_INFO message when performance counter is not available

Unit tests "corrupted database log" and "database log with bad
transaction" will fail without this patch.

Reported-by: Ansis Atteka <aatteka@nicira.com>¬
Signed-off-by: Andy Zhou <azhou@nicira.com>
9 years agoautoconf: check for linux/perf_event.h
Andy Zhou [Thu, 16 Apr 2015 19:52:09 +0000 (12:52 -0700)]
autoconf: check for linux/perf_event.h

Older Linux prior to version 2.6.32 do not support user mode
performance events, They also don't have 'linux/perf_event.h' header
file. Add check for those older Linux to conditionally compile
perf-counter.c

Reported-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
9 years agolib/rstp: Remove a dead store.
Jarno Rajahalme [Thu, 16 Apr 2015 21:56:50 +0000 (14:56 -0700)]
lib/rstp: Remove a dead store.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Daniele Venturino <daniele.venturino@m3s.it>
9 years agodatapath:netdevice: Export rpl_skb_gso_segment.
Alex Wang [Thu, 16 Apr 2015 18:23:47 +0000 (11:23 -0700)]
datapath:netdevice: Export rpl_skb_gso_segment.

With the latest change of separating vports into their own modules,
we also need to explicitly export rpl_skb_gso_segment to avoid linker
error.

VMware-BZ: #1432578
VMware-BZ: #1308175

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
9 years agoINSTALL.Windows: external.1 should be part of 'br-pif'
Nithin Raju [Thu, 16 Apr 2015 16:22:52 +0000 (09:22 -0700)]
INSTALL.Windows: external.1 should be part of 'br-pif'

Fixing a minor typo introduced in a previous commit.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoovs-lldp: Avoid free() of static data in aa_print_element_status_port().
Ben Pfaff [Thu, 16 Apr 2015 15:52:29 +0000 (08:52 -0700)]
ovs-lldp: Avoid free() of static data in aa_print_element_status_port().

In some cases 'id' could point to the static string "<None>", which was
then passed to free() even though it must not be.  This commit fixes the
problem.

Found by LLVM scan-build.

Reported-by: Kevin Lo <kevlo@FreeBSD.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
Acked-by: Dennis Flynn <drflynn@avaya.com>
9 years agodpctl: Add tests.
Ben Pfaff [Wed, 15 Apr 2015 18:16:23 +0000 (11:16 -0700)]
dpctl: Add tests.

These tests prevent regressions against the problems fixed by the previous
two commits.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
9 years agodpif-netdev: Reject adding duplicate ports.
Ben Pfaff [Wed, 15 Apr 2015 18:15:45 +0000 (11:15 -0700)]
dpif-netdev: Reject adding duplicate ports.

Otherwise it is at least very confusing.

Found during testing.  An upcoming commit adds a test.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
9 years agodpctl: Fix error handling and reporting regressions.
Ben Pfaff [Wed, 15 Apr 2015 18:13:04 +0000 (11:13 -0700)]
dpctl: Fix error handling and reporting regressions.

Fixes multiple weaknesses in dpctl error reporting:

    * dpctl_set_if() didn't stop processing or report to the caller
      attempts to change a port type or number.

    * dpctl_set_if() didn't report the specifics when netdev_set_config()
      reported an error setting port configuration (which can happen even
      it returns 0).

    * The unixctl handler didn't report errors encountered during command
      processing through the JSON-RPC error mechanism, which meant that
      ovs-appctl's return code wasn't useful (as ovs-dpctl's return code
      is useful) for detecting errors in command execution.

At least the first of these is a regression from OVS 2.3.x.

A followup commit will add tests.

Reported-by: Kevin Lo <kevlo@FreeBSD.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
9 years agorun-ryu: Use the IANA OpenFlow port number
YAMAMOTO Takashi [Wed, 15 Apr 2015 08:10:50 +0000 (17:10 +0900)]
run-ryu: Use the IANA OpenFlow port number

Specify the use of the port 6653 for ryu side explicitly
because it still defaults to port 6633.

Fixes check-ryu after commit d4763d1d4efbbcfd884df2d668980d61ec89d75a.
("Use the IANA-assigned ports for OpenFlow and OVSDB.")

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoovs-vswitchd: Don't print supported OpenFlow versions with "-V".
Justin Pettit [Wed, 15 Apr 2015 20:26:32 +0000 (13:26 -0700)]
ovs-vswitchd: Don't print supported OpenFlow versions with "-V".

When "-V" was supplied to ovs-vswitchd, it was returning a max supported
OpenFlow version of 1.0, which is no longer true.  There are other
methods to determine the supported OpenFlow versions in ovs-vswitchd, so
remove it from the "-V" output.

Reported-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
9 years agonetdev-bsd: Remove duplicate header inclusion of <netinet/in.h>
Kevin Lo [Wed, 15 Apr 2015 06:58:39 +0000 (14:58 +0800)]
netdev-bsd: Remove duplicate header inclusion of <netinet/in.h>

Signed-off-by: Kevin Lo <kevlo@FreeBSD.org>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoINSTALL.DPDK.md: Update ivshmem page size restrictions
Mark D. Gray [Fri, 10 Apr 2015 14:36:54 +0000 (15:36 +0100)]
INSTALL.DPDK.md: Update ivshmem page size restrictions

Update ivshmem restrictions to indicate that ivshmem does
not currently support small pages when sharing with a guest
operating system.

Reported-by: Daniele Di Proietto <diproiettod@vmware.com>
Signed-off-by: Mark D. Gray <mark.d.gray@intel.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoINSTALL.DPDK.md: Fix whitespace.
Mark D. Gray [Fri, 10 Apr 2015 14:36:53 +0000 (15:36 +0100)]
INSTALL.DPDK.md: Fix whitespace.

Signed-off-by: Mark D. Gray <mark.d.gray@intel.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoperf-counter: use 'int' instead of size_t
Andy Zhou [Wed, 15 Apr 2015 00:25:32 +0000 (17:25 -0700)]
perf-counter: use 'int' instead of size_t

'size_t' does not allow for catching the case where 'read' returns
an error code, which is a negative number.

Reported-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
9 years agoperf-counter: fix compiler warnings
Andy Zhou [Tue, 14 Apr 2015 21:22:08 +0000 (14:22 -0700)]
perf-counter: fix compiler warnings

Gcc complains about:
lib/perf-counter.c:43:13: error: ignoring return value of 'read',
declared with attribute warn_unused_result [-Werror=unused-result]
         read(fd__, counter, sizeof(*counter));

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
9 years agoovs-sandbox: add '-r' and '-e' options
Andy Zhou [Tue, 14 Apr 2015 20:44:01 +0000 (13:44 -0700)]
ovs-sandbox: add '-r' and '-e' options

'-e' option will run ovs-vswitchd under gdb, but runs immediately
instead of waiting for user input. '-r' options applies to ovsdb-server.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
9 years agoovs-sandbox: add delay before running ovs-vsctl
Andy Zhou [Fri, 10 Apr 2015 19:53:26 +0000 (12:53 -0700)]
ovs-sandbox: add delay before running ovs-vsctl

When running ovsdb-server under gdb, there is a race that ovs-vsctl
command can be called before ovsdb-server is fully launched. This will
cause ovs-vsctl to fail.  This patch fixes this by delay issuing
the ovs-vsctl command until ovsdb-server is fully launched.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoperf-counters: fix non-linux build
Andy Zhou [Tue, 14 Apr 2015 19:28:50 +0000 (12:28 -0700)]
perf-counters: fix non-linux build

Commit '97a3c43515e' misses definitions for non-Linux platforms thus
broke builds for any non-Linux platform.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Gurucharan Shetty <gshetty@nicira.com>
9 years agoperf-counter: Fix 32-bit build break due to incorrect printf specifiers.
Ben Pfaff [Tue, 14 Apr 2015 20:47:19 +0000 (13:47 -0700)]
perf-counter: Fix 32-bit build break due to incorrect printf specifiers.

Fixes the following warnings from GCC on 32-bit architectures:

    ../lib/perf-counter.c: In function 'perf_counter_to_ds':
    ../lib/perf-counter.c:119:19: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'uint64_t' [-Werror=format]
    ../lib/perf-counter.c:119:19: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'uint64_t' [-Werror=format]

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
9 years agoperf-counter: Lower log level when no perf counter.
Flavio Leitner [Tue, 14 Apr 2015 15:14:21 +0000 (12:14 -0300)]
perf-counter: Lower log level when no perf counter.

Some arches don't support perf counter and an error message
breaks many tests from the testsuite.  Since the software still
runs without it, just inform that perf counters are not available
with using INFO level instead.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
[blp@nicira.com removed unneeded \n from log message]
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agodpif-netdev: Add dpif-netdev/pmd-stats-* appctl commands.
Daniele Di Proietto [Fri, 10 Apr 2015 18:09:50 +0000 (19:09 +0100)]
dpif-netdev: Add dpif-netdev/pmd-stats-* appctl commands.

These commands can be used to get packets and cycles counters on a pmd
thread basis.  They're useful to get a clearer picture about the
performance of the userspace datapath.

They export these pieces of information:

- A (per-thread) view of the caches hit rate. Hits in the exact match
  cache are reported separately from hits in the masked classifier
- A rough cycles count. This will allow to estimate the load of OVS and
  the polling overhead.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
9 years agodpif-provider: Add class init function.
Daniele Di Proietto [Fri, 10 Apr 2015 18:09:49 +0000 (19:09 +0100)]
dpif-provider: Add class init function.

This init function is called when the dpif class is registered. It will
be used by following commits

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
9 years agodpif-netdev: Add simple per pmd-thread cycles counters.
Daniele Di Proietto [Fri, 10 Apr 2015 18:09:48 +0000 (19:09 +0100)]
dpif-netdev: Add simple per pmd-thread cycles counters.

The counters use x86 TSC if available (currently only with DPDK). They
will be exposed by subsequents commits

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
9 years agopython: Add setuptools for Python lib for PyPI.
Terry Wilson [Fri, 10 Apr 2015 19:57:00 +0000 (14:57 -0500)]
python: Add setuptools for Python lib for PyPI.

This adds very basic support for setuptools so that the OVS Python
lib can be added to PyPI.

This currently uses the Open vSwitch version number and the
generated dirs.py, though there is no real reason to tie the
Python libraries releases or version numbers to the main project's.

Signed-off-by: Terry Wilson <twilson@redhat.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
Acked-by: Kyle Mestery <mestery@mestery.com>
[blp@nicira.com adjusted automake.mk]
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoovsdb: integrate perf-counter infrastructure into ovsdb-server
Andy Zhou [Sat, 21 Mar 2015 07:00:49 +0000 (00:00 -0700)]
ovsdb: integrate perf-counter infrastructure into ovsdb-server

This integration also adds two commands:

ovsdb-server/perf-counters-show -- show all counters
ovsdb-server/perf-counters-clear -- clear all counters

There is no pre-configured sample points. A programmer needs to
added sampling point by changing the source code. However he
does not need to worry about infrastructures such as initialization
or cleaning up memory when ovsdb-server exits.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
9 years agolib: add a hardware performance counter access library
Andy Zhou [Sat, 21 Mar 2015 07:00:48 +0000 (00:00 -0700)]
lib: add a hardware performance counter access library

First cut of adding a performance library that provides access to
hardware counters. Please see comments in perf-counter.h for
more details.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
9 years agodatapath: Update inner offsets when expanding headroom.
Jesse Gross [Tue, 31 Mar 2015 16:19:58 +0000 (09:19 -0700)]
datapath: Update inner offsets when expanding headroom.

skb protocol offsets are relative to the beginning of the
buffer and therefore must be updated if the buffer size is
expanded. Kernel functions do this automatically for existing
fields but obviously not for anything that we backport. This
introduces a wrapper for pskb_expand_head() to update the
inner protocol fields that we have backported.

Without this, a kernel crash can be triggered with tunnel
packets that do not have enough headroom and need to be
segmented. pskb_expand_head() is called in directly through
skb_cow_head() at the beginning of each of the tunnel transmit
routines.

Reported-by: Yinpeijun <yinpeijun@huawei.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agoINSTALL.Windows.md: add steps for disabling test-signing.
Nithin Raju [Mon, 13 Apr 2015 19:00:37 +0000 (12:00 -0700)]
INSTALL.Windows.md: add steps for disabling test-signing.

Added the commands to be able to install an unsigned driver.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
9 years agoINSTALL.Windows: Correct invalid paths.
Gurucharan Shetty [Thu, 9 Apr 2015 20:36:39 +0000 (13:36 -0700)]
INSTALL.Windows: Correct invalid paths.

commit 0be55e389d2f1 (INSTALL.Windows: Add documentation about Windows
services.) added documentation about starting Windows services but
provided wrong executable paths. This commit fixes it.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Nithin Raju <nithin@vmware.com>
9 years agotravis: fix errors
Mark Kavanagh [Wed, 8 Apr 2015 22:30:06 +0000 (23:30 +0100)]
travis: fix errors

Fix two issues observed in travis scripts:
- prepare.sh: add '-E' flag to ensure user environmental variables
  (for example, URL of the proxy server) are passed to 'sudo'
- build.sh: add quotes around compiler variable to fix 'unary
  operator expected' error

[tgraf: Fixed two additional occurrences of missing "]

Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
9 years agotests: gre: fix flags endianness
Flavio Leitner [Fri, 10 Apr 2015 14:08:10 +0000 (11:08 -0300)]
tests: gre: fix flags endianness

The flags field is 16 bits so use network byte order in the
test case and use the proper conversion methods when parsing
and dumping.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
9 years agotest-csum: endianess fix
Flavio Leitner [Fri, 10 Apr 2015 14:07:50 +0000 (11:07 -0300)]
test-csum: endianess fix

The math is done in network byte order so the 32 bits won't
match between big and little endian, so the assert fails.

Reduce to 16 bits and then compare to the converted constant.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
9 years agodpif-netdev: Count exact match cache hits.
Daniele Di Proietto [Tue, 7 Apr 2015 19:02:15 +0000 (20:02 +0100)]
dpif-netdev: Count exact match cache hits.

We used to count exact match cache hits and masked classifier hits
together. This commit splits the DP_STAT_HIT counter into two.
This change will be used by future commits.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
9 years agodpif-netdev: Make datapath and flow stats atomic.
Daniele Di Proietto [Tue, 7 Apr 2015 19:02:14 +0000 (20:02 +0100)]
dpif-netdev: Make datapath and flow stats atomic.

A read operation from a non atomic shared value (without external
locking) can return incorrect values.  Using the atomic semantics
prevents this from happening.

However:
* No memory barriers are used.  We don't need that kind of consistency
  for statistics (we use relaxed operations).
* The updates are not atomic, just the loads and stores.  This is ok
  because there's a single writer.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
9 years agodpif-netdev: Group statistics updates in the slow path.
Daniele Di Proietto [Tue, 7 Apr 2015 19:02:13 +0000 (20:02 +0100)]
dpif-netdev: Group statistics updates in the slow path.

Since statistics updates might require locking (in future commits)
grouping them will reduce the locking overhead.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
9 years agodatapath: Account for "udptunnels: Call handle_offloads after inserting vlan tag."
Jesse Gross [Tue, 7 Apr 2015 23:11:23 +0000 (16:11 -0700)]
datapath: Account for "udptunnels: Call handle_offloads after inserting vlan tag."

Upstream commit:
    udptunnels: Call handle_offloads after inserting vlan tag.

    handle_offloads() calls skb_reset_inner_headers() to store
    the layer pointers to the encapsulated packet. However, we
    currently push the vlag tag (if there is one) onto the packet
    afterwards. This changes the MAC header for the encapsulated
    packet but it is not reflected in skb->inner_mac_header, which
    breaks GSO and drivers which attempt to use this for encapsulation
    offloads.

    Fixes: b736a623 ("vxlan: Add tx-vlan offload support.")
Signed-off-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: 4aac884d ("udptunnels: Call handle_offloads after inserting vlan tag.")
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agotunneling: Invalid packets should be cleared.
Jesse Gross [Wed, 8 Apr 2015 19:56:50 +0000 (12:56 -0700)]
tunneling: Invalid packets should be cleared.

If we receive a packet with an invalid tunnel header, we
should drop the packet without further processing. Currently
we do this by removing any parsed tunnel metadata. However,
this is not sufficient to stop processing - this only results
in the packet getting dropped by chance when something
usually runs across part of the packet that does not make
sense. Since both the packet and its metadata are in an
inconsistent state, it's also possible that the result is
an ovs-vswitchd crash or forwarding of a mangled packet.

Rather than clear the metadata, an alternate solution is to
remove all of the packet data. This guarantees that the
packet gets dropped during the next round of processing.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agotunneling: Convert tunnel push/pop functions to act on single packets.
Jesse Gross [Wed, 8 Apr 2015 00:45:40 +0000 (17:45 -0700)]
tunneling: Convert tunnel push/pop functions to act on single packets.

The userspace tunneling API for pushing and popping tunnel headers
is currently based on processing batches of packets. However, there
is no obvious way to take advantage of batching for these operations
and so each tunnel operation has a pair of loops to process the
batch. This changes the API to operate on single packets to enable
better code reuse.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>