2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-29 13:27:59 +00:00

17132 Commits

Author SHA1 Message Date
Ben Pfaff
8c3b84fb39 AUTHORS: Add Martin Fong.
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-12 10:02:21 -08:00
Martin Fong
0475db71c6 ovs-tcpdump: Add --span to mirror all ports on bridge.
Signed-off-by: Martin Fong <mwfong@csl.sri.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-12 09:59:57 -08:00
Tony van der Peet
2220548113 ofproto: Return correct error codes from meter_set.
This routine should return enum ofperr, but in a couple of places
doesn't. When adding one more meter when the meter table is full,
this results in an incorrect error message.

Signed-off-by: Tony van der Peet <tony.vanderpeet@alliedtelesis.co.nz>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-12 08:45:52 -08:00
Eelco Chaudron
cd5b89a5a9 utilities: Add smap related command and iterator to the GDB script
Adds "ovs_dump_smap <struct smap *>" command

Example output:

Breakpoint 1, trtcm_policer_qos_construct (details=0x135bad0, conf=0x7ffd31f5da28) at lib/netdev-dpdk.c:4154
(gdb) ovs_dump_smap 0x135bad0
cbs: 2048
cir: 151800
eir: 151800
pbs: 2048

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-12 08:40:55 -08:00
Ilya Maximets
b1331295ea cirrus: Add Cirrus CI integration for FreeBSD build
CirrusCI [1] is free for open-sorce projects and provides similar
to TravisCI interfaces. One significant difference is ability
to run tasks on FreeBSD instances.

This patch adds simple configuration file to test OVS build
on two FreeBSD releases with gcc and clang.
Unit tests are commented out because they are broken for now.

To enable the automated checks Cirrus CI application from GitHub
Marketplace should be installed. See details in Quick Start guide [2].

[1] https://cirrus-ci.org
[2] https://cirrus-ci.org/guide/quick-start/

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-11 13:52:22 -08:00
Ilya Maximets
1270b6e52c treewide: Wider use of packet batch APIs.
This patch replaces most of direct accesses to the dp_packet_batch
internal components by appropriate APIs.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
2018-12-11 20:18:26 +00:00
Ben Pfaff
f916262832 tests: Fix syntax in another ODP test.
Reported-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-11 08:39:55 -08:00
Ben Pfaff
d8c6955a03 tests: Simplify and improve the daemon tests.
The daemon tests used files a lot when shell variables were easier to use
and easier to understand.  This commit changes that.

The tests created empty databases that aren't really needed anymore.  This
commit changes them to use the ovsdb-server --no-db option instead.

The tests had a lot of common code for checking the ancestry of processes.
This commit factors out a new shell function check_ancestors.

The tests tended to use random pidfile names.  This switches to just using
the defaults, which are fine.

The tests didn't check the names of the child processes.  This adds those
checks using the new check_process_name shell function.  This should avoid
regression of the bug fixed by commit 266f79e32c60 ("daemon-unix: Use
same name for original or restarted children.")

Other minor improvements too.

I only made small updates to the Windows-specific test, because it is hard
for me to verify.

Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-11 08:35:41 -08:00
Darrell Ball
01dcd687c2 dpctl: Simplify opt_dpif_open().
The commonly used function, opt_dpif_open(), recently became more complex
to check for a datapath argument. Unnecessary dummy parameters for most users
were hence added.  Revert back and call the intended api, dp_arg_exists(), to
query for a datapath argument being supplied.

Fixes: 4eeec031d4c4 ("dpctl: Implement dpctl commands for conntrack per zone limit")
Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-11 08:27:47 -08:00
Ben Pfaff
b97da084d9 AUTHORS: Add David Marchand and Scott Cheloha.
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-10 13:04:20 -08:00
David Marchand
741fd33efe ovs-ctl: fix system-id.conf owner
As far as RPMs are concerned, system-id.conf file is declared as being
owned by openvswitch.
At the first ovs startup, ovs-ctl creates this file if none exists without
ensuring this.

We end up with an inconsistency:
$ rpm -V openvswitch
.....UG..  c /etc/openvswitch/system-id.conf

Fix this when ovs-ctl is the one who creates the file.

Note: this issue ends up being hidden after a RPM upgrade, since the
openvswitch user is enforced on the whole /etc/openvswitch directory as a
%post operation.

Acked-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-10 13:02:55 -08:00
Timothy Redaelli
71e8afbdfd rhel: Don't ship static libraries
Since commit bc4fd439586f ("rhel: Ship ovs shared libraries, fedora")
openvswitch-devel RPM package includes both static and shared library.
This is against the Fedora Packaging Guidelines [1].

This commit prevent the static libraries and libtool archives to be shipped.

[1] https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Static_Libraries

Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-10 12:39:07 -08:00
Ilya Maximets
5f361a2a32 ovs-thread: Add thread safety annotation to cond_wait.
This fixes build with clang on FreeBSD:

  lib/ovs-thread.c:266:13: error:

  calling function 'pthread_cond_wait' requires holding mutex \
  'mutex->lock' exclusively [-Werror,-Wthread-safety-analysis]

      error = pthread_cond_wait(cond, &mutex->lock);
              ^

Fixes: 97be153858b4 ("clang: Add annotations for thread safety check.")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-10 09:52:55 -08:00
Ilya Maximets
6fe27a7103 ovs-thread: Drop xpthread_meutex_{un}lock finctions.
There are no users of these functions.
This change fixes clang build on FreeBSD:

  lib/ovs-thread.c:158:1: error: \
      mutex 'mutex' is still held at the end of function \
      [-Werror,-Wthread-safety-analysis]
  XPTHREAD_FUNC1(pthread_mutex_lock, pthread_mutex_t *);
  ^
  lib/ovs-thread.c:138:5: note: expanded from macro 'XPTHREAD_FUNC1'
      }
      ^

