2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 05:47:55 +00:00

3402 Commits

Author SHA1 Message Date
Ben Pfaff
ce5a3e38da ovs-vsctl: Support references among records at creation time.
This makes it easy to create a bunch of records that are all related to
each other in a single ovs-vsctl invocation.  It adds an example to the
ovs-vsctl manpage.
2010-06-17 10:30:18 -07:00
Ben Pfaff
f19f25a44b ovs-vsctl: Fix spelling error in log message. 2010-06-17 10:26:13 -07:00
Jesse Gross
02029a699a tests: Allow some difference in rounding in timeval test.
We now use a time source that provides nanosecond granularity.
However, our test uses gettimeofday() for comparision, which has
microsecond granularity.  In some cases this can lead to different
values depending on the rounding.  This allows us to be off by one
to prevent intermittent test failures.
2010-06-10 16:37:14 -07:00
Jesse Gross
c73814a3e6 timeval: Use monotonic time where appropriate.
Most of the timekeeping needs of OVS are simply to measure intervals,
which means that it is sensitive to changes in the clock.  This commit
replaces the existing clocks with monotonic timers.  An additional set
of wall clock timers are added and used in locations that need absolute
time.

Bug #1858
2010-06-08 18:01:25 -07:00
Ben Pfaff
a36919566a tests: Remove incorrect OVS_UNUSED from declaration. 2010-05-26 15:24:43 -07:00
Ben Pfaff
70d3fbe765 tests: Speed up classifier test.
Many of the classifier tests take time exponential in the number of fields,
because the existing compare_classifiers() iterates over 2^n_fields
possibilities.  This is very slow.

This commit fixes the problem by only testing a fixed number of random
possibilities instead of all of them.  This makes it much, much faster.
2010-05-26 15:24:13 -07:00
Ben Pfaff
3223e977ca tests: Break monolithic classifier test into subtests.
This makes it easier to see which tests are taking up a lot of time, and
to see which ones actually fail if any of them do.
2010-05-26 15:23:58 -07:00
Ben Pfaff
a238d75e35 tests: Avoid nonportable \x escapes in printf(1) invocation.
The \x escape is not part of POSIX, but it is a common extension.  The
dash shell's built-in "printf" implementation does not include this
extension, which caused the testsuite to be generated incorrectly if it
is used as the default shell (as it is on newer versions of Debian and
Ubuntu).

This commit fixes the problem by using standard octal escapes instead.

Reported-by: Joan Cirer <joan@ev0.net>
2010-05-26 12:52:55 -07:00
Wei Yongjun
ca247927bd tests: fix compile warning of tests/test-ovsdb.c
This patch fixed the following compile warning:

tests/test-ovsdb.c: In function 'do_evaluate_conditions':
tests/test-ovsdb.c:744: warning: format '%2d' expects type 'int', but argument 2 has type 'size_t'
tests/test-ovsdb.c: In function 'do_execute_mutations':
tests/test-ovsdb.c:850: warning: format '%2d' expects type 'int', but argument 2 has type 'size_t'
tests/test-ovsdb.c: In function 'do_query':
tests/test-ovsdb.c:972: warning: format '%2d' expects type 'int', but argument 2 has type 'size_t'
tests/test-ovsdb.c: In function 'do_query_distinct':
tests/test-ovsdb.c:1105: warning: format '%2d' expects type 'int', but argument 2 has type 'size_t'
tests/test-ovsdb.c: In function 'parse_uuids':
tests/test-ovsdb.c:1600: warning: format '%d' expects type 'int', but argument 2 has type 'size_t'

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
2010-05-17 09:46:50 -07:00
Ben Pfaff
a1ae5dc8da ovsdb-client: Serialize columns in predictable order on "monitor" command.
The "monitor" command goes to some trouble to write its output in a
predictable order, so that test programs can reliably compare it against
expectations.  This commit fixes up one part that was missing, which is
that the columns were not being ordered predictably (it depended on
hash order, which differs between big-endian and little-endian systems).
It also updates the test suite to expect the new order.
2010-05-07 14:36:06 -07:00
Ben Pfaff
e86dd676cd tests: Fix bug in "ovsdb-tool compact" test.
This test examines the OVSDB database log and checks that it contains what
it should for specified transactions.  However, the database log ordering
differs between big-endian and little-endian architectures because it is
written out in hash order.  We don't want to incur the expense of always
sorting the log as we write it out, so instead this commit fixes the
problem by sorting the log as it reads it, using the "test-json" program.
2010-05-07 14:36:04 -07:00
Ben Pfaff
1f4f3cd7e0 tests: Fix bug in "weak references" test.
One part of the "weak references" test inserts invalid all-zeros weak
references into two columns and expects to get an error message mentioning
one of them.  Unfortunately the one that actually gets mentioned depends
on hash ordering and thus differs between big-endian and little-endian
machines.  This commit fixes the problem by only putting an invalid
reference in a single column, instead of two of them.
2010-05-07 14:36:03 -07:00
Ben Pfaff
62c87d4aed tests: Fix bug in ovsdb-server test suite.
The formatting of OVSDB syntax errors differed between big-endian and
little-endian systems, which caused the "database multiplexing
implementation" test to fail on SPARC.  This commit fixes the problem by
always outputting JSON in syntax errors in deterministic (sorted) order.
2010-05-07 14:36:02 -07:00
Ben Pfaff
76ce943239 Add support for multiple OpenFlow controllers on a single bridge.
With this commit, Open vSwitch permits a bridge to have any number of
OpenFlow controllers.  When multiple controllers are configured, Open
vSwitch connects to all of them simultaneously.  Details of configuration
are in the vswitch schema documentation.

