]> git.proxmox.com Git - mirror_ovs.git/log
mirror_ovs.git
6 years agoConfigurable Link State Change (LSC) detection mode
Róbert Mulik [Mon, 23 Apr 2018 11:42:41 +0000 (11:42 +0000)]
Configurable Link State Change (LSC) detection mode

It is possible to set LSC detection mode to polling or interrupt mode
for DPDK interfaces. The default is polling mode. To set interrupt mode,
option dpdk-lsc-interrupt has to be set to true.

For detailed description and usage see the dpdk install documentation.

Signed-off-by: Robert Mulik <robert.mulik@ericsson.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agodpif-netdev: Detection and logging of suspicious PMD iterations
Jan Scheurich [Thu, 19 Apr 2018 17:40:46 +0000 (19:40 +0200)]
dpif-netdev: Detection and logging of suspicious PMD iterations

This patch enhances dpif-netdev-perf to detect iterations with
suspicious statistics according to the following criteria:

- iteration lasts longer than US_THR microseconds (default 250).
  This can be used to capture events where a PMD is blocked or
  interrupted for such a period of time that there is a risk for
  dropped packets on any of its Rx queues.

- max vhost qlen exceeds a threshold Q_THR (default 128). This can
  be used to infer virtio queue overruns and dropped packets inside
  a VM, which are not visible in OVS otherwise.

Such suspicious iterations can be logged together with their iteration
statistics to be able to correlate them to packet drop or other events
outside OVS.

A new command is introduced to enable/disable logging at run-time and
to adjust the above thresholds for suspicious iterations:

ovs-appctl dpif-netdev/pmd-perf-log-set on | off
    [-b before] [-a after] [-e|-ne] [-us usec] [-q qlen]

Turn logging on or off at run-time (on|off).

-b before:  The number of iterations before the suspicious iteration to
            be logged (default 5).
-a after:   The number of iterations after the suspicious iteration to
            be logged (default 5).
-e:         Extend logging interval if another suspicious iteration is
            detected before logging occurs.
-ne:        Do not extend logging interval (default).
-q qlen:    Suspicious vhost queue fill level threshold. Increase this
            to 512 if the Qemu supports 1024 virtio queue length.
            (default 128).
-us usec:   change the duration threshold for a suspicious iteration
            (default 250 us).

Note: Logging of suspicious iterations itself consumes a considerable
amount of processing cycles of a PMD which may be visible in the iteration
history. In the worst case this can lead OVS to detect another
suspicious iteration caused by logging.

If more than 100 iterations around a suspicious iteration have been
logged once, OVS falls back to the safe default values (-b 5/-a 5/-ne)
to avoid that logging itself causes continuos further logging.

Signed-off-by: Jan Scheurich <jan.scheurich@ericsson.com>
Acked-by: Billy O'Mahony <billy.o.mahony@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agodpif-netdev: Detailed performance stats for PMDs
Jan Scheurich [Thu, 19 Apr 2018 17:40:45 +0000 (19:40 +0200)]
dpif-netdev: Detailed performance stats for PMDs

This patch instruments the dpif-netdev datapath to record detailed
statistics of what is happening in every iteration of a PMD thread.

The collection of detailed statistics can be controlled by a new
Open_vSwitch configuration parameter "other_config:pmd-perf-metrics".
By default it is disabled. The run-time overhead, when enabled, is
in the order of 1%.

The covered metrics per iteration are:
  - cycles
  - packets
  - (rx) batches
  - packets/batch
  - max. vhostuser qlen
  - upcalls
  - cycles spent in upcalls

This raw recorded data is used threefold:

1. In histograms for each of the following metrics:
   - cycles/iteration (log.)
   - packets/iteration (log.)
   - cycles/packet
   - packets/batch
   - max. vhostuser qlen (log.)
   - upcalls
   - cycles/upcall (log)
   The histograms bins are divided linear or logarithmic.

2. A cyclic history of the above statistics for 999 iterations

3. A cyclic history of the cummulative/average values per millisecond
   wall clock for the last 1000 milliseconds:
   - number of iterations
   - avg. cycles/iteration
   - packets (Kpps)
   - avg. packets/batch
   - avg. max vhost qlen
   - upcalls
   - avg. cycles/upcall

The gathered performance metrics can be printed at any time with the
new CLI command

ovs-appctl dpif-netdev/pmd-perf-show [-nh] [-it iter_len] [-ms ms_len]
    [-pmd core] [dp]

The options are

-nh:            Suppress the histograms
-it iter_len:   Display the last iter_len iteration stats
-ms ms_len:     Display the last ms_len millisecond stats
-pmd core:      Display only the specified PMD

The performance statistics are reset with the existing
dpif-netdev/pmd-stats-clear command.

The output always contains the following global PMD statistics,
similar to the pmd-stats-show command:

Time: 15:24:55.270
Measurement duration: 1.008 s

pmd thread numa_id 0 core_id 1:

  Cycles:            2419034712  (2.40 GHz)
  Iterations:            572817  (1.76 us/it)
  - idle:                486808  (15.9 % cycles)
  - busy:                 86009  (84.1 % cycles)
  Rx packets:           2399607  (2381 Kpps, 848 cycles/pkt)
  Datapath passes:      3599415  (1.50 passes/pkt)
  - EMC hits:            336472  ( 9.3 %)
  - Megaflow hits:      3262943  (90.7 %, 1.00 subtbl lookups/hit)
  - Upcalls:                  0  ( 0.0 %, 0.0 us/upcall)
  - Lost upcalls:             0  ( 0.0 %)
  Tx packets:           2399607  (2381 Kpps)
  Tx batches:            171400  (14.00 pkts/batch)

Signed-off-by: Jan Scheurich <jan.scheurich@ericsson.com>
Acked-by: Billy O'Mahony <billy.o.mahony@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agonetdev: Add optional qfill output parameter to rxq_recv()
Jan Scheurich [Thu, 19 Apr 2018 17:40:44 +0000 (19:40 +0200)]
netdev: Add optional qfill output parameter to rxq_recv()

If the caller provides a non-NULL qfill pointer and the netdev
implemementation supports reading the rx queue fill level, the rxq_recv()
function returns the remaining number of packets in the rx queue after
reception of the packet burst to the caller. If the implementation does
not support this, it returns -ENOTSUP instead. Reading the remaining queue
fill level should not substantilly slow down the recv() operation.

A first implementation is provided for ethernet and vhostuser DPDK ports
in netdev-dpdk.c.

This output parameter will be used in the upcoming commit for PMD
performance metrics to supervise the rx queue fill level for DPDK
vhostuser ports.

Signed-off-by: Jan Scheurich <jan.scheurich@ericsson.com>
Acked-by: Billy O'Mahony <billy.o.mahony@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agonetdev-dpdk: don't enable scatter for jumbo RX support for nfp
Pablo Cascón [Fri, 27 Apr 2018 16:40:49 +0000 (17:40 +0100)]
netdev-dpdk: don't enable scatter for jumbo RX support for nfp

Currently to RX jumbo packets fails for NICs not supporting scatter.
Scatter is not strictly needed for jumbo RX support. This change fixes
the issue by not enabling scatter only for the PMD/NIC known not to
need it to support jumbo RX.

Note: this change is temporary and not needed for later releases OVS/DPDK

Reported-by: Louis Peens <louis.peens@netronome.com>
Signed-off-by: Pablo Cascón <pablo.cascon@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agofaq: Document DPDK version maintenance.
Kevin Traynor [Wed, 25 Apr 2018 11:20:53 +0000 (12:20 +0100)]
faq: Document DPDK version maintenance.

The faq already shows the DPDK versions that were
used with each OVS version. Give information about
DPDK stable and LTS releases, so the user can understand
if those versions are maintained.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agodpdk: Use DPDK 17.11.2 release.
Kevin Traynor [Mon, 23 Apr 2018 15:11:46 +0000 (16:11 +0100)]
dpdk: Use DPDK 17.11.2 release.

Modify travis linux build script to use the latest
DPDK stable release 17.11.2. Update docs for latest
DPDK stable releases.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agoovn-nbctl: Support ACL commands on port groups.
Han Zhou [Thu, 10 May 2018 06:32:04 +0000 (23:32 -0700)]
ovn-nbctl: Support ACL commands on port groups.

Add support for using ovn-nbctl to add/delete/list ACLs on port
groups.