Fixes: 4dff0893c376 ("ovs-atomic-pthreads: Use global shared locks for atomic_flag also.")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-10 09:51:46 -08:00
Ilya Maximets
f9993a82b9 tests: Remove redzone flag for FreeBSD 12+.
'redzone' not supported in new versions of jemalloc
(since jemalloc 5.0.0).

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-10 09:51:03 -08:00
Ilya Maximets
28c47facb5 configure.ac: More enhanced check for pthread library.
FreeBSD 12 supports 'pthread_rwlock_tryrdlock' without 'pthread'
library. Let's add check for more rare function.
OTOH, Travis-CI environment supports 'pthread_rwlockattr_destroy',
but does not support 'pthread_rwlock_tryrdlock' without 'pthread'.
So, both checks needed.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-10 09:49:59 -08:00
Scott Cheloha
23cfec1cde tests: keep some datapath parsing tests from hanging
The arguments to sed(1) need to be on the same line in the shell
script or it will just sit there awaiting input.

Signed-off-by: Scott Cheloha <scottcheloha@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-10 09:24:07 -08:00
Ben Pfaff
40fc4d8c8e AUTHORS: Add Yousong Zhou.
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-03 18:15:43 -08:00
Yousong Zhou
dd091e163e ovs-ctl: fallback to "uname -n" for fetching hostname
The command "hostname" is not available in OpenWrt by default.  Strace
result of hostname-3.13 on centos7 shows that bare "hostname" command
calls uname() to fetch node name.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-03 18:14:45 -08:00
Yifeng Sun
4d1ca7035d ofctl_parse_target: Fix memory leaks if there is no usable protocol
When there is no usable protocol, ofctl_parse_flows__ returns without
properly freeing memory. A previous patch failed to fix this issue.
This patch fixes it.

Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11406
Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11408
Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-03 13:56:12 -08:00
Yifeng Sun
1a47405b65 odp-util: Validate values of vid and pcp in push_vlan action
Oss-fuzz complains that 'vid << VLAN_VID_SHIFT' is causing an error of
"Undefined-shift in parse_odp_action". This is because an invalid
value of vid is passed in push_vlan. This patch adds validation to
the value of vid, in addition to the value of pcp.

Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11520
Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-03 13:54:27 -08:00
Nobuhiro MIKI
2df300c5c8 ovs-ofctl: update a man page about group syntax
Signed-off-by: Nobuhiro MIKI <nob@bobuhiro11.net>
2018-12-03 13:43:28 -08:00
Numan Siddique
662d0b3a2b ovn-sb.xml: Remove outdated paragragh which is not true any more.
Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-03 13:42:11 -08:00
Ashish Varma
9fe2e90fd4 Documentation: Fixing some minor spelling mistakes and consistent usage of certain keywords.
Signed-off-by: Ashish Varma <ashishvarma.ovs@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-03 13:41:19 -08:00
Ashish Varma
640c2f0da0 ovs-ofctl: Correct "out_group" field usage text in manpage.
Right now the man page of ovs-ofctl has "out_group=port". Correcting the
output to group instead of port.

