2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00
Commit Graph

4623 Commits

Author SHA1 Message Date
Ben Pfaff
4000658b1a ofp-errors: Rename "OF" to "OF1.0+", "NX" to "NX1.0+".
This seems like a more reasonable way to do things given that we will soon
need "OpenFlow 1.1 and later" and "OpenFlow 1.1 only" keywords.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
2012-03-27 09:17:07 -07:00
Ben Pfaff
e792ba50dd extract-ofp-errors: Fix error message.
The error message should mention the keyword that caused the error, not
some other random keyword from previous iterations.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
2012-03-27 09:16:59 -07:00
Jesse Gross
734ec5ec13 packet: Add additional TCP flags extraction on IPv6.
Commit 11460e2316
(flow: Enable retrieval of TCP flags from IPv6 traffic.) updated
one of the TCP flags extraction functions in userspace but missed
the other.  This updates that function and converts the other to
use it to reduce duplication.

Bug #10194

Signed-off-by: Jesse Gross <jesse@nicira.com>
2012-03-26 15:53:42 -07:00
Raju Subramanian
42d89d2a61 ovs-bugtool: Add ability to prioritize files by date.
When size limit is reached in the middle of processing a dir,
the report ends up containing oldest files. This change adds
an optional param in the plugin to prioritize newer files.

Feature #9937
Requested-by: Ronald Lee <rlee@nicira.com>
Signed-off-by: Raju Subramanian <rsubramanian@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-26 15:41:14 -07:00
Ben Pfaff
906087ee33 DESIGN: Fix alignment in table.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-26 15:01:26 -07:00
Mehak Mahajan
f125905cdd Allow configuring DSCP on controller and manager connections.
The changes allow the user to specify a separate dscp value for the
controller connection and the manager connection. The value will take
effect on resetting the connections. If no value is specified a default
value of 192 is chosen for each of the connections.

Feature #10074
Requested-by: Rajiv Ramanathan <rramanathan@nicira.com>
Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
2012-03-23 18:13:08 -07:00
Jesse Gross
11460e2316 flow: Enable retrieval of TCP flags from IPv6 traffic.
We currently check that a packet is IPv4 and TCP before fetching the
TCP flags.  This enables fetching from IPv6 packets as well.

Bug #10194

Reported-by: Michael Mao <mmao@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
2012-03-23 16:01:12 -07:00
Jesse Gross
9c47b45a3b flow: Add length check when retrieving TCP flags.
When collecting TCP flags we check that the IP header indicates that
a TCP header is present but not that the packet is actually long
enough to contain the header.  This adds a check to prevent reading
off the end of the packet.

