2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00
Commit Graph

3402 Commits

Author SHA1 Message Date
Ben Pfaff
279c9e0308 Log anything that could prevent a daemon from starting.
If a daemon doesn't start, we need to know why.  Being able to
consistently consult the log to find out is helpful.
2011-04-04 10:58:55 -07:00
Ben Pfaff
67a51a1d85 type-props: New macro for estimating length of a decimal integer. 2011-04-04 10:58:54 -07:00
Ben Pfaff
fe1e967e3b Add a few more users for ovs_retval_to_string(). 2011-04-04 10:58:54 -07:00
Ben Pfaff
dc1539ae02 list: New functions list_is_singleton(), list_is_short(). 2011-04-01 15:52:19 -07:00
Ben Pfaff
d61113d992 ovsdb-server: Avoid intermittent test failures due to lockfile log message.
Sometimes lockfile will emit a message saying that it took a little while
to get the lock, which caused spurious test failures.  This commit
suppresses the message.  With this change, I was able to run these tests
continuously for some time without failures.

This was a bug in the testsuite, not in the code under test.
2011-04-01 15:46:22 -07:00
Ben Pfaff
43675e260c ovsdb: Truncate bad transactions from database log.
When ovsdb-server reads a database file that is corrupted at the
transaction level (that is, the transaction is valid JSON and has the
correct SHA-1 hash, but it does not describe a valid database transaction),
then ovsdb-server should truncate it and overwrite it by valid
transactions.  However, until now, it didn't.  Instead, it would keep the
invalid transaction and possibly every transaction in the database file
(depending on in what way the transaction was invalid), which would just
cause the same trouble again the next time the database was read.

This fixes the problem.  An invalid transaction will be deleted from the
database file at the first write to the database.

Bug #5144.
Bug #5149.
2011-03-31 16:43:51 -07:00
Ben Pfaff
db90b3742c ovsdb: Check that ovsdb-server truncates corrupted database logs.
When ovsdb-server reads a database that is corrupted at the log level
(that is, when ovsdb_log detects the corruption by checking the SHA-1 hash
of the record or JSON parser error reporting), then writing to the database
should discard the corrupted data and thereby fix the problem for future
ovsdb-server runs.

This already worked OK.  This just adds an extra test.
2011-03-31 16:43:51 -07:00
Ben Pfaff
42a49b9601 ovsdb: Force strong references to non-root tables to be persistent.
When a strong reference to a non-root table is ephemeral, the database log
can contain inconsistencies.  In particular, if the column in question is
the only reference to a row, then the row will be created in one logged
transaction but the reference to it will not be logged (because it is
ephemeral).  Thus, any later occurrence of the row later in the log (to
modify it, to delete it, or just to reference it) will yield a transaction
error and reading the database will abort at that point.

This commit fixes the problem by forcing any column with a strong reference
to a non-root table to be persistent.

The change to ovsdb_schema_from_json() looks bigger than it really is: it
just swaps the order of two operations on the schema and updates their
comments.  Similarly for the update to ovs.db.DbSchema.__init__().

Bug #5144.
Reported-by: Sujatha Sumanth <ssumanth@nicira.com>
Bug #5149.
Reported-by: Ram Jothikumar <rjothikumar@nicira.com>
2011-03-31 16:43:43 -07:00
Ethan Jackson
ef26353802 gitignore: Added ovs-vlan-bug-workaround and tests 2011-03-22 21:20:50 -07:00
Ethan Jackson
28a14bf3d8 ovs-vsctl: Back out garbage collection changes.
Garbage collection introduced in
c5f341ab19 changed ovs-vsctl so that
it would allow the garbage collector to reclaim unused tables
instead of manually deleting them itself.  Since garbage collection
runs at transaction completion, undeleted tables would hang around
and could conflict with future actions in a given transaction.
This commit backs out this change.

The following command is an example of something that would have
failed before this commit.