OpenFlow 1.0 does not specify how multiple controllers coordinate in
interacting with a single switch, so more than one controller should be
specified only if the controllers are themselves designed to coordinate
with each other.

An upcoming commit will provide a simple means for coordination between
multiple controllers.

Feature #2495.
2010-04-20 11:01:44 -07:00
Jesse Gross
659586efcf tunneling: Add support for tunnel ID.
Add a tun_id field which contains the ID of the encapsulating tunnel
on which a packet was received (0 if not received on a tunnel).  Also
add an action which allows the tunnel ID to be set for outgoing
packets.  At this point there aren't any tunnel implementations so
these fields don't have any effect.

The matching is exposed to OpenFlow by overloading the high 32 bits
of the cookie as the tunnel ID.  ovs-ofctl is capable of turning
on this special behavior using a new "tun-cookie" command but this
command is intentially undocumented to avoid it being used without
a full understanding of the consequences.
2010-04-19 09:11:51 -04:00
Ben Pfaff
0d11f523a3 ovsdb: Use port 6632 as a default port for database connections.
Until now we have required a port number to be specified explicitly for
database connections.  This commit adopts port 6632 as a default.
2010-04-12 11:15:15 -07:00
Ben Pfaff
766407ea90 stream: Generalize stream_open_block().
This change makes it possible to separate opening a stream from blocking on
connection completion.  This avoids some code redundancy in an upcoming
commit.
2010-04-12 11:13:04 -07:00
Ben Pfaff
19df7f512c reconnect: Implement "passive mode".
This allows the reconnect library to support clients that want to listen
for an incoming connection.
2010-04-12 11:03:32 -07:00
Ben Pfaff
18b239f583 ovs-vsctl: Allow setting arbitrary database columns in add-port, add-bond. 2010-04-05 12:58:21 -07:00
Ian Campbell
16f2ae571f xenserver: Ensure that Bridge.other-config:hwaddr and Interface.MAC are set as appropriate.
Otherwise bridges can end up with a generated MAC address using Nicira OID
which has an impact when using DHCP on that devices.

tests/interface-reconfigure.at updated by Ben Pfaff.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-03-26 09:35:46 -07:00
Ben Pfaff
5c43922c13 vswitchd: Make names of Bridge external_ids generic.
Until now the names of the external_ids keys used for Bridge records have
implied that they are specific to XenServer, because they begin with "xs-".
They are more generic in intent, however, so this commit removes the "xs-"
prefix and explains them more generically.

This finishes the renaming process started in commit c0f9490 "vswitchd:
Make names of Interface external_ids generic."

