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

5021 Commits

Author SHA1 Message Date
Ethan Jackson
9dbc190c81 ovsdb-server, ovs-vswitchd: Log version after daemonize_complete().
This fixes unit tests, and generally seems more correct.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
[blp@nicira.com added the change to ovs-vswitchd]
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-17 09:55:39 -07:00
Ethan Jackson
1ec3db6fd8 ofproto: Fix compiler warnings.
This patch fixes the following warnings on my system:

lib/ofp-actions.c:458:13: error: format '%x' expects argument of
type 'unsigned int', but argument 4 has type 'long unsigned int'
[-Werror=format]

ofproto/ofproto.c:3940:13: error: comparison between 'enum
ofoperation_type' and 'enum nx_flow_update_event'
[-Werror=enum-compare]

ofproto/ofproto.c:3941:13: error: comparison between 'enum
ofoperation_type' and 'enum nx_flow_update_event'
[-Werror=enum-compare]

ofproto/ofproto.c:3942:13: error: comparison between 'enum
ofoperation_type' and 'enum nx_flow_update_event'
[-Werror=enum-compare]

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-17 09:47:14 -07:00
Simon Horman
fbcbc81484 OXM, NXM: Add tests for all zero and all one masks
The motivation for this is that I was looking into some
bugs relating to masking of match code that I was developing
and it seemed that having these tests would be worthwhile.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-17 09:01:00 -07:00
Ethan Jackson
a890678229 userspace: Log version on startup.
It's convenient to have the OVS version directly in the logs so one
doesn't have to go digging through ovs-bugtool output to find it.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-07-16 22:28:07 -07:00
Leo Alterman
2c0d2b3bfa datapath: fix typo in README
Signed-off-by: Leo Alterman <lalterman@nicira.com>
2012-07-16 18:07:37 -07:00
Justin Pettit
945cad7fb1 Prepare for post-1.8.0 (1.8.90).
Signed-off-by: Justin Pettit <jpettit@nicira.com>
2012-07-16 16:49:00 -07:00
Justin Pettit
f3608bf129 Prepare for 1.8.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
2012-07-16 16:47:08 -07:00
Ben Pfaff
13f894b1f0 ofp-actions: Improve comments.
Reported-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-16 14:46:22 -07:00
Ben Pfaff
296ed88013 ovs-ofctl: Fix use-after-free error.
Commit 4ce9c31573 (ovs-ofctl: Factor code out of read_flows_from_switch().)
introduced a use-after-free error, fixed by this change.

Also adds a unit test for "ovs-ofctl diff-flows" that would have found the
problem.  (The bug report cited "diff-flows" but this bug was present in
dump-flows as well because they share common code.)

Bug #12461.
Reported-by: James Schmidt <jschmidt@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-16 13:58:35 -07:00
Gurucharan Shetty
5d03d2a765 ofproto: fix typo in documentation.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2012-07-16 09:51:40 -07:00
Ben Pfaff
149ff68ac9 memory: Document the memory/show unixctl command.
Suggested-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-13 10:25:27 -07:00
Zoltan Kiss
31a1e58ec7 lib: Define OVSP_NONE in a more clear way
The value represented by the macro would stay exactly the same, just become obvious.

Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12 16:49:16 -07:00
Ben Pfaff
4f8f2439c3 ovs-ofctl: Avoid use-after-free upon "ofctl/unblock" when connection dies.
The implementation of "ofctl/block" used a nested poll loop, with an inner
call to unixctl_server_run().  This poll loop always ran inside an outer
call to unixctl_server_run(), since that's the context within which unixctl
command implementations run.  That means that, if a unixctl connection got
closed within the inner poll loop, and the outer poll loop happened to be
processing the same unixctl connection, then the outer poll loop would
dereference data in the freed connection.

The simplest solution is to avoid a nested poll loop, so that's what this
commit does.

This didn't cause a failure in the unit tests on i386 (which is why I
didn't catch it before pushing) but it did, reliably, on x86-64, and it
showed up in valgrind everywhere.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12 16:34:08 -07:00
Jesse Gross
be812f2d2b Add Tadaaki Nagao to AUTHORS.
Signed-off-by: Jesse Gross <jesse@nicira.com>
2012-07-12 16:27:31 -07:00
Tadaaki Nagao
6c4ea27c48 datapath: Check for backported skb_frag_page().
Recently released CentOS 6.3 (and probably also RHEL 6.3, I assume)
backported skb_frag_page() and others to their 2.6.32-based kernel,
which caused build failure of Open vSwitch kernel modules.