A new option --type is also supported for these commands to
explicitely specify, when needed, whether the operation is on a
port-group or a logical switch. E.g.

ovn-nbctl --type=port-group acl-add port_group1 to-lport 1000 \
    'outport == @port_group1 && ip4.src == $port_group1_ip4' \
     allow-related

Signed-off-by: Han Zhou <hzhou8@ebay.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoAdd mirror/ovs-tcpdump support for slow protocols' Rx path.
Manohar Krishnappa Chidambaraswamy [Thu, 10 May 2018 06:56:22 +0000 (06:56 +0000)]
Add mirror/ovs-tcpdump support for slow protocols' Rx path.

Problem:
========
Received LACP/CFM/BFD/STP/LLDP slow protocols' packets are not captured in
ovs-tcpdump.

Fix:
====
Add mirror support for slow protocols.

Signed-off-by: Manohar K C <manohar.krishnappa.chidambaraswamy@ericsson.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoofproto: Fix crash processing malformed Bundle Add message.
Anju Thomas [Mon, 7 May 2018 17:28:06 +0000 (22:58 +0530)]
ofproto: Fix crash processing malformed Bundle Add message.

When an OpenFlow Bundle Add message is received, a bundle entry is
created and the OpenFlow message embedded in the bundle add message is
processed.  If any error is encountered while processing the embedded
message, the bundle entry is freed. The bundle entry free function
assumes that the entry has been populated with a properly formatted
OpenFlow message and performs some message specific cleanup actions .
This assumption does not hold true in the error case and OVS crashes
when performing the cleanup.

The fix is in case of errors, simply free the bundle entry without
attempting to perform any embedded message cleanup

Signed-off-by: Anju Thomas <anju.thomas@ericsson.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agotests: Fix typo in test name.
Ben Pfaff [Fri, 13 Apr 2018 17:38:53 +0000 (10:38 -0700)]
tests: Fix typo in test name.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
6 years agofaq: Start an OVN FAQ by giving a rationale for how it uses tunnels.
Ben Pfaff [Mon, 16 Apr 2018 19:16:24 +0000 (12:16 -0700)]
faq: Start an OVN FAQ by giving a rationale for how it uses tunnels.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
6 years agocheckpatch: Fix filename matching.
Ben Pfaff [Wed, 9 May 2018 18:26:06 +0000 (11:26 -0700)]
checkpatch: Fix filename matching.

The .match() method only matches at the beginning of a string but the
blacklists here need to match anywhere in a string.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Numan Siddique <nusiddiq@redhat.com>
6 years agorhel: openvswitch-fedora.spec.in: Specify PYTHON and PYTHON3
Timothy Redaelli [Thu, 10 May 2018 15:21:41 +0000 (17:21 +0200)]
rhel: openvswitch-fedora.spec.in: Specify PYTHON and PYTHON3

Currently python2 and python3 binaries are searched by following the
PATHs, but, on Fedora, the python2 package does not provides /bin/python2
and so if the PATH contains /bin before /usr/bin (for example by using
the ansible poc) then the resulting RPM file will require /bin/python2
instead of /usr/bin/python2 and this breaks some tools (for example
createrepo).

This patch specify the full path of python2 interpreter and,
if python3-openvswitch package is built, the full path of python3
interpreter.

Reported-by: Ansis Atteka <ansisatteka@gmail.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2018-May/346796.html
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Ansis Atteka <aatteka@ovn.org>
6 years agoofproto: Allow bundle idle timeout to be configured.
Flavio Leitner [Thu, 19 Apr 2018 17:09:38 +0000 (14:09 -0300)]
ofproto: Allow bundle idle timeout to be configured.

In some cases 10 seconds might be too much time and in
other cases it might be too little.

The OpenFlow spec mandates that it should wait at least one
second, so enforce that as the minimum acceptable value.

Signed-off-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoAvoid crash in OvS while transmitting fragmented packets over tunnel.
Rohith Basavaraja [Fri, 20 Apr 2018 08:47:58 +0000 (08:47 +0000)]
Avoid crash in OvS while transmitting fragmented packets over tunnel.

Currently when fragmented packets are to be transmitted in to tunnel,
base_flow->nw_frag which was initially non-zero at reception is not
reset to zero when the base_flow and flow are rewritten
as part of the emulated tnl_push action in the ofproto-dpif-xlate
module.

Because of this when fragmented packets are transmitted out of tunnel,
we hit crash caused by the following assert.

lib/odp-util.c:5654: assertion flow->nw_proto == base_flow->nw_proto &&
flow->nw_frag == base_flow->nw_frag failed in commit_set_ipv4_action()

With the following change propagate_tunnel_data_to_flow__
is modified to reset *nw_frag* to zero. Also, that currently we don't
fragment tunnelled packets, we should reset *nw_frag* to zero in
propagate_tunnel_data_to_flow__.

Signed-off-by: Jan Scheurich <jan.scheurich@ericsson.com>
From: Rohith Basavaraja <rohith.basavaraja@ericsson.com>
CC: Jan Scheurich <jan.scheurich@ericsson.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoExpose missing --peer-ca-cert and SSL options in usage and manpages.
Dan Williams [Mon, 23 Apr 2018 18:04:28 +0000 (13:04 -0500)]
Expose missing --peer-ca-cert and SSL options in usage and manpages.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoovn-nbctl: Show gw chassis in decreasing prio order.
Lorenzo Bianconi [Thu, 26 Apr 2018 14:35:46 +0000 (16:35 +0200)]
ovn-nbctl: Show gw chassis in decreasing prio order.

Report gateway chassis in decreasing priority order running ovn-nbctl
show sub-command. Add get_ordered_gw_chassis_prio_list routine to sort
gw chassis according to the configured priority

Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoDoc: Fix commands not being shown in code blocks
axel@tripier.fr [Fri, 27 Apr 2018 14:59:50 +0000 (16:59 +0200)]
Doc: Fix commands not being shown in code blocks

Some commands are not shown in code blocks in the Advances Features
tutorial, they are shown as variable width text because of a missing ":"
to designate them as code blocks.

Signed-off-by: Axel Tripier <axel@tripier.fr>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoDoc: Fix binary representation in Faucet tutorial
axel@tripier.fr [Fri, 27 Apr 2018 15:11:24 +0000 (17:11 +0200)]
Doc: Fix binary representation in Faucet tutorial

The binary representation of 80 and 8080 are switched in the
Faucet tutorial.

Signed-off-by: Axel Tripier <axel@tripier.fr>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agovswitchd: Enhance manager_options documentation.
Darrell Ball [Tue, 8 May 2018 22:43:07 +0000 (15:43 -0700)]
vswitchd: Enhance manager_options documentation.

Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoovn-northd: Fix parsing of load balance keys.
Darrell Ball [Tue, 24 Apr 2018 09:35:40 +0000 (02:35 -0700)]
ovn-northd: Fix parsing of load balance keys.

The OVN load balance tests are failing in both kernel and userspace DP.
The problem is due to bad parsing of the load balance keys because of
using the wrong default port mode in the call to inet_parse_active().

With this fix, the tests are now passing again.

system-ovn

100: ovn -- load-balancing                           ok
101: ovn -- load-balancing - same subnet.            ok
102: ovn -- load balancing in gateway router         ok
103: ovn -- multiple gateway routers, load-balancing ok
104: ovn -- load balancing in router with gateway router port ok

Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
6 years agosocket-util: Elaborate inet_parse_active comment.
Darrell Ball [Wed, 25 Apr 2018 20:11:42 +0000 (13:11 -0700)]
socket-util: Elaborate inet_parse_active comment.

The function inet_parse_active() is an external API and used
as one stop shopping for parsing ip address and L4 port
combinations from many other modules.  Hence, the function
header is extended to describe the special cases that it
handles.

Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoovn-controller: Make 'ovs_remote' a local variable.
Ben Pfaff [Wed, 25 Apr 2018 15:42:58 +0000 (08:42 -0700)]
ovn-controller: Make 'ovs_remote' a local variable.

There's not much value in making this a global since it's really just
parsed in one function and used in another.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
6 years agorhel: openvswitch-fedora.spec.in: Drop explicit usermod/groupadd deps
Markos Chandras [Fri, 4 May 2018 14:35:12 +0000 (15:35 +0100)]
rhel: openvswitch-fedora.spec.in: Drop explicit usermod/groupadd deps

