2
0
mirror of https://github.com/openvswitch/ovs synced 2025-09-05 00:35:33 +00:00
Commit Graph

3402 Commits

Author SHA1 Message Date
Ben Pfaff
ad6247f508 ovs-monitor-ipsec: Fix use_ssl_cert option implementation.
I skipped writing a unit test for this feature on the first go-around, and
of course that meant it didn't work.

Bug #7693.
Reported-by: Michael Hu <mhu@nicira.com>
2011-10-06 14:54:30 -07:00
Ben Pfaff
f937ccc232 check-structs: Add check that OFP_ASSERT is checking the right structures.
This avoids a fairly common issue in which a developer cuts and pastes a
structure definition and forgets to update the structure name inside the
OFP_ASSERT, so that the new structure's size doesn't really get checked at
all.
2011-10-04 09:26:14 -07:00
Ben Pfaff
3021ea6074 vconn: Remove unnecessary forward declarations and #includes from header.
This required fix-ups in a few other files that accidentally depended upon
vconn.h including those other headers.
2011-10-04 09:09:03 -07:00
Ben Pfaff
e3d98cb0ab test-classifier: Remove write-only variable. 2011-10-03 09:25:11 -07:00
Justin Pettit
7ff2009a95 ovs-appctl: Print command arguments for "help". 2011-09-29 18:52:28 -07:00
Ethan Jackson
42c2ebcdad tests: Use compat argparse when required.
Some build environments don't have argparse installed.  In these
cases the test framework will use the compat version.
2011-09-27 15:51:26 -07:00
Ethan Jackson
3a656eafb9 python: Upgrade to vlog.
This patch upgrades the library code in the python/ovs directory to
the new vlog module.
2011-09-27 14:51:49 -07:00
Ethan Jackson
b153e66790 python: Upgrade daemon module to argparse.
This patch also updates it's callers.
2011-09-27 14:51:49 -07:00
Ethan Jackson
ec394dad53 stream.py: Make usage() function return a string.
This will marginally simplify a future patch.
2011-09-27 14:50:26 -07:00
Ethan Jackson
8ed182d80e python: Create new vlog module.
Currently, each python daemon has to come up with it's own logging
solution.  These logging strategies are not consistent across the
python code or with the C vlog module.  This patch adds a new
logging module which hopes to solve the problem.  This new module
generates log messages in a manner consistent with the C code.
Furthermore, it can easily be extended to support things like rate
limiters in the future.

This patch does not update any python code to use the new module.
2011-09-27 14:50:26 -07:00
Ethan Jackson
484185ec4e test-jsonrpc: Help option doesn't work.
The test-jsonrpc.py script didn't understand the "-h" option and
threw an exception when "--help" was supplied.
2011-09-26 16:12:33 -07:00
Ben Pfaff
ecac4ebf93 Implement "native VLAN" feature.
Significant updates by Ben Pfaff, including:

* Comment, coding style, indentation updates.
* Documentation improved.
* Added tests.
* Dropped PORT_VLAN_EMPTY.
2011-09-26 13:15:56 -07:00
Ben Pfaff
04c956fc02 ofproto-dpif: Add tests for VLAN handling.
These tests would have caught the bug fixed in the previous commit
"ofproto-dpif: Fix behavior when a subset of VLANs is trunked."
2011-09-26 13:15:56 -07:00
Ben Pfaff
1b0fdca5fa ovs-xapi-sync: Add unit test. 2011-09-26 13:08:58 -07:00
Ben Pfaff
b54bdbe993 ovs-monitor-ipsec: Add unit test. 2011-09-26 13:08:58 -07:00
Ethan Jackson
26bb0f3129 python: Style cleanup.
This patch does minor style cleanups to the code in the python and
tests directory.  There's other code floating around that could use
similar treatment, but updating it is not convenient at the moment.
2011-09-24 16:32:54 -07:00
Ethan Jackson
b17a80ee40 test-reconnect: Fix use of undefined symbol. 2011-09-24 16:19:27 -07:00
Ethan Jackson
bfa29793ec test-ovsdb.py: Remove unused import. 2011-09-24 16:05:07 -07:00
Ethan Jackson
e60a5e2637 tests: test-jsonrpc.py whitespace cleanup.
Pleases pep8.
2011-09-23 15:26:42 -07:00
Ethan Jackson
d2dc8f5806 tests: test-jsonrpc references nonexistent variable. 2011-09-23 15:26:08 -07:00
Ben Pfaff
8cdf034974 python: Implement write support in Python IDL for OVSDB.
Until now, the Python bindings for OVSDB have not supported writing to the
database.  Instead, writes had to be done with "ovs-vsctl" subprocesses.
This commit adds write support and brings the Python bindings in line with
the C bindings.