ovs-vsctl -- add-br b \
-- del-br b           \
-- add-br b           \
-- set Interface b other_config:test=test
2011-03-16 16:57:11 -07:00
Ben Pfaff
195c808624 ofproto: Remove controller discovery support.
I've never heard of anyone actually using controller discovery.
It adds a great deal of code to the source tree, and a little
bit of complication to ofproto, so this commit removes it.
2011-03-16 14:57:56 -07:00
Ben Pfaff
9b45d7f5db ofproto: Get rid of archaic "switch status" OpenFlow extension.
Back in 2008 or so, I introduced this extension as a way to provide
information about switch status to the new "switch UI" program.  Since
then, the switch UI program has been removed and the important information
that was provided by the switch status extension is now available in the
database, so we might as well get rid of this extension, and that is what
this commit does.
2011-03-16 14:57:56 -07:00
Ben Pfaff
4ffd1b437c ofp-util: New function ofputil_decode_flow_stats_reply().
This function will see more use later in this series.  This commit just
starts using it to make ofp-print output entirely consistent for
OFPST_FLOW and NXST_FLOW replies.
2011-03-16 14:53:16 -07:00
Ben Pfaff
f9cbfbe4f4 ovs-ofctl: Check min flow format support in negotiate_highest_flow_format().
When the -F option wasn't set, or if it was set to an invalid flow format
for the match, this code would happily select a flow format that did not
select the user's requested match if the switch didn't support an
advanced-enough flow format.  This fixes the problem.  It also changes
behavior in the case where the user specifies a flow format that cannot
represent the match, changing this from a warning to a fatal error; this
is consistent with -F behavior for flow_mod commands.
2011-03-16 14:53:15 -07:00
Ben Pfaff
ce0307c473 classifier: Omit all-1-bits mask for VLAN TCI in cls_rule_format().
To me, this seems to be easier to read.
2011-03-16 14:53:15 -07:00
Ben Pfaff
fbc7ed06a7 ofp-print: Consistently print priority only if it is not default.
In NXST_FLOW replies, the priority was printed only if it was not
OFP_DEFAULT_PRIORITY, but it was always printed in OFPST_FLOW replies.
This commit changes OFPST_FLOW replies to match NXST_FLOW replies.
2011-03-16 14:53:15 -07:00
Ben Pfaff
a3e2d85f8f tests: Fix up interface-reconfigure test and results.
I forgot to update the test when I added the VLAN bug workaround.
2011-03-16 14:51:51 -07:00
Andrew Evans
5eda645e36 ovsdb-server: Report time since last connect and disconnect for each manager.
Only the time connected (if connected) or disconnected (if disconnected) is
currently reported for each manager. Change to reporting both in seconds since
the last connect and disconnect events respectively. An empty value indicates
no previous connection or disconnection.

This can help diagnose certain connectivity problems, e.g. flapping.

Requested-by: Peter Balland <peter@nicira.com>
Bug #4833.
2011-03-14 13:10:02 -07:00
Ben Pfaff
6d38ac7cb9 ofp-print: Omit timestamp when printing packets in ofp_packet_to_string().
There's no value in the timestamp here, because it will always be the
same.  Printing it just makes results less reproducible because output
then depends on the time zone.

This fixes a test failure in California due to yesterday's DST change,
and presumably a test failure almost everywhere else all the time.

Reported-by: Andrew Evans <aevans@nicira.com>
2011-03-14 10:13:34 -07:00
Ben Pfaff
c5f341ab19 ovsdb: Implement garbage collection. 2011-03-10 11:24:00 -08:00
Ben Pfaff
19b48a816b ovsdb: Improve error message for duplicate uuid-name.
ovsdb_execute_insert() tried to return a helpful error message when there
was a duplicate uuid-name, but ovsdb_execute() (its caller) makes any
parse error override a parse error.  Since ovsdb_execute_insert() would
skip parsing the row when the uuid-name was a duplicate, this meant that
the error actually reported would be that "row" was not allowed here, which
wasn't at all helpful (since "row" is in fact mandatory).

This commit clears up the problem by always retrieving the "row" member,
which required a small amount of refactoring, and adds a test.
2011-03-10 11:23:59 -08:00
Ben Pfaff
d198c4beee ovsdb-data: Verify that named-uuid string is an <id>.
The "uuid-name" that creates symbols must be an <id> but we weren't
verifying the same constraint on the "named-uuid"s that refer to symbols,
which was a bit confusing in writing transactions by hand.  This commit
fixes the inconsistency and updates the SPECS file to clarify that a
named-uuid string has to be an <id>.
2011-03-10 11:23:59 -08:00
Ben Pfaff
fdba672899 python/ovs/ovsuuid: Fix behavior of UUID.from_json() with no symbol table.
UUID.from_json(['named-uuid', 'x'], None) should raise an error about
invalid syntax, but instead it was raising a TypeError because it would
try to evaluate "'x' not in None".  This fixes the problem and adds a test.
2011-03-10 11:23:58 -08:00
Andrew Evans
c36cf65eda reconnect: Rename CONNECT_IN_PROGRESS state to CONNECTING (like rconn).
reconnect uses the same connection state names as rconn with the exception of
the above. This commit makes their states identical, which should reduce
confusion for people debugging connection problems.
2011-03-10 11:12:20 -08:00
Ethan Jackson
9ec4d255ac xenserver: Delete Bridge when creating vlan.
Commit 34edeccfd8 removed a
workaround which still applies to XenServer versions older than
5.5.  This could causes creation of vlans to fail in some cases.

