2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-29 15:28:56 +00:00
Commit Graph

4803 Commits

Author SHA1 Message Date
Ben Pfaff
66fb94b510 cfm: Avoid null pointer dereference in cfm_process_heartbeat().
Found by clang.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-14 09:37:17 -07:00
Simon Horman
d58c5bc2d8 Remove forward declaration of vsp_vlandev_to_realdev()
There is no need to for a forward declaration of vsp_vlandev_to_realdev()

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-14 09:22:54 -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
eb1b39b313 odp-util: Add tests for parsing and formatting ODP actions.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-10 11:44:05 -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
79d4ffe2c9 odp-util: Fix parsing of actions encapsulated within "sample" actions.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-10 11:44:04 -07:00
Ethan Jackson
0d193212d6 ofputil: Accept OFPP_NONE as a valid output port.
Ofproto-dpif treats an output to OFPP_NONE as a NOOP, but ofputil
treated it as an error.  The former behavior seems more natural.

Reported-by: Teemu Koponen <koponen@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-05-10 11:24:36 -07:00
Simon Horman
4acbc98d3c ofproto-dpif: Make parameters const.
The ofproto parameters to lookup_input_bundle(), get_ofp_port() and
get_odp_port() may be const.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-10 10:15:26 -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
Ben Pfaff
625b07205a ofproto-dpif: Segregate CFM, LACP, and STP traffic into separate queues.
Until now, packets for these special protocols have been mixed with general
traffic in the kernel-to-userspace queues.  This means that a big-enough
storm of new flows in these queues can cause packets for these special
protocols to be dropped at this interface, fooling userspace into believing
that, say, no CFM packets have been received even though they are arriving
at the expected rate.

This commit moves special protocols to a dedicated kernel-to-userspace
queue to avoid the problem.

Bug #7550.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-09 12:58:55 -07:00
Ben Pfaff
6a7e895f94 ofproto-dpif: Introduce "slow path" datapath flows.
Most exact-match flows can be handled directly in the datapath, but
for various reasons, some cannot: every packet in these flows must
be sent separately to userspace.  Until now, flows that cannot be
handled entirely in the kernel have been allowed to miss each time
in the datapath.  This is generally OK, but it has a few
disadvantages:

    * It can make troubleshooting at the level where one must look
      at datapath flows a bit confusing in some cases, because
      datapath misses due to genuinely new flows are mixed in with
      datapath misses for known flows that cannot be set up.

    * It means that the kernel-to-userspace packets for a given
      input port always go to a single kernel-to-userspace queue,
      even if we'd like to segregate out some of the packets for
      known flows.  (An upcoming commit has examples.)