CC: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-03-24 14:56:53 -07:00
Ben Pfaff
78876719e0 ovsdb-server: Obtain SSL configuration from database.
ovsdb-server should be able to obtain its SSL configuration from the
database that it is serving out, instead of having to specify it on the
command line.  This commit makes it so.
2010-03-19 16:47:11 -07:00
Jesse Gross
af7b73f470 classifer: Fix test classifier to match real classifier.
The trivial test classifier had the same bug as the real classifier
when replacing matching flows.  This caused it to not find the
original bug and then break when the bug was fixed.
2010-03-19 13:54:36 -04:00
Ben Pfaff
87ab878cad ovsdb: Allow constraining the number of rows in a table. 2010-03-18 11:32:26 -07:00
Ben Pfaff
ada496b5cc ovsdb: Compact databases online automatically and on-demand.
If the database grows fairly large, and we've written a fair number of
transactions to it, and it's been a while since the database was compacted,
then (after the next commit) compact the database.

Also, compact the database online if the "ovsdb-server/compact" command is
issued via unixctl.  I suspect that this feature will rarely if ever be
used in practice, but it's easier to test than compacting automatically.

Bug #2391.
2010-03-18 11:24:55 -07:00
Ben Pfaff
9ff373db19 ovsdb: Add tests for transient ovsdb-server.
This variant of the ovsdb execution tests runs each transaction against a
separately started ovsdb-server.  The idea is that this should help to
ferret out any differences between what ovsdb-server has in memory and what
actually gets committed to disk.  There should not be any such differences,
but we need to test for that.
2010-03-17 14:24:56 -07:00
Ben Pfaff
7360012bdf ovsdb: Add support for weak references. 2010-03-17 14:24:56 -07:00
Ben Pfaff
d3f8292158 tests: Don't use obsolete names in ovs-vsctl tests of external-ids.
The names used in the tests don't matter, but they could potentially
confuse a reader, so use more generic names.

Reported-by: Justin Pettit <jpettit@nicira.com>
2010-03-17 09:53:36 -07:00
Ben Pfaff
55aa00e0df Raise minimum Autoconf version to 2.64.
Our configure scripts were actually using Autoconf features introduced in
version 2.64 (e.g. AT_SKIP_IF, AT_CHECK_UNQUOTED), so we should not
claim 2.63 as prerequisite.

Reported-by: Andy Southgate <andy.southgate@citrix.com>
2010-03-08 14:25:20 -08:00
Ben Pfaff
2e57b53730 ovsdb: Remove "comment" support from OVSDB schemas.
Using a separate XML file to document a schema is much more flexible.
You end up with two files (a schema and documentation for it), each of
which is readable and maintainable, instead of a single schema file that
is almost illegible.
2010-03-05 17:05:43 -08:00
Ben Pfaff
af96ccd246 ovsdb-idl: New function ovsdb_idl_txn_commit_block().
This commit factors out common code from multiple callers of
ovsdb_idl_txn_commit() into a new function ovsdb_idl_txn_commit_block().
2010-03-03 12:55:39 -08:00
Ben Pfaff
47a3c536c3 xenserver: Implement missing interface-reconfigure settings.
These settings are supported by the bridge, and they were supported
earlier by the vswitch, but support regressed when OVSDB was initially
introduced because at first ovs-vsctl did not support these settings.
This commit restores support.

Related to bug #2430, #2442.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-03-03 09:55:33 -08:00
Ian Campbell
df9a459ab6 vswitch: interface-reconfigure: bring down physical interfaces
This should be done when bringing down the last PIF which uses a
datapath in order to account for VLAN PIFs sharing a datapath.

The logic in bring_down() already acounts for this requirement by
clearing the dp variable if the datapath is still required so if we
get as far as deconfiguring that datapath then it is also correct to
bring down the physical devices.