CC: "David Tsai" <dtsai@nicira.com>
Bug #4877.
2011-03-10 10:26:23 -08:00
Ethan Jackson
c366e0cc25 reconnect: Fix printf() format warning.
tests/test-reconnect.c:245:9: error: format '%llu' expects type
'long long unsigned int', but argument 2 has type 'unsigned int'
2011-03-10 10:26:13 -08:00
Andrew Evans
eba18f0044 reconnect: Track last-disconnected time.
Commit a4613b01ab (ovsdb: Change the way connection duration time is reported
in Manager table.), pushed earlier today, requires this commit, so OVSDB has
been unbuildable from then to now.
2011-03-09 18:40:03 -08:00
Ben Pfaff
70315176de ovs-ofctl: Make add-flows command read from stdin if file name is "-".
It is conventional for Unix tools to read from standard input if "-" is
specified as a file name.  It's easy for "ovs-ofctl add-flows" to behave
this way, too, so this commit implements it.

Suggested-by: Paul Ingram <paul@nicira.com>
2011-03-09 16:22:00 -08:00
Ben Pfaff
0fbc9f11c0 ovs-ofctl: Implement documented semantics of --flow-format for flow_mods.
Also adds a test and moves some code around in tests/ to make sure that
OFPROTO_START and OFPROTO_STOP are available in tests/ovs-ofctl.at.

Reported-by: Michael Mao <mmao@nicira.com>
Bug #4566.
2011-03-01 14:20:52 -08:00
Andrew Evans
da54975c9d xenserver: Add support for disabling in-band management via XAPI.
Allow users or applications to enable or disable in-band management of
individual bridges by setting the 'vswitch-disable-in-band' key in the
'other_config' attribute of the corresponding network to 'true' or
'false'.

Bug #4749.
2011-02-28 18:26:48 -08:00
Ben Pfaff
54ae6fa8f1 ofp-print: Don't print priority for flow stats requests.
A flow stats or aggregate stats request does not have a priority, but we
were printing one anyway.

Reported-by: Justin Pettit <jpettit@nicira.com>
2011-02-24 17:13:30 -08:00
Ben Pfaff
bca5120052 test-ovsdb: Check uuid_from_string() return value.
Coverity #10699.
2011-02-23 15:14:43 -08:00
Justin Pettit
8568316029 test-ovsdb: Don't leak return value from ovsdb_txn_commit().
Coverity #10727
2011-02-23 11:08:20 -08:00
Ben Pfaff
770f1f66bb multipath: Validate multipath actions more thoroughly in multipath_parse().
The stricter validation requires updates to the calls to test-multipath
to supply a valid n_links value.  test-multipath doesn't actually use
that value (it runs over different values in an internal "for" loop), so
this doesn't change any behavior.

Also adds a test to exercise each possible multipath_parse() error message.

Reported-by: Reid Price <reid@nicira.com>
Bug #4462.
2011-02-23 09:42:32 -08:00
Andrew Evans
289df16d29 ovsdb: Remove 'managers' column from 'Open vSwitch' table.
We had retained but deprecated the use of the older 'managers' column in the
'Open vSwitch' table for compatibility with applications that might still use
it, but that created more problems than it solved. This commit removes the
'managers' column from the schema, and removes all references to it from the
code, init scripts, documentation, and tests.
2011-02-18 11:09:29 -08:00
Ben Pfaff
403e3a25f8 ovsdb-tool: New command "needs-conversion". 2011-02-15 12:24:29 -08:00
Ben Pfaff
6aa0931372 ovsdb-tool: Add commands for printing the database checksum. 2011-02-15 12:24:29 -08:00
Justin Pettit
34edeccfd8 xenserver: Remove support for XenServer versions older than 5.6 FP1.
Commit 404c169247 breaks compatibility with
XenServers older than 5.6 FP1.  This commit removes the last vestiges of
support for those older XenServer versions.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
2011-02-11 13:12:59 -08:00
Andrew Evans
404c169247 xenserver: Merge upstream changes and drop pre-5.6.100 support.
Citrix have made modifications to the various interface configuration scripts
that OVS replaces, so at present those modifications are lost when OVS is
installed on e.g. XenServer 5.6.100. This commit applies those changes while
preserving OVS-specific modifications that have been made in the interim.

