]> git.proxmox.com Git - mirror_ovs.git/log
mirror_ovs.git
8 years agodatapath: compat: Use checksum offload for outer header.
Pravin B Shelar [Wed, 3 Aug 2016 21:37:44 +0000 (14:37 -0700)]
datapath: compat: Use checksum offload for outer header.

Following patch simplifies UDP-checksum routine by unconditionally
using checksum offload for non GSO packets. We might get some
performance improvement due to code simplification.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agodatapath: compat: gso: tighen checks for compat GSO code.
Pravin B Shelar [Wed, 3 Aug 2016 07:11:40 +0000 (00:11 -0700)]
datapath: compat: gso: tighen checks for compat GSO code.

Few function can be compiled out for non GSO case. This
patch make it bit cleaner to understand GSO compat code.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agodatapath: backport: geneve: fix max_mtu setting
Pravin B Shelar [Wed, 3 Aug 2016 06:59:39 +0000 (23:59 -0700)]
datapath: backport: geneve: fix max_mtu setting

Upstream commit:
    commit d5d5e8d55732c7c35c354e45e3b0af2795978a57
    Author: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
    Date:   Sat Jul 2 15:02:48 2016 +0800

    geneve: fix max_mtu setting

    For ipv6+udp+geneve encapsulation data, the max_mtu should subtract
    sizeof(ipv6hdr), instead of sizeof(iphdr).

Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agodatapath: backport: openvswitch: fix conntrack netlink event delivery
Pravin B Shelar [Wed, 3 Aug 2016 06:56:43 +0000 (23:56 -0700)]
datapath: backport: openvswitch: fix conntrack netlink event delivery

Upstream commit:

    commit d913d3a763a6f66a862a6eafcf6da89a7905832a
    Author: Samuel Gauthier <samuel.gauthier@6wind.com>
    Date:   Tue Jun 28 17:22:26 2016 +0200

    openvswitch: fix conntrack netlink event delivery

    Only the first and last netlink message for a particular conntrack are
    actually sent. The first message is sent through nf_conntrack_confirm when
    the conntrack is committed. The last one is sent when the conntrack is
    destroyed on timeout. The other conntrack state change messages are not
    advertised.

    When the conntrack subsystem is used from netfilter, nf_conntrack_confirm
    is called for each packet, from the postrouting hook, which in turn calls
    nf_ct_deliver_cached_events to send the state change netlink messages.

    This commit fixes the problem by calling nf_ct_deliver_cached_events in the
    non-commit case as well.

Fixes: 7f8a436eaa2c ("openvswitch: Add conntrack action")
CC: Joe Stringer <joestringer@nicira.com>
CC: Justin Pettit <jpettit@nicira.com>
CC: Andy Zhou <azhou@nicira.com>
CC: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Samuel Gauthier <samuel.gauthier@6wind.com>
Acked-by: Joe Stringer <joe@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agodatapath: compat: vxlan: fix udp-csum typo
Pravin B Shelar [Wed, 3 Aug 2016 06:47:37 +0000 (23:47 -0700)]
datapath: compat: vxlan: fix udp-csum typo

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agodatapath: fix size of struct ovs_gso_cb
Pravin B Shelar [Wed, 3 Aug 2016 00:03:41 +0000 (17:03 -0700)]
datapath: fix size of struct ovs_gso_cb

struct ovs_gso_cb is stored in skb->cd. avoid going beyond size
of skb->cb.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agodatapath: compat: Use udp-checksum function for compat case.
Pravin B Shelar [Tue, 2 Aug 2016 06:47:12 +0000 (23:47 -0700)]
datapath: compat: Use udp-checksum function for compat case.

udp_set_csum() has bug fix that is not relevant for upstream
(commit c77d947191b0).
So OVS need to use compat function. This function is also
used from UDP xmit path so we have to check USE_UPSTREAM_TUNNEL.
Following patch couple this function to USE_UPSTREAM_TUNNEL symbol
rather than kernel version.
This is not bug, This patch help in code readability.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agotest-netlink-conntrack: Fix sparse warning.
Daniele Di Proietto [Wed, 3 Aug 2016 17:29:59 +0000 (10:29 -0700)]
test-netlink-conntrack: Fix sparse warning.

On some systems I get a sparse warning when compiling
tests/test-netlink-conntrack.c

/usr/include/x86_64-linux-gnu/sys/cdefs.h:307:10: warning: preprocessor
token __always_inline redefined
/usr/include/linux/stddef.h:4:9: this was the original definition

