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
4a557a8e2d tests: Tolerate different versions of tcpdump.
The tcpdump output format differs slightly from one version to another, so
this test that runs tcpdump would fail depending on the system it was run
on.  This commit fixes the problem by using "sed" to trim off the part of
the line that can differ.

Reported-by: Justin Pettit <jpettit@nicira.com>
2011-01-27 09:50:19 -08:00
Justin Pettit
bfee9bd658 tests: Skip frequently hanging "closes standard fds" tests
The "closes standard fds" test frequently hangs, which causes builds to
not complete.  Skip these tests until we have time to debug the cause.
2011-01-26 13:37:44 -08:00
Ben Pfaff
8368c090ca Implement arbitrary bitwise masks for tun_id field.
This was documented to work, but not implemented.

Requested-by: Pankaj Thakkar <thakkar@nicira.com>
2011-01-20 15:29:00 -08:00
Ethan Jackson
27b1bdef46 tests: Update interface-reconfigure tests.
The interface-reconfigure tests currently fail because they were
not updated when fail_mode was added to XenServer configuration.
2011-01-18 22:49:00 -08:00
Ethan Jackson
b9b627d543 xenserver: Add miimon configuration support for xenserver.
This commit makes necessary changes to Interface Reconfigure to
allow miimon bond-detect-mode and bond-miimon-interval to be
changed using xapi.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2011-01-12 15:50:21 -08:00
Ben Pfaff
d90611f14d nx-match: Print register values in hex in "load" action also.
cls_rule_format() prints register values are printed in hex, but the "load"
action was printing them in decimal.  This makes it consistent.

Requested-by: Paul Ingram <paul@nicira.com>
Bug #4249.
2011-01-12 13:59:49 -08:00
Ben Pfaff
fec00620d6 ofp-print: Add tests for OpenFlow message formatting.
It's become clear over the past few weeks that some people really depend
on the formatting of ofp-print output.  It has also become clear that OVS
doesn't have anything that actually checks or enforces the formatting of
the output.  The former is not something I want to encourage, but the
latter is somewhat worrisome because the formatting does change from time
to time and I want to make sure that that is intentional.

So this commit adds at least one test for each supported OpenFlow and
Nicira extension message, so that we can better keep track of changes.
2011-01-12 13:57:53 -08:00
Ben Pfaff
3b62feba98 ofp-print: Print fragment handling in OpenFlow switch config messages. 2011-01-12 13:51:43 -08:00
Ethan Jackson
a4e4760797 tests: Fix bonding related test failures.
The tests did not get updated with recent interface reconfigure
changes.  This fixes the problem.
2011-01-12 10:39:52 -08:00
Justin Pettit
815bba308c Add some new generated files to .gitignore.
A few generated files have snuck in that should be ignored by git.
2011-01-11 19:05:09 -08:00
Ben Pfaff
15b619e29d tests: Fix Y2011 bug in testsuite.
The tests have been failing for a few days now, because the PKI expired a
few days into 2011.  This commit instead generates the PKI at "make check"
time, which has the additional benefit of getting some test exposure for
the ovs-pki program.

Reported-by: Aaron M. Ucko <ucko@debian.org>
CC: 609506@bugs.debian.org
2011-01-10 12:54:26 -08:00
Ben Pfaff
8159b984dc Implement database schema versioning.
As the database schema evolves, it might be useful to have an identifier
for the particular version in use.  This commit adds that feature.
2010-12-27 14:26:47 -08:00
Ben Pfaff
53ddd40ab5 Implement a new Nicira extension action for multipath link selection. 2010-12-17 14:38:50 -08:00
Ben Pfaff
21dd5f55a4 nx-match: Use [] in format_nxm_field_bits where possible.
This just makes formatting a bit more readable.
2010-12-17 14:31:40 -08:00
Ben Pfaff
f904747bf8 ofp-print: Always print priority exactly once.
Reported-by: Paul Ingram <paul@nicira.com>
2010-12-15 09:48:18 -08:00
Ben Pfaff
b9298d3f82 Expand tunnel IDs from 32 to 64 bits.
We have a need to identify tunnels with keys longer than 32 bits.  This
commit adds basic datapath and OpenFlow support for such keys.  It doesn't
actually add any tunnel protocols that support 64-bit keys, so this is not
very useful yet.