In practice, this is only likely to result in reading of bad data and
not a crash due to the presence of struct skb_shared_info at the end
of the packet.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
2012-03-23 16:00:59 -07:00
Pravin B Shelar
c1f15723c0 vswitchd: Do not refresh existing iface on new device addition.
There is no need to refresh status and stats for existing devices
if iface mtu is missing in ovs-db as missing MTU could just mean
error in last MTU read for that device.
So we can refresh stats for devices which are just created.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
2012-03-23 14:14:24 -07:00
Ben Pfaff
324f0c59d2 unixctl: Fix bad log message on error path.
'path' is usually not the right path (often it's NULL).

Introduced in commit bde9f75de (unixctl: New JSON RPC back-end.).

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-23 13:42:12 -07:00
Ben Pfaff
05fe17646f treewide: Convert tabs to spaces in C source files written in OVS style.
The Open vSwitch C style doesn't use hard tabs.

This commit doesn't touch files written in kernel style or that are
imported from other projects where we want to minimize changes from
upstream (the sflow files).

Reported-by: Mehak Mahajan <mmahajan@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-23 12:20:07 -07:00
Pravin B Shelar
ada3428f09 ofproto: Optimize internal device MTU update
Internal device mtu does not influence mtu of other internal devices.
So skip MTU update to other devices when internal device mtu is changed.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
2012-03-23 10:56:42 -07:00
Pravin B Shelar
69b0983e38 datapath: Support for kernel 3.3
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2012-03-23 10:50:08 -07:00
Ben Pfaff
f7f53d381d ovsdb-idlc: Fix memory leak in "optional bool" columns.
Commit 1bf2c90968 (idl: Generalize special case boolean exception.)
changed the IDL to do dynamic allocation with (x)malloc() for optional
booleans, but it didn't add the corresponding calls to free().  This
commit fixes the problem.

Bug #10357.
Reported-by: Paul Ingram <paul@nicira.com>
Reported-by: Krishna Miriyala <krishna@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-23 10:15:05 -07:00
Ethan Jackson
f67f13545e idl: New helpers for accessing string maps.
This removes some boilerplate from the bridge.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-03-22 16:27:04 -07:00
Ethan Jackson
0104aba86e ofproto-dpif: Fix CONTROLLER actions for LLC frames.
The CONTROLLER action assumed that all Ethernet frames stored their
Ethernet Type in the two bytes succeeding the source and
destination addresses.  This turns out not to be true for 802.2 LLC
frames, potentially causing an assertion failure.  This patch
solves the issue by skipping the assertion in this case.

Bug #10349.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-03-22 16:15:28 -07:00
Ethan Jackson
0acaddd05f bridge: Shorten long lines.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-03-22 11:28:58 -07:00
Pravin B Shelar
2c2ea5a88a netdev: Rename netdev->get_status() to netdev->get_drv_info().
get_status actually returns driver information, so get_drv_info()
is better name.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
2012-03-22 10:58:32 -07:00
Ben Pfaff
ece72d2415 debian: Fix log rotation.
Commit 24e81092a1 (debian: Bring Debian packaging in-line with new file
locations) introduced an ambiguous "--t" option invoking ovs-appctl, so
ovs-vswitchd and ovsdb-server were not reopening their log files following
log rotation.  This fixes the problem by correct the option name.

Reported-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-22 10:33:49 -07:00
Pravin B Shelar
08d19ca9fe datapath: Move CSUM_MANGLED_0 definition to net checksum header.
Following patch fixes compilation error on older kernel.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2012-03-22 10:20:33 -07:00
Ben Pfaff
0d6fc641dc xenserver: Recognize XenServer 5.6-SP2 scripts in RPM %post.
Somehow we forgot to put the md5sums for 5.6-SP2 so users were getting
scary error messages.

Bug #10210.
Reported-by: Ronald Lee <rlee@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-22 08:47:43 -07:00
Justin Pettit
81f9a03982 WHY-OVS: Update to reflect OVS's inclusion in Linux 3.3.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Suggested-by: Martin Casado <casado@nicira.com>
2012-03-21 23:36:36 -07:00
Ansis Atteka
012f5c4bd9 documentation: use correct rundir in INSTALL.Linux to terminate OVS
This patch fixes a minor documentation flaw where INSTALL.Linux uses
incorrect path to find ovsdb-server and ovs-vswitchd PIDs. The default
rundir is actually /usr/local/var/run/openvswitch/ instead of
/usr/local/var/run/.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
2012-03-21 11:11:36 -07:00
Ben Pfaff
33780682c5 ofproto-dpif: Fix tag caching for learned flows.
This code in xlate_table_action() is supposed to tag flows in tables that
have special forms so that changes do not require revalidating every flow.
When rule->tag is nonzero, its value can be used, because we know in this
case that rule->cr.wc is the same as table->other_table->wc and that thus
rule->tag caches the return value of the rule_calculate_tag() expression.
When rule->tag is zero (a "catchall" rule) we need to calculate the tag
manually because we have no way to cache it in that case.

I discovered this bug by running an "hping3" between a couple of VMs plus
the following commands on OVS in the middle:

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

Without this patch, flows don't get properly invalidated upon initial MAC
learning, so one sees warnings like the following:

    in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),
    eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,
    ttl=64,frag=no),tcp(src=13966,dst=0): inconsistency in subfacet
    (actions were: 3,0,1) (correct actions: 1)

