2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00
Commit Graph

1150 Commits

Author SHA1 Message Date
Ben Pfaff
a76150b18b ovs-ofctl: Fix handling of unexpected replies in dump_stats_transaction().
dump_stats_transaction() ignored errors and other non-stats replies to
its request and would continue to wait forever.  This fixes the problem.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-06-27 14:29:02 -07:00
Ethan Jackson
da2db2cb31 ovs-ctl: Add additional options to strace wrapper.
It's useful to know how long each system call took, and at what
time each system call happened.  In addition this patch causes
strace to print strings more fully allowing log messages to be seen
in the output.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-06-27 13:47:20 -07:00
Gurucharan Shetty
74e60d69ad ovs-bugtool: Avoid running ethtool on non-physical devices.
There can be possibilities where there are hundreds of OVS
internal devices. In such a situation, running ovs-bugtool
can take a very long time to complete as multiple ethtool
commands are run on each interface in /sys/class/net. Once
the ovs-bugtool completes, most of the ethtool command outputs
would be incomplete with "timeouts" as we only give 30 seconds
for CAP_NETWORK_STATUS.

With the following patch, we only run ethtools on those interfaces
that have an associated "device". All physical interfaces have
this entry in /sys/class/net/${interface_name}/. Virtual interfaces
can have this entry too, if it has an underlying virtual device.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2012-06-25 15:02:14 -07:00
Ben Pfaff
5aa7547411 docs: Add references to the database schema documentation.
I field lots of questions about "where's the documentation?"  Perhaps this
will help.

The changes to ovs-vsctl(8) add a couple of references to
ovs-vswitchd.conf.db(5) but they also rephrase a couple of paragraphs in
what seems to me an easier to understand style.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-06-20 15:47:00 -07:00
Ben Pfaff
287e3bc0ae ovs-lib: Add time stamps to Valgrind log messages.
Sometimes it's easier to interpret Valgrind warnings when you can
correlate them with other events.

Suggested-by: James Schmidt <jschmidt@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-06-20 14:30:16 -07:00
Ben Pfaff
d0c060994a ovs-ctl: Add support for running daemons under valgrind or strace.
This is occasionally useful for debugging.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-06-15 09:36:20 -07:00
Ben Pfaff
7bb8f95352 ovs-ctl: Document --ovs-brcompatd-priority.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-06-15 09:25:12 -07:00
Ethan Jackson
a699f6143e lib: Utilize smaps in the idl.
String to string maps are used all over the Open vSwitch database.
Before this patch, they were implemented in the idl as parallel
string arrays.  This strategy has proven a bit cumbersome.  With
this patch, string to string maps are implemented using the smap
library.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-06-14 16:41:44 -07:00
Ethan Jackson
79f1cbe9f8 lib: New data structure - smap.
A smap is a string to string hash map.  It has a cleaner interface
than shash's which were traditionally used for the same purpose.
This patch implements the data structure, and changes netdev and
its providers to use it.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-06-14 15:09:31 -07:00
Ben Pfaff
ff0b06eef1 Allow general masking of IPv6 addresses rather than just CIDR masks.
OF1.2 and later make these fields fully maskable so we might as well also.

Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-06-12 21:19:25 -07:00
Ben Pfaff
c08201d664 Allow general masking of IPv4 addresses rather than just CIDR masks.
OF1.1 and later make these fields fully maskable so we might as well also.

Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-06-12 21:19:22 -07:00
Ben Pfaff
410698cf7d ofp-util: Implement translation to and from OpenFlow 1.1 ofp_match.
This is another step toward OpenFlow 1.1 support.  The change does not
affect any outwardly visible OpenFlow behavior yet.

Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-06-12 21:19:19 -07:00
Ben Pfaff
eec25dc1ae openflow-1.0: Rename ofp_match to ofp10_match, OFPFW_* to OFPFW10_*.
This better fits our general policy of adding a version number suffix
to structures and constants whose values differ from one OpenFlow
version to the next.

Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-06-12 21:19:09 -07:00
Simon Horman
b5ae8913b2 nx-match: Add parsing and serialisation of OXM matches.
This code, which leverages the existing NXM implementation,
adds parsing and serialisation of OXM matches. Test cases
have also been provided.

This patch only implements parsing and serialisation of OXM fields that
are already handled by NXM.