The 'arg' member of struct odp_msg had to be expanded to 64-bits also,
because it sometimes contains a tunnel ID.  This member also contains the
argument passed to ODPAT_CONTROLLER, so I expanded that action's argument
to 64 bits also so that it can use the full width of the expanded 'arg'.
Userspace doesn't take advantage of the new space though (it was only
using 16 bits anyhow).

This commit has been tested only to the extent that it doesn't disrupt
basic Open vSwitch operation.  I have not tested it with tunnel traffic.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Feature #3976.
2010-12-10 11:14:13 -08:00
Ben Pfaff
ff9d38264c ofp-util: Make ofputil_cls_rule_to_match() help with flow cookies too.
This fixes OpenFlow 1.0 flow stats reporting of flows added via NXM.

I noticed this problem while implementing 64-bit tunnel IDs, hence the
positioning.  The following commit adds a test.

Acked-by: Jesse Gross <jesse@nicira.com>
2010-12-10 11:14:13 -08:00
Ben Pfaff
8961de6adf ofp-print: Print every flow on a new line for NXST_FLOW replies too.
This makes NXST_FLOW formatting consistent with OFPST_FLOW.

Suggested-by: Justin Pettit <jpettit@nicira.com>
2010-12-09 12:31:31 -08:00
Ben Pfaff
f393f81e42 ofp-print, ofp-parse: Add support for NXAST_REG_MOVE and NXAST_REG_LOAD. 2010-12-09 11:03:35 -08:00
Ben Pfaff
640c7c945f ovs-ofctl: Fix del-flows command parsing bugs.
"ovs-ofctl del-flows br0" segfaulted because do_flow_mod__() assumed that
it always had a "flow" argument, which is not true for the del-flows
command.

Beyond that, parse_ofp_flow_mod_str() rejected "ovs-ofctl del-flows
br0" because no actions were supplied, even though supplying actions
doesn't make sense for deleting flows.

This commit fixes both problems and adds a simple test that would have
caught both problems.

Bug #4112.
2010-12-09 10:27:08 -08:00
Ben Pfaff
00961f7cc5 Avoid using "grep -q" outside of GNU/Linux specific utilities.
According to the Autoconf manual, "grep -q" is not portable, so instead
redirect stdout to /dev/null.
2010-12-08 17:09:29 -08:00
Ben Pfaff
4f564f8dc7 ovs-ofctl: Add --more option to increase OpenFlow message verbosity.
This is useful for seeing the raw NXM data instead of just the parsed
cls_rules.
2010-12-07 13:32:02 -08:00
Ben Pfaff
88ca35eed0 ovs-ofctl: Add NXM support. 2010-12-07 13:32:01 -08:00
Ben Pfaff
558d80cbfa nx-match: Add tests for error return values for unknown NXM fields. 2010-12-07 11:04:15 -08:00
Ben Pfaff
d1e2cf2119 Refactor and centralize basic OpenFlow message decoding and validation.
Open vSwitch contains a few different chunks of code that need to decode
an OpenFlow message to determine its type and then validate that it is
long enough.  Until now, the code for doing this has been more or less
scattered across the tree.  Whenever a new piece of code needed to do this,
it generally needed to reimplement at least part of it.

This commit centralizes all of that work into a single function,
ofputil_decode_msg_type(), and helper functions, and converts all of the
code that was decoding messages by hand to use the new function.
2010-12-06 10:20:20 -08:00
Ben Pfaff
a2cb9dfdaf tests: Add tests for ofproto code.
This first set of tests is pretty basic and uninteresting, but the
infrastructure is now in place for adding more.
2010-12-02 14:57:53 -08:00
Ben Pfaff
7fe079c253 tests: Don't remove testsuite on distclean.
This file is part of the distribution so distclean should not delete it.
2010-11-30 12:16:37 -08:00
Ben Pfaff
66642cb40b nx-match: Implement support for arbitrary VLAN TCI masks.
Since the Nicira Extended Match was specified nicira-ext.h has claimed that
arbitrary masks are allowed, but in fact only certain masks were actually
implemented.  This commit implements general masking for the 802.1Q VLAN
TCI field.
2010-11-23 10:06:28 -08:00
Ben Pfaff
d8ae4d6726 flow: Fully separate flow_wildcards from OpenFlow wildcard bits.
Originally, wildcards were just the OpenFlow OFPFW_* bits.  Then, when
OpenFlow added CIDR masks for IP addresses, struct flow_wildcards was born
with additional members for those masks, derived from the wildcard bits.
Then, when OVS added support for tunnels, we added another bit
NXFW_TUN_ID that coexisted with the OFPFW_*.  Later we added even more bits
that do not appear in the OpenFlow 1.0 match structure at all.  This had
become really confusing, and the difficulties were especially visible in
the long list of invariants in comments on struct flow_wildcards.