Signed-off-by: Ashish Varma <ashishvarma.ovs@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-03 13:20:32 -08:00
Yousong Zhou
16d22e231f datapath: use KARCH when building linux datapath modules
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-03 13:14:36 -08:00
Yousong Zhou
5c92852807 ovs-save: compatible with busybox ip command
Busybox ip command will have exit code 1 for `ip -V` or `ip help` etc.,
use `ip link show` to cover both iproute2 and busybox ip command

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-03 13:11:47 -08:00
Ben Pfaff
81863a33ba debian: Install correct vtep-ctl.
The previous syntax installed the libtool wrapper script instead of the
actual binary.  This fixes the problem.

CC: James Page <james.page@ubuntu.com>
Fixes: 3d8dededeaf8 ("debian: Rationalize packaging using new debhelper.")
Reported-by: hubo <hubo@jiedaibao.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2018-October/047625.html
Acked-by: Justin Pettit <jpettit@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-03 12:59:29 -08:00
Ben Pfaff
3b3bad07f7 osvdb: Add some helpful comments.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
2018-12-03 12:57:48 -08:00
Ben Pfaff
c332ed151a ofp-table: Parse table features messages more carefully.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
2018-12-03 12:50:05 -08:00
Ben Pfaff
5f223e9232 tests: Add support for Address Sanitizer.
This makes the tests all pass cleanly when Address Sanitizer is enabled.

Acked-by: Mark Michelson <mmichels@redhat.com>
Acked-by: Justin Pettit <jpettit@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-12-03 12:46:57 -08:00
Ben Pfaff
21b522169a unixctl: Avoid 100% CPU for slowly processed requests with another queued.
If another request came in on a particular connection while the previous
request was still being processed, unixctl_server_wait() would wake up the
main loop but unixctl_server_run() wouldn't read the request, resulting in
100% CPU use.

I doubt whether this is a real problem because it's unusual for a client
to attempt to make requests in parallel.  I found it while pursuing a 100%
CPU issue but it turned out not to be a bug (the 100% CPU was caused by
a client making requests as fast as possible).

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
2018-12-03 12:31:33 -08:00
Tiago Lam
a32bab26e5 netdev-dpdk: Add mbuf HEADROOM after alignment.
Commit dfaf00e started using the result of dpdk_buf_size() to calculate
the available size on each mbuf, as opposed to using the previous
MBUF_SIZE macro. However, this was calculating the mbuf size by adding
up the MTU with RTE_PKTMBUF_HEADROOM and only then aligning to
NETDEV_DPDK_MBUF_ALIGN. Instead, the accounting for the
RTE_PKTMBUF_HEADROOM should only happen after alignment, as per below.

Before alignment:
ROUNDUP(MTU(1500) + RTE_PKTMBUF_HEADROOM(128), 1024) = 2048

After aligment:
ROUNDUP(MTU(1500), 1024) + 128 = 2176

This might seem insignificant, however, it might have performance
implications in DPDK, where each mbuf is expected to have 2k +
RTE_PKTMBUF_HEADROOM of available space. This is because not only some
NICs have course grained alignments of 1k, they will also take
RTE_PKTMBUF_HEADROOM bytes from the overall available space in an mbuf
when setting up their Rx requirements. Thus, only the "After alignment"
case above would guarantee a 2k of available room, as the "Before
alignment" would report only 1920B.

Some extra information can be found at:
https://mails.dpdk.org/archives/dev/2018-November/119219.html

Note: This has been found by Ian Stokes while going through some
af_packet checks.

Reported-by: Ian Stokes <ian.stokes@intel.com>
Fixes: dfaf00e ("netdev-dpdk: fix mbuf sizing")
Signed-off-by: Tiago Lam <tiago.lam@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
2018-11-28 15:30:03 +00:00
Numan Siddique
85706c34d5 ovn: Avoid tunneling for VLAN packets redirected to a gateway chassis
An OVN deployment can have multiple logical switches each with a
localnet port connected to a distributed logical router in which one
logical switch may provide external connectivity and the rest of
the localnet logical switches use VLAN tagging in the physical
network.

As reported in [1], external traffic from these localnet VLAN tagged
logical switches are tunnelled to the gateway chassis (chassis hosting
a distributed gateway port which applies NAT rules). As part of the
discussion in [1], there are few possible solutions proposed by
Russell [2]. This patch implements the first option in [2].

With this patch, a new option 'reside-on-redirect-chassis' in 'options'
column of Logical_Router_Port table is added. If the value of this
option is set to 'true' and if the logical router also have a
distributed gateway port, then routing for this logical router port
is centralized in the chassis hosting the distributed gateway port.

