2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 13:58:14 +00:00
Commit Graph

19894 Commits

Author SHA1 Message Date
Jesse Gross
d65349ea28 Merge citrix branch into master. 2009-11-10 15:12:01 -08:00
Jesse Gross
f2d7fd66cf mirroring: Allow learning to be disabled on a VLAN.
RSPAN does not work properly unless MAC learning for the VLAN is
disabled on all switches between the origin and monitoring point.
This allows learning to be disabled on a given VLAN so vSwitch can
acts as an intermediate switch.

Feature #2136
2009-11-10 13:37:08 -08:00
Jesse Gross
93dfc06772 bridge: Require learning table at all times.
The bridge nominally allowed the MAC learning module to not be enabled
though in reality it was always used.  Tracking active MAC addresses
in the bridge is useful for other reasons besides deciding the output
port - primarily for bonding.  In addition there were several bugs
that would have been triggered had learning actually been disabled since
that code path is never tested.  This makes it explicit that the learning
table should be maintained at all times.
2009-11-09 16:37:01 -08:00
Justin Pettit
8ddb3f376d vconn: Clean-up "match" typo in comments
A few comments referenced "m", when "match" was clearly meant.  This was
likely due to a quick search and replace that scooped up these comments
along with the intended code.  This cleans that up.
2009-11-09 16:06:52 -08:00
Ben Pfaff
01b528c1b7 ovs-vsctl: Capitalize names of global constants but not variables.
Conforms to the Google style guide for Python.

Reported by Justin.
2009-11-09 15:02:05 -08:00
Ben Pfaff
3fbe1d307e Make ovs-appctl easier to use and synchronize its interface with ovs-vsctl.
It is inconvenient to type the whole path to the Unix daemon socket when
using ovs-appctl.  Allow the name of the daemon to be used instead when
a pidfile exists in the default location, and contact ovs-vswitchd by
default.

Also, the various options for manipulating vlog were invented before the
general-purpose command mechanism existed.  Get rid of all of the action
options in favor of just specifying the command to be executed as
non-option arguments.

Finally, there simply wasn't much value in allowing multiple targets or
options to be specified; these variations were never used in practice.  So
simplify the interface by making it one target, one action per invocation.

Also, make ovs-vsctl use the same syntax for its --target option.

Based on work by Justin Pettit.
2009-11-09 14:46:38 -08:00
Jesse Gross
8b2a2f4a79 bonding: Ignore updelay if there is no active slave.
If all slaves on a bond are down but some are waiting for an updelay,
enable the slave with the shortest amount of delay remaining.  This
would already occur if all other slaves were disabled at the time the
delay was to begin but not if a delay was already in progress.  This
also immediately sends learning packets out in both situations, which
prevents incoming packets to disabled slaves from being blackholed.

CC: Danny Wannagat <Danny.Wannagat@eu.citrix.com>
2009-11-09 14:32:29 -08:00
Ben Pfaff
2886875a38 Fix incorrect printf format specifiers.
GCC reported these during a 64-bit build.
2009-11-09 10:30:10 -08:00
Ben Pfaff
cc56746aed backtrace: Avoid GCC warning on x86-64.
The portable implementation of stack_low(), which before this commit is
used on x86-64, provokes a warning from GCC that cannot be disabled.  We
already have an i386-specific implementation that does not warn; this
commit adds a corresponding implementation for x86-64 to avoid the warning
there too.
2009-11-09 10:30:10 -08:00
Ben Pfaff
7559c39668 backtrace: Suppress dumb GCC warning on x86-64.
Without this change GCC warns "use of assignment suppression and length
modifier together in scanf format", which doesn't actually point out any
real problem (and why would it?  Google turns up nothing interesting).
2009-11-09 10:30:10 -08:00
Ben Pfaff
d0632593fe ovsdb: Add new ovsdb-client program. 2009-11-06 15:35:34 -08:00
Ben Pfaff
f7f62235b1 ovsdb: Add documentation for ovsdb-server and ovsdb-tool programs. 2009-11-06 15:35:10 -08:00
Ben Pfaff
5764c0ed32 ovsdb: Improve error message for transaction that uses unknown operation.
Without this commit, misspelling an operation name provokes a mysterious
error message.
2009-11-06 15:34:01 -08:00
Ben Pfaff
dd18a8a4e6 Don't try to distribute file that doesn't exist.
lib/ovsdb-client.h was in my source tree at one point but was never checked
in.