This commit cleanly separates the OpenFlow 1.0 wildcard bits from the
bits used inside Open vSwitch, by defining a new set of bits that are
used only internally to Open vSwitch and converting to and from those
wildcard bits at the point where data comes off or goes onto the wire.
It also moves those functions into ofp-util.[ch] since they are only for
dealing with OpenFlow wire protocol now.
2010-11-22 10:11:40 -08:00
Ben Pfaff
844dff325b flow: Remove flow_to/from_match() in favor of cls_rule_to/from_match().
The flow_from_match() and flow_to_match() functions have to deal with most
of the state in a cls_rule anyhow, and this will increase in upcoming
commits, to the point that we might as well just use a cls_rule anyhow.
This commit therefore deletes flow_from_match() and flow_to_match(),
integrating their code into cls_rule_from_match() and the new function
cls_rule_to_match(), respectively.  It also changes each of the functions'
callers to use the new cls_rule_*() function.
2010-11-22 10:10:14 -08:00
Ben Pfaff
0596e89755 flow: Move functions for dealing with wildcard bit counts to ofp-util.
These functions are really OpenFlow-specific, and they will not be used
directly by the flow code soon, so move them to ofp-util.
2010-11-22 10:09:18 -08:00
Ben Pfaff
00561f415c flow: New function flow_wildcards_is_exact(). 2010-11-22 09:40:35 -08:00
Ben Pfaff
193eb87453 classifier: New function cls_rule_equal(). 2010-11-22 09:40:34 -08:00
Ben Pfaff
955f579d42 classifier: Fix segfault iterating with rules that differ only in priority.
When CLS_CURSOR_FOR_EACH(_SAFE) iterated through a classifier, the
cls_cursor_next() function did not properly handle the case where there was
more than a single rule on a list.  This commit fixes the problem.

The addition to the testsuite would have found the problem earlier.

Reported-by: Teemu Koponen <koponen@nicira.com>
CC: Teemu Koponen <koponen@nicira.com>
2010-11-19 16:41:02 -08:00
Ben Pfaff
fbd8715e4b ovs-vsctl: Fix br-set-external-id.
The wrong prerequisite function was being called for set-br-external-id, so
it didn't set up to monitor the right columns, so an assertion failed.
This fixes the problem.

