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

10798 Commits

Author SHA1 Message Date
Andy Zhou
a35da174c8 db-ctl-base: remove ctl_get_all_commands() function
all_commands currently is some times accessed directly, some times via
a function call. Change to always access it directly.

Signed-off-by: Andy Zhou <azhou@nicira.com>
2015-07-17 12:42:23 -07:00
Andy Zhou
21a93e08a5 db-ctl-base: remove db_ctl_show_command table
It is not clear why "show" command needs its own command table.
Remove it for simplicity.

Signed-off-by: Andy Zhou <azhou@nicira.com>
2015-07-17 12:42:23 -07:00
Andy Zhou
bc487aeff2 ovsdb: Add per transaction commit instruction counter
Measure user space only instruction counters for commit each
transaction. This measurement is mainly useful for
tuning OVSDB internal implementation, such as how OVSDB scales over
number of client connections.

A simple usage example:

ovs-appctl -t ovsdb-server ovsdb-server/perf-counters-clear
ovs-vsctl add-port br0 p3
ovs-appctl -t ovsdb-server ovsdb-server/perf-counters-show
ovsdb_txn_commit            2      906922 453461.0

The commands above show that the 'add-port br p3' command caused ovsdb
to execute 2 transactions. Each transaction takes 453461 instructions,
total 906922 instructions. The number will vary based on number of
ovsdb clients connected.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-17 12:24:22 -07:00
Andy Zhou
73ec82bf5a perf-counter: simplify the performance macro
Replace the original PERF_FUNCTION_BEGIN and PERF_FUNCTION_END
pair with a single PERF macro. This design is also more flexible,
removing the restriction of have only one measurement per function.

The next patch will make use of this macro.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-17 12:24:22 -07:00
Andy Zhou
cd747abb60 perf-counter: initialize perf counter shash before use
Private variable perf_counters needs to be initialized before
use. Otherwise,  perf_counter_init() call will cause crashes.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-17 12:24:22 -07:00
Joe Stringer
8b34ccdadf ovn: Fix extra token detection.
This code attempts to first check whether another error was detected for
the string it is parsing, then if it's not at the end of the tokens,
report an error. However, 'errorp' is always a valid pointer to a
'char *', so the first check in this statement always evaluates false.

Furthermore, this undefined behaviour may be optimised out by modern
compilers due to the prior dereference in expr_parse(). Fix this to
check the actual value of *errorp. Also add a test to check this case.

Found by MIT STACK undefined behaviour checker.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-17 10:25:21 -07:00
Joe Stringer
2bb0bea827 ovs-vsctl: Remove redundant checks.
In several places, "br" is dereferenced just before a check such as
"if (br ...)". These checks may be optimised out, and they provide no
additional safety, so this patch removes them.

Found by MIT STACK undefined behaviour checker.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-17 10:24:46 -07:00
Joe Stringer
e8eba0ab28 vtep-ctl: Remove extraneous NULL pointer check.
OVS will exit if the allocations in this function fail, so this check is
pointless.

Found by MIT STACK undefined behaviour checker.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-17 10:24:41 -07:00
Joe Stringer
a805558c40 ofp-parse: Fix typo in consistency check.
This check in parse_ofp_str__() attempted to detect inconsistencies
between matches and actions, or inconsistencies within the actions. In
this case, ofpacts_check() would effectively zero the "usable_protocols"
and return 0 (ie, OK). However, when checking the return parameter, it
checks the pointer rather than the value.

In practice, this seems to only come up for fields which are used
internally in OVS and not exposed for matching from the controller, like
tunnel flags or skb_priority.

Found by MIT STACK undefined behaviour checker.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-17 10:24:36 -07:00
Jarno Rajahalme
09b0fa9c55 flow: Make compile with MSVC.
MSVC does not like zero sized arrays in structs.  Hence, remove the
'values' member from struct miniflow and add back the getters
miniflow_values() and miniflow_get_values().

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-16 17:42:24 -07:00
Russell Bryant
2cd87fce12 ovn: Convert tabs to spaces in ovn-sb.xml.
This file used mixed indentation.  Fix it up to be consistent.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-16 16:51:48 -07:00
Daniele Di Proietto
10d01ad215 acinclude: Require libfuse only for DPDK with vhost-cuse.
DPDK with vhost-user doesn't require libfuse, so we shouldn't link OVS
with libfuse unless DPDK is built with vhost-cuse support.

CC: Rapelly, Varun <vrapelly@sonusnet.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
2015-07-16 13:34:18 -07:00
Huanle Han
0fc1f5c04c ovs-appctl: register unixctl commands in the beginning
Some commands of ovs-appctl were lazily registered when first
bridg or bfd was added. Before that, calling these commands raised a
error("xxx is not a valid command"). The problem commangs included
"bfd/...", "upcall/...","dpif/...","fdb/..." and so on.

Fix this by moving the register into the "bridge_init" and
"bridge_init_ofproto". All commands are registered at the moment
ovs-vswitchd starts.