If a logical switch 'sw0' is connected to a router 'lr0' with the
router port - 'lr0-sw0' with the address - "00:00:00:00:af:12 192.168.1.1"
, and it has a distributed logical port - 'lr0-public', then the
below logical flow is added in the logical switch pipeline
of 'sw0' if the 'reside-on-redirect-chassis' option is set on 'lr-sw0' -

table=16(ls_in_l2_lkup), priority=50,
match=(eth.dst == 00:00:00:00:af:12 && is_chassis_resident("cr-lr0-public")),
action=(outport = "sw0-lr0"; output;)

"cr-lr0-public" is an internal port binding created by ovn-northd of type
'chassisredirect' for lr0-public in SB DB. Please see "man ovn-sb" for more details.

With the above flow, the packet doesn't enter the router pipeline in
the source chassis. Instead the packet is sent out via the localnet
port of 'sw0'. The gateway chassis upon receiving this packet, runs
the logical router pipeline applying NAT rules and sends the traffic
out via the localnet port of the logical switch providing external connectivity.
The gateway chassis will also reply to the ARP requests for the router port IPs.

With this approach, we avoid redirecting the external traffic to the
gateway chassis via the tunnel port. There are a couple of drawbacks
with this approach:

  - East - West routing is no more distributed for the VLAN tagged
    localnet logical switches if 'reside-on-redirect-chassis' option is defined

  - 'dnat_and_snat' NAT rules with 'logical_mac' and 'logical_port'
    columns defined will not work for these logical switches.

This approach is taken for now as it is simple. If there is a requirement
to support distributed routing for these VLAN tenant networks, we
can explore other possible solutions.

[1] -  https://mail.openvswitch.org/pipermail/ovs-discuss/2018-April/046543.html
[2] - https://mail.openvswitch.org/pipermail/ovs-discuss/2018-April/046557.html

Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2018-April/046543.html
Reported-by: venkata anil <vkommadi@redhat.com>
Co-authored-by: venkata anil <vkommadi@redhat.com>
Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: venkata anil <vkommadi@redhat.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
2018-11-26 00:14:17 -08:00
Ben Pfaff
7ab4b06537 configure: Check for more specific function to pull in pthread library.
On my laptop, pthread_create() is always available without -lpthread, but
when I use -fsanitize=address, -lpthread is required to pull in other
threading functions such as pthread_rwlock_tryrdlock().  Thus, with
-fsanitize=address I have to manually add -lpthread to link commands one
way or another.  This commit avoids that problem by checking for a
function that is sometimes only available in -lpthread.

Tested-by: Yifeng Sun <pkusunyifeng@gmail.com>
Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-11-19 12:28:38 -08:00
Ben Pfaff
024d93f62c ofp-actions: Make all actions a multiple of OFPACT_ALIGNTO bytes.
The functions to put ofpacts into ofpbufs have always padded them to
OFPACT_ALIGNTO boundaries, but the underlying structures weren't
necessarily padded out.  That led to difficulties in a few places where
structures were allocated on the stack instead in an ofpbuf, because
functions like ofpact_init_*() would access beyond the end of the actual
structure.  This is true, for example, in test_multipath_main() in
tests/test-multipath.c, which allocates a struct ofpact_multipath on the
stack, and in lswitch_handshake() in learning-switch.c, which allocates
a struct ofpact_output on the stack.

It's possible to fix these individual cases, but it's possible that there
are others that haven't been identified.  This commit addresses the issue
another way, by padding all of the ofpact structures to a full multiple
of OFPACT_ALIGNTO and adding assertions to ensure that it can't be screwed
up in the future.

This commit removes the OFPACT_*_SIZE enums, because they are now
equivalent to sizeof(struct ofpact_*) in every case.

Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-11-19 08:47:55 -08:00
Ben Pfaff
9a403b0760 tests: Always use --no-chdir with --detach.
With --detach but not --no-chdir, core files and Address Sanitizer logs
don't go into the testsuite directory but end up dropped because it tries
to write them in the root directory.

Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-11-19 08:47:53 -08:00
Ben Pfaff
4123c2123a packets: Fix use-after-free error in packet_put_ra_prefix_opt().
dp_packet_put_uninit() can reallocate the data buffer, so find the L4
header pointer afterward instead of before.

Found by Address Sanitizer.

Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-11-19 08:47:51 -08:00
Ben Pfaff
17bd414951 raft: Fix notifications when a server leaves the cluster.
When server A sends the leader a request to remove server B from the
cluster, where A != B, the leader sends both A and B a notification when
the removal is complete.  Until now, however, the notification (which is a
raft_remove_server_reply message) did not say which server had been
removed, and the receiver did not check.  Instead, the receiver assumed
that it had been removed.  The result was that B was removed and A stopped
serving out the database even though it was still part of the cluster,
This commit fixes the problem.