Also, change the test for external IDs so that it will find the regression.
(Running all of the ovs-vsctl commands together caused the column to be
monitored due to another command's intervention.)

Reported-by: Mikael Doverhag <mdoverhag@nicira.com>
Bug #4095.
2010-11-18 14:36:53 -08:00
Ben Pfaff
8064219064 csum: Avoid misaligned data access.
This should fix a checksum test failure observed on Alpha in Debian's
buildds.
2010-11-16 12:52:10 -08:00
Ben Pfaff
d932cf70b1 test-csum: Make test_case requirements clear.
This test code only works properly with test cases whose data is a multiple
of 4, so make that clear in the code and the data.
2010-11-16 12:51:08 -08:00
Ben Pfaff
ef73f86cd4 ovsdb-idl: Make selecting tables and columns to replicate more flexible.
Until now, by default the IDL replicated all tables and all columns in the
database, and a few functions made it possible to avoid replicating
selected columns.  This commit adds a mode in which nothing is replicated
by default and the client code is responsible for specifying each column
and table that it is interested in.  The following commit adds a user for
this mode.
2010-11-16 09:14:52 -08:00
Ben Pfaff
5ecc9d8156 classifier: Add functions and macros for iteration, and use them in ofproto.
This is much more convenient in practice than being forced to use a
callback function.
2010-11-15 15:09:00 -08:00
Ben Pfaff
bf9712678f util: Add function hexits_value() for parsing multiple hex digits.
Suggested-by: Justin Pettit <jpettit@nicira.com>
2010-11-15 10:18:10 -08:00
Ben Pfaff
96fc46e8fd nicira-ext: New Nicira vendor action NXAST_NOTE.
Our controller group at Nicira has requested a way to annotate flows with
extra information beyond the flow cookie.  The new NXAST_NOTE action
provides such a way.

This new action is somewhat controversial.  Some have suggested that it
should be added another way (either as part of the Nicira Extended Match
or as a new component of the flow_mod and related messages).  Others think
that it has no place in the OpenFlow protocol at all and that an equivalent
should be implemented using the already available features of OVSDB.  So
it is possible that this extension will be deleted and the feature will
be reimplemented some other way (or not at all).

CC: Teemu Koponen <koponen@nicira.com>
CC: Jeremy Stribling <strib@nicira.com>
2010-11-15 09:41:41 -08:00
Ben Pfaff
78f3f31640 random: Add entropy test.
This test would have made the bug fixed in the previous commit obvious.  It
would have printed the following:

average=0007c220

bit      0     1
  0  5012  4988
  1  5019  4981
  2  5154  4846
  3  4909  5091
  4  5011  4989
  5  5021  4979
  6  4911  5089
  7  4910  5090
  8  5011  4989
  9  5020  4980
 10  5154  4846
 11  5021  4979
 12  5155  4845
 13  5019  4981
 14  5153  4847
 15  5153  4847
 16  5153  4847
 17  5153  4847
 18  5153  4847
 19  5152  4848
 20 10000     0
 21 10000     0
 22 10000     0
 23 10000     0
 24 10000     0
 25 10000     0
 26 10000     0
 27 10000     0
 28 10000     0
 29 10000     0
 30 10000     0
 31 10000     0
(expected values are 5000)

nibble   0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
     0 696 646 564 693 542 545 612 611 687 663 645 560 674 566 592 704
     1 625 589 597 571 638 623 604 663 670 652 650 557 541 683 686 651
     2 628 644 659 672 648 569 585 616 623 647 681 600 586 675 601 566
     3 683 665 717 549 633 613 701 592 663 531 545 800 623 608 590 487
     4 622 657 777 557 720 608 613 598 657 678 551 654 615 596 598 499
     5 10000   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
     6 10000   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
     7 10000   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
(expected values are 625)
2010-11-15 09:34:18 -08:00
Ben Pfaff
cd10ed7fb4 classifier: Delete dead code specialized for the exact table.
These functions and macros are no longer used.
2010-11-12 14:50:45 -08:00
Ben Pfaff
3c4486a5f7 classifier: Drop CLS_INC_* enumerations and related 'include' parameters.
This type and these parameters were useful when ofproto had the need to
separately traverse exact-match rules looking for subrules, but it no
longer does that because subrules (now called "facets") are not kept in
the classifier any longer.  All the callers are now passing CLS_INC_ALL
anyhow, so we might as well delete this feature and simplify the code.
2010-11-12 14:50:44 -08:00
Ben Pfaff
c0a56d9fe1 test-classifier: Use get_unaligned_u32() from unaligned.h.
There's no point in defining our own code to do this here.
2010-11-12 14:50:44 -08:00
Ben Pfaff
06da29ee25 nx-match: Add tests that wildcard bits are zeroed by flow parser.
Suggested-by: Justin Pettit <jpettit@nicira.com>
2010-11-11 10:51:07 -08:00
Ben Pfaff
1e37a2d751 Add support for matching Ethernet multicast frames. 2010-11-11 10:46:23 -08:00
Ben Pfaff
b6c9e612fa ofproto: Implement support for registers in extended flow match. 2010-11-11 10:41:33 -08:00
Ben Pfaff
9b2cfa734c test-classifier: Test CLASSIFIER_FOR_EACH_EXACT_RULE.
This would have found the bug fixed by the previous commit.
2010-11-11 10:26:04 -08:00
Ben Pfaff
6e170b4c78 socket-util: Work around Unix domain socket path name limits on Linux.
Many Open vSwitch tests fail on Debian's automatic build machines because
the builds occur in deeply nested directories with long names.  OVS tries
to bind and connect to Unix domain sockets using absolute path names, which
in combination with long directory names means that the socket's name
exceeds the limit for Unix domain socket names (108 bytes on Linux).

This commit works around the problem on Linux by indirecting through
/proc/self/fd/<dirfd>/<basename> when names exceed the maximum that can be
used directly.

Reported-by: Hector Oron <hector.oron@gmail.com>
Reported-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Reported-by: Roger Leigh <rleigh@codelibre.net>
Debian bug #602891.
Debian bug #602911.
2010-11-10 10:56:01 -08:00