The problem seems to be that Linux upstream commit
283d75737837("uapi/linux/stddef.h: Provide __always_inline to userspace
headers") introduced __always_inline in stddef.h, but glibc headers
didn't like that until e0835a5354ab("Bug 20215: Always undefine
__always_inline before defining it.").

This commit works around the issue by including a glibc header before a
kernel header.

Fixes: 2c06d9a927c5("ovstest: Add test-netlink-conntrack command.")
Reported-by: Joe Stringer <joe@ovn.org>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Joe Stringer <joe@ovn.org>
8 years agotests: Skip vlog tests that try to move opened file.
Paul Boca [Tue, 2 Aug 2016 17:45:48 +0000 (17:45 +0000)]
tests: Skip vlog tests that try to move opened file.

On Windows if a file is opened by an application for writing, we cannot move
it until all handles to that file are closed.

Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agodatapath: compat: remove duplicate check.
Pravin B Shelar [Tue, 2 Aug 2016 17:30:02 +0000 (10:30 -0700)]
datapath: compat: remove duplicate check.

The check for tunnel GSO packet is done at ip-handle-offloads. Remove
same check from udp-handle-offloads.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agodatapath: compat: fix SKB_INIT_FILL_METADATA_DST definition
Pravin B Shelar [Tue, 2 Aug 2016 07:25:23 +0000 (00:25 -0700)]
datapath: compat: fix SKB_INIT_FILL_METADATA_DST definition

In case of OVS using compat fill metadata dst implementation we need to
setup temperory dst.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agodatapath: compat: cleanup ip-tunnels
Pravin B Shelar [Tue, 2 Aug 2016 07:15:47 +0000 (00:15 -0700)]
datapath: compat: cleanup ip-tunnels

Remove kernel version check related to unsupported kernel.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agodatapath: compat: Detect GSO support at ovs configure
Pravin B Shelar [Tue, 2 Aug 2016 03:12:06 +0000 (20:12 -0700)]
datapath: compat: Detect GSO support at ovs configure

OVS turns on tunnel GSO for statically for kernel older than 3.18.
Some distributions kernel could backport tunnel GSO. To make use
of device offload on such kernel detect the support at configure
stage.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agopython tests: Fixed abs_file_name function for Windows
Paul Boca [Tue, 2 Aug 2016 17:45:44 +0000 (17:45 +0000)]
python tests: Fixed abs_file_name function for Windows

On windows a path containint ':' is considered an absolute path.

Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agopython tests: Fixed OSError not iterable on Windows
Paul Boca [Tue, 2 Aug 2016 17:45:43 +0000 (17:45 +0000)]
python tests: Fixed OSError not iterable on Windows

On Windows if this exception is triggered then it will raise an exception while in the
exception handler.

Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agopython tests: Skip TCP6 idl tests on Windows
Paul Boca [Tue, 2 Aug 2016 17:45:42 +0000 (17:45 +0000)]
python tests: Skip TCP6 idl tests on Windows

The IPPROTO_IPV6 is not defined on Python for Windows because of
compatibility with older Windows versions.
Here is this issue discussed:https://bugs.python.org/issue6926

Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agopython tests: Skip IPsec test on Windows
Paul Boca [Tue, 2 Aug 2016 17:45:42 +0000 (17:45 +0000)]
python tests: Skip IPsec test on Windows

IPsec is not used on Windows yet, and the services used by this test
are non-existent on Windows.
Also the paths in the test do not exist on Windows.

Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agopython tests: Added fcntl module for Windows
Paul Boca [Tue, 2 Aug 2016 17:45:41 +0000 (17:45 +0000)]
python tests: Added fcntl module for Windows

This is needed for lockf function used to lock the PID file on Windows.
ioctl and fcntl functions are not implemented at this time because they are
not used by any script.

Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agopython tests: Fixed unixctl python tests for Windows
Paul Boca [Tue, 2 Aug 2016 17:45:41 +0000 (17:45 +0000)]
python tests: Fixed unixctl python tests for Windows

For bogus pid file path, use a windows-like file path.

Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agopython tests: Fixed ctl file name for Windows
Paul Boca [Tue, 2 Aug 2016 17:45:40 +0000 (17:45 +0000)]
python tests: Fixed ctl file name for Windows

On Windows the CTL filename doesn't contain the pid of the process.

Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agopython tests: Register signal handlers only on supported types on Windows
Paul Boca [Tue, 2 Aug 2016 17:45:39 +0000 (17:45 +0000)]
python tests: Register signal handlers only on supported types on Windows

SIGHUP and SIGALRM are not available on Windows.

Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agopython tests: Implemented signal.alarm for Windows
Paul Boca [Tue, 2 Aug 2016 17:45:39 +0000 (17:45 +0000)]
python tests: Implemented signal.alarm for Windows

signal.alarm is not available in Windows and would trigger an exception
when called. Implemented this to mentain compatibility between
Windows and Linux for python tests.

Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agoWindows: Local named pipe implementation
Alin Serdean [Tue, 2 Aug 2016 18:19:34 +0000 (18:19 +0000)]
Windows: Local named pipe implementation

Currently in the case of command line arguments punix/unix, on Windows
we create a file, write a TCP port number to connect. This is a security
concern.

This patch adds support for the command line arguments punix/unix trying
to mimic AF_UNIX behind a local named pipe.

This patch drops the TCP socket implementation behind command line
arguments punix/unix and switches to the local named pipe implementation.

Since we do not write anything to the file created by the punix/unix
arguments, switch tests to plain file existence.

Man pages and code comments have been updated.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Paul Boca <pboca@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agofedora.spec: Add OVN include files.
William Tu [Wed, 3 Aug 2016 06:07:15 +0000 (23:07 -0700)]
fedora.spec: Add OVN include files.

Current 'make rpm-fedora' fails due to files exists in $RPM_BUILD_ROOT
directory but not found in the %files section, resulting in errors below:
RPM build errors:
    Installed (but unpackaged) file(s) found:
    /usr/include/ovn/actions.h
    /usr/include/ovn/expr.h
    /usr/include/ovn/lex.h
The patch fixes it and tested with rpmbuild 4.13.0 under Fedora 23.

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agotests: Fix conntrack tests on windows.
Daniele Di Proietto [Tue, 2 Aug 2016 18:45:54 +0000 (11:45 -0700)]
tests: Fix conntrack tests on windows.

The conntrack unit tests seem to generate different megaflow masks on
Windows.  The megaflow masks depend on the internal ordering of the
subtables, which are sorted using qsort(), based on their max priority.
If two subtables have the same priority the ordering between them
depends on the stability properties of qsort(), which apparently are
different between Windows and Linux/*BSD.

This commit uses multiple OpenFlow tables to build our conntrack
pipelines in the tests, which gives us more control over the visited
subtables and also improves clarity.

Reported-by: Alin Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Joe Stringer <joe@ovn.org>
8 years agoovn-nbctl: fix help message for lsp-get/set-addresses
Han Zhou [Sun, 31 Jul 2016 06:17:44 +0000 (23:17 -0700)]
ovn-nbctl: fix help message for lsp-get/set-addresses

Signed-off-by: Han Zhou <zhouhan@gmail.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agoovn: improve OVN tutorial.
nickcooper-zhangtonghao [Mon, 1 Aug 2016 07:57:01 +0000 (00:57 -0700)]
ovn: improve OVN tutorial.

Improve the tutorial of the basic OVN features. Update the contents of
the "Locally attached networks" and "Locally attached networks with VLANs"
in detail. The logical ports of type "l2gateway" is described.

Submitted-at: https://github.com/openvswitch/ovs/pull/144
Signed-off-by: nickcooper-zhangtonghao <nickcooper-zhangtonghao@opencloud.tech>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agoovn-controller: if 'ovn-bridge-mappings' unconfigured, return directly.
nickcooper-zhangtonghao [Mon, 1 Aug 2016 09:55:26 +0000 (02:55 -0700)]
ovn-controller: if 'ovn-bridge-mappings' unconfigured, return directly.

If the chassis doesn't configure the 'external-ids:ovn-bridge-mappings' in
the OVSDB, the 'add_bridge_mappings' should return directly to skip some
unnecessary code.

Signed-off-by: nickcooper-zhangtonghao <nickcooper-zhangtonghao@opencloud.tech>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agoovsdb: Fix memory leak in execute_update.
William Tu [Wed, 27 Jul 2016 01:28:30 +0000 (18:28 -0700)]
ovsdb: Fix memory leak in execute_update.

Valgrind testcase 1804 ovsdb-server.at:1023 insert rows, update rows by value
reports the following leak.
    json_from_string (json.c:1025)
    execute_update (replication.c:614), similarily at execute_delete()
    process_table_update (replication.c:502)
    process_notification.part.5 (replication.c:445)
    process_notification (replication.c:402)
    check_for_notifications (replication.c:418)
    replication_run (replication.c:110)

Signed-off-by: William Tu <u9012063@gmail.com>
Acked-by: Andy Zhou <azhou@ovn.org>
Signed-off-by: Andy Zhou <azhou@ovn.org>
8 years agoovsdb: Fix OVSDB disconnect replication bug
Mario Cabrera [Tue, 28 Jun 2016 21:14:53 +0000 (15:14 -0600)]
ovsdb: Fix OVSDB disconnect replication bug

Currently disconnecting from the replicator server means closing the
jsonrpc connection and destroying the monitored table names and
blacklisted table names.

This patch makes a distinction between disconnecting from the
remote server, applicable when the replication incurs in an error,
and destroying the remote server info, applicable when ovsdb-server
exits gracefully.

Signed-off-by: Mario Cabrera <mario.cabrera@hpe.com>
8 years agocompat: Properly handle fragment lru.
Joe Stringer [Mon, 1 Aug 2016 20:58:38 +0000 (13:58 -0700)]
compat: Properly handle fragment lru.

In kernels <=3.16 there is an LRU for managing fragment queues for IPv4
and IPv6. Because the backport code comes from more recent upstream
versions of Linux, this LRU management was missing from ip_frag_queue()
and nf_ct_frag6_queue().

Fixes: 595e069a0634 ("compat: Backport IPv4 reassembly.")
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
8 years agocompat: Only call nf_defrag_ipv[46]_enable() once.
Joe Stringer [Tue, 12 Jul 2016 22:26:23 +0000 (15:26 -0700)]
compat: Only call nf_defrag_ipv[46]_enable() once.

This function is just a dummy to ensure that the corresponding netfilter
fragment module is loaded, to initialize the shared structures. But it
doesn't need to be invoked once per namespace; one call per protocol
should do the trick.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
8 years agocompat: Remove inet_frag_evictor backport.
Joe Stringer [Tue, 12 Jul 2016 22:26:22 +0000 (15:26 -0700)]
compat: Remove inet_frag_evictor backport.

Kernel 3.7 and lower are now unsupported, remove this fragment.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
8 years agocompat: IPv6 fragmentation backport cleanups.
Joe Stringer [Tue, 12 Jul 2016 22:26:21 +0000 (15:26 -0700)]
compat: IPv6 fragmentation backport cleanups.

Remove a couple of functions that are available on all supported kernel
versions.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
8 years agocompat: Remove ip6_expire_frag_queue().
Joe Stringer [Tue, 12 Jul 2016 22:26:20 +0000 (15:26 -0700)]
compat: Remove ip6_expire_frag_queue().

This was previously backported to fix issues with our inet_fragment
backport; with that largely gone, we can get rid of this too.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
8 years agocompat: Simplify inet_fragment backports.
Joe Stringer [Tue, 12 Jul 2016 22:26:19 +0000 (15:26 -0700)]
compat: Simplify inet_fragment backports.

The core fragmentation handling logic is exported on all supported
kernels, so it's not necessary to backport the latest version of this.
This greatly simplifies the code due to inconsistencies between the old
per-lookup garbage collection and the newer workqueue based garbage
collection.

As a result of simplifying and removing unnecessary backport code, a few
bugs are fixed for corner cases such as when some fragments remain in
the fragment cache when openvswitch is unloaded.

Some backported ip functions need a little extra logic than what is seen
on the latest code due to this, for instance on kernels <3.17:
* Call inet_frag_evictor() before defrag
* Limit hashsize in ip{,6}_fragment logic

The pernet init/exit logic also differs a little from upstream. Upstream
ipv[46]_defrag logic initializes the various pernet fragment parameters
and its own global fragments cache. In the OVS backport, the pernet
parameters are shared while the fragments cache is separate. The
backport relies upon upstream pernet initialization to perform the
shared setup, and performs no pernet initialization of its own. When it
comes to pernet exit however, the backport must ensure that all
OVS-specific fragment state is cleared, while the shared state remains
untouched so that the regular ipv[46] logic may do its own cleanup. In
practice this means that OVS must have its own divergent implementation
of inet_frags_exit_net().

Fixes the following crash:

Call Trace:
 <IRQ>
 [<ffffffff810744f6>] ? call_timer_fn+0x36/0x100
 [<ffffffff8107548f>] run_timer_softirq+0x1ef/0x2f0
 [<ffffffff8106cccc>] __do_softirq+0xec/0x2c0
 [<ffffffff8106d215>] irq_exit+0x105/0x110
 [<ffffffff81737095>] smp_apic_timer_interrupt+0x45/0x60
 [<ffffffff81735a1d>] apic_timer_interrupt+0x6d/0x80
 <EOI>
 [<ffffffff8104f596>] ? native_safe_halt+0x6/0x10
 [<ffffffff8101cb2f>] default_idle+0x1f/0xc0
 [<ffffffff8101d406>] arch_cpu_idle+0x26/0x30
 [<ffffffff810bf3a5>] cpu_startup_entry+0xc5/0x290
 [<ffffffff810415ed>] start_secondary+0x21d/0x2d0
Code:  Bad RIP value.
RIP  [<ffffffffa0177480>] 0xffffffffa0177480
 RSP <ffff88003f703e78>
CR2: ffffffffa0177480
---[ end trace eb98ca80ba07bd9c ]---
Kernel panic - not syncing: Fatal exception in interrupt

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
8 years agocompat: Fix IPv6 frag expiry crash.
Joe Stringer [Tue, 12 Jul 2016 22:26:18 +0000 (15:26 -0700)]
compat: Fix IPv6 frag expiry crash.

If a user sends some fragments of an IPv6 message through OVS, but OVS
fails to assemble the IPv6 message and the OVS module is then unloaded
before the fragments expire, it could lead to a kernel panic like the
following:

Call Trace:
 <IRQ>
 [<ffffffff810e1919>] ? call_timer_fn+0x39/0x130
 [<ffffffff810e31fe>] run_timer_softirq+0x20e/0x2c0
 [<ffffffff8107dd0d>] __do_softirq+0xdd/0x290
 [<ffffffff817c5bdc>] do_softirq_own_stack+0x1c/0x30
 <EOI>
 [<ffffffff8107df5f>] do_softirq+0x4f/0x60
 [<ffffffff8107dff5>] __local_bh_enable_ip+0x85/0x90
 [<ffffffff8173994f>] inet_frags_exit_net+0x6f/0xc0
 [<ffffffffc00c02a3>] nf_ct_net_exit+0x43/0x50 [nf_defrag_ipv6]
 [<ffffffff816ae528>] ops_exit_list.isra.4+0x38/0x60
 [<ffffffff816ae656>] unregister_pernet_operations+0x96/0xe0
 [<ffffffff816ae6c5>] unregister_pernet_subsys+0x25/0x40
 [<ffffffffc00c1315>] nf_ct_frag6_cleanup+0x15/0x23 [nf_defrag_ipv6]
 [<ffffffffc00c133d>] nf_defrag_fini+0x1a/0xcdd [nf_defrag_ipv6]
 [<ffffffff810fbedd>] SyS_delete_module+0x18d/0x220
 [<ffffffff817c40b2>] entry_SYSCALL_64_fastpath+0x16/0x75
Code:  Bad RIP value.
RIP  [<ffffffffc030f990>] 0xffffffffc030f990
 RSP <ffff88007a043e90>
CR2: ffffffffc030f990
---[ end trace 3bd8c1bbc4478fe2 ]---
Kernel panic - not syncing: Fatal exception in interrupt

Fixes: 73b09aff14c7 ("compat: Backport IPv6 reassembly.")
Reported-by: Jarno Rajahalme <jarno@ovn.org>
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
8 years agoovn: Add support for IPv6 dynamic bindings.
Justin Pettit [Tue, 28 Jun 2016 09:57:27 +0000 (02:57 -0700)]
ovn: Add support for IPv6 dynamic bindings.

This commit also introduces "get_nd" and "put_nd" logical actions.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovn: Add support for link-local addresses.
Justin Pettit [Sun, 26 Jun 2016 05:22:52 +0000 (22:22 -0700)]
ovn: Add support for link-local addresses.

Every IPv6-enabled interface is supposed to have a link-local address
available to it.  This commit adds a link local interface to each router
port and scopes link-local routes to the ingress port that received the
packet.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovn: Don't require clearing inport to hair-pin packets.
Justin Pettit [Sat, 23 Jul 2016 14:56:54 +0000 (07:56 -0700)]
ovn: Don't require clearing inport to hair-pin packets.

Introduce the "flags.loopback" symbol to allow packets to be sent back
on their ingress ports.  Previously, one needed to clear "inport" to
hair-pin packets, but this made "inport" not available for future
matching.  This approach should be more intuitive, but it will also be
needed in future patches.

This patch also removes functionality from the OVN expression library
that clears the OpenFlow ingress port when the logical input port is
zeroed.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovn-northd: Implement basic IPv6 routing.
Justin Pettit [Tue, 17 May 2016 11:06:13 +0000 (04:06 -0700)]
ovn-northd: Implement basic IPv6 routing.

This commit only supports static MAC bindings.  A future commit will add
support for dynamic IPv6/MAC bindings.  It has a few other limitations
described in "ovn/TODO".

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovn-northd.8.xml: Remove destination unreachable from "IP Routing".
Justin Pettit [Fri, 22 Jul 2016 18:33:44 +0000 (11:33 -0700)]
ovn-northd.8.xml: Remove destination unreachable from "IP Routing".

We don't support generating these flows yet.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovn-util: Preallocate address strings.
Justin Pettit [Tue, 19 Jul 2016 23:12:11 +0000 (16:12 -0700)]
ovn-util: Preallocate address strings.

Suggested-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovn: Rename "nd" action to "nd_na".
Justin Pettit [Thu, 23 Jun 2016 01:21:40 +0000 (18:21 -0700)]
ovn: Rename "nd" action to "nd_na".

Rename "nd" to "nd_na" to be more descriptive and consistent with other
ND messages and actions.  This commit also fixes some minor
documentation issues and limits the action to responding to Neighbor
Solicitation messages.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovn-controller: Tighten "nd" definition, add "nd_ns" and "nd_na".
Justin Pettit [Thu, 23 Jun 2016 01:18:14 +0000 (18:18 -0700)]
ovn-controller: Tighten "nd" definition, add "nd_ns" and "nd_na".

According to RFC 4861, Neighbor Discovery messages should only match
when the Hop Limit is 255 to prevent off-link senders from sending ND
messages.  This commit limits matching to that Hop Limit.

It also introduces Neighbor Discovery Solicitation ("nd_ns") and
Advertisement ("nd_na") definitions.

The "nd.sll" and "nd.tll" only apply to "nd_ns" and "nd_na",
respectively.  This commit limits those symbols appropriately.  (Note
that Router and Redirect also use those fields, so we will need to
include them as well when they are added.)

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agopackets: Cleanup ND compose functions.
Justin Pettit [Sat, 18 Jun 2016 00:17:58 +0000 (17:17 -0700)]
packets: Cleanup ND compose functions.

Rename "compose_nd" and "compose_na" to "compose_nd_ns" and
"compose_nd_na", respecively, to be clearer about their functionality.
This will also make it more consistent when we add Neighbor Discover
Router Solicitation/Advertisement compose functions.

Also change the source and destination IPv6 addresses to take
"struct in6_addr" arguments, which are more common in the code base.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovn-architecture: Drop references to "Nicira extension registers"
Justin Pettit [Sat, 23 Jul 2016 04:27:38 +0000 (21:27 -0700)]
ovn-architecture: Drop references to "Nicira extension registers"

Refer to these as "Open vSwitch extension registers".

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovn-sb.xml: Remove obsolete documentation of OVN logical flows.
Ben Pfaff [Sat, 30 Jul 2016 06:02:52 +0000 (23:02 -0700)]
ovn-sb.xml: Remove obsolete documentation of OVN logical flows.

This description might have been accurate for 5 minutes or so, but no
longer than that.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Ryan Moats <rmoats@us.ibm.com>
8 years agotests: Add new pmd test for pmd-rxq-affinity.
Daniele Di Proietto [Tue, 26 Jul 2016 23:13:39 +0000 (16:13 -0700)]
tests: Add new pmd test for pmd-rxq-affinity.

This tests that the newly introduced pmd-rxq-affinity option works as
intended, at least for a single port.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
8 years agodpif-netdev: Fix xps revalidation.
Ilya Maximets [Fri, 29 Jul 2016 08:07:21 +0000 (11:07 +0300)]
dpif-netdev: Fix xps revalidation.

Revalidation should work in case of 'dynamic_txqs == true'.

Fixes: 324c8374852a ("dpif-netdev: XPS (Transmit Packet Steering) implementation.")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agonetdev-dpdk: Add Flow Control support.
Sugesh Chandran [Thu, 28 Jul 2016 15:30:12 +0000 (16:30 +0100)]
netdev-dpdk: Add Flow Control support.

Add support for flow-control(mac control frame) to DPDK enabled physical
port types. By default, the flow-control is OFF on both rx and tx side.
The flow control can be enabled/disabled either when adding a port to OVS
or at run time.

For eg:
To enable flow control support at tx side while adding a port, add the
'tx-flow-ctrl' option to the 'ovs-vsctl add-port' command-line as below.

 'ovs-vsctl add-port br0 dpdk0 -- \
  set Interface dpdk0 type=dpdk options:tx-flow-ctrl=true'

Similarly to enable rx flow control,
 'ovs-vsctl add-port br0 dpdk0 -- \
  set Interface dpdk0 type=dpdk options:rx-flow-ctrl=true'

And to enable the flow control auto-negotiation,
 'ovs-vsctl add-port br0 dpdk0 -- \
  set Interface dpdk0 type=dpdk options:flow-ctrl-autoneg=true'

To turn ON the tx flow control at run time(After the port is being added
to OVS), the command-line input will be,
 'ovs-vsctl set Interface dpdk0 options:tx-flow-ctrl=true'

The flow control parameters can be turned off by setting 'false' to the
respective parameter. To dsiable the flow control at tx side,
 'ovs-vsctl set Interface dpdk0 options:tx-flow-ctrl=false'

Signed-off-by: Sugesh Chandran <sugesh.chandran@intel.com>
Acked-by: Bhanuprakash Bodireddy <Bhanuprakash.bodireddy@intel.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agoofproto: Add 'command' to ofproto_flow_mod.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:05 +0000 (16:52 -0700)]
ofproto: Add 'command' to ofproto_flow_mod.

This helps releasing ofputil_flow_mod earlier in a later patch.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto: Add 'modify_cookie' to ofproto_flow_mod.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:04 +0000 (16:52 -0700)]
ofproto: Add 'modify_cookie' to ofproto_flow_mod.

ofproto internally modifies 'modify_cookie' field, and adding a
replica to ofproto_flow_mod allows the ofputil_flow_mod argument to be
changed to a const.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto: Reduce dependency on ofputil_flow_mod after rule has been created.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:04 +0000 (16:52 -0700)]
ofproto: Reduce dependency on ofputil_flow_mod after rule has been created.

One step towards the goal of removing the ofputil_flow_mod from the
bundle message.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofp-util: remove flow mod's delete_reason.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:04 +0000 (16:52 -0700)]
ofp-util: remove flow mod's delete_reason.

We can use the rule's removed_reason instead.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto: Support group mods in bundles.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:04 +0000 (16:52 -0700)]
ofproto: Support group mods in bundles.

Allow adding group mods in OpenFlow bundles.  Group mods are executed
atomically with any flow mods in the same bundle.  Mods are executed
in order, so that groups appearing in flow actions need to be inserted
in to the bundle before the dependent flow mods.

ovs-ofctl is enhanced to allow the '--bundle' option with group mod
commands.  add-groups file format is enhanced to allow each line to be
preceded by one of the keywords "add", "modify", "delete",
"add_or_mod", "insert_bucket", or "remove_bucket".

ovs-ofctl also has a new "bundle" command that reads a file in which
each line contains one flow mod or group mod, and then executes them
all as a single atomic bundle transaction.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agometa-flow: Compact struct field_array.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:04 +0000 (16:52 -0700)]
meta-flow: Compact struct field_array.

struct field_array is included in each ofgroup, but the current
implementation is very sparse, using more than 20kb of data.

Also loop over 1-bits instead of each and every MF type to make
processing faster.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto: Use ofputil_uninit_group_mod().
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:04 +0000 (16:52 -0700)]
ofproto: Use ofputil_uninit_group_mod().

Use ofputil_uninit_group_mod() instead of
ofputil_bucket_list_destroy().  Currently these have the same effect,
but this will change in a following patch.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofp-util: Do not free() field that is not allocated.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:03 +0000 (16:52 -0700)]
ofp-util: Do not free() field that is not allocated.

Group properties field array is not dynamically allocated, so it
should not be freed.  This has not been a problem, as this function
has not been called by anyone so far, but following patch will.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto-dpif-xlate: Hash only fields specified for 'hash' selection method.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:03 +0000 (16:52 -0700)]
ofproto-dpif-xlate: Hash only fields specified for 'hash' selection method.

The mask for non-present fields in struct field_array is always zero,
so hashing a prerequisite field that was not also specified for the
"hash" selection method boiled down to hashing a all-zeroes value and
unwildcarding the prerequisite field.  Now that mf_are_prereqs_ok()
already takes care of unwildcarding, we can simplify the code by
hashing only the specified fields.

Also change the test case to include fields that have prerequisities.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agometa-flow: Clean up masking with prerequisities checking.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:03 +0000 (16:52 -0700)]
meta-flow: Clean up masking with prerequisities checking.

Change mf_are_prereqs_ok() take a flow_wildcards pointer, so that the
wildcards can be set at the same time as the prerequisiteis are
checked.  This makes it easier to write more obviously correct code.

Remove the functions mf_mask_field_and_prereqs() and
mf_mask_field_and_prereqs__(), and make the callers first check the
prerequisites, while supplying 'wc' to mf_are_prereqs_ok(), and if
successful, mask the bits of the field that were read or set using
mf_mask_field_masked().

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agometa-flow: Add mf_mask_field_masked().
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:03 +0000 (16:52 -0700)]
meta-flow: Add mf_mask_field_masked().

Having a masked version allows generating better wildcarding.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agometa-flow: Add byte access to struct mf_value.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:03 +0000 (16:52 -0700)]
meta-flow: Add byte access to struct mf_value.

This allows reducing pointer casting when individual bytes of mf_value
are accessed.  First users are in the following patches.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto-dpif: Always forward 'used' from the old_rule.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:03 +0000 (16:52 -0700)]
ofproto-dpif: Always forward 'used' from the old_rule.

Use new rule's flags to determine whether stats should be forwarded
from the old, modified rule to the new rule.  This captures the fact
that prior to OpenFlow 1.2, which defines the reset counts flag, the
reset counts semantics was assumed by default.  However, in that case
the reset counts flag is only present in the new flow, not on the
corresponding flow mod.

Having the above fixed revealed that the 'used' timestamp was not
forwarded from the old rule to the new rule when counts were not being
forwarded.  Fix this by always forwarding the 'used' timestamp.

Fixes: 39c9459355 ("Use classifier versioning.")
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agovconn: Better bundle error management.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:03 +0000 (16:52 -0700)]
vconn: Better bundle error management.

It is possible that a bundle add message fails, but the following
commit succeeds, since the message was not added to the bundle.  Make
ovs-ofctl fail also in these cases.

Also, the commit should not be sent if any of the bundled messages
failed.  To make sure all the errors are received before the commit is
sent, a barrier is required before sending the commit message.

Finally, make vconn collect bundle errors into a list instead of
calling a callback.  This makes bundle error management simpler.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agovconn: Update length of bundled messages.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:03 +0000 (16:52 -0700)]
vconn: Update length of bundled messages.

Variable length messages need their length updated before they can be
added to the bundle.

Message length updating after encoding is sometimes done by the
encoding function, but always latest when the message is sent out.  As
an OpenFlow message is added to a bundle add message, it will not be
sent by itself, and we need to update the length explicitly instead.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto: Make groups versioned.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:02 +0000 (16:52 -0700)]
ofproto: Make groups versioned.

This is a prepatory step for adding group mod support for bundles in a
following patch.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto: refactor group mods.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:02 +0000 (16:52 -0700)]
ofproto: refactor group mods.

This changes ofproto providers modify_group() to never fail.

Separating major refactoring to a separate patch should make following
patches easier to review.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto: Report flow mods also from bundles.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:02 +0000 (16:52 -0700)]
ofproto: Report flow mods also from bundles.

Flow mod stats get skewed if they are not reported from bundles.  Move
reporting to ofproto_flow_mod_finish() so that it will be done in all
cases.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto: Generalize flow_mod_requester.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:02 +0000 (16:52 -0700)]
ofproto: Generalize flow_mod_requester.

Group mods also need a 'requester', so rename 'flow_mod_requester' as
'openflow_mod_requester'.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto: Add generic non-intrusive object_collection.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:02 +0000 (16:52 -0700)]
ofproto: Add generic non-intrusive object_collection.

Define rule_collection in terms of a new object_collection.  This
makes it easier to add other types of collections later.

This patch makes no functional changes.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto: Use ofproto_mutex for groups and keep track of referring flows.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:02 +0000 (16:52 -0700)]
ofproto: Use ofproto_mutex for groups and keep track of referring flows.

Adding groups support for bundles is simpler if also groups are
modified under ofproto_mutex.

Eliminate the search for rules when deleting a group so that we will
not keep the mutex for too long.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto: Make flow handling more symmetric.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:02 +0000 (16:52 -0700)]
ofproto: Make flow handling more symmetric.

Remove flow from ofproto data structures in the 'start' phase, even if
we may need to add them back in 'revert' phase.

This makes bundled group mods easier, as a group delete may also
delete flows, and we need the referring flows to be updated in the
'start' phase so that we will not have stale references to the
referring flows.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto: Take group references only when needed.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:02 +0000 (16:52 -0700)]
ofproto: Take group references only when needed.

Avoid unnecessary references when RCU protection suffices.  This makes
group lookup memory management more like flow lookup memory
management.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto: Lockless group lookups.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:01 +0000 (16:52 -0700)]
ofproto: Lockless group lookups.

Make groups RCU protected and make group lookups lockless.  While this
makes group lookups perform better, the main motivation is to have an
unified memory management model for versioned data supported in
OpenFlow bundles.  Later patches will make groups versioned and add
bundle support for groups.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agolib: Separate versioning to its own module.
Jarno Rajahalme [Fri, 29 Jul 2016 23:52:01 +0000 (16:52 -0700)]
lib: Separate versioning to its own module.

Separate rule versioning to lib/versions.h to make it easier to use
versioning for other data types.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovn-controller: Restore ct zone assignment.
Babu Shanmugam [Thu, 28 Jul 2016 20:15:14 +0000 (16:15 -0400)]
ovn-controller: Restore ct zone assignment.

Recent commits reorganizing bindings handling and also moving ct zone
assignment to ovn-controller.c caused ct zone assignment to no longer
work.  The code relies on an "all_lports" sset that should contain all
logical ports that we should be assigning ct zones for.  Prior to this
change, all_lports was always empty.

Signed-off-by: Babu Shanmugam <bschanmu@redhat.com>
Co-authored-by: Russell Bryant <russell@ovn.org>
Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ryan Moats <rmoats@us.ibm.com>
8 years agosystem-tests: Add ping through conntrack test.
Daniele Di Proietto [Tue, 26 Apr 2016 02:06:40 +0000 (19:06 -0700)]
system-tests: Add ping through conntrack test.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Joe Stringer <joe@ovn.org>
8 years agosystem-tests: Run conntrack tests with userspace.
Daniele Di Proietto [Mon, 16 Nov 2015 06:07:25 +0000 (22:07 -0800)]
system-tests: Run conntrack tests with userspace.

The userspace connection tracker doesn't support ALGs, frag reassembly
or NAT yet, so skip those tests.

Also, connection tracking state input from a local port is not possible
in userspace.

Finally, the userspace datapath checks for the IPv4 header checksum, so
fix those in the hardcoded packets.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Joe Stringer <joe@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
8 years agotests: Remove trim_zeros() from ovn tests.
Daniele Di Proietto [Fri, 29 Jul 2016 17:32:13 +0000 (10:32 -0700)]
tests: Remove trim_zeros() from ovn tests.

trim_zeros() is not necessary anymore, since now we don't pad packets in
the userspace datapath.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agonetdev-*: Do not use dp_packet_pad() in recv() functions.
Daniele Di Proietto [Fri, 29 Jul 2016 01:02:01 +0000 (18:02 -0700)]
netdev-*: Do not use dp_packet_pad() in recv() functions.

All the netdevs used by dpif-netdev (except for netdev-dpdk) have a
dp_packet_pad() call in the receive function, probably because the
userspace datapath couldn't handle properly short packets.

This doesn't appear to be the case anymore.

This commit removes the call to have a more consistent behavior with the
kernel datapath.

All the testsuite changes in this commit adjust the expectations for
packet lengths in flow dumps and other stats.  There's only one fix in
ovn.at: one of the test_ip() functions generated an incomplete udp
packet, which was not a problem until now, because of the padding.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agotravis: Fix flake8 failures from flake8 3.0.
Russell Bryant [Fri, 29 Jul 2016 18:51:07 +0000 (14:51 -0400)]
travis: Fix flake8 failures from flake8 3.0.

The "hacking" plugin for flake8 is not currently compatible with flake8
3.0.  Ensure that we install flake8 2.x on travis-ci.  Also update the
docs to indicate this incompatibility.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
8 years agofedora: Prioritize OVS modules in weak-updates.
Joe Stringer [Fri, 29 Jul 2016 00:09:38 +0000 (17:09 -0700)]
fedora: Prioritize OVS modules in weak-updates.

Out-of-tree modules are installed into the kernel's "extra" modules
directory for the version that kmod-openvswitch is compiled against. For
all other kernels on the system at install time, a symlink is created in
the "weak-updates" directory. This provides a path for the same kernel
module to be used when minor kernel updates are done on a system.
However, without updating the depmod configuration the weak-update will
not be prioritized, so modprobe will switch back to using upstream
kernel modules when you upgrade. This patch introduces that depmod
configuration to ensure that the out-of-tree module is always used when
it is installed, regardless of kernel upgrades.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
8 years agorhel: Prioritize our vport-foo modules in depmod.
Joe Stringer [Fri, 29 Jul 2016 00:09:37 +0000 (17:09 -0700)]
rhel: Prioritize our vport-foo modules in depmod.

We've done the same for openvswitch.ko previously, but we really should
be doing this for vport modules as well; otherwise, depmod may try to
pair upstream vport modules with the out-of-tree openvswitch module
(leading to depmod warnings on package install, and failure to load the
module at runtime).

VMware-BZ: #1700293
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
8 years agopvector: Expose non-concurrent priority vector.
Jarno Rajahalme [Fri, 29 Jul 2016 18:04:49 +0000 (11:04 -0700)]
pvector: Expose non-concurrent priority vector.

PMD threads use pvectors but do not need the overhead of the
concurrent version.  Expose the non-concurrent version for
that use.

Note that struct pvector is renamed as struct cpvector (for concurrent
priority vector), and the former struct pvector_impl is now struct
pvector.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agopvector: Get rid of special purpose of INT_MIN.
Jarno Rajahalme [Fri, 29 Jul 2016 18:04:48 +0000 (11:04 -0700)]
pvector: Get rid of special purpose of INT_MIN.

Allow clients to use the whole priority range.  Note that this changes
the semantics of PVECTOR_FOR_EACH_PRIORITY so that the iteration still
continues for entries at the given priority.

Suggested-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agopvector: Move PVECTOR_EXTRA_ALLOC to pvector.c.
Jarno Rajahalme [Fri, 29 Jul 2016 18:04:48 +0000 (11:04 -0700)]
pvector: Move PVECTOR_EXTRA_ALLOC to pvector.c.

There is no need to expose PVECTOR_EXTRA_ALLOC in the API.

Suggested-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agotests: Ignore proxy configuration.
Jarno Rajahalme [Fri, 29 Jul 2016 18:04:48 +0000 (11:04 -0700)]
tests: Ignore proxy configuration.

As any proxy configuration may ruin kernel testsuite tests, it is
better to ignore all proxy configuration.

Suggested-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agodatapath-windows: Post Conntrack delete and new events
Sairam Venugopal [Tue, 26 Jul 2016 00:04:43 +0000 (17:04 -0700)]
datapath-windows: Post Conntrack delete and new events

Post Conntrack delete and create events when entries are deleted or
created.

Signed-off-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Paul Boca <pboca@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-By: Yin Lin <linyi@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agodatapath-windows: Update OvsReadEventCmdHandler in Datapath.c to support different...
Sairam Venugopal [Tue, 26 Jul 2016 00:04:42 +0000 (17:04 -0700)]
datapath-windows: Update OvsReadEventCmdHandler in Datapath.c to support different events

OvsReadEventCmdHandler must now reflect the right event being read. If the
event is a Conntrack related event, then convert the entry to netlink
format and send it to userspace. If it's Vport event, retain the existing
workflow.

Signed-off-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Paul Boca <pboca@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agodatapath-windows: Add support for multiple event queue in Event.c
Sairam Venugopal [Tue, 26 Jul 2016 00:04:41 +0000 (17:04 -0700)]
datapath-windows: Add support for multiple event queue in Event.c

Update Event.c to have multiple event queues and mechanism to retrieve the
associated queue. Introduce OvsPostCtEvent and OvsRemoveCtEventEntry
similar to OvsPostVportEvent and OvsRemoveVportEventEntry.

Signed-off-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Paul Boca <pboca@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-By: Yin Lin <linyi@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agodatapath-windows: Modify OvsCreateNlMsgFromCtEntry to make it reusable
Sairam Venugopal [Tue, 26 Jul 2016 00:04:40 +0000 (17:04 -0700)]
datapath-windows: Modify OvsCreateNlMsgFromCtEntry to make it reusable

Tweak the OvsCreateNlMsgFromCtEntry() method to reuse it for creating
netlink messages from other files. Also define the function in Conntrack.h
to make it accessible.

Signed-off-by: Sairam Venugopal <vsairam@vmware.com>
Acked-By: Yin Lin <linyi@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-By: Yin Lin <linyi@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agodatapath-windows: Define new multicast conntrack events and netlink protocol
Sairam Venugopal [Tue, 26 Jul 2016 00:04:39 +0000 (17:04 -0700)]
datapath-windows: Define new multicast conntrack events and netlink protocol

The Hyper-V datapath supports NETLINK_GENERIC and NETLINK_NETFILTER
protocols for netlink communication. Define these two protocols in the
datapath.

Define new Conntrack events (new and delete) and add support for
subscribing to these events. Parse out OVS_NL_ATTR_MCAST_GRP and store it
as part of OVS_EVENT_SUBSCRIBE structure.

Signed-off-by: Sairam Venugopal <vsairam@vmware.com>
Acked-By: Yin Lin <linyi@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agodatapath-windows: Fix bugs in Event.c around subscribe and lock
Sairam Venugopal [Tue, 26 Jul 2016 00:04:38 +0000 (17:04 -0700)]
datapath-windows: Fix bugs in Event.c around subscribe and lock

When userspace tries to resubscribe to an existing queue, return
STATUS_INVALID_PARAMETER since it's not supported. The current bug
overwrites status to STATUS_SUCCESS.

The second bug fix is around releasing the EventQueue lock if an open
instance couldn't be found. The current version returns back without
releasing the lock. Moving the OvsAcquireEventQueueLock() after the
instance is verified.

OvsGetOpenInstance does not enforce a safe read for
gOvsSwitchContext->dpNo. Use the gOvsSwitchContext->dispatchLock for
accessing the parameter.

Signed-off-by: Sairam Venugopal <vsairam@vmware.com>
Acked-By: Yin Lin <linyi@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agodatapath-windows: Explicitly name vport related event to vportEvent
Sairam Venugopal [Tue, 26 Jul 2016 00:04:37 +0000 (17:04 -0700)]
datapath-windows: Explicitly name vport related event to vportEvent

OVS_EVENT_ENTRY currently handles only Vport related events. Updating the
name of the struct to OVS_VPORT_EVENT_ENTRY. Remove OVS_EVENT_STATUS since
it's currently not in use. Update the datapath to refer to events as
vportEvents. This will aid in the introduction of other events.

Signed-off-by: Sairam Venugopal <vsairam@vmware.com>
Acked-By: Yin Lin <linyi@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-By: Yin Lin <linyi@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agotests: Remove most packet-forwarding related "sleep"s from OVN tests.
Ben Pfaff [Wed, 27 Jul 2016 06:50:06 +0000 (23:50 -0700)]
tests: Remove most packet-forwarding related "sleep"s from OVN tests.

These arbitrary sleeps are often longer than necessary and can be too short
in corner cases.  This commit replaces them by a common macro that waits
only as long as necessary.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Ryan Moats <rmoats@us.ibm.com>
Acked-by: Flavio Fernandes <flavio@flaviof.com>
8 years agoovn: Make two end-to-end tests more reliable.
Ben Pfaff [Wed, 27 Jul 2016 06:18:12 +0000 (23:18 -0700)]
ovn: Make two end-to-end tests more reliable.

These tests change the northbound configuration and then immediately check
that the changes have taken effect on the hypervisors.  This can't work
reliably, so add a sleep to each one.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Ryan Moats <rmoats@us.ibm.com>
8 years agotests: Define trim_zeros in only one place.
Ben Pfaff [Fri, 29 Jul 2016 04:41:29 +0000 (21:41 -0700)]
tests: Define trim_zeros in only one place.

Defining trim_zeros in a common place allows us to skip defining it in
every test that needs it.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Ryan Moats <rmoats@us.ibm.com>
Acked-by: Flavio Fernandes <flavio@flaviof.com>
8 years agoovn-controller: Remove old values from local_ids.
Russell Bryant [Thu, 28 Jul 2016 21:22:41 +0000 (17:22 -0400)]
ovn-controller: Remove old values from local_ids.

local_ids is supposed to be the set of interface iface-id values from
this chassis that correspond to OVN logical ports.  We use this for
detecting when an interface has been removed as well as if child-ports
should be bound to this chassis.

Old values were not being removed from local_ids.  The most immediate
effect of this was that once an interface has been removed from a
chassis, we would think a removal has occured *every* time through
binding_run and trigger the full binding processing.  This was
a performance problem.

The second problem this would cause is if a port that had child ports
was moved to another chassis.  We would end up with two chassis fighting
over the binding of the child ports.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ryan Moats <rmoats@us.ibm.com>
8 years agoREADME: Add reference to DPDK installation.
Mauricio Vasquez B [Thu, 28 Jul 2016 20:49:26 +0000 (22:49 +0200)]
README: Add reference to DPDK installation.

There was not any reference to the DPDK installation in the main README file.

Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Signed-off-by: Ben Pfaff <blp@ovn.org>