This patch fixes the problem and thus avoids these warnings.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-21 09:03:51 -07:00
Ben Pfaff
805e4d07ec ofproto-dpif: Avoid segfault deleting facets that execute LEARN actions.
"ovs-ofctl del-flows <bridge>" can result in the following call path:

  delete_flows_loose() in ofproto.c
    -> collect_rules_loose() -- uses 'ofproto_node' inside 'struct rule'
    -> rule_destruct() in ofproto-dpif.c
      -> facet_revalidate()
        -> facet_remove()
          -> facet_flush_stats()
            -> facet_account()
              -> xlate_actions()
                -> xlate_learn_action()
                  -> ofproto_flow_mod() back in ofproto.c
                    -> modify_flow_strict()
                      -> collect_rules_strict() -- also uses 'ofproto_node'

which goes "boom" when we fall back up the call chain because the nested
use of ofproto_node steps on the outer use of ofproto_node.

This commit fixes the problem by refusing to translate "learn" actions
within facet_flush_stats(), breaking the doubled use.

Another possible approach would be to switch to another way to keep track
of rules in the flow_mod implementations, so that there'd be no fighting
over 'ofproto_node'.  But then "ovs-ofctl del-flows" might still leave some
flows around (ones created by "learn" actions as flows are accounted as
facets get deleted), which would be surprising behavior.  And it seems in
general a bad idea to allow recursive flow_mods; the consequences have not
been carefully thought through.

Before this commit, one can reproduce the problem by running an "hping3"
between a couple of VMs plus the following commands on OVS in the middle.
Sometimes you have to run them a few times:

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

This commit has a side effect that leftover unaccounted packets no longer
update the timeouts in MAC learning actions in some cases, when the facets
that cause updates are deleted.  At most one second of updates should  be
lost.

Bug #10184.
Reported-by: Michael Mao <mmao@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-21 09:03:50 -07:00
Ben Pfaff
e39e5b9d9d hmap: New function hmap_contains().
This is useful in a situation where one knows that an hmap_node is in some
hmap, but it's not certain which one, and one needs to know whether it is
in a particular one.  This is not a very common case; I don't see any
potential users in the current tree, although an upcoming commit will add
one.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-21 09:03:50 -07:00
Ben Pfaff
822d941452 ofproto-dpif: Fix return type of rule_calculate_tag().
tag_type is currently uint32_t but using uint32_t directly is conceptually
wrong.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-21 09:03:46 -07:00
Ben Pfaff
9ed20b8a36 learn: Initialize cookie_mask in constructed flow_mod.
Otherwise the "learn" action may not correctly set the cookie in flows that
it creates.

Found by valgrind.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-21 08:51:30 -07:00
Ben Pfaff
5341d04613 ovs-vsctl: Allow "fake bridges" to be created for VLAN 0.
A fake bridge for VLAN 0 is useful, because it provides a way to create
access ports for VLAN 0.  There is no good reason to prevent it.

NIC-464.
Reported-by: Rob Hoes <Rob.Hoes@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-20 15:47:36 -07:00
Ethan Jackson
94e0c3ff3c xenserver: Verify updates in ovs-xapi-sync.
This prevents potential race conditions when updating database
tables.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-03-19 18:08:45 -07:00
Ethan Jackson
189cb9e468 cfm: Support random VLAN tag for CCM PDUs.
CCM PDUs may take a different path through the network depending on
the VLAN tag they carry.  In order to exercise these paths, it
may be advantageous to use a random VLAN tag.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-03-19 18:03:36 -07:00
Ben Pfaff
f486e8405a netdev-linux: Fix use-after-free when netdev_dump_queues() deletes queues.
iface_configure_qos() passes a callback to netdev_dump_queues() that can
delete queues.  The netdev-linux implementation of this function was
unprepared for the callback to delete queues, so this could cause a
use-after-free.  This fixes the problem in netdev_linux_dump_queues() and
documents that netdev_dump_queues() implementations must support deletions
in the callback.