With unit test suite update by Ben Pfaff.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-02-26 09:31:14 -08:00
Ben Pfaff
bfc96d9b50 ovsdb: Add support for "enum" constraints.
Some of the uses for the formerly supported regular expression constraints
were simply to limit values to those in a set of allowed values.
This commit adds support for that kind of simple enumeration constraint.
2010-02-25 14:59:41 -08:00
Ben Pfaff
a26cc67c16 Remove PCRE dependency. 2010-02-25 14:59:41 -08:00
Ben Pfaff
89521e3f79 ovsdb: Drop regular expression constraints.
Regular expression constraints have caused nothing but trouble due to the
lack of a ubiquitous regular expression library.  PCRE is *almost*
everywhere, but it has different versions, and different features, and
different bugs, in different places.  It is more trouble than it is worth.
So this commit drops support.
2010-02-25 14:59:16 -08:00
Ben Pfaff
02a987d28b interface-reconfigure: Fix up unit tests expected output.
The previous commit added "mtu" settings in various places, so the output
changed.
2010-02-24 11:11:50 -08:00
Justin Pettit
834377ea55 ofproto: Match on IP ToS/DSCP bits (OpenFlow 1.0)
OpenFlow 1.0 adds support for matching on IP ToS/DSCP bits.

NOTE: OVS at this point is not wire-compatible with OpenFlow 1.0 until
the final commit in this OpenFlow 1.0 set.
2010-02-20 02:22:28 -08:00
Justin Pettit
959a2ecdc8 ofproto: Match VLAN PCP and rewrite ToS bits (OpenFlow 0.9)
Starting in OpenFlow 0.9, it is possible to match on the VLAN PCP
(priority) field and rewrite the IP ToS/DSCP bits.  This check-in
provides that support and bumps the wire protocol number to 0x98.

NOTE: The wire changes come together over the set of OpenFlow 0.9 commits,
so OVS will not be OpenFlow-compatible with any official release between
this commit and the one that completes the set.
2010-02-20 02:22:26 -08:00
Ben Pfaff
48d014bff2 tests: Add basic unit tests for interface-reconfigure.
These tests are probably not perfect, and we could and should certainly
add more of them, but they should at least help us to notice when commits
change interface-reconfigure's behavior.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-02-23 09:55:51 -08:00
Ben Pfaff
1e19e50e8d ovsdb: Implement ovsdb-tool commands "compact" and "convert".
Partial fix for bug #2391.
2010-02-15 12:54:52 -08:00
Ben Pfaff
7446f1480b ovsdb: Allow ovsdb_log_open()'s caller to choose whether to lock.
The current callers of ovsdb_log_open() always want to lock the file if
they are accessing it for read/write access.  An upcoming commit will add
a new caller that does not fit this model (it wants to lock the file
across a wider region) and so the caller should be able to choose whether
to do locking.  This commit adds that ability.

Also, get rid of the use of <fcntl.h> flags to choose the open mode, which
has always seemed somewhat crude and which this change would make even
cruder.
2010-02-15 11:31:32 -08:00
Ben Pfaff
e5125481cf ovsdb-client: Add blank line between tables in CSV, tabular output.
Adding a blank line makes the output easier to read when there are
multiple tables.
2010-02-15 11:31:05 -08:00
Ben Pfaff
c3a0bfd57e ovsdb-client: Introduce new data formatting style as the default.
The new data formatting style is generally shorter and easier to read than
the JSON representation (which is still available using "-d json").
2010-02-15 11:28:39 -08:00
Ben Pfaff
8894256573 ovsdb: Fix commit to disk of rows added to a table with all-default values. 2010-02-15 11:28:39 -08:00
Ben Pfaff
c69ee87c10 Merge "master" into "next".
The main change here is the need to update all of the uses of UNUSED in
the next branch to OVS_UNUSED as it is now spelled on "master".
2010-02-11 11:11:23 -08:00
Ben Pfaff
67a4917b07 Rename UNUSED macro to OVS_UNUSED to avoid naming conflict.
Requested by Jean Tourrilhes <jt@hpl.hp.com>.
2010-02-11 10:59:47 -08:00
Ben Pfaff
f0f4410a47 tests: Remove write-only variables.
Found by Clang (http://clang-analyzer.llvm.org/).
2010-02-11 10:35:28 -08:00
Ben Pfaff
9cb53f2613 ovsdb: Add support for multiple databases to the protocol.
This also adds protocol compatibility to the database itself and to
ovsdb-client.  It doesn't actually add multiple database support to
ovsdb-server, since we don't really need that yet.
2010-02-09 14:25:32 -08:00
Ben Pfaff
bb1c67c813 ovs-vsctl: Add --may-exist option for add-port, add-bond commands.
This is useful in interface-reconfigure, in an upcoming commit.
2010-02-09 12:13:52 -08:00