It should be noted that in OXM ports are 32bit whereas in NXM they
are 16 bit. This has been handled as a special case as all other field
widths are the same in both OXM and NXM.

This patch does not address differences in wildcarding between OXM and NXM.
It is planned that liberal wildcarding policy dictated by either OXM or
NXM will be implemented.

This patch also does not address any (subtle?) differences between
OXM and NXM treatment of specific fields. It is envisages that his
can be handled by subsequent patches.

Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com adjusted style, added a comment, changed in_port special
 case, enabled NXM extensions to OXM]
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-06-11 10:02:13 -07:00
Joe Stringer
73c0ce349b flow: Adds support for arbitrary ethernet masking
Arbitrary ethernet mask support is one step on the way to support for OpenFlow
1.1+. This patch set seeks to add this capability without breaking current
protocol support.

Signed-off-by: Joe Stringer <joe@wand.net.nz>
[blp@nicira.com made some updates, see
 http://openvswitch.org/pipermail/dev/2012-May/017585.html]
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-29 12:24:07 -07:00
Justin Pettit
623e1caf2f ofp-util: Clean up cookie handling.
Commit e72e793 (Add ability to restrict flow mods and flow stats
requests to cookies.) modified cookie handling.  Some of its behavior
was unintuitive and there was at least one bug (described below).
Commit f66b87d (DESIGN: Document uses for flow cookies.) attempted to
document a clean design for cookie handling.  This commit updates the
DESIGN document and brings the implementation in line with it.

In commit e72e793, the code that handled processing OpenFlow flow
modification requests set the cookie mask to exact-match.  This seems
reasonable for adding flows, but is not correct for matching, since
OpenFlow 1.0 doesn't support matching based on the cookie.  This commit
changes to cookie mask to fully wildcarded, which is the correct
behavior for modifications and deletions.  It doesn't cause any problems
for flow additions, since the mask is ignored for that operation.

Bug #9742

Reported-by: Luca Giraudo <lgiraudo@nicira.com>
Reported-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
2012-05-29 01:41:21 -07:00
Ben Pfaff
28124950e4 ovs-ofctl: Support all OFPPC_* flags in "mod-port" command.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-24 14:06:03 -07:00
Ben Pfaff
0d08568461 Add support for tracking and logging daemon memory usage.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-22 10:32:05 -07:00
Ben Pfaff
44bac24ba5 simap: New data structure for string-to-integer maps.
This commit adapts a couple of existing pieces of code to use the
new data structure.  The following commit will add another user
(which is also the first use of the simap_increas() function).

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-22 10:32:02 -07:00
Ben Pfaff
ea523221d4 vlog: Take advantage of relaxed "-v" syntax through the tree.
The vlog manpage implies that writing ANY explicitly is obsolete, but
examples elsewhere in the documentation and code still tend to add it.
This removes them.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-22 10:17:06 -07:00
Ben Pfaff
f26ddb5b5f python: Implement "vlog/set", "vlog/list" unixctl commands in Python vlog.
This doesn't implement control over log patterns, though.

The change to vlog.man in this commit doesn't have any practical effect
because OVS doesn't come with any Python daemons that have their own
manpages.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-22 10:17:06 -07:00
Ethan Jackson
583dc85248 gitignore: Add ovs-check-dead-ifs.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-05-16 08:24:52 -07:00
Arun Sharma
eeb8467eec ovs-vsctl: Add "--all" option for "destroy" command in ovs-vsctl.
Adds the ability to delete all records from table. This will help
users to destroy all records from Qos or Queue table using single
command rather then current method.

Feature #11306
Suggested-by: Kevin Mancuso <kevin.mancuso@rackspace.com>
Signed-off-by: Arun Sharma <arun.sharma@calsoftinc.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-16 12:23:43 -07:00
Ben Pfaff
6bdfa48858 ovs-dpctl: Remove obsolete documentation of limit on number of datapaths.
Reported-by: Vjekoslav Brajkovic <balkan@cs.washington.edu>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-14 12:24:20 -07:00
Ben Pfaff
f4dace9c28 ovs-ofctl: Avoid impossible check for !osm in fetch_port_by_stats().
At the time of the call to ofpbuf_at(), we know that the ofp_stats_msg is
present because ofputil_decode_msg_type() reported that it was.  Therefore,
we can use ofpbuf_at_assert() and don't have to check for a null pointer.

Found by clang.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-14 09:37:18 -07:00
Ben Pfaff
f5cd6874f1 Avoid writes to variables that are never read back.
Found by clang.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-14 09:37:18 -07:00
Gurucharan Shetty
a122b0fa65 ovs-bugtool: Close file descriptors after use.
In ovs-bugtool, we do a bunch of Popen calls to
get the results of some shell commands with stdout
set to PIPE. Once we are done, we need to
close the file descriptors.

Bug #11083.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2012-05-11 14:49:02 -07:00
Ben Pfaff
06d7ae7d9b dynamic-string: New function ds_get_test_line().
This eliminates some code duplication.   An upcoming commit will add
another user.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-10 11:44:05 -07:00
Ben Pfaff
c0516e94a0 Fix "make distcheck" failure since we weren't cleaning up a generated file.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-10 09:37:11 -07:00
Arun Sharma
ab7b77bbf7 bugtool: rename label names in plugins related to ovs-appctl
It improves to have proper out file name in bugtool archive with respect
to ovs-appctl commands. E.g. if command is 'ovs-appctl lacp/show' then
the related out file will be 'ovs-appctl-lacp-show.out'

Feature #11283.
Signed-off-by: Arun Sharma <arun.sharma@calsoftinc.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-10 09:11:42 -07:00
Arun Sharma
271c896ee4 bugtool: Collect bond state information from ovs.
This is an enhancement in bugtool archive output to determine the bond
state information. It is implemented as a plugin which internally calls
"ovs-appctl bond/show" command to get bond state.

Feature #11283.
Signed-off-by: Arun Sharma <arun.sharma@calsoftinc.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-10 09:10:52 -07:00
Justin Pettit
da91750fb1 ovs-ofctl: Use port description stat to look up ports when necessary.
Not all ports may fit in a Features Reply, so if that's the case, then
use the new port description stat message for looking up ports.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
2012-05-08 10:58:31 -07:00
Justin Pettit
ae0e700932 ovs-ofctl: Support large number of ports with "show" command.
OpenFlow Features Reply messages prior to 1.3 can give users the wrong
impression about how many ports are on the system.  With this commit,
the command will check if the number of ports may be truncated.  If so,
it will send a Port Description stats request to get the complete list
and ignore the Features Reply port list.

Bug #11087

Signed-off-by: Justin Pettit <jpettit@nicira.com>
2012-05-08 09:51:46 -07:00
Justin Pettit
2be393edd3 ofproto: Add support for OF1.3 port description multipart message.
OpenFlow 1.0 is limited to displaying 1364 ports in the Features Reply
message, and there is no other way to get consolidated port information.
OpenFlow 1.3 adds a new port description multipart message
(OFPMP_PORT_DESC) that is not limited by size.  This commit adds support
through the OpenFlow 1.0 stats mechanism, since they have complimentary
enum values.

Bug #11040

Signed-off-by: Justin Pettit <jpettit@nicira.com>
2012-05-08 09:51:43 -07:00
Raju Subramanian
e0edde6fee Global replace of Nicira Networks.
Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc.

Feature #10593
Signed-off-by: Raju Subramanian <rsubramanian@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-02 17:08:02 -07:00
Ben Pfaff
2dc7590de5 ovs-ctl: Make "force-reload-kmod" warn when DHCP clients must be restarted.
This should make it more obvious when the admin needs to restart a DHCP
client (or other daemon).  Without this, unless the admin carefully reads
the documentation, the first notice he gets about a need to restart the
DHCP client can easily be when the lease expires and the machine drops off
the network.

Bug #5391.
Tested-by: Gurucharan Shetty <gshetty@nicira.com>
Suggested-by: Duffie Cooley <dcooley@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-01 15:36:44 -07:00
Ben Pfaff
e063192769 ovs-ofctl: Document padding in "note" actions.
Reported-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-01 15:28:08 -07:00
Ben Pfaff
4530afbaf4 ovs-ofctl: Document importance of priorities.
Multiple users have asked me about this.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-01 14:29:39 -07:00
Ben Pfaff
300d3e95f9 ovs-appctl: Point to individual daemon manpages in docs.
Sometimes users seem surprised that appctl commands are documented.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-01 14:29:37 -07:00
Ben Pfaff
e09616c6c9 ovs-bugtool: Add "ovs-vsctl show" output to bugtool.
The information output by "ovs-vsctl show" is a subset of that available
elsewhere in bugtool output, but it is human-readable instead of needing
to be processed through ovsdb-server or ovsdb-tool, so it is much more
convenient for basic diagnosis.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-30 11:38:59 -07:00
Ben Pfaff
e2dfe6d3a8 ovs-bugtool: Add "ovs-appctl coverage/show" output to bugtool.
This can be useful for diagnosis.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-30 11:38:59 -07:00
Ansis Atteka
47284b1fc6 nicira-ext: Support masking of nd_target field
This commit adds support to specify a mask in CIDR format for
the nd_target field.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
2012-04-26 15:22:48 -07:00
Ben Pfaff
a341ee57ee ovs-vsctl: Speed up port management operations with many ports.
This makes a sequence of 10,000 "add-port" operations on a single ovs-vsctl
command line about 4X faster.  It makes a sequence of 10,000 "del-port"
operations on a single command line over 2X faster.

It works by not repopulating the cache of relationships between bridges,
ports, and interfaces after most operations, instead updating them
incrementally in-place.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-19 14:27:44 -07:00
Ben Pfaff
286a2e825b ovs-vsctl: Remove 'ctrl', 'n_ctrl' from struct vsctl_bridge.
Only the controller commands used these members and they didn't even help
those commands very much.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-19 14:27:43 -07:00
Ben Pfaff
753cb20f03 ovs-vsctl: Remove 'fail_mode' member from struct vsctl_bridge.
It's only used in cmd_get_fail_mode(), which can easily look it up for
itself, so there's no benefit to storing it in every vsctl_bridge record.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-19 14:27:40 -07:00
Ben Pfaff
5ce5a6b57c ovs-vsctl: Merge struct vsctl_info into struct vsctl_context.
To speed up management operations with many ports, we need to preserve the
cache of bridges, ports, and interfaces from one operation to the next.
One necessary step is to push the "struct vsctl_info" that did the caching
up from the individual functions that need it into a more global structure.
This commit does that, merging it into struct vsctl_context.

This commit also modifies do_vsctl(), the top-level control code in
ovs-vsctl, to keep this part of the vsctl_context unchanged from running
one command to the next.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-19 14:27:23 -07:00
Ben Pfaff
7da6c3a690 ovs-vsctl: Verify VLAN bridge controllers in cmd_get_controller().
A VLAN bridge uses its parent's controllers, so checking the controller
should verify the parent's set of controllers.

The change to verify_controllers() isn't necessary; it just deletes
the check for a null 'bridge' because verify_controllers() can no
longer be called with a null 'bridge'.

This fixes a bug, but it is unlikely to ever have caused a real problem for
users.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-19 12:55:01 -07:00
Ben Pfaff
d655c728e3 ovs-vsctl: Verify correct record in cmd_get_fail_mode() for VLAN bridges.
A VLAN bridge uses its parent's fail-mode, so checking the fail-mode should
verify the parent's bridge record.

This fixes a bug, but it is unlikely to ever have caused a real problem for
users.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-19 12:53:47 -07:00
Ben Pfaff
72d32ac0b3 netlink-socket: Make caller provide message receive buffers.
Typically an nl_sock client can stack-allocate the buffer for receiving
a Netlink message, which provides a performance boost.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-18 20:28:48 -07:00
Ansis Atteka
8d25d9a254 ovs-test: Enhancements to the ovs-test tool
-Implemented support for ovs-test client, so that it could automatically
spawn an ovs-test server process from itself. This reduces the number of
commands the user have to type to get tests running.
-Automated creation of OVS bridges and ports (for VLAN and GRE tests), so that
user would not need to invoke ovs-vsctl manually to switch from direct, 802.1Q
and GRE tests.
-Fixed some pylint reported warnings.
-Fixed ethtool invocation so that we always try to query the physical interface
to get the driver name and version.
-and some others enhancements.

The new usage:
Node1:ovs-test -s 15531
Node2:ovs-test -c 127.0.0.1,1.1.1.1 192.168.122.151,1.1.1.2 -d -l 125 -t gre

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
2012-04-18 14:56:01 -07:00