Fixes "make dist".
2009-11-06 15:33:47 -08:00
Ben Pfaff
9f2cfbfef3 ovsdb: Fix inverted logic in ovsdb_open().
We want ovsdb_create() (and thus, the open database) to receive the file
only if it is a read-write database.  If it is read-only, then there is
no need to keep the file around, since we will never read or write it
after opening the database.
2009-11-06 15:33:47 -08:00
Ben Pfaff
1248fcd24a ovsdb: Fix use-after-free error in ovsdb_destroy(). 2009-11-06 15:33:47 -08:00
Ben Pfaff
434910dd23 ovsdb-server: Remove unixctl transaction support.
Executing transactions over JSON-RPC makes more sense, now that it is
supported, so remove the older support for unixctl.
2009-11-06 15:33:47 -08:00
Ben Pfaff
8b681e6fdf ovsdb-tool: Make "query" and "transact" commands work properly.
These were passing O_RDONLY or O_RDWR as arguments to a function that
expected "true" or "false", respectively.
2009-11-06 15:33:47 -08:00
Jesse Gross
fde05aded2 udatapath: Implement ZERO_TCP_FLAGS option.
An option to zero the TCP flags when querying flow stats was added
to the kernel datapath to support NetFlow active timeouts.  This
adds that same support to the user datapath.
2009-11-06 14:35:59 -08:00
Jesse Gross
094e151456 netflow: Only query stats of installed flows.
NetFlow active timeouts was querying the stats of all exact match
flows that had reached a certain age including those that could
not be installed.  This was not harmful but it was wasteful and
produced log spew.  This changes it to only query the flows that
are actually installed.

Bug #2252
2009-11-06 14:24:20 -08:00
Jesse Gross
18fdbe16de datapath: Allow TCP flags to be cleared.
When querying flow stats allow the TCP flags to be reset.  Since
the datapath ORs together all flags that have previously been
seen it is otherwise impossible to determine the set of flags from
after a particular time.
2009-11-06 14:05:14 -08:00
Ben Pfaff
c2bffba3ee ovsdb: Make JSON-RPC sessions other than the first work.
The number of open sessions wasn't being tracked properly, so closing a
JSON-RPC database session made it impossible to open any more.
2009-11-06 12:26:22 -08:00
Ben Pfaff
6e57173fab json: Make json_equal() compare objects correctly.
The previous code checked only that JSON objects have members with the
same names.  This commit makes json_equal() also check that like-named
members have the same values.
2009-11-06 12:26:22 -08:00
Jeremy Stribling
dc268c788e ovsdb: Fix bug in JSON-RPC server. 2009-11-06 10:55:37 -08:00
Ben Pfaff
e8bad84fb9 vswitch: First try at an OVSDB schema. 2009-11-05 11:33:07 -08:00
Jean Tourrilhes
ae602adc43 Revert "ovs-ofctl: Fix use-after-free error in del-flows command."
This reverts commit cae7a4b90a.