Found by valgrind:

==1593== Invalid read of size 8
==1593==    at 0x4A8C43: netdev_linux_dump_queues (hmap.h:326)
==1593==    by 0x4305F7: bridge_reconfigure (bridge.c:3084)
==1593==    by 0x431384: bridge_run (bridge.c:1892)
==1593==    by 0x432749: main (ovs-vswitchd.c:96)
==1593==  Address 0x632e078 is 8 bytes inside a block of size 32 free'd
==1593==    at 0x4C240FD: free (vg_replace_malloc.c:366)
==1593==    by 0x4A4D74: hfsc_class_delete (netdev-linux.c:3250)
==1593==    by 0x42AA59: iface_delete_queues (bridge.c:3055)
==1593==    by 0x4A8C8C: netdev_linux_dump_queues (netdev-linux.c:1881)
==1593==    by 0x4305F7: bridge_reconfigure (bridge.c:3084)
==1593==    by 0x431384: bridge_run (bridge.c:1892)

Bug #10164.
Reported-by: Ram Jothikumar <ram@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-19 13:48:24 -07:00
Ethan Jackson
6e037e3ca6 idl: Move vswitch-idl to libopenvswitch.
This is cleaner then having multiple programs build the idl
independently.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-03-19 10:52:53 -07:00
Ben Pfaff
8a07709cb8 configure: Remove --with-build-number.
From early days, Nicira used the --with-build-number option to configure to
stamp our internal builds.  We've since switched to another scheme, so
this option is obsolete.

Good riddance.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-19 10:07:09 -07:00
Ben Pfaff
8a5b3cfd91 debian: Use a different way to avoid failing install without kernel module.
The dh_installinit --error-handler option makes a lot of sense, but after
playing with it for a while I could not figure out a nice way to use it
only for openvswitch-switch without either duplicating the dh_installinit
fragments in postinst and prerm (the actual bug that was reported) or
omitting them for some package.

Also, we forgot to write the error handler function for the prerm.

This commit switches to a different way to avoid failing the install when
the kernel module is not available, without using --error-handler.

CC: 663051@bugs.debian.org
Reported-by: Thomas Goirand <zigo@debian.org>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-16 14:18:05 -07:00
Ben Pfaff
d2b9f5b017 netlink-socket: Increase Netlink socket receive buffer size.
Open vSwitch userspace can set up flows at a high rate, but it is somewhat
"bursty" in opportunities to set up flows, by which I mean that OVS sets up
a batch of flows, then goes off and does some other work for a while, then
sets up another batch of flows, and so on.  The result is that, if a large
number of packets that need flow setups come in all at once, then some of
them can overflow the relatively small kernel-to-user buffers.

This commit increases the kernel-to-user buffers from the default of
approximately 120 kB each to 1 MB each.  In one somewhat synthetic test
case that I ran based on an "hping3" that generated a load of about 20,000
new flows per second (including both requests and replies), this reduced
the packets dropped at the kernel-to-user interface from about 30% to none.
I expect that it will similarly improve packet loss in workloads where
flow arrival is not easily predictable.

(This has little effect on workloads generated by "ovs-benchmark rate"
because that benchmark is effectively "self-clocking", that is, a new flow
is triggered only by a reply to a request made earlier, which means that
the number of buffered packets at any given has a known, constant upper
limit.)