This commit deletes the Python-specific IDL tests in favor of using the
same tests as the C version of the IDL, which now pass with both
implementations.

This commit updates the two users of the Python IDL to use the new write
support.  I tested this updates only by writing unit tests for them,
which appear in upcoming commits.
2011-09-23 14:23:16 -07:00
Ben Pfaff
49c541dc11 ovs.ovsuuid: Get rid of ovs.ovsuuid.UUID class.
This class only caused unnecessary confusion.  This commit changes all of
its methods into top-level functions.
2011-09-23 09:10:45 -07:00
Ben Pfaff
6484e7cd7a tests: Fix typos in C versions of test-ovsdb error messages. 2011-09-23 09:10:44 -07:00
Ben Pfaff
9cf0ccf00c tests: Actually run all the Python IDL tests under Python.
The lack of _PY in the macro invocations caused these tests to actually
test the C IDL.

Fortunately they would have passed anyway, modulo some minor differences
in output formatting that this commit fixes up.
2011-09-23 09:10:44 -07:00
Ben Pfaff
05b8f1c2b4 ofp-print: Avoid double space before "actions" for catch-all flows.
Bug #7434.
Reported-by: Michael Mao <mmao@nicira.com>
2011-09-22 14:35:05 -07:00
Ethan Jackson
50e97486ca tests: Cleanup test-daemon.py style.
By convention, unused arguments should be named "_" and top level
definitions should be separated by two spaces.
2011-09-16 15:51:12 -07:00
Ben Pfaff
75a7504356 Implement new "learn" action.
There are a few loose ends here.  First, learning actions cause too much
flow revalidation.  Upcoming commits will fix that problem.  The following
additional issues have not yet been addressed:

    * Resource limits: nothing yet limits the maximum number of flows that
      can be learned.  It is possible to exhaust all system memory.

    * Age reporting: there is no way to find out how soon a learned table
      entry is due to be evicted.

To try this action out, here's a recipe for a very simple-minded MAC
learning switch.  It uses a 10-second MAC expiration time to make it easier
to see what's going on:

ovs-vsctl del-controller br0
ovs-ofctl del-flows br0
ovs-ofctl add-flow br0 "table=0 actions=learn(table=1, hard_timeout=10, \
	NXM_OF_VLAN_TCI[0..11], NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], \
	output:NXM_OF_IN_PORT[]), resubmit(,1)"
ovs-ofctl add-flow br0 "table=1 priority=0 actions=flood"

You can then dump the MAC learning table with:

ovs-ofctl dump-flows br0 table=1
2011-09-13 11:46:09 -07:00
Ben Pfaff
a75531e53e test-openflowd: Allow specifying port type on --ports option.
This allows a command like "test-openflowd --enable-dummy dummy@br0
--ports=dummy@eth0,dummy@eth1,dummy@eth2" to create a dummy datapath with
a number of dummy ports.  This is more useful for testing than a dummy
datapath with just an internal port, since output to "flood" and "normal"
has less pathological results.
2011-09-13 11:46:09 -07:00
Ben Pfaff
aad29cd1a1 packets: Add more utility functions for IPv4 and IPv6 addresses.
We had these functions scattered around the source tree anyway.  packets.h
is a good place to centralize them.

I do plan to introduce some additional callers.
2011-09-13 11:46:08 -07:00
Ethan Jackson
8e9ce036dd tests: Test ofproto-dpif set_tunnel translation.
This patch adds a unit test which would have caught the issue fixed
in Commit 2446268e "ofproto-dpif: set_tunnel when required to."
2011-09-12 20:28:40 -07:00
Justin Pettit
df2c07f433 datapath: Use "OVS_*" as opposed to "ODP_*" for user<->kernel interactions.
The prefix "ODP_*" is not overly descriptive in the context of the
larger Linux tree.  This commit changes the prefix to "OVS_*" for the
userpace to kernel interactions.  The userspace libraries still use
"ODP_" in many of their interfaces since it is more descriptive in the
OVS oeuvre.