This commit forced the user to specify an action when deleting a flow,
which is not desirable.  The change was not actually needed, as the
buffer is never passed to str_to_flow() in the original code.
2009-11-04 23:43:22 -08:00
Ben Pfaff
f85f8ebbfa Initial implementation of OVSDB. 2009-11-04 17:12:10 -08:00
Ben Pfaff
f212909325 Implement JSON-RPC protocol. 2009-11-04 15:24:40 -08:00
Ben Pfaff
1c617a495f byteq: Move from extras/ezio into lib and export some private functions.
The upcoming JSON-RPC library wants to use this library, and it needs some
functions that are currently declared static.
2009-11-04 15:24:40 -08:00
Ben Pfaff
c34b65c731 stream: New library for bidirectional streams (e.g. TCP, SSL, Unix sockets).
This code is heavily based on the vconn code.  Eventually we should make
the stream-based vconns (currently that's all of them) a wrapper around
streams, but I haven't done that yet.

SSL is not implemented yet.
2009-11-04 15:24:40 -08:00
Ben Pfaff
8a8eb86772 socket-util: Make TCP open function support no default port.
Until now, tcp_open_active() and tcp_open_passive() have only been used
in situations where there is a reasonable default port, e.g. OFP_TCP_PORT.
But now, in the upcoming JSON-RPC library and underlying stream library,
there is no reasonable default, so enhance these functions so that they
can require the user to specify a port explicitly.
2009-11-04 15:24:40 -08:00
Ben Pfaff
675febfa2f Factor out common code from utilities that multiplex commands.
An upcoming commit will add yet another such utility and the code
redundancy was getting to be a bit much.
2009-11-04 15:24:40 -08:00
Ben Pfaff
29d4af6016 New dir_name() function plus tests. 2009-11-04 15:24:40 -08:00
Ben Pfaff
0fec26b00b util: Make ovs_error() understand that EOF means "end of file".
This convention is in use in a few places in the source tree, and so it
seems to be about time to start putting it into central places.
2009-11-04 15:24:40 -08:00
Ben Pfaff
d918d9d112 Implement RFC 4122-compliant UUIDs.
This UUID library will be used by the upcoming configuration database.
2009-11-04 15:24:40 -08:00
Ben Pfaff
f38b84ea2b Implement JSON parsing and serialization.
This will be used by the upcoming Open vSwitch configuration database.
2009-11-04 15:24:40 -08:00
Ben Pfaff
e7f1bf58e4 sha1: Add functions, macros for converting digests to and from strings.
These will be used in the upcoming OVSDB.

The SHA1_FMT and SHA1_ARGS macros are arguably absurd, but they are
also convenient.
2009-11-04 15:24:40 -08:00
Ben Pfaff
0611aea043 queue: New function queue_is_empty(). 2009-11-04 15:01:02 -08:00
Ben Pfaff
07423999f1 shash: New function shash_sort(). 2009-11-04 15:01:02 -08:00
Ben Pfaff
c01da22964 shash: New function shash_count(). 2009-11-04 15:01:02 -08:00
Ben Pfaff
837e80977c shash: New function shash_find_and_delete(). 2009-11-04 15:01:02 -08:00
Ben Pfaff
3adb8bf048 hmap: New functions, macros for iterating buckets without comparing hashes.
Usually, the hash comparison that HMAP_FOR_EACH_WITH_HASH does is an
optimization, because comparing a hash value is usually cheaper than
comparing an entire hash map key.  But for simple hash map keys, it makes
sense to just compare the key directly, because it avoids doing two
comparisons when a single simple comparison suffices.  This commit adds new
functions and macros to support this simple case.
2009-11-04 15:01:02 -08:00
Ben Pfaff
9a757a721f hmap: Fix bug in hmap_replace().
When hmap_replace() replaces one hash table node by another, it must
ensure that any nodes following the old node also follow the new node,
by copying the "next" pointer from "old" to "new".
2009-11-04 15:01:02 -08:00
Ben Pfaff
44528c5463 hash: Improve hash function for integers.
As previously defined, the following both returned the same value for
given values of 'basis':
	hash_int(0, hash_int(1, basis))
	hash_int(1, hash_int(0, basis))
because hash_int(0, basis) evaluated to basis and hash_int(1, basis)
evaluated to c + basis for some constant c.

This commit fixes the problem, by eliminating any simple linear
relationship between basis and the hash value.

We should write some tests for hash function quality.
2009-11-04 15:01:02 -08:00
Ben Pfaff
8e5421180d hash: Implement hash function for Boolean values.
This will be used by the configuration database, and it's generally useful
to have around.
2009-11-04 15:01:00 -08:00
Ben Pfaff
cce1d8bd8e hash: Implement hash function for "double" values.
This will be used by the configuration database, which can store real
numbers.
2009-11-04 15:00:30 -08:00
Ben Pfaff
0064467516 hash: Implement hash function for pointer values.
This will be used by an upcoming commit, and it's generally useful to
have around.
2009-11-04 15:00:28 -08:00
Ben Pfaff
ec6fde61c8 Add new function xzalloc(n) as a shorthand for xcalloc(1, n). 2009-11-04 14:52:32 -08:00
Jean Tourrilhes
cae7a4b90a ovs-ofctl: Fix use-after-free error in del-flows command. 2009-11-04 13:21:07 -08:00
Justin Pettit
2a577bd807 xenserver: Fix issue with deleting network UUID on VLAN destruction
In XenServer, a VLAN is considered an additional network with its own
UUID.  The interface-reconfigure script properly adds this network UUID
to the configuration script, but commit 774428 removed the code that
would remove this information on VLAN destruction.  Ian Campbell was the
author of that commit and felt that reverting this part was safe.

Bug #1973
2009-11-03 21:46:29 -08:00