Bug #10210.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-15 21:15:38 -07:00
Ben Pfaff
33500edd53 meta-flow: Don't dereference NULL sf->field in mf_format_subfield().
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-15 14:12:23 -07:00
Ethan Jackson
b5fcae5027 ovs-vsctl: Clarify br-exists usage.
Requested-by: Niklas Andersson <nandersson@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-03-15 11:48:22 -07:00
Ben Pfaff
076f4c1ea3 connmgr: Remove now-unused function connmgr_broadcast().
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-15 10:23:05 -07:00
Ben Pfaff
0b0517ef14 fail-open: Use connmgr_send_packet_in() instead of connmgr_broadcast().
Otherwise even controllers that should not receive any packet-ins (via
enable-async-messages=false) still receive the packet-ins that probe for
a controller being up when we're in fail-open.

Bug #9964.
Reported-by: James Schmidt <jschmidt@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-15 10:23:04 -07:00
Ben Pfaff
2ed1202f14 ofproto: connmgr_send_packet_in() doesn't need buffer_id and total_len.
Trying to add a new caller for connmgr_send_packet_in(), I wasn't sure
what to put in these members.  Investigating, I saw that the function
didn't really need them, so this commit clears that up.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-15 10:23:04 -07:00
Ben Pfaff
d8653c386a connmgr: Drop 'flow' parameter from connmgr_send_packet_in().
Only 'flow->in_port' was used, which was redundant with pin->fmd.in_port.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-15 10:23:03 -07:00
Ben Pfaff
2a6dab2f80 ofp-util: Fix typo in comment.
The ofp_packet_in reasons are OFPR_*, not OFPRR_*.  (Duh.)

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-15 10:23:02 -07:00
Chris Wright
d8965755e7 configure: add configure option to disable building brcompat
This adds ability to do:

  ./configure --disable-brcompat

to disable building userspace and kernel module associated with
providing linux bridge compatibility.  Sources should still be
distributed w/ make dist.

While there, update comment referring to long removed veth driver
which is now relevant for brcompat module.

Cc: Jesse Gross <jesse@nicira.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2012-03-13 16:50:42 -07:00
Pravin B Shelar
199253134c ofproto: Fix internal port mtu setting.
Update port does not check changed MTU for internal port which allows
administrator assign larger MTU compared to non-internal port.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
2012-03-13 11:40:58 -07:00
Ben Pfaff
40e05935fd ofproto-dpif: Add comments for a few VLAN splinters functions.
CC: Min Chen <ustcer.tonychan@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-13 09:55:11 -07:00
Ben Pfaff
37d034580a Use pwd in place of $PWD, treewide.
The Autoconf manual says:

     Posix 1003.1-2001 requires that `cd' and `pwd' must update the
     `PWD' environment variable to point to the logical name of the
     current directory, but traditional shells do not support this.
     This can cause confusion if one shell instance maintains `PWD' but
     a subsidiary and different shell does not know about `PWD' and
     executes `cd'; in this case `PWD' points to the wrong directory.
     Use ``pwd`' rather than `$PWD'.

so this commit replaces all uses of $PWD by `pwd`.

Reported-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-13 09:34:55 -07:00
Ben Pfaff
4807bca955 tests: Skip "strings at least 2 characters long" test for narrow Python.
Narrow Python can't handle Unicode characters outside the BMP, so skip the
test.

Reported-by: Michael Shigorin <mike@osdn.org.ua>
Tested-by: Michael Shigorin <mike@osdn.org.ua>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-12 14:46:56 -07:00
Ben Pfaff
2666caae11 ofproto: Fix code that keeps track of MTU.
ofport_install() should set the MTU that it finds into the ofport
before calling set_internal_devs_mtu(), because the latter function might
change the MTU and update ofport->mtu and the caller should not incorrectly
overwrite its changes.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-12 12:59:47 -07:00
Ben Pfaff
63633ffd8c openflow: Properly clean out stamp files on "make clean".
Reported-by: Chris Wright <chrisw@sous-sol.org>
Acked-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-12 12:30:57 -07:00