Signed-off-by: Huanle Han <hanxueluo@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-16 11:50:25 -07:00
Sorin Vinturis
3f11b876be datapath-windows: Fixed spelling errors in OVS
Solved some spelling errors observed in the datapath code.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-16 11:41:50 -07:00
Ben Pfaff
a6c06d92b6 ovn-nb: Add per-port IP addresses to routers.
A router needs one IP address per port, not just one for the whole router.

Reported-by: Gal Sagie <gal.sagie@gmail.com>
Reported-at: http://openvswitch.org/pipermail/dev/2015-July/057242.html
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-16 11:10:53 -07:00
Thadeu Lima de Souza Cascardo
bb13fe5ee9 netdev-linux: do not warn when getting stats for netdev with no vport
When there is no vport for a given netdev, dpif_netlink_vport_get might return
ENODEV. Do not warn a failure to get port stats when that's the case.

This happens when the userspace switch is used.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-16 10:58:13 -07:00
Jesse Gross
b666962be3 tunneling: Allow matching and setting tunnel 'OAM' flag.
Several encapsulation formats have the concept of an 'OAM' bit
which typically is used with networking tracing tools to
distinguish test packets from real traffic. OVS already internally
has support for this, however, it doesn't do anything with it
and it also isn't exposed for controllers to use. This enables
support through OpenFlow.

There are several other tunnel flags which are consumed internally
by OVS. It's not clear that it makes sense to use them externally
so this does not expose those flags - although it should be easy
to do so if necessary in the future.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-15 20:33:41 -07:00
Jesse Gross
8e4c1621e9 flow: Factor out flag parsing and formatting routines.
There are several implementations of functions that parse/format
flags and their binary representation. This factors them out into
common routines. In addition to reducing code, it also makes things
more consistent across different parts of OVS.

Signed-off-by: Jesse Gross <jesse@nicira.com>
2015-07-15 20:24:04 -07:00
Alex Wang
cadf7ec937 ofproto-macros.at: Make check_logs() check all *.log files.
As we have more daemons with OVN that can be tested using ovs autotest
framework, it is convenient to extend check_logs() to check all *.log
files, except testsuite.log.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-15 17:35:15 -07:00
Jarno Rajahalme
a851eb9492 flow: Eliminate miniflow_clone() and minimask_clone().
miniflow_clone() and minimask_clone() are no longer used, remove them
from the API.

Now that miniflow data is always inlined, it makes sense to rename
miniflow_clone_inline() miniflow_clone().

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-15 13:17:10 -07:00
Jarno Rajahalme
ceb3bd6731 match: Single malloc minimatch.
Allocate the miniflow and minimask in struct minimatch at once, so
that they are consecutive in memory.  This halves the number of
allocations, and allows smaller minimatches to share the same cache
line.

After this a minimatch has one heap allocation for all it's data.
Previously it had either none (when data was small enough to fit in
struct miniflow's inline buffer), or two (when the inline buffer was
insufficient).  Hopefully always having one performs almost the same
as none or two, in average.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-15 13:17:10 -07:00
Jarno Rajahalme
8fd4792403 flow: Always inline miniflows.
Now that performance critical code already inlines miniflows and
minimasks, we can simplify struct miniflow by always dynamically
allocating miniflows and minimasks to the correct size.  This changes
the struct minimatch to always contain pointers to its miniflow and
minimask.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-15 13:17:10 -07:00
Jarno Rajahalme
1aaf0ada55 meta-flow: Add a missing break statement.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2015-07-15 13:17:10 -07:00
Ben Pfaff
a4fc3c17d5 datapath-windows: Fix broken break by distributing resource.h.
Commit e19a0c6 (datapath-windows: update extension information) added
resource.h but did not distribute it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-15 11:27:28 -07:00
Alin Gabriel Serdean
e19a0c6f04 datapath-windows: update extension information
This patch sets additional information about the driver used by various
applications.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-15 10:45:31 -07:00
Alin Serdean
55d398e979 datapath-windows: Update VXLAN header information
Use tunnel key information on the IP header preceding the VXLAN header.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-15 10:41:46 -07:00
Sorin Vinturis
f18390b7fc datapath-windows: Solved BSOD when cleaning up the VXLAN tunnel
When removing vport also remove the vxlan tunnel port.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/94
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-15 08:53:32 -07:00
Justin Pettit
210045a4b4 ovn: Minor cleanups in "physical" component comments.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Gal Sagie <gal.sagie@gmail.com>
2015-07-15 00:40:39 -07:00
Justin Pettit
421e818cd4 ovs-ofctl.8: Specify correct variable in "snoop" description.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-15 00:03:04 -07:00
Kyle Upton
5b3c194faa lib/automake.mk: Fix dependency typos.
Fix dependency issues with lib/ofp-errors.lo and lib/ofp-msgs.lo that
caused problems when building debian packages.

Signed-off-by: Kyle Upton <kupton@baymicrosystems.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-14 22:41:13 -07:00
Gal Sagie
de8fe480d2 ovn-nb: Add 'name' field to Logical Router
Adding a name identifier will increase convinence
for Openstack (or Other CMS) that want to identify
the logical router (or store the CMS id in the router name)