This commit therefore introduces the concept of a "slow path" flow,
one that is installed in the datapath with a single action that
sends the flow's packets to userspace.  To make troubleshooting
easier, the action includes a reason code (displayed by "ovs-dpctl
dump-flows") that explains why the flow has been slow-pathed.

Bug #7550.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-09 12:58:55 -07:00
Ben Pfaff
c57b22267b ofproto-dpif: Introduce "internal flows" for handling flow table misses.
The ofproto-dpif implementation of "facet"s requires a facet to be
associated with an OpenFlow rule.  Until now, this meant that packets
that miss in the OpenFlow table (and thus didn't have OpenFlow rules)
couldn't be set up as facets and thus couldn't be installed in the
kernel.  This commit changes that, by introducing "internal" OpenFlow
rules to associate with such packets.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-09 12:58:54 -07:00
Ben Pfaff
9616614bd7 ofproto-dpif: Move code closer to left margin in facet_check_consistency().
This makes an upcoming commit break up fewer lines.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-09 12:58:54 -07:00
Ben Pfaff
a218c87929 ofproto-dpif: Factor parts of update_stats() out into separate functions.
This makes the code more readable in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-09 12:58:54 -07:00
Ben Pfaff
1673e0e400 odp-util: Change user_action_cookie from struct to union.
An upcoming commit will introduce a new type and a new use for the
additional members.  It seems cleanest to use a union, rather that using
the existing members multiple ways.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-09 12:58:54 -07:00
Ben Pfaff
36fc5f1833 ofproto-dpif: Clean up and centralize sFlow logic.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-09 12:58:53 -07:00
Ben Pfaff
21ae82ffb3 odp-util: Use switch for checking values of an enum.
The compiler warns when we forget to handle some value of an enum, whereas
it won't for a sequence of 'if' statements.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-09 12:58:53 -07:00
Ben Pfaff
0a18743a89 odp-util: Fix typo in comment.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-09 12:58:53 -07:00
Ben Pfaff
6a7d1a39bb ofproto-dpif: Minor style fix.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-09 12:58:53 -07:00
Ben Pfaff
ec1c5c7ebc ofproto: Don't limit flows in OpenFlow tables by default.
This bug is ordinarily not exposed because bridge_configure_tables() in
bridge.c configures the max number of flows soon after an ofproto is
created.  But an upcoming commit will make construct() in ofproto-dpif.c
try to create some built-in flows before bridge gets control, so we need
to allow creating flows immediately upon initialization.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-09 12:58:52 -07:00
Brian Kruger
cfa9bf12e1 rhel: Add timeouts to network scripts.
If the daemon(s) aren't running for whatever reason, the RHEL ovs
ifup/ifdown scripts don't take that into account and an attempt to reboot a
system could take forever. (literally. endless loop!)  Here are a couple of
patches (one of ifup, one for ifdown) to add timeouts (10 seconds), because
it runs per interface you have configured and that could take awhile to
reboot a system if needed.

Signed-off-by: Brian Kruger <bkruger+ovsdev@gmail.com>
[blp@nicira.com fixed up a conflict against master]
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-09 12:32:17 -07:00
Gurucharan Shetty
a6a60925d7 debian: Remove --no-wait option from the ifupdown script.
Using the --no-wait option in the ifupdown script creates a
race condition where-in the network devices may not yet be created
after ovs-vsctl returns successfully.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2012-05-09 10:08:51 -07:00
Justin Pettit
c8d5d22c6a Prepare for post-1.7.0 (1.7.90).
Signed-off-by: Justin Pettit <jpettit@nicira.com>
2012-05-08 11:22:15 -07:00
Justin Pettit
d8b11fb9fa Prepare for 1.7.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
2012-05-08 11:22:12 -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
5b5a3a674c ofp-util: Factor out determining physical port size.
There are a few places where we determine the size of a physical port
structure based on the OpenFlow version.  Use a helper function to do
that.

Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
2012-05-08 09:51:46 -07:00
Justin Pettit
347b7ac46a ofp-util: Add ofputil_switch_features_ports_trunc function.
Add function to determine whether the max number of ports are contains
in a Features Reply.  If so, it removes the port list, since it may be
incomplete.  This function will be used in a later commit.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
2012-05-08 09:51:45 -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
Justin Pettit
3a51996b8a OpenFlow: Move stats message enums into "common".
We will be adding some OpenFlow 1.3 stats (aka multipart request)
messages to our OpenFlow 1.0 implementation.  As such, move the
definition of those message numbers to the common location.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
2012-05-07 21:22:25 -07:00
Pravin B Shelar
b1323f59ef datapath: Validation of IPv6 set port action uses IPv4 header
When the kernel validates set TCP/UDP port actions, it looks at
the ports in the existing flow to make sure that the L4 header exists.
However, these actions always use the IPv4 version of the struct.
Following patch fixes this by checking for flow ip protocol first.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>

Bug #11205
2012-05-07 17:04:57 -07:00
Ben Pfaff
751c778501 ofp-util: Treat a packet-out in_port of OFPP_CONTROLLER as OFPP_NONE.
Some OpenFlow 1.0 controllers incorrectly use OPFP_CONTROLLER as the
in_port in packet-out messages, when OFPP_NONE is their intent.  Until now,
Open vSwitch has rejected such requests with an error message.  This commit
makes Open vSwitch instead treat OFPP_CONTROLLER the same as OFPP_NONE for
compatibility with those controllers.

(Also, as of this writing, OpenFlow 1.0.1 appears to be changing the port
to use from OFPP_NONE to OFPP_CONTROLLER.)

Suggested-by: Rob Sherwood <rob.sherwood@bigswitch.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-07 12:30:54 -07:00
Ben Pfaff
31a19d69db ofproto-dpif: Accept OpenFlow-like flows in "ofproto/trace".
Until now it has not been possible to directly trace flows that include
register values and other concepts that are not in datapath flows, because
"ofproto/trace" requires a flow in the format output by "ovs-dpctl
dump-flows", which doesn't know anything about registers.  This commit
makes it possible to instead specify an OpenFlow-like flow.

Feature #10084.
Requested-by: Igor Ganichev <iganichev@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-07 11:23:31 -07:00
Ben Pfaff
ccbe50f8f6 ofp-parse: New function parse_ofp_exact_flow().
This function parses a flow rather than a cls_rule.  It will be useful
for "ofproto/trace", which currently requires an odp_flow and thus can't
accept values for registers and other concepts that don't exist in the
kernel.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-07 11:23:31 -07:00
Ben Pfaff
33cadc5034 ofp-util: Avoid ovs_fatal() in ofputil_parse_key_value().
ofputil_parse_key_value() is safe to use from a process that must not abort
except in one case: where the argument contains unbalanced parentheses.
This commit eliminates that call to ovs_fatal(), instead just treating the
end of the string as closing all nested parentheses.

It would be better to propagate the error condition upward, but I'm not
sure that it's worth it just for this one corner case.

The purpose of this commit is to make it possible to use this function
indirectly within the "ofproto/trace" implementation, which must never
abort ovs-vswitchd.  (All the current callers are within ovs-ofctl and
other utilities.)

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-07 11:23:31 -07:00
Ben Pfaff
b98d8985b6 ofproto-dpif: Factor out VLAN splinter flow adjustment into new function.
An upcoming commit will add a new user.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-07 11:23:31 -07:00
Ben Pfaff
34c1f33b37 debian: Synchronize debian/changelog with downstream Debian changelog.
Reported-by: Greg Dahlman <gdahlman@hotmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-07 11:06:45 -07:00
Gurucharan Shetty
86b87c9266 debian: Add network integration scripts.
Add scripts that will allow Open vSwitch bridges and ports to be
configured through /etc/network/interfaces.  This patch follows a
very similar style as OVS network integration for rhel.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2012-05-04 17:11:02 -07:00
Ansis Atteka
7a6c067d1a datapath: Release rtnl_lock if ovs_vport_cmd_build_info() failed
This patch fixes a possible lock-up bug where rtnl_lock might not
get released.

Acked-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
2012-05-03 17:13:13 -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
Justin Pettit
b0a5c43bd7 ofproto: Rate-limit STP status errors on non-existent ports.
As part of the bridge's main loop, it queries the STP status of all
ports.  If the port doesn't exist, log files can become filled with
warning messages.  This situation is very unusual, since system devices
do not normally disappear, but it's easy enough to rate-limit these
messages.

Bug #10936

Reported-by: Reid Price <reid@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
2012-05-02 10:20:07 -07:00
Ben Pfaff
f66b87de59 DESIGN: Document uses for flow cookies.
The paragraph near the end that starts out "However, unlike OpenFlow 1.1,
..." seems to correctly document OVS behavior, but it also seems like
pretty lousy behavior.  Justin says that he's going to fix it before we
put out an OVS release version with this behavior.

CC: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-01 16:24:09 -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
99811d070e tests: Fix typo in comment.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-01 15:34:01 -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
b9718b7ba7 ofp-print: Add some more white space to flow dumps.
Before idle_age and hard_age were added, in the absence of timeouts there
was a space between the statistics for a flow and the start of the flow
match.  This restores that space.

Requested-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-01 15:21:39 -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
612ca9c5d7 vswitch.xml: Document more details of CFM intervals.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-01 14:29:37 -07:00