]> git.proxmox.com Git - mirror_ovs.git/log
mirror_ovs.git
7 years agodoc: Convert ovs-vlan-test to rST
Stephen Finucane [Mon, 10 Apr 2017 12:12:28 +0000 (13:12 +0100)]
doc: Convert ovs-vlan-test to rST

Let's start with a simple one that lets us focus on setting up most of
the required "infrastructure" for building man pages using Sphinx.

This changes the 'check-htmldocs' target to 'check-docs' as its now
responsible for building man page docs too.

Other than that, hurrah for (mostly) legible syntaxes.

[1] http://www.tldp.org/HOWTO/Man-Page/q2.html

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Add man page section to documentation guide
Stephen Finucane [Mon, 10 Apr 2017 12:12:27 +0000 (13:12 +0100)]
doc: Add man page section to documentation guide

We also replace 'reST' with the far more common 'rST'.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoofproto: Report only un-deleted groups in group stats replies.
Ben Pfaff [Wed, 19 Apr 2017 18:29:15 +0000 (11:29 -0700)]
ofproto: Report only un-deleted groups in group stats replies.

Deleted groups hang around in the group table until the next grace period,
so it's important for the group stats code to pretend that they're gone
until they really get deleted.

Reported-by: "Timothy M. Redaelli" <tredaelli@redhat.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-April/331117.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
Tested-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Greg Rose <gvrose8192@gmail.com>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agobridge: Log interface deletion
Andy Zhou [Fri, 21 Apr 2017 00:33:28 +0000 (17:33 -0700)]
bridge: Log interface deletion

Currently interface additions are logged but not deletions. This
makes system debugging, such as confirming OVSDB transaction are
timely replicated harder than necessary.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agoovn-util: Allow /32 IP addresses for router ports.
Guru Shetty [Fri, 10 Mar 2017 07:46:38 +0000 (23:46 -0800)]
ovn-util: Allow /32 IP addresses for router ports.

On Google cloud, a VM gets a /32 IP address. When OVN
is deployed on such VMs, the OVN gateway router's IP
address becomes a /32 IP address. This commit allows
such a configuration.

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-northd: Allow static routes with nexthop in different subnet.
Guru Shetty [Fri, 10 Mar 2017 07:46:37 +0000 (23:46 -0800)]
ovn-northd: Allow static routes with nexthop in different subnet.

There are cases where the default gateway of a interface is in
a different subnet than its IP address. Linux allows such
configuration. For e.g, one could set the IP address of
a Linux interface as 172.16.1.2/32 and then give it a default
gateway of 172.16.1.1.  This can be done for e.g. by running the
following commands.

ifconfig eth0 172.16.1.2 netmask 255.255.255.255 broadcast 172.16.1.2
route add 172.16.1.1 dev eth0
route add default gw 172.16.1.1

The above configuration is what google cloud uses for its VMs.

In OVN static routes, we currently have the ability to specify the
router port via which the packet needs to be pushed out to reach a
next hop.  But when support for IPv6 was added, we only allowed
nexthops to be in the same subnet as one of the router's IP addresses.

This commit relaxes that restriction. When a outport is specified in
static routes and when a nexthop is in a different subnet than any
of the router IP addresses, we will assume that it is reachable from
the first IP address of the router.  Since this is a corner case,
we just go with the first IP address.  If it turns out that there
are more cases, we can let users choose the IP address via which
the destination is reachable.

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoofproto-dpif: Propagate may_enable flag as link aliveness.
László Sürü [Thu, 20 Apr 2017 15:41:57 +0000 (15:41 +0000)]
ofproto-dpif: Propagate may_enable flag as link aliveness.

The idea is to use OFPPS_LIVE bit to propagate link aliveness state
towards the controller also when sending port status.  The
ofport->may_enable flag could be used for this purpose, thus any
change in LIVE bit is propagated towards conrtoller in
OFPT_PORT_STATUS message.  OFPPS_LIVE bit is set only when links is
not down not administratively, neither operationally as recommended
in OF papers.  I added 9 new unit tests to verify link state changes
when monitored with cfm, bfd or lacp for OF 1.3, OF 1.4 and OF 1.5.
I updated related unit tests according to the changes of
ofproto-dpif.

Signed-off-by: László Sürü <laszlo.suru at ericsson.com>
Co-authored-by: Zoltán Balogh <zoltan.balogh at ericsson.com>
Signed-off-by: Zoltán Balogh <zoltan.balogh at ericsson.com>
Co-authored-by: Jan Scheurich <jan.scheurich at ericsson.com>
Signed-off-by: Jan Scheurich <jan.scheurich at ericsson.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodatapath-windows: Add software checksums for nbl which contain multiple nb
Alin Serdean [Fri, 21 Apr 2017 02:43:17 +0000 (02:43 +0000)]
datapath-windows: Add software checksums for nbl which contain multiple nb

Until now we only needed to compute software checksums on net buffer lists
containing a single net buffer.

This patch allows the software checksums to be applied on a net buffer list
with multiple net buffers. The hard assumption for this, is the net buffers are
part of the same connection. The position of the offsets is pointed by the
layers parameter.

This will be useful for introducing support ip fragments in conntrack.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Anand Kumar <kumaranand@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agodatapath-windows: Pass fwdCtx to conntrack
Yin Lin [Thu, 20 Apr 2017 22:26:08 +0000 (15:26 -0700)]
datapath-windows: Pass fwdCtx to conntrack

There are dependencies in Contrack module such as NAT and fragmentation on
OvsForwardingContext. This patch will make OvsForwardingContext public
in order to implement these functionalities.

Signed-off-by: Yin Lin <linyi@vmware.com>
Acked-by: Alin Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovn-trace: Implement ct_next and ct_clear actions.
Ben Pfaff [Tue, 18 Apr 2017 19:47:21 +0000 (12:47 -0700)]
ovn-trace: Implement ct_next and ct_clear actions.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Miguel Angel Ajo <majopela@redhat.com>
7 years agoflow: New function flow_clear_conntrack().
Ben Pfaff [Tue, 18 Apr 2017 18:22:05 +0000 (11:22 -0700)]
flow: New function flow_clear_conntrack().

This will have a new user in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Miguel Angel Ajo <majopela@redhat.com>
7 years agoflow: New function ct_state_from_string().
Ben Pfaff [Mon, 17 Apr 2017 23:06:35 +0000 (16:06 -0700)]
flow: New function ct_state_from_string().

This will have its first user in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Miguel Angel Ajo <majopela@redhat.com>
7 years agopackets: Reduce redundant copies of connection states.
Ben Pfaff [Mon, 17 Apr 2017 20:43:48 +0000 (13:43 -0700)]
packets: Reduce redundant copies of connection states.

I was about to add another complete list of all the connection states but
this eliminates the need.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Miguel Angel Ajo <majopela@redhat.com>
7 years agoovn-sb.xml: Document ct.trk and improve wording for other ct flags.
Ben Pfaff [Tue, 18 Apr 2017 18:18:02 +0000 (11:18 -0700)]
ovn-sb.xml: Document ct.trk and improve wording for other ct flags.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Miguel Angel Ajo <majopela@redhat.com>
7 years agodatapath: pass extended ACK struct to parsing functions
Johannes Berg [Fri, 21 Apr 2017 01:16:46 +0000 (18:16 -0700)]
datapath: pass extended ACK struct to parsing functions