These dependencies have been moved from the %post to the %pre scriptlet
in f624bf23b62a ("rhel: user/group openvswitch does not exist") and are
already provided by the shadow-utils package so we can simply drop
them.

Cc: Alan Pevec <alan.pevec@redhat.com>
Cc: Aaron Conole <aconole@redhat.com>
Signed-off-by: Markos Chandras <mchandras@suse.de>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
6 years agoutilities: Add some GDB macros for ovs-vswitchd
Eelco Chaudron [Wed, 9 May 2018 11:47:26 +0000 (13:47 +0200)]
utilities: Add some GDB macros for ovs-vswitchd

This commit adds basic GDB macro's for ovs-vswitchd:
  - ovs_dump_bridge [ports|wanted]
  - ovs_dump_bridge_ports <struct bridge *>
  - ovs_dump_dp_netdev [ports]
  - ovs_dump_dp_netdev_ports <struct dp_netdev *>
  - ovs_dump_netdev

These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:

(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev     , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0    , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0          , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0         , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0          , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3            , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0         , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>

(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
  reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoovn-controller: Make the local-only flow generic.
Han Zhou [Tue, 8 May 2018 22:11:52 +0000 (15:11 -0700)]
ovn-controller: Make the local-only flow generic.

The flow that handles MLF_LOCAL_ONLY flag is now added for each
multicast group, but in fact it can be more generic and only one
is needed rather than per mc group.

Suggested-by: Ben Pfaff <blp@ovn.org>
Suggested-at: https://mail.openvswitch.org/pipermail/ovs-dev/2018-May/346719.html
Signed-off-by: Han Zhou <hzhou8@ebay.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agotests: Avoid OVN environment variables leaking into tests.
Ben Pfaff [Wed, 9 May 2018 18:18:15 +0000 (11:18 -0700)]
tests: Avoid OVN environment variables leaking into tests.

If $OVN_NB_DB or $OVN_SB_DB happened to be set in the environment in which
"make check" was invoked, then their values would leak into the tests'
environment and interfere with the tests.  This commit avoids that problem.

OVS has a number of environment variables too, such as OVS_RUNDIR, but
the tests already set those to custom values.

Reported-by: Han Zhou <zhouhan@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Han Zhou <hzhou8@ebay.com>
6 years agoovn: support applying ACLs to port groups
Han Zhou [Sun, 22 Apr 2018 16:52:34 +0000 (09:52 -0700)]
ovn: support applying ACLs to port groups

Although port group can be used in match conditions of ACLs, it is
still inconvenient for clients to figure out the lswitches that each
ACL should be applied to.

This patch supports applying ACLs to port groups directly instead of
applying to each related lswitch individually. It provides convenience
for clients such as k8s and OpenStack Neutron.

Requested-at: https://mail.openvswitch.org/pipermail/ovs-dev/2018-March/344856.html
Requested-by: Guru Shetty <guru@ovn.org>
Requested-by: Daniel Alvarez Sanchez <dalvarez@redhat.com>
Signed-off-by: Han Zhou <hzhou8@ebay.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agocompat: Fix upstream 4.4.119 kernel
Greg Rose [Fri, 20 Apr 2018 18:13:07 +0000 (11:13 -0700)]
compat: Fix upstream 4.4.119 kernel

The Linux 4.4.119 kernel (and perhaps others) from kernel.org
backports some dst_cache code that breaks the openvswitch kernel
due to a duplicated name "dst_cache_destroy".  For most cases the
"USE_UPSTREAM_TUNNEL" covers this but in this case the dst_cache
feature needs to be separated out.

Add the necessary compatibility detection layer in acinclude.m4 and
then fixup the source files so that if the built-in kernel includes
dst_cache support then exclude our own compatibility code.

Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
6 years agoovn.at: fix occasional dns lookup test failure
Han Zhou [Mon, 30 Apr 2018 17:04:54 +0000 (10:04 -0700)]
ovn.at: fix occasional dns lookup test failure

The option "--wait=hv" was missed when adding back the DNS options
for ls1-lp1 using ovn-nbctl, so the test case failed occasionally.
This commit fix the same.

Signed-off-by: Han Zhou <hzhou8@ebay.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agovswitch.xml: Add details for mac option.
Tonghao Zhang [Thu, 3 May 2018 13:06:14 +0000 (06:06 -0700)]
vswitch.xml: Add details for mac option.

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoovn.at: fix timing in test case /32 router IP address
Han Zhou [Fri, 4 May 2018 02:39:33 +0000 (19:39 -0700)]
ovn.at: fix timing in test case /32 router IP address

After mac binding is populated in SB, before sending a packet, we
should ensure HVs processed this SB change. This patch ensures it
by: ovn-nbctl --wait=hv sync.

Signed-off-by: Han Zhou <hzhou8@ebay.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoovn.at: fix occasional failure - options:requested-chassis for logical port
Han Zhou [Tue, 8 May 2018 16:42:07 +0000 (09:42 -0700)]
ovn.at: fix occasional failure - options:requested-chassis for logical port

There are two problems in this test case that lead to occasional
failures.

Firstly, hv1_uuid or hv2_uuid could be empty because they
may be assigned before SB is updated, so adding ovn-sbctl wait-until
fixes it.

Secondly, when port-binding chassis is queried from SB,
it could be in the transient state - updated by the releasing chassis
to empty, but not yet updated by the requested chassis to the new
uuid. Although it is retried by OVS_WAIT_UNTIL, an empty string leads
to syntax error of the "test ... = ..." command and errors out immediately
in that case. So adding prefix "x" to both side of the test command
fixes it.

Signed-off-by: Han Zhou <hzhou8@ebay.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoovn.at: fix occasional failure - options:requested-chassis with hostname
Han Zhou [Tue, 8 May 2018 16:48:22 +0000 (09:48 -0700)]
ovn.at: fix occasional failure - options:requested-chassis with hostname

hv1_hostname could be empty because it may be assigned before SB is
updated, so adding ovn-sbctl wait-until fixes it.

Signed-off-by: Han Zhou <hzhou8@ebay.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoovn-controller.at: fix occasional ovn-bridge-mappings test failure
Han Zhou [Tue, 8 May 2018 17:29:40 +0000 (10:29 -0700)]
ovn-controller.at: fix occasional ovn-bridge-mappings test failure

This patch fixes the time issue in the test case so that when external-ids
is updated in Open_vSwitch OVSDB, give some time for SB OVSDB to get
updated by ovn-controller.

Signed-off-by: Han Zhou <hzhou8@ebay.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoovs-vsctl: Extend manager_options documentation.
Darrell Ball [Tue, 8 May 2018 17:22:23 +0000 (10:22 -0700)]
ovs-vsctl: Extend manager_options documentation.

Add ovsdb-server command option to the manager_options
documentation.

Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoovs-sandbox: Support managers in sandbox.
Ben Pfaff [Tue, 8 May 2018 15:30:11 +0000 (08:30 -0700)]
ovs-sandbox: Support managers in sandbox.

Until now, ovsdb-server in the sandbox ignored the Managers table.  This
commit adds support.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Darrell Ball <dlu00998@gmail.com>
6 years agoovn: Fix occasional failure in gratuitous ARP for NAT rules test.
Han Zhou [Tue, 8 May 2018 01:09:57 +0000 (18:09 -0700)]
ovn: Fix occasional failure in gratuitous ARP for NAT rules test.

In this test case it didn't wait for all HVs to catch up, which
leads to occasional failures due to timing. This fix updates
the --wait=sb to --wait=hv, which fixes the problem.

Signed-off-by: Han Zhou <hzhou8@ebay.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agowindows: Fix return value in case of named pipe send failure
Alin Gabriel Serdean [Mon, 30 Apr 2018 20:44:00 +0000 (23:44 +0300)]
windows: Fix return value in case of named pipe send failure

Named pipes should emulate UNIX socket behavior.

Until now the named pipes returned WSA (Windows implementation of BSD sockets
errors) return codes, for send errors.

In case of a disconnected named pipe (UNIX socket) send error, we should return
EPIPE.

Fixes: `check_logs` transient errors when checking for EPIPE.
Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Alin Balutoiu <abalutoiu@cloudbasesolutions.com>
Acked-by: Ben Pfaff <blp@ovn.org>
6 years agoovs-vsctl: Fix segfault when attempting to del-port from parent bridge.
Flavio Fernandes [Tue, 1 May 2018 23:07:36 +0000 (19:07 -0400)]
ovs-vsctl: Fix segfault when attempting to del-port from parent bridge.

The error message in the check for improper bridge param is de-referencing
parent from the wrong bridge. Also, the message itself had the parent and
child bridges reversed, so that got a small tweak as well.

Also, add a regression test.

Signed-off-by: Flavio Fernandes <flavio@flaviof.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoovn-ctl: Handle whitespaces when using eval for start_ovsdb:
aginwala [Tue, 17 Apr 2018 04:55:38 +0000 (21:55 -0700)]
ovn-ctl: Handle whitespaces when using eval for start_ovsdb:

eval doesn't understand white space for local var which was introduced in commit
79c7961b8b3c4b7ea0251dea2ffacfa84c84fecb for starting clustered ovn dbs.
As ovn-ctl uses sh instead of bash, parsing local var with white space will fail.

e.g. /usr/share/openvswitch/scripts/ovn-ctl --db-nb-addr=192.168.220.101 --db-nb-create-insecure-remote=yes \
     --db-sb-addr=192.168.220.101 --db-sb-create-insecure-remote=yes \
     --db-nb-cluster-local-addr=192.168.220.101 \
     --db-sb-cluster-local-addr=192.168.220.101 \
     --ovn-northd-nb-db=tcp:192.168.220.101:6641,tcp:192.168.220.102:6641,tcp:192.168.220.103:6641 \
     --ovn-northd-sb-db=tcp:192.168.220.101:6642,tcp:192.168.220.102:6642,tcp:192.168.220.103:6642 \
     start_northd

gives error: /usr/share/openvswitch/scripts/ovn-ctl: 1: local: -vfile:info: bad variable name

As a result ovsdb fails to even initialize and start. Hence, we need to seperate local keyword for all
variables used with eval to make it work with both dash and bash.

Signed-off-by: aginwala <aginwala@ebay.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoovs-vswitchd: Better document that ovs-vswitchd manages its own datapaths.
Ben Pfaff [Fri, 4 May 2018 06:27:26 +0000 (23:27 -0700)]
ovs-vswitchd: Better document that ovs-vswitchd manages its own datapaths.

More explicitly discourage users from managing them themselves.

Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoofproto-dpif-xlate: Fix segmentation fault caused by tun_table
Yi-Hung Wei [Thu, 3 May 2018 16:49:50 +0000 (09:49 -0700)]
ofproto-dpif-xlate: Fix segmentation fault caused by tun_table

Currently, the revalidator thread may hit segmentation fault when geneve
TLV map is updated.  It is because we may store the old TLV map (struct
tun_table) in the frozen state for recirculation, and we may access the
already freed old tun_table in xlate_actions().

This patch update the logic of getting tun_table so that we will use
the latest tun_table instead of the frozen one.

VMWare-BZ: #2106987
Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agorhel: user/group openvswitch does not exist
Alan Pevec [Thu, 19 Apr 2018 15:27:09 +0000 (11:27 -0400)]
rhel: user/group openvswitch does not exist

Default ownership[1] for config files is failing on an empty system:
  Running scriptlet: openvswitch-2.9.0-3.fc28.x86_64
warning: user openvswitch does not exist - using root
warning: group openvswitch does not exist - using root
...

Required user/group need to be created in %pre as documented in
Fedora guideline[2]

[1] https://github.com/openvswitch/ovs/commit/951d79e638ecdb3b1dcd19df1adb2ff91fe61af8

[2] https://fedoraproject.org/wiki/Packaging:UsersAndGroups#Dynamic_allocation

Submitted-at: https://github.com/openvswitch/ovs/pull/223
Signed-off-by: Alan Pevec <alan.pevec@redhat.com>
Co-authored-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Markos Chandras <mchandras@suse.de>
Signed-off-by: Russell Bryant <russell@ovn.org>
6 years agoodp-util: Remove unnecessary TOS ECN bits rewrite for tunnels
Jianbo Liu [Tue, 1 May 2018 12:36:06 +0000 (12:36 +0000)]
odp-util: Remove unnecessary TOS ECN bits rewrite for tunnels

For tunnels, TOS ECN bits are never wildcard for the reason that they
are always inherited. OVS will create a rewrite action if we add rule
to modify other IP headers. But it also adds an extra ECN rewrite for
the action because of this ECN un-wildcarding.

It seems no error because the ECN bits to be changed are same in this
case. But as rule can't be offloaded to hardware, the unnecssary ECN
rewrite should be removed.

Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
Reviewed-by: Paul Blakey <paulb@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
6 years agodatapath-windows: Prevent ct-counters from getting redundantly incremented
Anand Kumar [Fri, 27 Apr 2018 17:00:30 +0000 (10:00 -0700)]
datapath-windows: Prevent ct-counters from getting redundantly incremented

The conntrack-counters ought to be incremented only if it's a new lookup
or if it's recirculated through a different zone for the first time.

Signed-off-by: Anand Kumar <kumaranand@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
6 years agoMerge branch 'dpdk_merge' of https://github.com/istokes/ovs into HEAD
Ben Pfaff [Mon, 30 Apr 2018 15:34:47 +0000 (08:34 -0700)]
Merge branch 'dpdk_merge' of https://github.com/istokes/ovs into HEAD

6 years agoovsdb.7: Clarify description of OVSDB.
Ben Pfaff [Thu, 26 Apr 2018 16:39:30 +0000 (09:39 -0700)]
ovsdb.7: Clarify description of OVSDB.

A reader reported that "network database system" made it sound like OVSDB
was specialized for databases about networks.  It's not, it's just
accessible over the network.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
6 years agoMakefile.am: Distribute poc/playbook-fedora-builder.yml.
Ben Pfaff [Wed, 25 Apr 2018 19:48:07 +0000 (12:48 -0700)]
Makefile.am: Distribute poc/playbook-fedora-builder.yml.

This fixes a broken build.

CC: Ansis Atteka <aatteka@ovn.org>
Fixes: 3a2ceb01c81b ("poc: Automate building of Fedora rpm packages")
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Ansis Atteka <aatteka@ovn.org>
6 years agoovs-ofctl: Fix "ovs-ofctl snoop".
Ashish Varma [Fri, 20 Apr 2018 22:28:38 +0000 (15:28 -0700)]
ovs-ofctl: Fix "ovs-ofctl snoop".

In case where "use_names" is set (e.g. in an interactive session) to show
the port and table names when ovs-ofctl is run with snoop command,
ovs-ofctl would get stuck in an endless loop inside "table_iterator_next"
function's while loop checking for "while (ti->send_xid != recv_xid)".
This would happening because the "vconn" to "<bridge>.snoop" socket would
not respond to TABLE_FEATURES_REQUEST sent by ovs-ofctl.

This commit disables showing port or table names in the snoop command.

Signed-off-by: Ashish Varma <ashishvarma.ovs@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agopoc: Automate building of Fedora rpm packages
Ansis Atteka [Mon, 23 Apr 2018 21:53:25 +0000 (14:53 -0700)]
poc: Automate building of Fedora rpm packages

This patch automates building of Fedora rpm packages (Just
like we are already doing this for for CentOS and Ubuntu).

Signed-off-by: Ansis Atteka <aatteka@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
6 years agocheckpatch: Don't do line length or whitespace checks on debian/rules.
Ben Pfaff [Mon, 16 Apr 2018 20:00:03 +0000 (13:00 -0700)]
checkpatch: Don't do line length or whitespace checks on debian/rules.

debian/rules is a Makefile with a funny name.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Aaron Conole <aconole@redhat.com>
6 years agolib/tc: Remove unnecessary icmp recalculation
Jianbo Liu [Wed, 25 Apr 2018 08:09:08 +0000 (08:09 +0000)]
lib/tc: Remove unnecessary icmp recalculation

ICMP checksum is calculated from ICMP headers and data, so hardware doesn't
need to calculate it again because we only rewrite IP headers.

Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
Reviewed-by: Paul Blakey <paulb@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
6 years agopoc: update the documentation
Aaron Conole [Tue, 24 Apr 2018 20:10:51 +0000 (16:10 -0400)]
poc: update the documentation

Misc. fixes to the Proof of Concepts section to help render the
information a bit nicer.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Ansis Atteka <aatteka@ovn.org>
6 years agodatapath: Prevent panic
Greg Rose [Tue, 17 Apr 2018 19:34:08 +0000 (12:34 -0700)]
datapath: Prevent panic

On RHEL 7.x kernels we observe a panic induced by a paging error
when the timer kicks off a job that subsequently accesses memory
that belonged to the openvswitch kernel module but was since
unloaded - thus the paging error.

The panic can be induced on any RHEL 7.x kernel with the following test:

while `true`
do
    make check-kmod TESTSUITEFLAGS="-k \!gre"
done

On the systems I've been testing on it generally takes anywhere from a
minute to 15 minutes or so to repro but never longer than that.  Similar
results have been seen by other testers.

This patch does not fix the underlying bug, which does need to be
investigated and fixed, but it does prevent it from occurring. We
would like to prevent customer systems from panicking while we do
futher investigation to find the root cause.

Here is the trace:
[252257.801809] BUG: unable to handle kernel paging request at ffffffffc07c6298
[252257.802451] IP: [<ffffffff810996e0>] run_timer_softirq+0xe0/0x310
[252257.803055] PGD 19f5067 PUD 19f7067 PMD 2fb5fc2067 PTE 0
[252257.803559] Oops: 0002 [#1] SMP
[252257.804138] Modules linked in: geneve ip6_udp_tunnel xt_statistic xt_physdev xt_nat xt_recent xt_comment xt_mark ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat xt_addrtype ipt_REJECT nf_reject_ipv4 xt_conntrack iptable_filter ip_tables nf_conntrack_netlink br_netfilter overlay(T) sch_htb veth udp_tunnel 8021q garp mrp tun ip_set nfnetlink bridge stp llc nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iTCO_wdt iTCO_vendor_support dcdbas mxm_wmi sb_edac edac_core intel_powerclamp coretemp intel_rapl iosf_mbi kvm_intel kvm irqbypass crc32_pclmul ghash_clmulni_intel aesni_intel lrw gf128mul glue_helper ablk_helper cryptd joydev mei_me sg mei ipmi_ssif pcspkr shpchp lpc_ich ipmi_si ipmi_devintf ipmi_msghandler acpi_power_meter wmi nfsd auth_rpcgss
[252257.808079] nfs_acl lockd grace sunrpc xfs libcrc32c sr_mod sd_mod cdrom crc_t10dif crct10dif_generic uas usb_storage mgag200 drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ttm drm crct10dif_pclmul crct10dif_common crc32c_intel ahci libahci ixgbe libata igb megaraid_sas mdio ptp i2c_algo_bit pps_core i2c_core dca dm_mirror dm_region_hash dm_log dm_mod [last unloaded: openvswitch]
[252257.811056] CPU: 33 PID: 0 Comm: swapper/33 Tainted: G OE ------------ T 3.10.0-693.el7.x86_64 #1
[252257.811826] Hardware name: Dell Inc. PowerEdge R630/02C2CP, BIOS 2.1.5 04/11/2016
[252257.812605] task: ffff8830b7708fd0 ti: ffff8830b7718000 task.ti: ffff8830b7718000
[252257.813447] RIP: 0010:[<ffffffff810996e0>] [<ffffffff810996e0>] run_timer_softirq+0xe0/0x310
[252257.814298] RSP: 0018:ffff885fbe203e68 EFLAGS: 00010082
[252257.815122] RAX: ffff8830b66bc838 RBX: ffff8830b66bc000 RCX: ffffffffc07c6290
[252257.815933] RDX: ffff8830b66bc810 RSI: ffff885fbe203e90 RDI: ffff8830b66bc000
[252257.816733] RBP: ffff885fbe203ed0 R08: 0000e56b5701d800 R09: ffff885fbe203da0
[252257.817568] R10: 0000000000000002 R11: ffff885fbe203da8 R12: 0000000000000081
[252257.818429] R13: 0000e56b56fb2eca R14: ffffffff819eb0c8 R15: 0000000000000001
[252257.819297] FS: 0000000000000000(0000) GS:ffff885fbe200000(0000) knlGS:0000000000000000
[252257.820174] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[252257.821156] CR2: ffffffffc07c6298 CR3: 00000000019f2000 CR4: 00000000003407e0
[252257.822012] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[252257.822869] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[252257.823720] Stack:
[252257.824678] ffff8830b66bdc28 ffff8830b66bd828 ffff8830b66bd428 ffff8830b66bd028
[252257.825699] ffff885fbe20fe80 ffff885fbe203eb0 ffffffff8132bfe0 28a56c277c4fe974
[252257.826623] 0000000000000001 0000000000000001 0000e56b56fb2eca ffffffff819eb0c8
[252257.827524] Call Trace:
[252257.828410] <IRQ>
[252257.828417]
[252257.829292] [<ffffffff8132bfe0>] ? timerqueue_add+0x60/0xb0
[252257.830164] [<ffffffff81090b3f>] __do_softirq+0xef/0x280
[252257.831010] [<ffffffff816b6a5c>] call_softirq+0x1c/0x30
[252257.831849] [<ffffffff8102d3c5>] do_softirq+0x65/0xa0
[252257.832669] [<ffffffff81090ec5>] irq_exit+0x105/0x110
[252257.833501] [<ffffffff816b76c2>] smp_apic_timer_interrupt+0x42/0x50
[252257.834330] [<ffffffff816b5c1d>] apic_timer_interrupt+0x6d/0x80
[252257.835152] <EOI>
[252257.835159]
[252257.835944] [<ffffffff81527a02>] ? cpuidle_enter_state+0x52/0xc0
[252257.837231] [<ffffffff81527b48>] cpuidle_idle_call+0xd8/0x210
[252257.838224] [<ffffffff81034fee>] arch_cpu_idle+0xe/0x30
[252257.839133] [<ffffffff810e7bca>] cpu_startup_entry+0x14a/0x1c0
[252257.839933] [<ffffffff81051af6>] start_secondary+0x1b6/0x230
[252257.840684] Code: 00 00 00 44 0f b6 e0 45 85 e4 0f 84 a7 01 00 00 49 63 d4 48 83 43 10 01 48 8d 75 c0 48 c1 e2 04 48 01 da 48 8b 4a 28 48 8d 42 28 <48> 89 71 08 48 89 4d c0 48 8b 4a 30 48 89 4d c8 48 89 31 48 89
[252257.842366] RIP [<ffffffff810996e0>] run_timer_softirq+0xe0/0x310
[252257.843183] RSP <ffff885fbe203e68>
[252257.843955] CR2: ffffffffc07c6298

Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
6 years agotests: Add system-dpdk-testsuite
Marcin Rybka [Fri, 20 Apr 2018 13:46:27 +0000 (14:46 +0100)]
tests: Add system-dpdk-testsuite

New OVS-DPDK testsuite, which can be launched via `make check-dpdk`,
tests OVS using a DPDK datapath. The testsuite contains already
initial tests:
 1. EAL init
 2. Add standard DPDK PHY port
 3. Add vhost-user-client port

Signed-off-by: Marcin Rybka <marcinx.rybka@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agodocs: Clarify changes in Rx queue allocation
Stephen Finucane [Fri, 20 Apr 2018 09:24:32 +0000 (10:24 +0100)]
docs: Clarify changes in Rx queue allocation

Two mistakes here:

- Automatic assignment of Rx queues to PMD threads has always existed -
  it was simply switched from round-robin allocation to
  utilization-based allocation
- The above, along with the 'pmd-rxq-rebalance' command, was added in
  OVS 2.9.0 - not OVS 2.8.0 - while the 'pmd-rxq-show' command was added
  in OVS 2.6.0 and modified in OVS 2.9.0

Correct both of these and modify the NEWS entry for this to clarify
things a little (it took a bit of git spelunking and bothering people on
IRC to figure out).

Signed-off-by: Stephen Finucane <stephen@that.guru>
Cc: Kevin Traynor <ktraynor@redhat.com>
Cc: Ian Stokes <ian.stokes@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agodoc: Add "jumbo frames" topic document
Stephen Finucane [Thu, 19 Apr 2018 12:57:28 +0000 (13:57 +0100)]
doc: Add "jumbo frames" topic document

We include references from the physical and vhost-user interface guides.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agodoc: Move "pdump" guide to its own document
Stephen Finucane [Thu, 19 Apr 2018 12:57:27 +0000 (13:57 +0100)]
doc: Move "pdump" guide to its own document

Yet another section that's far too detailed for someone getting started
with DPDK in OVS. Split it out.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agodoc: Add "bridge" topic document
Stephen Finucane [Thu, 19 Apr 2018 12:57:26 +0000 (13:57 +0100)]
doc: Add "bridge" topic document

This details configuration steps that apply to the entire bridge, rather
than individual ports.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agodoc: Move "QoS" guide to its own document
Stephen Finucane [Thu, 19 Apr 2018 12:57:25 +0000 (13:57 +0100)]
doc: Move "QoS" guide to its own document

Again, this stuff is too detailed for a high-level howto.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agodoc: Add "vdev" topic document
Stephen Finucane [Thu, 19 Apr 2018 12:57:24 +0000 (13:57 +0100)]
doc: Add "vdev" topic document

These are separate things from physical, ring and vhost-user interfaces
and deserve their own documents. A couple of small typos are fixed along
the way.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agodoc: Move additional sections to "physical ports" doc
Stephen Finucane [Thu, 19 Apr 2018 12:57:23 +0000 (13:57 +0100)]
doc: Move additional sections to "physical ports" doc

The "hotplugging", "flow control", and "Rx checksum offload" sections
only apply to 'dpdk' ports and are too detailed to include in a
high-level howto. Move them, reworking some aspects of this in the
process.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agodoc: Add "PMD" topic document
Stephen Finucane [Thu, 19 Apr 2018 12:57:22 +0000 (13:57 +0100)]
doc: Add "PMD" topic document

This continues the breakup of the huge DPDK "howto" into smaller
components. There are a couple of related changes included, such as
using "Rx queue" instead of "rxq" and noting how Tx queues cannot be
configured.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agodoc: Add an overview of the 'dpdk' port
Stephen Finucane [Thu, 19 Apr 2018 12:57:21 +0000 (13:57 +0100)]
doc: Add an overview of the 'dpdk' port

These ports are used to allow ingress/egress from the host and are
therefore _reasonably_ important. However, there is no clear overview of
what these ports actually are or why things are done the way they are.
Start closing this gap by providing a standalone example of using these
ports along with a little more detailed overview of the binding process.

There is additional cleanup to be done for the DPDK howto, but that will
be done separately.

We enable the TODO directive so we can actually start calling out some
TODOs.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agodocs: Fix urls in index.rst.
Ian Stokes [Wed, 18 Apr 2018 12:30:42 +0000 (13:30 +0100)]
docs: Fix urls in index.rst.

This patch prepends 'www' to openvswitch urls in index.rst. Without this
make check-docs fails when verifying url liveness. Also remove url
referencing ovsdb-server(5) as these are no longer accessible.

Cc: Stephen Finucane <stephen@that.guru>
Fixes: 4f6ec357c ("doc: Populate 'ref' section")
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Stephen Finucane <stephen@that.guru>
6 years agodocs: Fix sphinx urls.
Ian Stokes [Wed, 18 Apr 2018 10:17:12 +0000 (11:17 +0100)]
docs: Fix sphinx urls.

Update dead url links for sphinx documentation to avoid
make check-docs failing.

Cc: Stephen Finucane <stephen@that.guru>
Fixes: 26ea2d409 ("docs: Add writing guide")
Fixes: 73c76b447 ("doc: Add info on building documentation")
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Stephen Finucane <stephen@that.guru>
6 years agodocs: Fix style guide url in DocumentationStyle.rst.
Ian Stokes [Wed, 18 Apr 2018 10:17:12 +0000 (11:17 +0100)]
docs: Fix style guide url in DocumentationStyle.rst.

The link used for IBM Style Guide is no longer valid. As there is no
longer a valid link via redbooks remove the url to avoid make
check-docs failing.

Cc: Stephen Finucane <stephen@that.guru>
Fixes: 26ea2d409 ("docs: Add writing guide")
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Stephen Finucane <stephen@that.guru>
6 years agodocs: Fix sflow documentation url and markup.
Ian Stokes [Wed, 18 Apr 2018 09:54:09 +0000 (10:54 +0100)]
docs: Fix sflow documentation url and markup.

The link url link for the blog in sflow documentation causes make
check-docs to fail with a broken link warning. Fix this by correcting
the url address. Also use correct markup for note regarding the
configuration of sflow.

CC: Stephen Finucane <stephen@that.guru>
Fixes: 198c5d3d0 ("doc: Add sFlow cookbook from website")
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Stephen Finucane <stephen@that.guru>
6 years agonetdev-dpdk: Free mempool only when no in-use mbufs.
Kevin Traynor [Fri, 13 Apr 2018 17:40:13 +0000 (18:40 +0100)]
netdev-dpdk: Free mempool only when no in-use mbufs.

DPDK mempools are freed when they are no longer needed.
This can happen when a port is removed or a port's mtu
is reconfigured so that a new mempool is used.

It is possible that an mbuf is attempted to be returned
to a freed mempool from NIC Tx queues and this can lead
to a segfault.

In order to prevent this, only free mempools when they
are not needed and have no in-use mbufs. As this might
not be possible immediately, create a free list of
mempools and sweep it anytime a port tries to get a
mempool.

Fixes: 8d38823bdf8b ("netdev-dpdk: fix memory leak")
Cc: mark.b.kavanagh81@gmail.com
Cc: Ilya Maximets <i.maximets@samsung.com>
Reported-by: Venkatesan Pradeep <venkatesan.pradeep@ericsson.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agodpdk docs: Drop file share in libvirt config.
Tiago Lam [Wed, 11 Apr 2018 10:25:52 +0000 (11:25 +0100)]
dpdk docs: Drop file share in libvirt config.

When explaining on how to add vhost-user ports to a guest, using
libvirt, the following piece of configuration is used:
    <disk type='dir' device='disk'>
      <driver name='qemu' type='fat'/>
      <source dir='/usr/src/dpdk-stable-17.11.1'/>
      <target dev='vdb' bus='virtio'/>
      <readonly/>
    </disk>

This is used to facilitate sharing of a DPDK directory between the host
and the guest. However, for this to work selinux also needs to be
configured (or disabled).  Furthermore, if one is using Ubuntu, libvirtd
would need to be added to complain only in AppArmor. Instead, in [1] it
is advised to use wget to get the DPDK sources over the internet, which
avoids this differentiation. Thus, we drop this piece of configuration
here as well and keep the example configuration as simple as possible.

This has been verified on both a Fedora 27 image and a Ubuntu 16.04 LTS
image.

[1] http://docs.openvswitch.org/en/latest/topics/dpdk/vhost-user/#dpdk-in-the-guest

Signed-off-by: Tiago Lam <tiago.lam@intel.com>
Acked-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agodpdk docs: Drop qemu-kvm for qemu-system-x86_64.
Tiago Lam [Wed, 11 Apr 2018 10:25:51 +0000 (11:25 +0100)]
dpdk docs: Drop qemu-kvm for qemu-system-x86_64.

When explaining on how to add vhost-user ports to a guest, using
libvirt, point to the qemu-system-x86_64 binary by default, instead of
using qemu-kvm. The latter has been made obsolete and dropped from a
number of distributions (although it is still available on Fedora).

This has been verified on both a Fedora 27 image and a Ubuntu 16.04 LTS
image.

Signed-off-by: Tiago Lam <tiago.lam@intel.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agonetdev-dpdk: fix MAC address in port addr example
Marcelo Ricardo Leitner [Mon, 9 Apr 2018 17:20:50 +0000 (14:20 -0300)]
netdev-dpdk: fix MAC address in port addr example

The MAC address is always 6-bytes long, never 7. The extra :01 and :02
doesn't belong in there as it doesn't mean selecting one port or
another.

Instead, use an incrementing MAC address, which is what usually happens
on such cards.

See-also: http://www.dpdk.org/ml/archives/dev/2018-April/094976.html
Fixes: 5e7588186839 ("netdev-dpdk: fix port addition for ports sharing same PCI id")
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agoovn-sbctl: add support for --bootstrap-ca-cert
Dan Williams [Fri, 20 Apr 2018 19:40:18 +0000 (14:40 -0500)]
ovn-sbctl: add support for --bootstrap-ca-cert

Signed-off-by: Dan Williams <dcbw@redhat.com>
6 years agoovn-nbctl: show --bootstrap-ca-cert help text
Dan Williams [Fri, 20 Apr 2018 19:39:47 +0000 (14:39 -0500)]
ovn-nbctl: show --bootstrap-ca-cert help text

The option exists but was not shown with --help.

Signed-off-by: Dan Williams <dcbw@redhat.com>
6 years agoofproto-dpif-upcall: Only call ovsrcu_postpone() on active actions
Eelco Chaudron [Thu, 19 Apr 2018 11:24:06 +0000 (13:24 +0200)]
ofproto-dpif-upcall: Only call ovsrcu_postpone() on active actions

Currently, ovsrcu_postpone() is called even with a NULL argument,
i.e. when there is no data to be freed. This is causing additional
overhead because work is scheduled for the urcu thread. This change
avoids adding the postpone callback if no work needs to be done.

This especially helps for the OVS-DPDK case where the PMD threads
might no longer have to do a write() due to the latch_set(), and thus
saving a syscall.

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agopython: Tighten the check if we need encoding
Jakub Sitnicki [Thu, 19 Apr 2018 09:33:21 +0000 (11:33 +0200)]
python: Tighten the check if we need encoding

Check if we are dealing with a Unicode string that needs
encoding for both Python 2 & 3.

Also, do the encoding the same way for Python 2 & 3 and avoid using
negation to make the code simpler.

Signed-off-by: Jakub Sitnicki <jkbs@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agorpm: depend on /bin/sed instead of /usr/bin/sed for compatibility
Isaac Freeman [Mon, 16 Apr 2018 21:12:54 +0000 (17:12 -0400)]
rpm: depend on /bin/sed instead of /usr/bin/sed for compatibility

The sed package in RHEL/CentOS 7 only provides /bin/sed and not
/usr/bin/sed, but later versions (including Fedora) provide both.

Signed-off-by: Isaac Freeman <memotype@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoxlate: Move tnl_neigh_snoop() to terminate_native_tunnel()
Zoltan Balogh [Wed, 4 Apr 2018 21:57:54 +0000 (23:57 +0200)]
xlate: Move tnl_neigh_snoop() to terminate_native_tunnel()

Currently OVS snoops any ARP or ND packets in any bridge and populates
the tunnel neighbor cache with the retreived data. For instance, when
an ARP reply originated by a tenant is received in an overlay bridge, the
ARP packet is snooped and tunnel neighbor cache is filled with tenant
address information. This is at best useless as tunnel endpoints can only
reside on an underlay bridge.

The real problem starts if different tenants on the overlay bridge have
overlapping IP addresses such that they keep overwriting each other's
pseudo tunnel neighbor entries. These frequent updates are treated as
configuration changes and trigger revalidation each time, thus causing
a lot of useless revalidation load on the system.

To keep the ARP neighbor cache clean, this patch moves tunnel neighbor
snooping from the generic function do_xlate_actions() to the specific
funtion terminate_native_tunnel() in compose_output_action(). Thus,
only ARP and Neighbor Advertisement packets addressing a local
tunnel endpoint (on the LOCAL port of the underlay bridge) are snooped.

In order to achieve this, IP addresses of the bridge ports are retrieved
and then stored in xbridge by calling xlate_xbridge_set(). The
destination address extracted from the ARP or Neighbor Advertisement
packet is then matched against the known xbridge addresses in
is_neighbor_reply_correct() to filter the snooped packets further.

Signed-off-by: Zoltan Balogh <zoltan.balogh.eth@gmail.com>
Co-authored-by: Jan Scheurich <jan.scheurich@ericsson.com>
Signed-off-by: Jan Scheurich <jan.scheurich@ericsson.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agotests: Inject ARP replies for snoop tests on different port
Zoltan Balogh [Wed, 4 Apr 2018 21:57:53 +0000 (23:57 +0200)]
tests: Inject ARP replies for snoop tests on different port

The ARP replies injected into the underlay bridge 'br0' to trigger
ARP snooping should be destined to the the bridges LOCAL port. So far
the tests injected them on LOCAL port 'br0' itself, which didn't matter
as OVS snooped on all ARP packets passing the bridge.

This patch injects the ARP replies on a different port in preparation for
an upcoming commit that will make OVS only snoop on ARP packets output
to the LOCAL port.

The clone() wrapper must be added to the generated datapath flows now as
the traced packets would actually be transmitted through the tunnel port.
Previously the underlay bridge dropped the packets as the learned egress
port for the tunnel nexthop was the LOCAL port, which also served as
virtual ingress port for the encapsulated traffic. The translation
end result was an expensive way to say 'drop'.

Signed-off-by: Zoltan Balogh <zoltan.balogh.eth@gmail.com>
Co-authored-by: Jan Scheurich <jan.scheurich@ericsson.com>
Signed-off-by: Jan Scheurich <jan.scheurich@ericsson.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoofproto-dpif-xlate: makes OVS native tunneling honor tunnel-specified source addresses
wenxu [Wed, 18 Apr 2018 03:03:47 +0000 (11:03 +0800)]
ofproto-dpif-xlate: makes OVS native tunneling honor tunnel-specified source addresses

It makes OVS native tunneling honor tunnel-specified source addresses,
in the same way that Linux kernel tunneling honors them.

This patch made valid tun_src specified by flow-action can be used for
tunnel_src of packet. add a "local" property for a route entry and enhance
the priority of local route higher than user route.
Like the kernel space when lookup the route, if there are tun_src specified
by flow-action or port options. Check the tun_src wheather is a local
address, then lookup the route.

Signed-off-by: wenxu <wenxu@ucloud.cn>
Signed-off-by: frank.zeng <frank.zeng@ucloud.cn>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agolacp: New command "lacp/show-stats" fordisplaying LACP counters.
Nitin Katiyar [Wed, 18 Apr 2018 18:27:43 +0000 (23:57 +0530)]
lacp: New command "lacp/show-stats" fordisplaying LACP counters.

Currently OVS does not provide any command to display stats for LACP
without which it is difficult to debug LACP issues. Here we propose
to display various statistics about LACP PDUs and slave state change.

Sample output:

ovs_lacp # ovs-appctl lacp/stats-show
---- bond-prv statistics ----

slave: dpdk0:
        RX PDUs: 128
        RX Bad PDUs: 0
        TX PDUs: 5
        Link Expired: 2
        Link Defaulted: 1
        Carrier Status Changed: 0

Signed-off-by: Nitin Katiyar <nitin.katiyar@ericsson.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agotutorial: skip passing .db for backup option for ovn_start_ovsdb_server:
aginwala [Thu, 12 Apr 2018 00:43:01 +0000 (17:43 -0700)]
tutorial: skip passing .db for backup option for ovn_start_ovsdb_server:

current params uses two sb1.db which is redundant:
e.g. ovsdb-server --remote=punix:sb1.ovsdb sb1.db sb1.db
expected:
e.g. ovsdb-server --remote=punix:sb1.ovsdb sb1.db

tested and works as expected:
ovn-sbctl --db=unix:/root/ovs/tutorial/sandbox/sb2.ovsdb show
Chassis "chassis-1"
    hostname: sandbox
    Encap geneve
        ip: "127.0.0.1"
        options: {csum="true"}

Signed-off-by: aginwala <aginwala@ebay.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agotests: Extend Python IDL checks to also run with SSL
Jakub Sitnicki [Wed, 18 Apr 2018 16:01:13 +0000 (18:01 +0200)]
tests: Extend Python IDL checks to also run with SSL

Extend the macro for running a Python IDL test against an OVSDB server
that uses SSL so that it can be used for regular IDL tests and for the
notify tests.

This makes it easy to generate additional Python IDL tests that run
using SSL, so do it.

As it turns out, newly added SSL tests unearth a pre-existing issue with
unicode encoding when SSL is used, which will be fixed in the following
patch.

Signed-off-by: Jakub Sitnicki <jkbs@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agopython: Fix a double encoding attempt on an Unicode string
Jakub Sitnicki [Wed, 18 Apr 2018 16:01:14 +0000 (18:01 +0200)]
python: Fix a double encoding attempt on an Unicode string

Encoding from 'unicode' to 'str' that has been added to the Stream class
in commit 2254074e3067 ("python: fix python3 encode/decode on Windows")
conflicts with SSLStream which already contains a quirk for pyopenssl
that does the same thing.

This results in a double encoding attempt when SSL is used and we crash
and burn due to:

Traceback (most recent call last):
  File "../.././test-ovsdb.py", line 874, in <module>
    main(sys.argv)
  File "../.././test-ovsdb.py", line 869, in main
    func(*args)
  File "../.././test-ovsdb.py", line 655, in do_idl
    idl_set(idl, command, step)
  File "../.././test-ovsdb.py", line 526, in idl_set
    status = txn.commit_block()
  File "/home/jkbs/src/ovs/python/ovs/db/idl.py", line 1405, in commit_block
    status = self.commit()
  File "/home/jkbs/src/ovs/python/ovs/db/idl.py", line 1388, in commit
    if not self.idl._session.send(msg):
  File "/home/jkbs/src/ovs/python/ovs/jsonrpc.py", line 540, in send
    return self.rpc.send(msg)
  File "/home/jkbs/src/ovs/python/ovs/jsonrpc.py", line 244, in send
    self.run()
  File "/home/jkbs/src/ovs/python/ovs/jsonrpc.py", line 203, in run
    retval = self.stream.send(self.output)
  File "/home/jkbs/src/ovs/python/ovs/stream.py", line 808, in send
    return super(SSLStream, self).send(buf)
  File "/home/jkbs/src/ovs/python/ovs/stream.py", line 391, in send
    buf = buf.encode('utf-8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 83: ordinal not in range(128)

Remove the quirk from SSLStream as the base class now does encoding.

Reported-by: Marcin Mirecki <mmirecki@redhat.com>
Signed-off-by: Jakub Sitnicki <jkbs@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agotests: Reuse OVSDB_CHECK_IDL_PYN macro for IDL notify tests
Jakub Sitnicki [Wed, 18 Apr 2018 16:01:12 +0000 (18:01 +0200)]
tests: Reuse OVSDB_CHECK_IDL_PYN macro for IDL notify tests

OVSDB_CHECK_IDL_NOTIFY_PYN macro is the same as OVSDB_CHECK_IDL_PYN
except it doesn't support PRE-IDL-TXN parameter. Reuse the more generic
OVSDB_CHECK_IDL_PYN macro.

Signed-off-by: Jakub Sitnicki <jkbs@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agotests: Remove useless run-if-fail commands passed to AT_CHECK
Jakub Sitnicki [Wed, 18 Apr 2018 16:01:11 +0000 (18:01 +0200)]
tests: Remove useless run-if-fail commands passed to AT_CHECK

Path to ovsdb-server's pidfile has changed long ago when
ovsdb_start_idltest() helper was introduced in commit 561205007e17
("tests: Get rid of overly specific --pidfile and --unixctl options.")
but the run-if-fail commands were left behind.

Besides, we don't need to kill the ovs-db-server from the AT_CHECK
anymore since ovsdb_start_idltest() registers an on_exit hook that will
do it.

Clean up any run-if-fail commands that attempt to kill ovsdb-server
using an invalid pidfile.

Signed-off-by: Jakub Sitnicki <jkbs@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agotests: Complain if key and certs not provided for SSL connection
Jakub Sitnicki [Wed, 18 Apr 2018 16:01:10 +0000 (18:01 +0200)]
tests: Complain if key and certs not provided for SSL connection

Add an argument check to test-ovsdb.py to ensure that the user has
provided the private key, the certificate, and the peer CA certificate
needed to set up an SSL connection.

Signed-off-by: Jakub Sitnicki <jkbs@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agonetdev: If MTU set fails, issue warn log.
Darrell Ball [Wed, 18 Apr 2018 17:52:58 +0000 (10:52 -0700)]
netdev: If MTU set fails, issue warn log.

Recently, an issue was debugged that was thought to be a bond
failover triggered issue.  It turned out to an vlan interface MTU set issue
that had nothing to do with bonding or most other likely possibilities.
Besides the effect of not setting the MTU to the desired value, this can
result in increased netlink traffic and processing with associated wasted
work. Let us flag a configuration issue at warn level (rather than dbg) to
catch the problem early.

Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agopython: Fix reporting that test-ovsdb.py command needs more args
Jakub Sitnicki [Wed, 18 Apr 2018 10:35:08 +0000 (12:35 +0200)]
python: Fix reporting that test-ovsdb.py command needs more args

In Python OVSDB tester, we are not unpacking a value from n_args tuple
that holds the accepted range of arguments. This causes an error:

  $ python tests/test-ovsdb.py idl tests/idltest.schema
  Traceback (most recent call last):
    File "./tests/test-ovsdb.py", line 869, in <module>
      main(sys.argv)
    File "./tests/test-ovsdb.py", line 852, in main
      n_args, len(args)))
  TypeError: %d format: a number is required, not tuple

Signed-off-by: Jakub Sitnicki <jkbs@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
6 years agocheckpatch: add checks for new rst docs
Flavio Leitner [Tue, 17 Apr 2018 21:46:24 +0000 (18:46 -0300)]
checkpatch: add checks for new rst docs

When a new rst document is added under Documentation, check if the
new file is added to the proper index.rst and to the automake.mk.

Signed-off-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoAdd multi-column index support for the Python IDL
Terry Wilson [Fri, 13 Apr 2018 00:24:27 +0000 (19:24 -0500)]
Add multi-column index support for the Python IDL

This adds multi-column index support for the Python IDL that is
similar to the feature in the C IDL. Since it adds sortedcontainers
as a dependency and some distros don't yet package it, the library
is copied in-tree and used if sortedcontainers is not installed.

Signed-off-by: Terry Wilson <twilson@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agorhel: Fix literal dollar sign usage in systemd service files
Timothy Redaelli [Mon, 16 Apr 2018 15:15:47 +0000 (17:15 +0200)]
rhel: Fix literal dollar sign usage in systemd service files

Currently (at least on RHEL 7.5) openvswitch fails to start (with DPDK
enabled) as non-root, since chown fails and "/dev/hugepages" group is not
changed.

Commit tested on Fedora 28 and RHEL 7.5, both as root as non-root user.

From man 5 systemd.service:

  To pass a literal dollar sign, use "$$". Variables whose value is not known
  at expansion time are treated as empty strings. Note that the first argument
  (i.e. the program to execute) may not be a variable.

CC: Aaron Conole <aconole@redhat.com>
Fixes: 4299145c1095 ("rhel: don't drop capabilities when running as root")
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
6 years agonetdev: Fix typos in comment.
Ben Pfaff [Tue, 17 Apr 2018 15:33:41 +0000 (08:33 -0700)]
netdev: Fix typos in comment.

Fixes: ee4776b8bce1 ("netdev: New function netdev_get_ip_by_name().")
Suggested-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agosocket-util: Improve comments on (host,port) parsing functions.
Ben Pfaff [Tue, 17 Apr 2018 15:30:13 +0000 (08:30 -0700)]
socket-util: Improve comments on (host,port) parsing functions.

Fixes: 0b043300dbad ("Make <host>:<port> parsing uniform treewide.")
Suggested-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agotests: Added NSH related unit test cases for datapath
Ashish Varma [Thu, 29 Mar 2018 23:46:09 +0000 (16:46 -0700)]
tests: Added NSH related unit test cases for datapath

Added test cases for encap, decap, replace and forwarding of NSH packets.
Also added a python script 'sendpkt.py' to send hex ethernet frames.

Signed-off-by: Ashish Varma <ashishvarma.ovs@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Tested-by: Greg Rose <gvrose8192@gmail.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
6 years agoovn-nbctl: Use common code for sockaddr_storage.
Ben Pfaff [Fri, 13 Apr 2018 17:14:40 +0000 (10:14 -0700)]
ovn-nbctl: Use common code for sockaddr_storage.

This better reuses existing code.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
6 years agoovn-nbctl: Simplify lb_info_add_smap().
Ben Pfaff [Wed, 11 Apr 2018 18:36:50 +0000 (11:36 -0700)]
ovn-nbctl: Simplify lb_info_add_smap().

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
6 years agoofproto-dpif-slow: Add IPv6 agent address support.
Ben Pfaff [Fri, 13 Apr 2018 17:04:26 +0000 (10:04 -0700)]
ofproto-dpif-slow: Add IPv6 agent address support.

Suggested-by: Neil McKee <neil.mckee@inmon.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>