Signed-off-by: Tadaaki Nagao <nagao@stratosphere.co.jp>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2012-07-12 15:40:26 -07:00
Ben Pfaff
2b07c8b182 ofproto: New feature to notify controllers of flow table changes.
OpenFlow switching monitoring and controller coordination can be made more
efficient if the switch can notify a controller of flow table changes as
they occur, rather than periodically polling for changes.  This commit
implements such a feature.

Feature #6633.
CC: Natasha Gude <natasha@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12 14:18:05 -07:00
Ben Pfaff
e2a3d183f6 ofproto: Add extra comments and checking for expiring a pending rule.
A given rule may only have one pending operation at a time, so when an
operation is pending we must not allow a flow expiration to be started on
that rule.

This doesn't fix a user-visible bug in ofproto-dpif because ofproto-dpif
always completes operations immediately, that is, no operations will be
pending when expiration runs.  (Technically there is a bug if the user
runs "ovs-appctl ofproto/clog", but that feature is for debugging only and
there is no reason for a user to ever run it.)

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12 14:13:01 -07:00
Ben Pfaff
080437614b ofproto: Represent flow cookie changes as operations too.
An upcoming commit will add support for monitoring changes to the flow
table.  This feature wants to be able to report changes to flow cookies,
as well as to other properties of a flow.  Until now, however, a flow_mod
that modifies only the flow's cookie is treated as a special case that does
not go through the ofoperation mechanism.  That makes it harder to report
flow cookie-only changes (it would require an additional special case in
the reporting mechanism) so this commit changes cookie-only changes to
go through ofoperations.

The bulk of this change is to change the meaning of ofoperation's 'ofpacts'
member so that a NULL value indicates that the flow's actions are not
changing.  Otherwise a flow-cookie only change would still require copying
and then freeing all the actions, which seems like a waste.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12 14:13:00 -07:00
Ben Pfaff
4179246429 ofproto: Revert change in flow cookie when an ofoperation fails.
The flow_cookie member of struct ofoperation has always been there, but it
seems that it's never been used.  This fixes the code so that if a modify
operation fails the rule's original flow cookie is restored.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12 14:12:59 -07:00
Ben Pfaff
a644168568 rconn: Add byte counting feature to rconn_packet_counter.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12 14:12:59 -07:00
Ben Pfaff
1d31ece9c0 Add OFPRR_EVICTION to enum ofp_flow_removed_reason.
This is likely to be part of OpenFlow 1.3.1 or 1.4 and we have use for it
beforehand to report evicted flows.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12 14:12:58 -07:00
Ben Pfaff
5cc63216b1 ofp-util: Make put_stats__() public as ofputil_put_stats_header().
An upcoming commit will introduce a user outside of ofp-util.c.

The change to put_stats_reply__() is larger than strictly necessary to
avoid making really ugly line breaks.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12 14:12:57 -07:00
Ben Pfaff
e8fa940e4a ofp-print: Slightly extend ofp_print_bit_names().
In an upcoming commit I want to print comma-separated, not space-separated,
names for a set of bits.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12 14:12:56 -07:00
Ben Pfaff
6ceeaa926d classifier: New function cls_rule_is_loose_match().
This function will be useful in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12 14:12:55 -07:00
Ben Pfaff
e615b0a347 ofproto: Finalize all ofoperations in a given ofgroup at the same time.
An upcoming commit will add support for flow table monitoring by
controllers.  One feature of this upcoming support is that a controller's
own changes to the flow table can be abbreviated to a summary, since the
controller presumably knows what it has already sent to the switch.
However, the summary only makes sense if a set of flow table changes
completely succeeds or completely fails.  If it partially fails, the
switch must not attempt to summarize it, because the controller needs
to know the details.  Given that, we have to wait for all of the
operations in an ofgroup to either succeed or fail before the switch
can send its flow table update report to the controllers.  This
commit makes that change.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12 14:12:48 -07:00
Ben Pfaff
d4ce8a49d7 ofproto: Mark some function parameters const.
This allows FOR_EACH_MATCHING_TABLE to be used with const TABLE and
OFPROTO arguments.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12 14:09:35 -07:00
Ben Pfaff
de0f16bc0b ofp-print: Print out_port field in "flow_mod"s.
Somehow we've overlooked this for a long time.  I guess that feature
doesn't get used very much.