Upstream commit:

    commit fceb6435e85298f747fee938415057af837f5a8a
    Author: Johannes Berg <johannes.berg@intel.com>
    Date:   Wed Apr 12 14:34:07 2017 +0200

    netlink: pass extended ACK struct to parsing functions

    Pass the new extended ACK reporting struct to all of the generic
    netlink parsing functions. For now, pass NULL in almost all callers
    (except for some in the core.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agodatapath: Fix refcount leak on force commit.
Jarno Rajahalme [Tue, 28 Mar 2017 18:25:26 +0000 (11:25 -0700)]
datapath: Fix refcount leak on force commit.

Upstream commit:

    commit b768b16de58d5e0b1d7c3f936825b25327ced20c
    Author: Jarno Rajahalme <jarno@ovn.org>
    Date:   Tue Mar 28 11:25:26 2017 -0700

    openvswitch: Fix refcount leak on force commit.

    The reference count held for skb needs to be released when the skb's
    nfct pointer is cleared regardless of if nf_ct_delete() is called or
    not.

    Failing to release the skb's reference cound led to deferred conntrack
    cleanup spinning forever within nf_conntrack_cleanup_net_list() when
    cleaning up a network namespace:

       kworker/u16:0-19025 [004] 45981067.173642: sched_switch: kworker/u16:0:19025 [120] R ==> rcu_preempt:7 [120]
       kworker/u16:0-19025 [004] 45981067.173651: kernel_stack: <stack trace>
    => ___preempt_schedule (ffffffffa001ed36)
    => _raw_spin_unlock_bh (ffffffffa0713290)
    => nf_ct_iterate_cleanup (ffffffffc00a4454)
    => nf_conntrack_cleanup_net_list (ffffffffc00a5e1e)
    => nf_conntrack_pernet_exit (ffffffffc00a63dd)
    => ops_exit_list.isra.1 (ffffffffa06075f3)
    => cleanup_net (ffffffffa0607df0)
    => process_one_work (ffffffffa0084c31)
    => worker_thread (ffffffffa008592b)
    => kthread (ffffffffa008bee2)
    => ret_from_fork (ffffffffa071b67c)

Fixes: dd41d33f0b03 ("openvswitch: Add force commit.")
Reported-by: Yang Song <yangsong@vmware.com>
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agodatapath: Openvswitch: Refactor sample and recirc actions implementation
Andy Zhou [Thu, 6 Apr 2017 20:10:25 +0000 (13:10 -0700)]
datapath: Openvswitch: Refactor sample and recirc actions implementation

Upstream commit:
    Openvswitch: Refactor sample and recirc actions implementation

    Added clone_execute() that both the sample and the recirc
    action implementation can use.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: bef7f7567a10 ("Openvswitch: Refactor sample and recirc actions implementation")
Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agodatapath: openvswitch: Optimize sample action for the clone use cases
Andy Zhou [Thu, 6 Apr 2017 20:05:48 +0000 (13:05 -0700)]
datapath: openvswitch: Optimize sample action for the clone use cases

Upstream commit:
    openvswitch: Optimize sample action for the clone use cases

    With the introduction of open flow 'clone' action, the OVS user space
    can now translate the 'clone' action into kernel datapath 'sample'
    action, with 100% probability, to ensure that the clone semantics,
    which is that the packet seen by the clone action is the same as the
    packet seen by the action after clone, is faithfully carried out
    in the datapath.

    While the sample action in the datpath has the matching semantics,
    its implementation is only optimized for its original use.
    Specifically, there are two limitation: First, there is a 3 level of
    nesting restriction, enforced at the flow downloading time. This
    limit turns out to be too restrictive for the 'clone' use case.
    Second, the implementation avoid recursive call only if the sample
    action list has a single userspace action.

    The main optimization implemented in this series removes the static
    nesting limit check, instead, implement the run time recursion limit
    check, and recursion avoidance similar to that of the 'recirc' action.
    This optimization solve both #1 and #2 issues above.

    One related optimization attempts to avoid copying flow key as
    long as the actions enclosed does not change the flow key. The
    detection is performed only once at the flow downloading time.

    Another related optimization is to rewrite the action list
    at flow downloading time in order to save the fast path from parsing
    the sample action list in its original form repeatedly.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: 798c166173ff ("openvswitch: Optimize sample action for the clone use cases")
Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agodatapath: openvswitch: Refactor recirc key allocation.
Andy Zhou [Thu, 6 Apr 2017 19:51:43 +0000 (12:51 -0700)]
datapath: openvswitch: Refactor recirc key allocation.

Upstream commit:
    openvswitch: Refactor recirc key allocation.

    The logic of allocating and copy key for each 'exec_actions_level'
    was specific to execute_recirc(). However, future patches will reuse
    as well.  Refactor the logic into its own function clone_key().

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: 4572ef52a00b ("openvswitch: Refactor recirc key allocation.")
Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agodatapath: openvswitch: Deferred fifo API change.
Andy Zhou [Thu, 6 Apr 2017 19:45:39 +0000 (12:45 -0700)]
datapath: openvswitch: Deferred fifo API change.

Upstream commit:
    openvswitch: Deferred fifo API change.

    add_deferred_actions() API currently requires actions to be passed in
    as a fully encoded netlink message. So far both 'sample' and 'recirc'
    actions happens to carry actions as fully encoded netlink messages.
    However, this requirement is more restrictive than necessary, future
    patch will need to pass in action lists that are not fully encoded
    by themselves.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: 47c697aa2d07 ("openvswitch: Deferred fifo API change.")
Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agodatapath: openvswitch: Add missing case OVS_TUNNEL_KEY_ATTR_PAD
Kris Murphy [Thu, 6 Apr 2017 19:39:09 +0000 (12:39 -0700)]
datapath: openvswitch: Add missing case OVS_TUNNEL_KEY_ATTR_PAD

    openvswitch: Add missing case OVS_TUNNEL_KEY_ATTR_PAD

    Added a case for OVS_TUNNEL_KEY_ATTR_PAD to the switch statement
    in ip_tun_from_nlattr in order to prevent the default case
    returning an error.

Fixes: b46f6ded906e ("libnl: nla_put_be64(): align on a 64-bit area")
Signed-off-by: Kris Murphy <kriskend@linux.vnet.ibm.com>
Acked-by: Joe Stringer <joe@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: 8f3dbfd79ed9("openvswitch: Add missing case OVS_TUNNEL_KEY_ATTR_PAD")

Fixes: f34648187b03 ("datapath: backport: libnl: nla_put_be64(): align
on a 64-bit area")

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agodatapath: net/openvswitch: Set the ipv6 source tunnel key address attribute correctly
Or Gerlitz [Thu, 6 Apr 2017 19:31:09 +0000 (12:31 -0700)]
datapath: net/openvswitch: Set the ipv6 source tunnel key address attribute correctly

Upstream commit:
    net/openvswitch: Set the ipv6 source tunnel key address attribute correctly

    When dealing with ipv6 source tunnel key address attribute
    (OVS_TUNNEL_KEY_ATTR_IPV6_SRC) we are wrongly setting the tunnel
    dst ip, fix that.

Fixes: 6b26ba3a7d95 ('openvswitch: netlink attributes for IPv6 tunneling')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reported-by: Paul Blakey <paulb@mellanox.com>
Acked-by: Jiri Benc <jbenc@redhat.com>
Acked-by: Joe Stringer <joe@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: 3d20f1f7bd575 ("net/openvswitch: Set the ipv6 source tunnel key address attribute correctly")

Fixes: 8a2d4905a00f ("datapath: Add support for IPv6 tunnels.")
Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agodatapath: actions: fixed a brace coding style warning.
Peter Downs [Wed, 1 Mar 2017 09:01:17 +0000 (01:01 -0800)]
datapath: actions: fixed a brace coding style warning.

Upstream commit:
    openvswitch: actions: fixed a brace coding style warning

    Fixed a brace coding style warning reported by checkpatch.pl

Signed-off-by: Peter Downs <padowns@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: f1304f7ba398 ("openvswitch: actions: fixed a brace coding style warning")
Signed-off-by: Joe Stringer <joe@ovn.org>
Signed-off-by: Andy Zhou <azhou@ovn.org>
7 years agocompat: ipv6: orphan skbs in reassembly unit.
Eric Dumazet [Wed, 1 Mar 2017 22:45:06 +0000 (14:45 -0800)]
compat: ipv6: orphan skbs in reassembly unit.

Upstream commit:
    ipv6: orphan skbs in reassembly unit

    Andrey reported a use-after-free in IPv6 stack.

    Issue here is that we free the socket while it still has skb
    in TX path and in some queues.

    It happens here because IPv6 reassembly unit messes skb->truesize,
    breaking skb_set_owner_w() badly.

    We fixed a similar issue for IPV4 in commit 8282f27449bf ("inet: frag:
    Always orphan skbs inside ip_defrag()")
Acked-by: Joe Stringer <joe@ovn.org>
    ==================================================================
    BUG: KASAN: use-after-free in sock_wfree+0x118/0x120
    Read of size 8 at addr ffff880062da0060 by task a.out/4140

    page:ffffea00018b6800 count:1 mapcount:0 mapping:          (null)
    index:0x0 compound_mapcount: 0
    flags: 0x100000000008100(slab|head)
    raw: 0100000000008100 0000000000000000 0000000000000000 0000000180130013
    raw: dead000000000100 dead000000000200 ffff88006741f140 0000000000000000
    page dumped because: kasan: bad access detected

    CPU: 0 PID: 4140 Comm: a.out Not tainted 4.10.0-rc3+ #59
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
    Call Trace:
     __dump_stack lib/dump_stack.c:15
     dump_stack+0x292/0x398 lib/dump_stack.c:51
     describe_address mm/kasan/report.c:262
     kasan_report_error+0x121/0x560 mm/kasan/report.c:370
     kasan_report mm/kasan/report.c:392
     __asan_report_load8_noabort+0x3e/0x40 mm/kasan/report.c:413
     sock_flag ./arch/x86/include/asm/bitops.h:324
     sock_wfree+0x118/0x120 net/core/sock.c:1631
     skb_release_head_state+0xfc/0x250 net/core/skbuff.c:655
     skb_release_all+0x15/0x60 net/core/skbuff.c:668
     __kfree_skb+0x15/0x20 net/core/skbuff.c:684
     kfree_skb+0x16e/0x4e0 net/core/skbuff.c:705
     inet_frag_destroy+0x121/0x290 net/ipv4/inet_fragment.c:304
     inet_frag_put ./include/net/inet_frag.h:133
     nf_ct_frag6_gather+0x1125/0x38b0 net/ipv6/netfilter/nf_conntrack_reasm.c:617
     ipv6_defrag+0x21b/0x350 net/ipv6/netfilter/nf_defrag_ipv6_hooks.c:68
     nf_hook_entry_hookfn ./include/linux/netfilter.h:102
     nf_hook_slow+0xc3/0x290 net/netfilter/core.c:310
     nf_hook ./include/linux/netfilter.h:212
     __ip6_local_out+0x52c/0xaf0 net/ipv6/output_core.c:160
     ip6_local_out+0x2d/0x170 net/ipv6/output_core.c:170
     ip6_send_skb+0xa1/0x340 net/ipv6/ip6_output.c:1722
     ip6_push_pending_frames+0xb3/0xe0 net/ipv6/ip6_output.c:1742
     rawv6_push_pending_frames net/ipv6/raw.c:613
     rawv6_sendmsg+0x2cff/0x4130 net/ipv6/raw.c:927
     inet_sendmsg+0x164/0x5b0 net/ipv4/af_inet.c:744
     sock_sendmsg_nosec net/socket.c:635
     sock_sendmsg+0xca/0x110 net/socket.c:645
     sock_write_iter+0x326/0x620 net/socket.c:848
     new_sync_write fs/read_write.c:499
     __vfs_write+0x483/0x760 fs/read_write.c:512
     vfs_write+0x187/0x530 fs/read_write.c:560
     SYSC_write fs/read_write.c:607
     SyS_write+0xfb/0x230 fs/read_write.c:599
     entry_SYSCALL_64_fastpath+0x1f/0xc2 arch/x86/entry/entry_64.S:203
    RIP: 0033:0x7ff26e6f5b79
    RSP: 002b:00007ff268e0ed98 EFLAGS: 00000206 ORIG_RAX: 0000000000000001
    RAX: ffffffffffffffda RBX: 00007ff268e0f9c0 RCX: 00007ff26e6f5b79
    RDX: 0000000000000010 RSI: 0000000020f50fe1 RDI: 0000000000000003
    RBP: 00007ff26ebc1220 R08: 0000000000000000 R09: 0000000000000000
    R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000
    R13: 00007ff268e0f9c0 R14: 00007ff26efec040 R15: 0000000000000003

    The buggy address belongs to the object at ffff880062da0000
     which belongs to the cache RAWv6 of size 1504
    The buggy address ffff880062da0060 is located 96 bytes inside
     of 1504-byte region [ffff880062da0000ffff880062da05e0)

    Freed by task 4113:
     save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57
     save_stack+0x43/0xd0 mm/kasan/kasan.c:502
     set_track mm/kasan/kasan.c:514
     kasan_slab_free+0x73/0xc0 mm/kasan/kasan.c:578
     slab_free_hook mm/slub.c:1352
     slab_free_freelist_hook mm/slub.c:1374
     slab_free mm/slub.c:2951
     kmem_cache_free+0xb2/0x2c0 mm/slub.c:2973
     sk_prot_free net/core/sock.c:1377
     __sk_destruct+0x49c/0x6e0 net/core/sock.c:1452
     sk_destruct+0x47/0x80 net/core/sock.c:1460
     __sk_free+0x57/0x230 net/core/sock.c:1468
     sk_free+0x23/0x30 net/core/sock.c:1479
     sock_put ./include/net/sock.h:1638
     sk_common_release+0x31e/0x4e0 net/core/sock.c:2782
     rawv6_close+0x54/0x80 net/ipv6/raw.c:1214
     inet_release+0xed/0x1c0 net/ipv4/af_inet.c:425
     inet6_release+0x50/0x70 net/ipv6/af_inet6.c:431
     sock_release+0x8d/0x1e0 net/socket.c:599
     sock_close+0x16/0x20 net/socket.c:1063
     __fput+0x332/0x7f0 fs/file_table.c:208
     ____fput+0x15/0x20 fs/file_table.c:244
     task_work_run+0x19b/0x270 kernel/task_work.c:116
     exit_task_work ./include/linux/task_work.h:21
     do_exit+0x186b/0x2800 kernel/exit.c:839
     do_group_exit+0x149/0x420 kernel/exit.c:943
     SYSC_exit_group kernel/exit.c:954
     SyS_exit_group+0x1d/0x20 kernel/exit.c:952
     entry_SYSCALL_64_fastpath+0x1f/0xc2 arch/x86/entry/entry_64.S:203

    Allocated by task 4115:
     save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57
     save_stack+0x43/0xd0 mm/kasan/kasan.c:502
     set_track mm/kasan/kasan.c:514
     kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:605
     kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:544
     slab_post_alloc_hook mm/slab.h:432
     slab_alloc_node mm/slub.c:2708
     slab_alloc mm/slub.c:2716
     kmem_cache_alloc+0x1af/0x250 mm/slub.c:2721
     sk_prot_alloc+0x65/0x2a0 net/core/sock.c:1334
     sk_alloc+0x105/0x1010 net/core/sock.c:1396
     inet6_create+0x44d/0x1150 net/ipv6/af_inet6.c:183
     __sock_create+0x4f6/0x880 net/socket.c:1199
     sock_create net/socket.c:1239
     SYSC_socket net/socket.c:1269
     SyS_socket+0xf9/0x230 net/socket.c:1249
     entry_SYSCALL_64_fastpath+0x1f/0xc2 arch/x86/entry/entry_64.S:203

    Memory state around the buggy address:
     ffff880062d9ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
     ffff880062d9ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
    >ffff880062da0000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                           ^
     ffff880062da0080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
     ffff880062da0100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
    ==================================================================

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This patch is a bugfix, and will be progressively backported to earlier
kernels. If it is backported to any kernel 4.5 through 4.10, then users
use that updated kernel with the OVS kernel module prior to this patch, it
could cause a crash. The compat code here resolves such issues.

Upstream: 48cac18ecf1d ("ipv6: orphan skbs in reassembly unit")
Signed-off-by: Joe Stringer <joe@ovn.org>
Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agodatapath: Pack struct sw_flow_key.
Jarno Rajahalme [Thu, 9 Feb 2017 19:22:01 +0000 (11:22 -0800)]
datapath: Pack struct sw_flow_key.

Upstream commit:
    openvswitch: Pack struct sw_flow_key.

    struct sw_flow_key has two 16-bit holes. Move the most matched
    conntrack match fields there.  In some typical cases this reduces the
    size of the key that needs to be hashed into half and into one cache
    line.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: 316d4d78cf9b ("openvswitch: Pack struct sw_flow_key.")
Signed-off-by: Joe Stringer <joe@ovn.org>
Signed-off-by: Andy Zhou <azhou@ovn.org>
7 years agodatapath: Always define NF_CT_LABELS_MAX_SIZE
Andy Zhou [Fri, 14 Apr 2017 21:33:28 +0000 (14:33 -0700)]
datapath: Always define NF_CT_LABELS_MAX_SIZE

When CONFIG_NF_CONNTRACK_LABLES is not set, upstream code still make
use of NF_CT_LABLES_MAX_SIZE. Always define it in the compat code
to keep back ports close to the upstream.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agoofproto-dpif: Check support for resubmit with conntrack action.
Jarno Rajahalme [Tue, 18 Apr 2017 17:37:19 +0000 (10:37 -0700)]
ofproto-dpif: Check support for resubmit with conntrack action.

Use the existing probed support flag for the original direction tuple
to determine if resubmit(ct) can be executed or not.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <bpl@ovn.org>
7 years agoofproto-dpif: Check if original direction matches are supported.
Jarno Rajahalme [Tue, 18 Apr 2017 17:37:19 +0000 (10:37 -0700)]
ofproto-dpif: Check if original direction matches are supported.

Use the existing probed support flag for the original direction tuple
to determine if matches on the original direction tuple can be supported.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <bpl@ovn.org>
7 years agoofproto-dpif: Check support for CT action force commit flag.
Jarno Rajahalme [Tue, 18 Apr 2017 17:37:19 +0000 (10:37 -0700)]
ofproto-dpif: Check support for CT action force commit flag.

So far the force commit feature is implemented together with the
original direction tuple feature by all datapaths, so we can use the
support flag for the 'ct_orig_tuple' to indicate support for the force
commit feature as well.

Better fail the flow install than rely on ovs-vswitchd log being
filled by error messages from the datapath.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <bpl@ovn.org>
7 years agoofproto/bond: Make bond_may_recirc() private within bond.c
Andy Zhou [Fri, 10 Mar 2017 00:52:27 +0000 (16:52 -0800)]
ofproto/bond: Make bond_may_recirc() private within bond.c

Minor refactoring to make the bond code easier to read.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoacinclude: Allow compile with Linux 4.11.
Jarno Rajahalme [Thu, 13 Apr 2017 23:39:35 +0000 (16:39 -0700)]
acinclude: Allow compile with Linux 4.11.

Change the Linux kernel tests in OVS configuration.

While the backports may still be a little behind, it is useful to be
able to test the OVS tree kernel module with the upstream net-next
kernel.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agodpif: Log packet metadata on execute.
Jarno Rajahalme [Thu, 13 Apr 2017 23:39:35 +0000 (16:39 -0700)]
dpif: Log packet metadata on execute.

Debug log output for execute operations is missing the packet
metadata, which can be instrumental in tracing what the datapath
should be executing.  No reason to not have the metadata on the debug
output, so add it there.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoofp-parse: Fix match parsing with [x..y]=z format.
Jarno Rajahalme [Mon, 17 Apr 2017 18:37:29 +0000 (11:37 -0700)]
ofp-parse: Fix match parsing with [x..y]=z format.

Commit 21b2fa617126 ("ofp-parse: Allow match field names in actions
and brackets in matches.") added support for matching a consecutive
set of bits with the [x..y]=z format, but the copying of the parsed
value ('z') to the match was done from a wrong offset, so that the
actual value matched would be incorrect.

Fix this and add a test case preventing regression in future.

Fixes: 21b2fa617126 ("ofp-parse: Allow match field names in actions and brackets in matches.")
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoAUTHORS: Add Greg Rose.
Ben Pfaff [Mon, 17 Apr 2017 16:37:08 +0000 (09:37 -0700)]
AUTHORS: Add Greg Rose.

Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoxenserver: Add install files to RPM file list
Greg Rose [Mon, 17 Apr 2017 16:18:53 +0000 (09:18 -0700)]
xenserver: Add install files to RPM file list

Add missing intall files to RPM file list to prevent file check error so
that RPM files will be built.

Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovs build: Fix memset with zero size warning.
Darrell Ball [Sun, 19 Mar 2017 17:11:09 +0000 (10:11 -0700)]
ovs build: Fix memset with zero size warning.

In file included from /usr/include/string.h:640:0,
                 from ./lib/string.h:20,
                 from /usr/include/netinet/icmp6.h:22,
                 from ../lib/flow.h:21,
                 from ../lib/flow.c:18:
In function 'memset',
    inlined from 'flow_push_vlan_uninit' at ../lib/flow.c:2188:19:
/usr/include/x86_64-linux-gnu/bits/string3.h:81:30: error:
call to '__warn_memset_zero_len' declared with attribute warning:
memset used with constant zero length parameter; this could be
due to transposed parameters [-Werror]
       __warn_memset_zero_len ();
                              ^
cc1: all warnings being treated as errors
make[2]: *** [lib/flow.lo] Error 1

Fixes: f0fb825a3785 ("Add support for 802.1ad (QinQ tunneling)")
Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodp-packet.h: Fix comments in dp_packet_source.
Bhanuprakash Bodireddy [Sun, 12 Mar 2017 17:33:28 +0000 (17:33 +0000)]
dp-packet.h: Fix comments in dp_packet_source.

Add the appropriate function and the source file.

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agowindows: return NULL in xreadlink
Alin Serdean [Mon, 6 Feb 2017 04:41:41 +0000 (04:41 +0000)]
windows: return NULL in xreadlink

readlink does not exist on Windows.

While we could skip the function all togheter on Windows, we may add
support for it later on. For the moment return change errno to ENOENT
and return NULL.

FYI:
https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10/#kBeZetM7P1dorllZ.97
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365680(v=vs.85).aspx

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agouse portable getpagesize() in system-stats
Alin Serdean [Mon, 6 Feb 2017 04:41:41 +0000 (04:41 +0000)]
use portable getpagesize() in system-stats

Use the intended portable function defined above "get_page_size()" not
"getpagesize()".

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Apply flake8 to conf.py also.
Ben Pfaff [Fri, 14 Apr 2017 21:18:52 +0000 (14:18 -0700)]
doc: Apply flake8 to conf.py also.

Suggested-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Stephen Finucane <stephen@that.guru>
7 years agodoc: Add back target for datapath testing section.
Ben Pfaff [Fri, 14 Apr 2017 22:56:48 +0000 (15:56 -0700)]
doc: Add back target for datapath testing section.

This one really is used.  I'm honestly not sure how I missed this, because
I did test things.

Fixes: 9ef589e4daf7 ("doc: Remove some link targets that aren't used anywhere.")
Reported-by: Andy Zhou <azhou@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoovn-northd ipam: Support IPv6 dynamic assignment
Numan Siddique [Fri, 10 Mar 2017 02:17:20 +0000 (07:47 +0530)]
ovn-northd ipam: Support IPv6 dynamic assignment

OVN will generate the IPv6 address for a logical port if requested
using the IPv6 prefix and the MAC address (as IEEE EUI64 identifier).
To generate the IPv6 address, CMS should define the IPv6 prefix in the
'Logical_switch.other_config:ipv6_prefix' column.

Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Co-authored-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-northd ipam: Support 'exclude_ips' option
Numan Siddique [Fri, 10 Mar 2017 02:16:58 +0000 (07:46 +0530)]
ovn-northd ipam: Support 'exclude_ips' option

If the CMS wants to make use of ovn ipam it can now provide a
list of IPv4 addresses and a range of IPv4 addresses which
will be excluded from the dynamic address assignment.
To support this, a new option 'exclude_ips' is added in the
Logical_switch.other_config column.

Eg. ovn-nbctl set Logical_switch sw0
other_config:exclude_ips="10.0.0.2 10.0.0.30..10.0.0.40"

The present code, uses hash maps to store the assigned IP addresses.
In order to support this option, this patch has refactored the IPAM
assignment. It now uses a bitmap to manage the IP assignment with
each bit in the bitmap representing an IPv4 address.

This patch also clears the 'Logical_switch_port.dynamic_addresses'
if the CMS has cleared 'dynamic' address assignment request.

Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Remove some link targets that aren't used anywhere.
Ben Pfaff [Fri, 14 Apr 2017 17:31:16 +0000 (10:31 -0700)]
doc: Remove some link targets that aren't used anywhere.

It seems that there's a style here that every title has a separate link
target even if it's never used.  Maybe there is some reason for that (maybe
it should be explained in the documentation style document?), but if not
then it seems reasonable to leave out the unused ones since they look to
me like just visual clutter.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Stephen Finucane <stephen@that.guru>
7 years agodoc: Convert a named link into a title link.
Ben Pfaff [Fri, 14 Apr 2017 17:31:15 +0000 (10:31 -0700)]
doc: Convert a named link into a title link.

It seems like this is easier to read in the source form.  I don't
understand what is typical style here, though.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Stephen Finucane <stephen@that.guru>
7 years agodoc: Convert some bolded words into links.
Ben Pfaff [Fri, 14 Apr 2017 17:31:14 +0000 (10:31 -0700)]
doc: Convert some bolded words into links.

Seems more user-friendly.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Stephen Finucane <stephen@that.guru>
7 years agodoc: Avoid need to generate conf.py.
Ben Pfaff [Fri, 14 Apr 2017 19:38:12 +0000 (12:38 -0700)]
doc: Avoid need to generate conf.py.

It's awkward to have to at the same time generate conf.py from conf.py.in
and to keep both versions in the repository.  This avoids the issue.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Stephen Finucane <stephen@that.guru>
7 years agodoc: Also delete stamp file in clean-docs target.
Ben Pfaff [Fri, 14 Apr 2017 00:46:28 +0000 (17:46 -0700)]
doc: Also delete stamp file in clean-docs target.

Otherwise "make docs-check" won't necessarily do anything since its
apparent target is up to date.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Stephen Finucane <stephen@that.guru>
7 years agowindows-installer: Update DriverVersion to be streamlined to OVS version
Alin Serdean [Thu, 13 Apr 2017 16:51:40 +0000 (16:51 +0000)]
windows-installer: Update DriverVersion to be streamlined to OVS version

Patch:
https://github.com/openvswitch/ovs/commit/0c15b76511e78a1f84dec49138d7169c2f3eedf6
introduced a version variable for the MSI itself but did not propagate it
too the driver version (used by the windows certificate tests).

This patch updates the driver version.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agowindows: Crash when the handle communication device cannot be found
Alin Serdean [Thu, 13 Apr 2017 19:25:45 +0000 (19:25 +0000)]
windows: Crash when the handle communication device cannot be found

When trying to uninstall/disable the OVS extension the driver will
fail to unload properly(require reboot)/hang until ovs-vswitchd is closed.

The root cause of this behavior is because the handles from ovs-vswitchd
to the kernel communication devices are still opened although the
actual device was removed from the kernel.

Trying to close the handles will also fail because they do not exist.

The remaining option is to cause a crash and rely on the service manager
to restart ovs-vswitchd.

Reported-at: https://github.com/openvswitch/ovs-issues/issues/27
Reported-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodpctl: add examples to the manpage.
Aaron Conole [Tue, 21 Mar 2017 20:32:01 +0000 (16:32 -0400)]
dpctl: add examples to the manpage.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agodoc: Fix broken formatting in releases FAQ
Stephen Finucane [Fri, 7 Apr 2017 13:58:15 +0000 (14:58 +0100)]
doc: Fix broken formatting in releases FAQ

Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Link to release FAQ from DPDK install guide
Stephen Finucane [Mon, 10 Apr 2017 14:15:07 +0000 (15:15 +0100)]
doc: Link to release FAQ from DPDK install guide

I wanted to find the mappings of DPDK versions to OVS versions. This was
a little more difficult than expected. Resolve the issue by linking to
it from the DPDK install guide.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agorhel: Avoid logrotate error if /var/run/openvswitch does not exist
Timothy Redaelli [Thu, 13 Apr 2017 09:48:20 +0000 (11:48 +0200)]
rhel: Avoid logrotate error if /var/run/openvswitch does not exist

Avoid also errors if an ovs server didn't start correctly or it crashed without
deleting the pid file.

Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1441524
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agorhel/etc_logrotate.d_openvswitch: Fix coding style
Timothy Redaelli [Thu, 13 Apr 2017 09:48:19 +0000 (11:48 +0200)]
rhel/etc_logrotate.d_openvswitch: Fix coding style

Replace tabs by 4 spaces and indent the postrotate script like the
examples in 'man logrotate.conf'

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoAdd NAT information to the logical routers in nbctl show output
Lucas Alvares Gomes [Thu, 13 Apr 2017 09:11:58 +0000 (10:11 +0100)]
Add NAT information to the logical routers in nbctl show output

This patch is changing the print_lr() function in ovn-nbctl.c to include
logical router NAT information as part of the output (external ip,
logical ip and type).

Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agopython: Allow tuning the session probe_interval from IDL
Lucas Alvares Gomes [Tue, 11 Apr 2017 15:00:31 +0000 (16:00 +0100)]
python: Allow tuning the session probe_interval from IDL

This patch is adding a new parameter called "probe_interval" to the
constructor of the Idl class. This new parameter will be used to tune
the database connection probing for that IDL session, some users might
want to tune it to be less agressive than the current 5s default in OVS
or even disable it.

Reported-at: https://bugs.launchpad.net/networking-ovn/+bug/1680146
Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
Acked-by: Daniel Alvarez <dalvarez@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agotests: Add test for CT action with setting labels.
Jarno Rajahalme [Wed, 12 Apr 2017 21:11:59 +0000 (14:11 -0700)]
tests: Add test for CT action with setting labels.

This test clearly demonstrates the bit order of labels in the OpenFlow
wire format.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agocompat: vxlan: Fix NULL dereference in dst_cache.
Joe Stringer [Thu, 6 Apr 2017 13:51:55 +0000 (06:51 -0700)]
compat: vxlan: Fix NULL dereference in dst_cache.

Neelakantam reports:

BUG: unable to handle kernel NULL pointer dereference
RIP: 0010:[<ffffffffa04e8b4c>]  [<ffffffffa04e8b4c>] dst_cache_get_ip4+0xc/0x50 [openvswitch]
Call Trace:
 [<ffffffffa04f6b0a>] vxlan_get_route.isra.41+0xea/0x130 [openvswitch]
 [<ffffffff81524289>] ? __skb_get_hash+0x39/0x160
 [<ffffffffa04f7ec0>] ovs_vxlan_fill_metadata_dst+0x170/0x1e0 [openvswitch]
 [<ffffffffa04e88ee>] ovs_dev_fill_metadata_dst+0x9e/0xd0 [openvswitch]
 [<ffffffffa04d717e>] output_userspace+0xfe/0x180 [openvswitch]
 [<ffffffffa04d86dd>] do_execute_actions+0x63d/0x8f0 [openvswitch]
 [<ffffffffa04d89d1>] ovs_execute_actions+0x41/0x130 [openvswitch]
 [<ffffffffa04de904>] ovs_dp_process_packet+0x94/0x140 [openvswitch]
 [<ffffffffa04e73a3>] ovs_vport_receive+0x73/0xd0 [openvswitch]
 [<ffffffff810c3f12>] ? enqueue_task_fair+0x402/0x6c0
 [<ffffffff810bb685>] ? sched_clock_cpu+0x85/0xc0
 [<ffffffff810b5d85>] ? check_preempt_curr+0x75/0xa0
 [<ffffffff810b5dc9>] ? ttwu_do_wakeup+0x19/0xd0
 [<ffffffff810b5f5d>] ? ttwu_do_activate.constprop.84+0x5d/0x70
 [<ffffffff810b8a66>] ? try_to_wake_up+0x1b6/0x300
 [<ffffffff810b0d84>] ? __wake_up+0x44/0x50
 [<ffffffffa04e7d84>] internal_dev_xmit+0x24/0x60 [openvswitch]
 [<ffffffff8152c671>] dev_hard_start_xmit+0x171/0x3b0
 [<ffffffff8154cd74>] sch_direct_xmit+0x104/0x200
 [<ffffffff8152cae6>] dev_queue_xmit+0x236/0x570
 [<ffffffffa03897bc>] macvlan_start_xmit+0x3c/0xc0 [macvlan]
 [<ffffffff8152c671>] dev_hard_start_xmit+0x171/0x3b0
 [<ffffffff8154cd74>] sch_direct_xmit+0x104/0x200
 [<ffffffff8152cae6>] dev_queue_xmit+0x236/0x570
 [<ffffffffa0517a74>] macvtap_get_user+0x414/0x720 [macvtap]
 [<ffffffffa0517dab>] macvtap_sendmsg+0x2b/0x30 [macvtap]
 [<ffffffffa052e10c>] handle_tx+0x2fc/0x550 [vhost_net]
 [<ffffffffa052e395>] handle_tx_kick+0x15/0x20 [vhost_net]
 [<ffffffffa051e60b>] vhost_worker+0xfb/0x1e0 [vhost]
 [<ffffffffa051e510>] ? vhost_dev_reset_owner+0x50/0x50 [vhost]
 [<ffffffff810a5aef>] kthread+0xcf/0xe0
 [<ffffffff810a5a20>] ? kthread_create_on_node+0x140/0x140
 [<ffffffff81645858>] ret_from_fork+0x58/0x90
 [<ffffffff810a5a20>] ? kthread_create_on_node+0x140/0x140

ovs_vxlan_fill_metadata_dst() calls vxlan_get_route() with no dst_cache,
handle this case and don't attempt to use dst_cache.

Fixes: e02c0ed70fb7 ("datapath: compat: Use dst-cache for Geneve and VxLAN tunnels.")
Reported-by: Neelakantam Gaddam <neelugaddam@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
Tested-by: Neelakantam Gaddam <neelugaddam@gmail.com>
7 years agodpif-netlink: Handle netlink errors on port del.
Eric Garver [Wed, 12 Apr 2017 20:11:18 +0000 (13:11 -0700)]
dpif-netlink: Handle netlink errors on port del.

The return code of dpif_netlink_port_query__() was not being checked.

Fixes: da467899ab6e ("Windows: Add internal switch port per OVS bridge")
Signed-off-by: Eric Garver <e@erig.me>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agodpif-netlink: Fix memory leak on port del on WIN32.
Eric Garver [Tue, 4 Apr 2017 20:31:57 +0000 (16:31 -0400)]
dpif-netlink: Fix memory leak on port del on WIN32.

Fixes: da467899ab6e ("Windows: Add internal switch port per OVS bridge")
Signed-off-by: Eric Garver <e@erig.me>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agodocs: Update version numbers in doc config.
Russell Bryant [Tue, 11 Apr 2017 17:13:16 +0000 (13:13 -0400)]
docs: Update version numbers in doc config.

Update the version numbers in the documentation config to reflect 2.7.90
instead of 2.6.0.

This patch also updates the build system to automatically update this file.
conf.py is now a generated file from conf.py.in.  We still include conf.py
in the tree because it's needed for the docs to be automatically generated
for docs.openvswitch.org.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Stephen Finucane <stephen@that.guru>
7 years agodatapath: Avoid struct copy on conntrack labels.
Jarno Rajahalme [Tue, 11 Apr 2017 01:18:30 +0000 (18:18 -0700)]
datapath: Avoid struct copy on conntrack labels.

Older kernels have variable sized labels, and the struct itself
contains only the length, so we must memcpy the bits explicitly.

The modified system test fails on older kernels without this change.

VMware-BZ: #1841876
Fixes: 09aa98ad496d ("datapath: Inherit master's labels.")
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoAdd support for OpenFlow 1.6 (draft) port status and port mod messages.
Ben Pfaff [Thu, 6 Apr 2017 06:08:09 +0000 (23:08 -0700)]
Add support for OpenFlow 1.6 (draft) port status and port mod messages.

OpenFlow 1.6 adds support for EUI-64 addresses for ports, and extends
the maximum length of OpenFlow port names from 16 to 64 bytes.

ONF-JIRA: EXT-566
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agotypes: New struct eth_addr64 for EUI-64 identifiers.
Ben Pfaff [Thu, 6 Apr 2017 05:56:17 +0000 (22:56 -0700)]
types: New struct eth_addr64 for EUI-64 identifiers.

This will see its first real user in the following commit.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agom4: fix use of log fd vs. file in "configure"
Lance Richardson [Fri, 7 Apr 2017 21:05:06 +0000 (17:05 -0400)]
m4: fix use of log fd vs. file in "configure"

Recent Travis builds are failing when making the distcleancheck
target with:
     ERROR: files left in build directory after distclean:
     ./5

Fix by treating log fd as a file descriptor instead of a file.

Fixes: 7777d53d2f4b ("m4: Add hard requirements for python in "configure"")
Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovs-ctl: Expose openvswitch run directory through ovsdb.
Robert Wojciechowicz [Thu, 9 Mar 2017 13:59:51 +0000 (13:59 +0000)]
ovs-ctl: Expose openvswitch run directory through ovsdb.

When using vhost-user client or server mode with OpenStack, Neutron needs
to be able to construct the fully qualified socket path and pass it to
Nova.  While the relative vhost-user socket directory is exposed via the
Open_vSwitch table in other_config:vhost-sock-dir, the openvswitch run
directory that it is relative to is not.  This patch adds it to the
Open_vSwitch table as external_ids:rundir.

Signed-off-by: Robert Wojciechowicz <robertx.wojciechowicz@intel.com>
Acked-by: Sean K Mooney <sean.k.mooney@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Update makefile target for docs
Stephen Finucane [Thu, 6 Apr 2017 13:58:03 +0000 (14:58 +0100)]
doc: Update makefile target for docs

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agodoc: Describe how docs.openvswitch.org works
Stephen Finucane [Thu, 6 Apr 2017 13:58:02 +0000 (14:58 +0100)]
doc: Describe how docs.openvswitch.org works

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agom4: Add hard requirements for python in "configure"
Timothy Redaelli [Wed, 29 Mar 2017 11:49:42 +0000 (13:49 +0200)]
m4: Add hard requirements for python in "configure"

Since Python 2.7 and python-six are needed to build Open vSwitch,
./configure should return an error if they are missing or if they are too old

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Tested-by: Timothy Redaelli <tredaelli@redhat.com>
Tested-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-April/330565.html

7 years agoAUTHORS: Add wenxu.
Ben Pfaff [Fri, 7 Apr 2017 00:30:51 +0000 (17:30 -0700)]
AUTHORS: Add wenxu.

Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agobundle: add nw_src/dst hash method
wenxu [Thu, 9 Mar 2017 04:01:02 +0000 (12:01 +0800)]
bundle: add nw_src/dst hash method

Add only nw_src or nw_dst hash feature to bundle and multipath.

Signed-off-by: wenxu <wenxu@ucloud.cn>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-controller: enable ssl config via local ovsdb
Lance Richardson [Thu, 6 Apr 2017 16:49:13 +0000 (12:49 -0400)]
ovn-controller: enable ssl config via local ovsdb

Allow ovn-controller to use SSL certificate and key configuration
from local ovsdb. With this change, SSL configuration from the
vswitchd database will be used if present, otherwise configuration
can still be specified from the command line.

If SSL configuration is present in both locations, the configuration
in the local ovsdb has precedence. This is consistent with how
vswitchd is currently implemented.

The existing ovs-vsctl get-ssl/set-ssl/del-ssl commands can be used
to manage the configuration in the vswitchd database.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoroute-table: Fix compatibility with pre-2.6.36 headers.
Ben Pfaff [Fri, 17 Mar 2017 21:21:46 +0000 (14:21 -0700)]
route-table: Fix compatibility with pre-2.6.36 headers.

Reported-by: Timothy Redaelli <tredaelli@redhat.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-March/329604.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agocheck-structs: struct eth_addr has alignment 2, not 1.
Ben Pfaff [Thu, 6 Apr 2017 05:55:03 +0000 (22:55 -0700)]
check-structs: struct eth_addr has alignment 2, not 1.

It consists of ovs_be16 elements, so it has 16-bit alignment.

(This doesn't make a difference for any actual OpenFlow protocol elements.)

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoutil: New macro ovs_strlcpy_arrays().
Ben Pfaff [Thu, 6 Apr 2017 05:49:27 +0000 (22:49 -0700)]
util: New macro ovs_strlcpy_arrays().

When both arguments to ovs_strlcpy() are character arrays, it makes sense
to just pass the smaller of their sizes as the overall size.  It's
somewhat error-prone and definitely redundant to write that by hand, so
this commit adds a new macro that does it automatically.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoovn-nbctl: include table formatting options in man page
Lance Richardson [Tue, 4 Apr 2017 13:44:51 +0000 (09:44 -0400)]
ovn-nbctl: include table formatting options in man page

Include descriptions of table formatting optiosn in ovn-nbctl
man page.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agotable: add xml version of lib/table.man
Lance Richardson [Tue, 4 Apr 2017 13:44:45 +0000 (09:44 -0400)]
table: add xml version of lib/table.man

Add lib/table.xml, translated from lib/table.man for inclusion
in XML man pages (such as ovn-nbctl.8.xml).

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovsdb-client: improve formatting option description in man page
Lance Richardson [Tue, 4 Apr 2017 13:44:39 +0000 (09:44 -0400)]
ovsdb-client: improve formatting option description in man page

Use correct option name for "--no-headings", remove duplicate
"--no-heading" option in synopsis.

Clarify description of "--data=json" option.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agotable: provide table formatting option help at runtime
Lance Richardson [Fri, 31 Mar 2017 17:21:03 +0000 (13:21 -0400)]
table: provide table formatting option help at runtime

Show table formatting options with help output from
ovn-nbctl, obn-sbctl, ovs-vsctl, and vtep-ctl commands.
Include "--data" option in ovsdb-client help output.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-nbctl: include db connection options in help
Lance Richardson [Tue, 28 Mar 2017 15:22:33 +0000 (11:22 -0400)]
ovn-nbctl: include db connection options in help

Include db connection options in help text.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agolib: Fix typos in db-ctl-base.{man,xml}
Timothy Redaelli [Mon, 3 Apr 2017 10:17:36 +0000 (12:17 +0200)]
lib: Fix typos in db-ctl-base.{man,xml}

s/exmaple/example/

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoDocumentation: Add a new topic document about ofproto/trace
Timothy Redaelli [Wed, 5 Apr 2017 11:10:47 +0000 (13:10 +0200)]
Documentation: Add a new topic document about ofproto/trace

Add a new document "Tracing packets inside Open vSwitch" that explains
how to use "ofproto/trace" to debug flows inside the vswitch.

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoofproto: Use macros to define DPIF support fields
Andy Zhou [Thu, 16 Mar 2017 01:39:57 +0000 (18:39 -0700)]
ofproto: Use macros to define DPIF support fields

When adding a new field in the 'struct dpif_backer_support', the
corresponding appctl show command should be updated to display
the new field. Currently, there is nothing to remind the developer
that to update the show command. This can lead to code maintenance
issues.

Switch to use macros to define those fields. This makes the show
command update automatic.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agoofproto-dpif-mirror: Fix issue of reseting snaplen in mirroring
Zhenyu Gao [Mon, 27 Mar 2017 03:16:11 +0000 (20:16 -0700)]
ofproto-dpif-mirror: Fix issue of reseting snaplen in mirroring

Currently, the mirror code doesn't check new value of snaplen when try
to reconfigure snaplen.
This patch fix this issue and add testings to reconfigure snaplen.

Signed-off-by: Zhenyu Gao <sysugaozhenyu@gmail.com>
Acked-by: William Tu <u9012063@gmail.com>
Signed-off-by: Andy Zhou <azhou@ovn.org>
7 years agoovn: Gratuitous ARP for distributed NAT rules
Mickey Spiegel [Thu, 30 Mar 2017 18:42:22 +0000 (11:42 -0700)]
ovn: Gratuitous ARP for distributed NAT rules

This patch extends gratuitous ARP support for NAT addresses so that it
applies to distributed NAT rules on a distributed logical router.
Distributed NAT rules have type "dnat_and_snat" and specify
'external_mac' and 'logical_port'.

Gratuitous ARP packets for distributed NAT rules are only generated on
the chassis where the 'logical_port' specified in the NAT rule resides.
Gratuitous ARPs are issued for the 'external_ip' address, resolving to
the 'external_mac'.

Since the MAC address varies for each distributed NAT rule, a separate
'nat_addresses' string must be generated for each distributed NAT rule.
For this reason, in the southbound 'Port_Binding',
'options:nat-addresses' is replaced by a 'nat_addresses' column that
can have an unlimited number of instances.  In order to allow for
upgrades, pinctrl in the ovn-controller can work off either the
'nat_addresses' column (if present), or 'options:nat-addresses'
otherwise.

Signed-off-by: Mickey Spiegel <mickeys.dev@gmail.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovn: Gratuitous ARP for centralized NAT rules on a distributed router
Mickey Spiegel [Thu, 30 Mar 2017 18:42:21 +0000 (11:42 -0700)]
ovn: Gratuitous ARP for centralized NAT rules on a distributed router

This patch extends gratuitous ARP support for NAT addresses so that it
applies to centralized NAT rules on a distributed router, in addition to
the existing gratuitous ARP support for NAT addresses on gateway routers.
Centralized NAT rules have type other than "dnat_and_snat", or have type
"dnat_and_snat" but do not specify external_mac or logical_port.  These
NAT rules apply on the redirect-chassis.

Gratuitous ARP packets for centralized NAT rules on a distributed router
are only generated on the redirect-chassis.  This is achieved by extending
the syntax for "options:nat-addresses" in the southbound database,
allowing the condition 'is_chassis_resident("LPORT_NAME")' to be appended
after the MAC and IP addresses.  This condition is automatically inserted
by ovn-northd when the northbound "options:nat-addresses" is set to
"router" and the peer is a distributed gateway port.

A separate patch will be required to support gratuitous ARP for
distributed NAT rules that specify logical_port and external_mac.  Since
the MAC address differs and the logical port often resides on a different
chassis from the redirect-chassis, these addresses cannot be included in
the same "nat-addresses" string as for centralized NAT rules.

Signed-off-by: Mickey Spiegel <mickeys.dev@gmail.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovs-ofctl: Document reset_counts, no_packet_counts, no_byte_counts.
Ben Pfaff [Thu, 30 Mar 2017 15:55:19 +0000 (08:55 -0700)]
ovs-ofctl: Document reset_counts, no_packet_counts, no_byte_counts.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agofaq: Expand on answer about packet buffering removal.
Ben Pfaff [Wed, 29 Mar 2017 18:25:38 +0000 (11:25 -0700)]
faq: Expand on answer about packet buffering removal.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoMakefile: Fix name of coding style guide.
Ben Pfaff [Wed, 29 Mar 2017 19:43:11 +0000 (12:43 -0700)]
Makefile: Fix name of coding style guide.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Stephen Finucane <stephen@that.guru>
7 years agoovsdb-server: Drop unnecessary find_db() function.
Ben Pfaff [Mon, 20 Mar 2017 17:56:22 +0000 (10:56 -0700)]
ovsdb-server: Drop unnecessary find_db() function.

'all_dbs' maps from a schema name to its struct db, so there's no need to
iterate the whole thing to find a database by schema name; instead, just
use the shash in the usual way.

Also, a few related but simpler changes elsewhere.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>>
7 years agoovsdb-server: Fix memory leak in update_remote_status() error path.
Ben Pfaff [Sun, 19 Mar 2017 17:22:05 +0000 (10:22 -0700)]
ovsdb-server: Fix memory leak in update_remote_status() error path.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoFix broken link in installation instructions.
Ben Pfaff [Wed, 29 Mar 2017 18:18:56 +0000 (11:18 -0700)]
Fix broken link in installation instructions.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Fixes: 8e3fd39f1edb ("doc: Minor improvements to install instructions.")
7 years agoofproto-dpif-xlate: Don't save pkt_mark in compose_output_action__().
Ben Pfaff [Fri, 17 Mar 2017 17:55:03 +0000 (10:55 -0700)]
ofproto-dpif-xlate: Don't save pkt_mark in compose_output_action__().

Previously, this function could modify the pkt_mark field as part of IPsec
integration.  It no longer does that, so there's no longer any need for it
to save and restore pkt_mark, and this commit removes that.

CC: Ansis Atteka <aatteka@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agodoc: Minor improvements to install instructions.
Ben Pfaff [Fri, 17 Mar 2017 21:40:08 +0000 (14:40 -0700)]
doc: Minor improvements to install instructions.

Clang 3.4 and later should now be widespread, so it's not worth suggesting
where to find it.

OVS needs a variety of shared libraries at runtime and it's not worth
mentioning each one by name.

The Linux kernel datapath module is available from a variety of places, so
don't say you have to use the one you built.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoDocument how to get Open vSwitch source code.
Ben Pfaff [Wed, 29 Mar 2017 17:19:48 +0000 (10:19 -0700)]
Document how to get Open vSwitch source code.

Suggested-by: "Nadathur, Sundar" <sundar.nadathur@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Gurucharan Shetty <guru@ovn.org>
7 years agoDocumentation: fix typo in documentation-style.rst
Timothy Redaelli [Wed, 29 Mar 2017 14:15:52 +0000 (16:15 +0200)]
Documentation: fix typo in documentation-style.rst

s/indenation/indentation/

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn: Fix options:router-port in Gratuitous ARP tests
Mickey Spiegel [Tue, 28 Mar 2017 01:34:03 +0000 (18:34 -0700)]
ovn: Fix options:router-port in Gratuitous ARP tests

In two of the Gratuitous ARP tests, "options:router-port"
is not set correctly.  This does not currently affect
validity of the tests since the next line resets
"options:router-port" to the correct value.

Reported-by: Guruchuran Shetty <guru@ovn.org>
Signed-off-by: Mickey Spiegel <mickeys.dev@gmail.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoconntrack: Add formatting support for IGMP, DCCP, and UDPLITE.
Jarno Rajahalme [Wed, 29 Mar 2017 00:17:36 +0000 (17:17 -0700)]
conntrack: Add formatting support for IGMP, DCCP, and UDPLITE.

Print names for protocols that are supported by (Linux) conntrack
(DCCP, UDPLITE) and IGMP, which has been seen in logs.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agonetlink-conntrack: Change unsupported IPPROTO log to debug.
Jarno Rajahalme [Wed, 29 Mar 2017 00:17:36 +0000 (17:17 -0700)]
netlink-conntrack: Change unsupported IPPROTO log to debug.

No point littering the logs with messages on an unsupported protocol,
so change the log to debug level.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>