Reported-by: ramteja tadishetti <ramtejatadishetti@gmail.com>
Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-11-19 08:47:49 -08:00
Ben Pfaff
e8208c6617 raft: Avoid null dereference in raft_update_our_match_index().
When the server is leaving the cluster but remains leader, the
raft_find_server() call can return NULL.  Previously this caused a null
dereference.  This commit fixes the problem.

Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-11-19 08:47:46 -08:00
Ben Pfaff
8b37ed759c raft: Avoid use-after-free error in raft_update_commit_index().
raft_update_commit_index() iterates over a sequence of entries that may
have up to two components: a set of servers and a piece of data.  When
a set of servers is present, it calls raft_run_reconfigure(), which can
call through the following chain of functions in some cases:

   raft_log_reconfiguration()
   raft_command_execute__()
   raft_command_initiate()
   raft_write_entry()
   raft_add_entry()

and raft_add_entry() can reallocate raft->entries, which turns the pointer
'e' that raft_update_commit_index() has to the current entry into a wild
pointer.

This commit fixes the problem.

Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-11-19 08:47:43 -08:00
Ben Pfaff
02acb41a48 raft: Improve logging for sent RPCs.
For debugging, it is useful to know the source code line that sent a
given RPC message.

Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-11-19 08:47:42 -08:00
Ben Pfaff
e83ea0d652 ovsdb-idl: Treat "unknown database" error as reason to reconnect.
Ordinarily the IDL finds out in advance whether a particular database is
on its server, or it finds out via notifications.  But it's also a good
idea to adopt a belt-and-suspenders approach so that, if the IDL does
receive an "unknown database" error, we treat it as a "soft" error that
can be fixed by reconnecting to another server, rather than a "hard" error
that should cause an immediate abort.

Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-11-19 08:47:36 -08:00
Ben Pfaff
f50714bf9a ovsdb-idl: Avoid sending transactions when the DB is not synced up.
Until now the code here would happily try to send transactions to the
database server even if the database connection was not in the correct
state.  In some cases this could lead to strange behavior, such as sending
a database transaction for a database that the IDL had just learned did not
exist on the server.

Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-11-19 08:47:22 -08:00
Ben Pfaff
9a609f6354 pcap-file: Correctly format enum type.
The underlying type for an enum is somewhat unpredictable in that the
compiler and the ABI influence it.  The format specifier I used here was
apparently correct for i386 on Linux but wrong for x86-64.  It's better to
just use a cast.

Fixes: 597177a283da ("pcap-file: Add support for Linux SLL formatted PCAP files.")
Reported-by: Simon Horman <simon.horman@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-11-16 10:55:20 -08:00
Alin Gabriel Serdean
d240e46aca Windows: Fix broken kernel userspace communication
Patch: 69c51582ff
broke Windows userpace - kernel communication.

On windows we create netlink sockets when the handlers are initiated and
reuse them.
This patch remaps the usage of the netlink socket pool.

Fixes:
https://github.com/openvswitch/ovs-issues/issues/164

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Shashank Ram <rams@vmware.com>
Tested-by: Shashank Ram <rams@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Co-authored-by: Ben Pfaff <blp@ovn.org>
2018-11-16 18:06:12 +02:00
Ilya Maximets
b24f1e49b5 coding-style: Few visual enhancements for the document.
Some keywords and numbers highlighted. Added few spaces to
the examples.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-11-16 07:21:50 -08:00
Ben Pfaff
7f8d02a9ab pcap: Fix reading regular old Ethernet pcap files.
This broke the unit tests.

Fixes: 597177a283da ("pcap-file: Add support for Linux SLL formatted PCAP files.")
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
Tested-by: Alin Gabriel Serdean <aserdean@ovn.org>
Reported-by: Alin Gabriel Serdean <aserdean@ovn.org>
Tested-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-11-16 06:07:36 -08:00
Ben Pfaff
713a45dbd5 dpif-netlink: Fix error behavior in dpif_netlink_port_add__().
Until now, the code here would report an error to its caller as success.
This fixes the problem.

Found by inspection.

Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-11-15 09:36:20 -08:00
Yifeng Sun
33a3ee6b39 odp-util: Add checking to prevent buffer overflow when parsing push_nsh
Previously, the buffer size of 'struct ofpbuf b' is less than the
size of 'char buf[512]', this could cause memory overflow of ofpbuf
when calling ofpbuf_put_hex. This patch fixes it.

Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10865
Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-11-15 08:27:13 -08:00