Feature #6904

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2011-08-19 22:48:23 -07:00
Ethan Jackson
f694937d4e nicra-ext: New action NXAST_OUTPUT_REG.
The NXAST_OUTPUT_REG action outputs to the OpenFlow port contained
in a supplied NXM field.
2011-08-12 15:06:53 -07:00
Ethan Jackson
58a89177ab tests: test "load" and "move" actions. 2011-08-12 15:06:50 -07:00
Ethan Jackson
027be50120 tests: Update gitignore. 2011-08-12 15:05:41 -07:00
Ben Pfaff
299016266e New action NXAST_RESUBMIT_TABLE.
This makes multiple table support in ofproto-dpif useful, by allowing
resubmits into tables other than 0.
2011-08-09 09:24:18 -07:00
Ben Pfaff
0697b5c3c9 ofproto-dpif: Add multiple table support.
Tables other than 0 can be modified and dumped, but they are not yet useful
because actions and flow table lookups never use them.
2011-08-09 09:17:02 -07:00
Ben Pfaff
3bffc610fa odp-util: New function odp_flow_key_from_string().
This will be used in upcoming commits.
2011-08-08 13:14:01 -07:00
Ben Pfaff
18812dff32 netdev: Get rid of struct netdev_options and netdev_open_default().
Now that netdev_options only has two members, we might as well pass them
directly as parameters.
2011-08-08 12:55:43 -07:00
Justin Pettit
55d5bb44cb util: Introduce get_program_version function.
Useful in an upcoming commit.
2011-08-04 11:15:43 -07:00
Ben Pfaff
c1a543a8d6 vlog: Add a new log level "off".
Until now, "emer" has effectively been "off" because no messages were ever
logged at "emer" level.  Justin points out that it is useful to use "emer"
for messages that indicate a fatal error.  This commit makes that change
and adds a new "off" level to really turn off all logging to a facility.
2011-08-01 13:23:19 -07:00
Ethan Jackson
db5b4525b2 ovs-ofctl: Print human readable nx_pull_match() errors.
I've found this makes debugging a bit easier.
2011-07-28 17:06:00 -07:00
Ethan Jackson
79b8c1edcb git: Update gitignore in tests and utilities. 2011-07-28 13:14:11 -07:00
Ben Pfaff
eaa6eb2afd ovs-ofctl: Fix dump-ports and queue-stats commands.
These ovs-ofctl commands have been sending malformed stats requests since
commit 63f2140a55 "openflow: Make stats replies more like other OpenFlow
messages."  This commit fixes the problem and adds basic unit tests that
should prevent similar regressions.

Reported-by: Hao Zheng <hzheng@nicira.com>
2011-07-27 15:00:34 -07:00
Ben Pfaff
0ab14c8e28 ofp-print: Make port "config" and "state" output easier to read.
This changes the output of "ovs-ofctl show" from printing ports like this:
     1(eth1): addr:50:54:00:00:00:02, config: 0x11, state:0x1
to this:
     1(eth1): addr:50:54:00:00:00:02
         config:     PORT_DOWN NO_FLOOD
         state:      LINK_DOWN
which seems much easier to read.

It also eliminates trailing white space from the output.

Reported-by: Ethan Jackson <ethan@nicira.com>
2011-07-26 17:04:38 -07:00
Ben Pfaff
da897f41cd ovsdb: Implement a "lock" feature in the database protocol.
This provides clients a way to coordinate their access to the database.
This is a voluntary, not mandatory, locking protocols, that is, clients
are not prevented from modifying the database unless they cooperate with
the locking protocol.  It is also not related to any of the ACID properties
of database transactions.  It is strictly a way for clients to coordinate
among themselves.

The following commit will introduce one user.
2011-07-26 16:50:09 -07:00
Ben Pfaff
e317253b13 ovsdb: Refactor jsonrpc-server to make the concept of a session public.
An upcoming commit will need to expose the concept of a database session
to the execution engine, to allow the execution engine to query the locks
held by the session.  This commit prepares for that by making sessions a
publicly visible data structure.
2011-07-26 16:50:09 -07:00
Ben Pfaff
53ffefe93c ovsdb-client: Make "server" and "database" arguments optional.
In practice these arguments are almost always the defaults, so this change
makes ovsdb-client much more usable interactively.
2011-07-26 16:50:08 -07:00
Ethan Jackson
a368bb53d9 bundle: New action "bundle_load".
The bundle_load action behaves the same as the bundle action,
except instead of outputting, it writes its result to a register.
2011-07-22 17:46:48 -07:00
Ethan Jackson
04a85497b9 bundle: Implement NX_BD_ALG_ACTIVE_BACKUP.
I don't expect this bundling algorithm to be particularly useful in
software switches.  However, hardware switches will probably only
support this bundling algorithm, so it's implemented here as an
example and a reference.
2011-07-22 17:46:48 -07:00
Ethan Jackson
43edca5717 nx-match: New helpers.
This patch creates two new helper functions, nxm_reg_load() and
nxm_dst_check().  The new nxm_dst_check() function may be used to
check the validity of destination fields used by actions.  The new
nxm_reg_load() function may be used by actions which need to write
to NXM fields.

This patch also allows multipath and autopath to write their result
to non-register NXM fields.
2011-07-22 17:46:48 -07:00