Also updates the test output for OFPT_FLOW_MOD to include the out_port
output and adds out_port to the NXT_FLOW_MOD tests.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12 14:09:34 -07:00
Ben Pfaff
bdcc592595 ovs-ofctl: Add --sort and --rsort options for "dump-flows" command.
Feature #8754.
Signed-off-by: Arun Sharma <arun.sharma@calsoftinc.com>
[blp@nicira.com rewrote most of the code]
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12 13:32:47 -07:00
Ben Pfaff
4ce9c31573 ovs-ofctl: Factor code out of read_flows_from_switch().
I want to use this code in another function in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12 13:06:07 -07:00
Ben Pfaff
9abfe55791 ovs-ofctl: Use the prepared connection to dump flows in do_dump_flows__().
The logic in do_dump_flows__() went to some trouble to open an OpenFlow
connection and set the correct protocol, but then it allowed
dump_stats_transaction() to create and use a completely different OpenFlow
connection that hadn't been prepared that way.  This commit fixes the
problem.

I don't think that there is a real bug here because currently the set of
protocols doesn't influence flow stats replies.  But that could change in
the future.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12 12:56:01 -07:00
Ben Pfaff
1a59dc2c8a ofp-util: Reload ofpbuf pointers after nx_put_match().
Fixes a wild pointer write when nx_put_match() expands the ofpbuf.

The change to the OFPST_FLOW case isn't strictly a bug fix, it just makes
the code for that case more closely resemble the NXST_FLOW case.

Bug #12403.
Bug #12460.
Bug #12461.
Bug #12481.
Reported-by: Timothy Chen <tchen@nicira.com>
Reported-by: Natasha Gude <natasha@nicira.com>
Reported-by: James Schmidt <jschmidt@nicira.com>
Reported-by: Alan Shieh <ashieh@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12 11:31:13 -07:00
Simon Horman
615660a99a meta-flow: Remove mf_set_subfield and mf_set_subfield
These functions do not appear to be used any more.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12 09:12:44 -07:00
Ben Pfaff
9d2e744579 ovs-vsctl: Correct example for removing a mirror.
Reported-by: Kris zhang <zhang.kris@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12 08:43:29 -07:00
Ben Pfaff
6302c64103 FAQ: Patch ports are not targeted for upstream.
The previous text was ambiguous.

Reported-by: Konstantin Khorenko <khorenko@openvz.org>
CC: Jesse Gross <jesse@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12 08:10:18 -07:00
Joe Stringer
71baec0655 meta-flow: Reduce redundant transport set/get code
Signed-off-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-11 17:24:41 -07:00
Ben Pfaff
d285965980 cfm: Always initialize CCM "internal_ms_x" extension field.
Found by valgrind:

Syscall param socketcall.sendmsg(msg.msg_iov[i]) points to uninitialised
byte(s)
   at 0x42D3021: sendmsg (in /lib/libc-2.5.so)
   by 0x80E4D23: nl_sock_transact (netlink-socket.c:670)
   by 0x80D9086: dpif_linux_execute__ (dpif-linux.c:872)
   by 0x807D6AE: dpif_execute__ (dpif.c:957)
   by 0x807D6FE: dpif_execute (dpif.c:987)
   by 0x805DED9: send_packet (ofproto-dpif.c:4727)
   by 0x805F8E1: port_run_fast (ofproto-dpif.c:2441)
   by 0x8065CF6: run_fast (ofproto-dpif.c:926)
   by 0x805674F: ofproto_run_fast (ofproto.c:1148)
   by 0x804C957: bridge_run_fast (bridge.c:1980)
   by 0x8053F49: main (ovs-vswitchd.c:123)
  Address 0xbea0895c is on thread 1's stack