Signed-off-by: Gal Sagie <gal.sagie@gmail.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-14 14:26:37 -07:00
Ben Pfaff
af6d538d06 Revert "ofctrl: Don't use designated initializers."
This reverts commit 0b090f2263807e25be14f90a287c4bfdee2d82ec.  When that
commit was applied, we did not know of a fix for the MSVC bug that it
avoided, but now we know that sufficiently new MSVC 2013 supports this
feature.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Gurucharan Shetty <gshetty@nicira.com>
2015-07-14 14:23:01 -07:00
Ben Pfaff
4819b3a518 tests: Skip IPv6 tests if the system does not support IPv6.
This is only for the tests that actually create IPv6 sockets.  The tests
that merely use IPv6 addresses in flow entries, etc., do not depend on
kernel support.

Reported-by: 俊 赵 <zhaojun12@outlook.com>
Reported-at: http://openvswitch.org/pipermail/discuss/2015-July/018173.html
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
2015-07-13 11:22:24 -07:00
James Page
3d8dededea debian: Rationalize packaging using new debhelper.
Newer debhelper versions support overrides, making rules files simpler and
easier to extend.

Requires some changes in how files are installed (_debian build folder
dropped).

Signed-off-by: James Page <james.page@ubuntu.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-13 08:55:11 -07:00
Alin Serdean
37382aa6f3 dpif-netlink: Fix compiler warning.
warning C4098: 'dpif_netlink_init_flow_del' : 'void' function returning a value

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-13 08:27:34 -07:00
Andy Zhou
be69730234 db-ctl-base: group static functions together
This file follows a convention that all static functions are grouped
towards the beginning, ahead of public functions. Re-arrange the code
to confirm to this convention.  No functional changes.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
2015-07-13 00:40:59 -07:00
Andy Zhou
802cb46ebc db-ctl-base: do not require client to expose the "tables" variable
Instead, client now pass it via the modified ctl_init() API.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
2015-07-13 00:40:59 -07:00
Andy Zhou
15ffc20282 db-ctl-base: do not expose get_table() API
Both get_table() and set_cloum() APIs are mostly used within db-ctl-base
library. This patch makes both private to the library.

Add a new ctl_set_colum() API for library client.

The changes are cleanups. No functional changes.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
2015-07-13 00:40:58 -07:00
Ben Pfaff
07d2723a27 hmap: Fix bad advice in comment (plus a typo).
This dates to 2010!

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
2015-07-12 21:28:19 -07:00
Ben Pfaff
7202883c3a xml2nroff: Allow comments in block XML.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
2015-07-12 15:38:48 -07:00
Ben Pfaff
d12fa0b881 nicira-ext: Fix typo in comment.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
2015-07-12 15:38:48 -07:00
Alin Serdean
a35f3d61c7 Undefined symbol make_unix_socket
syslog_direct_create defined in (lib/syslog-direct.c) uses make_unix_socket
which is currently undefined on the windows build.

We either can remove the new file from the chain but this patch proposes
to define a wrapper to make_unix_socket in which we return EINVAL.

This will avoid this kind of problems in the future.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2015-07-10 20:33:09 -07:00
Andy Zhou
943f394ea3 db-ctl-base: fix a few typos
Minor typo and style fixes.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
2015-07-09 12:53:58 -07:00
Jeroen van Bemmel
4249b5470e hash: Add symmetric L3/L4 hash functions for multipath, bundle hashing.
Signed-off-by: Jeroen van Bemmel <jvb127@gmail.com>
[blp@nicira.com made code style fixes, expanded documentation]
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-08 08:33:27 -07:00
James Page
c4270b1377 debian: wrap-and-sort
Wrap long lines and sort items in the Debian packaging files.

Signed-off-by: James Page <james.page@ubuntu.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-08 08:07:09 -07:00
Steffen Gebert
5fd5a65cbc FAQ: Fix headline.
There must be no line break within the headline.

Signed-off-by: Steffen Gebert <steffen.gebert@informatik.uni-wuerzburg.de>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-08 07:46:20 -07:00
Ben Pfaff
8c0de36e8f FAQ.md: Remove text saying that OpenFlow 1.5 is not final.
OF1.5 was released months ago.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
2015-07-06 21:09:03 -07:00
Ben Pfaff
4d9d1d9e72 nroff: Fix style of names.
The recommended Google Python style is multi_word_names, not
multiWordNames.

There are lots of other places where the style could be improved.
I started here because I was working in this code anyway and because
this code is only used at build time and not installed, so that it
can't break any third-party code.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
2015-07-06 21:05:51 -07:00
Ben Pfaff
44648b0f08 ofp-util: Log the type of an invalid message being added to a bundle.
This makes troubleshooting easier.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
2015-07-06 20:50:11 -07:00
Ben Pfaff
46be713295 ofp-util: Require inner and outer message in bundle add to be same version.
It doesn't make sense for the messages added to a bundle to have a
different OpenFlow version from the outer OpenFlow version.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
2015-07-06 20:50:08 -07:00