One major change introduced by these updates is the removal of support for
XenServer releases prior to 5.6.100.

This commit also updates the OVS-supplied xen-bugtool in similar fashion. We
will soon remove xen-bugtool from OVS altogether and move the added OVS
functionality to an XML extension as described in the Supplemental Pack DDK
guide.
2011-02-11 13:03:06 -08:00
Ben Pfaff
0a140468dd ovs-vsctl: Add new "find" command.
This allows listing records that match specified criteria, instead
of just records that have specific names.

This will be used in an upcoming patch, along with --columns, to
list all of the interfaces whose type is 'internal'.
2011-02-08 16:01:28 -08:00
Ben Pfaff
9591fefeea ovs-vsctl: Add --columns options to "list" command.
This allows the user to list just selected columns from a table,
for example just the "name" column.

This will become more useful as additional formatting options
are added in upcoming commits.
2011-02-08 16:01:28 -08:00
Andrew Evans
24b8b259bb ovs-vsctl: Add commands to get/delete/set manager connections. 2011-02-07 23:13:48 -08:00
Ben Pfaff
8274ae959a daemon: Define daemon options enums the same way as other option enums.
Other modules that accept options use this style and I don't see a reason
for the daemon code to be different.  The style used by the daemon code
until now runs the risk of ending up with conflicting values accidentally,
which would be confusing.
2011-02-07 12:50:19 -08:00
Ethan Jackson
2776e40860 xenserver: Allow LACP configuration from xapi.
Makes required changes to interface reconfigure to allow LACP
configuration from xapi.  Conforms to XenServer style bonding
configuration which is slightly different from OVS.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Bug #4213.
2011-02-03 12:26:58 -08:00
Justin Pettit
685a51a5b8 nicira-ext: Support matching IPv6 Neighbor Discovery messages.
IPv6 uses Neighbor Discovery messages in a similar manner to how IPv4
uses ARP.  This commit adds support for matching deeper into the
payloads of Neighbor Solicitation (NS) and Neighbor Advertisement (NA)
messages.  Currently, the matching fields include:

    - NS and NA Target (nd_target)
    - NS Source Link Layer Address (nd_sll)
    - NA Target Link Layer Address (nd_tll)

When defining IPv6 Neighbor Discovery rules, the Nicira Extensible Match
(NXM) extension to OVS must be used.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2011-02-02 13:22:34 -08:00
Justin Pettit
d31f1109f1 nicira-ext: Support matching IPv6 traffic.
Provides ability to match over IPv6 traffic in the same manner as IPv4.
Currently, the matching fields include:

    - IPv6 source and destination addresses (ipv6_src and ipv6_dst)
    - Traffic Class (nw_tos)
    - Next Header (nw_proto)
    - ICMPv6 Type and Code (icmp_type and icmp_code)
    - TCP and UDP Ports over IPv6 (tp_src and tp_dst)

When defining IPv6 rules, the Nicira Extensible Match (NXM) extension to
OVS must be used.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2011-02-02 12:53:26 -08:00
Justin Pettit
bad68a9965 nicira-ext: Support matching ARP source and target hardware addresses.
OpenFlow 1.0 doesn't allow matching on the ARP source and target
hardware address.  This has caused us to introduce hacks such as the
Drop Spoofed ARP action.  Now that we have extensible match, we can
match on more fields within ARP:

    - Source Hardware Address (arp_sha)
    - Target Hardware Address (arp_tha)

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2011-02-02 12:42:40 -08:00
Justin Pettit
6767a2cce9 lib: Replace IP_TYPE_ references with IPPROTO_.
A few common IP protocol types were defined in "lib/packets.h".  However,
we already assume the existence of <netinet/in.h> which contains a more
exhaustive list and should be available on POSIX systems.
2011-02-02 11:50:17 -08:00
Justin Pettit
f696f12fbe tests: Add test suite for packets.h.
This only tests ip_is_cidr(), since that is the only tricky function
currently defined.  This will get more use once IPv6 functions are
added.
2011-02-01 13:43:14 -08:00
Ethan Jackson
6568335309 tests: Fix tests with UCS-2 Python.
Python can be built with either UCS2 or UCS4 support.  When built
with UCS2 the python related surrogate pairs tests cannot pass.
This commit handles this situation more gracefully.
2011-01-31 14:59:27 -08:00