Bug #11797.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-11 14:44:20 -07:00
Joe Stringer
7525e578b6 tests: Improve test coverage of OXM metadata field
Signed-off-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-11 14:26:40 -07:00
Simon Horman
626186c3be NXM, OXM: Add Flow Label Tests
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-11 14:11:09 -07:00
Ed Maste
47cd84a8d0 Add forgotten header
Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-11 09:01:24 -07:00
Ben Pfaff
c5b25863dc FAQ: Add FAQ entry for determining OpenFlow port numbers.
I don't understand why, but I've had this question from multiple people
recently.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-11 01:13:25 -07:00
Ben Pfaff
0c449c5683 ofp-actions: Add hex dump of bad actions to log message on error.
This should make debugging easier in such cases.

Bug #12460.
Reported-by: Natasha Gude <natasha@nicira.com>
Reported-by: James Schmidt <jschmidt@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-11 01:05:09 -07:00
Ben Pfaff
5cb2356b59 FAQ: Add FAQ entry about flow normalization.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-11 00:54:53 -07:00
Ben Pfaff
d4cba1f88b datapath: Check gso_type for correct sk_buff in queue_gso_packets().
At the point where it was used, skb_shinfo(skb)->gso_type referred to a
post-GSO sk_buff.  Thus, it would always be 0.  We want to know the pre-GSO
gso_type, so we need to obtain it before segmenting.

Before this change, the kernel would pass inconsistent data to userspace:
packets for UDP fragments with nonzero offset would be passed along with
flow keys that indicate a zero offset (that is, the flow key for "later"
fragments claimed to be "first" fragments).  This inconsistency tended
to confuse Open vSwitch userspace, causing it to log messages about
"failed to flow_del" the flows with "later" fragments.

Bug #12394.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2012-07-10 15:21:46 -07:00
Ethan Jackson
fd0ca62bb1 cfm: Remove sequence fault reason.
Commit 2b540ecb (Added handling of previously ignored cfm faults.)
made the CFM code trigger a fault when a packet is received with an
out of order sequence number.  This means that if even one CFM
probe is dropped, a fault will be triggered because the next
received probe's sequence would be two greater than the last.  This
is in conflict with the 802.1ag requirement that 3.5 dropped probes
triggers fault.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-07-09 19:01:39 -07:00
Arun Sharma
e1fef0f921 Rename static functions to increase uniqueness.
Rename do_* in ovs-dpctl and ovs-ofctl command with "dpctl_" or "ofctl_"
prefix.

Rename add_flow with dp_netdev_flow_add in lib/dpif-netdev.c.

Signed-off-by: Arun Sharma <arun.sharma@calsoftinc.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-09 13:15:36 -07:00
Ben Pfaff
ba3bbb4ca7 debian: Remove obsolete advice to edit /etc/default/openvswitch-switch.
This hasn't been necessary for a long time.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-09 09:35:45 -07:00
Ben Pfaff
67d84df5d9 debian: Add "netbase" dependency for /etc/protocols.
ovs-ctl.in uses /etc/protocols, which is in the "netbase" package, so a
dependency is required.

Debian bug #680537.
CC: 680537@bugs.debian.org
Reported-by: Bastian Blank <waldi@debian.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-09 09:35:44 -07:00
Justin Pettit
900f7601a1 ipsec gre: Don't cache bad ovs-monitor-ipsec pid values.
Commit 2a586a5 (ipsec gre: Do not reread ovs monitor ipsec pidfile in
netdev vport so much) attempts to cache the pid of ovs-monitor-ipsec so
that it's not re-checked so often.  Unfortunately, it also cached error
returns, so errors never recover.  This commit continues to check for
the process's existence after an error.

Issue #12399

Reported-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
2012-07-08 13:21:11 -07:00
Ben Pfaff
a7d94793c9 ofproto: Make ofoperation_create() return the new operation.
This seems like sensible return value semantics to me, even though the new
operation is also available through rule->pending.

This is a code cleanup only that should not affect behavior.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-06 10:02:47 -07:00
Ben Pfaff
cc75d2c7d1 nicira-ext: Fix wrong information in comment.
The priority of exact-match flows is ignored only for the OF1.0 flow match
format, never for NXM.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-06 10:02:46 -07:00