sliver-openvswitch.git
13 years agoRelease Open vSwitch 1.0.2 lts-1.0a v1.0.2
Justin Pettit [Sat, 9 Oct 2010 00:15:05 +0000 (17:15 -0700)]
Release Open vSwitch 1.0.2

13 years agonetdev: Enforce a floor "linux-htb" min-rate
Justin Pettit [Fri, 8 Oct 2010 21:18:28 +0000 (14:18 -0700)]
netdev: Enforce a floor "linux-htb" min-rate

13 years agonetdev: Don't divide by zero when "linux-htb" zero min-rate is used
Justin Pettit [Fri, 8 Oct 2010 20:50:16 +0000 (13:50 -0700)]
netdev: Don't divide by zero when "linux-htb" zero min-rate is used

A "min-rate" of zero for the "linux-htb" QoS type would cause a divide
by zero exception.  This patch prevents that by just returning zero.  A
later patch will try to enforce reasonable values for "min-rate".

Bug #3745

13 years agoxenserver: ovs-external-ids log to file instead of syslog
Ethan Jackson [Fri, 1 Oct 2010 02:29:27 +0000 (02:29 +0000)]
xenserver: ovs-external-ids log to file instead of syslog

ovs-external-ids was crashing on startup because it was brought up
before /dev/log exists.  The simplest solution to this problem is
to have it log to /var/log/openvswitch/ovs-external-ids.log .  This
is consistent with vswitchd and ovsdb-server.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
13 years agonetflow: Avoid (theoretically) looping 2**32 times.
Ben Pfaff [Wed, 1 Sep 2010 19:45:24 +0000 (12:45 -0700)]
netflow: Avoid (theoretically) looping 2**32 times.

If the netflow byte counter is UINT64_MAX, or at any rate much larger than
UINT32_MAX, netflow_expire() could loop for a very long time.  This commit
avoids that case.

This is only a theoretical bug fix.  I don't know of any actual bug that
would cause a counter to be that high.

13 years agonetflow: Do 64-bit division less often.
Ben Pfaff [Wed, 1 Sep 2010 19:43:11 +0000 (12:43 -0700)]
netflow: Do 64-bit division less often.

64-bit division is expensive.  Usually we can avoid it entirely, as done by
this patch.

13 years agonetdev-linux: Fix off-by-one error dumping queue stats.
Ben Pfaff [Thu, 16 Sep 2010 22:38:10 +0000 (15:38 -0700)]
netdev-linux: Fix off-by-one error dumping queue stats.

Linux kernel queue numbers are one greater than OpenFlow queue numbers, for
HTB anyhow.  The code to dump queues wasn't compensating for this, so this
commit fixes it up.

13 years agoxenserver: monitor-external-ids should run with --monitor
Ethan Jackson [Wed, 22 Sep 2010 19:40:39 +0000 (12:40 -0700)]
xenserver: monitor-external-ids should run with --monitor

The init script starts monitor-external-ids with --monitor when
configured to do so.  Also made changes to guarantee that --monitor
actually restarts ovs-external-ids.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
13 years agoxenserver: Added additional logging to ovs-external-ids
Ethan Jackson [Wed, 22 Sep 2010 22:38:17 +0000 (15:38 -0700)]
xenserver: Added additional logging to ovs-external-ids

Added additional logging for debug-ability and migrated to python
logging module.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
13 years agoxenserver: Rename monitor-external-ids -> ovs-external-ids
Ethan Jackson [Wed, 22 Sep 2010 01:03:07 +0000 (18:03 -0700)]
xenserver: Rename monitor-external-ids -> ovs-external-ids

Renamed the monitor-external-ids script ovs-external-ids.
Hopefully this will make it clearer who owns it when someone does
ps xa.

Also removed trailing whitespace from ovs-external-ids.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
13 years agoxenserver: Add license to uuid.py.
Ben Pfaff [Wed, 22 Sep 2010 17:03:31 +0000 (10:03 -0700)]
xenserver: Add license to uuid.py.

There seemed to be some confusion regarding this file's provenance, so it
is best to clarify.

Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agoxenserver: Add explicit license to refresh-xs-network-uuids.
Ben Pfaff [Wed, 22 Sep 2010 17:05:29 +0000 (10:05 -0700)]
xenserver: Add explicit license to refresh-xs-network-uuids.

I had assumed that a trivial one-line shell script didn't need an explicit
license, but it seems that I was wrong.

Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agoxenserver: Change license of xsconsole plugin to GPLv2.
Ben Pfaff [Wed, 22 Sep 2010 16:32:58 +0000 (09:32 -0700)]
xenserver: Change license of xsconsole plugin to GPLv2.

This file was under a proprietary license because it was derived from
proprietary XenServer code.  That upstream code is now under GPLv2, so
change the downstream code to GPLv2 also.

Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agopython: timer_wait_until calculated current time incorrectly
Ethan Jackson [Fri, 17 Sep 2010 22:06:17 +0000 (15:06 -0700)]
python: timer_wait_until calculated current time incorrectly

The timer_wait_until function in poller.py was using Time.msec to
figure out the current time.  Unfortunately, Time.msec does not in
exist. Changed to use ovs.timeval.msec .

13 years agoovsdb: Fix bug in "wait" command implementation.
Ben Pfaff [Thu, 2 Sep 2010 17:06:42 +0000 (10:06 -0700)]
ovsdb: Fix bug in "wait" command implementation.

The declaration of "error" that this commit removes shadowed an outer local
declaration of "error", which caused errors detected by this code not to be
propagated up to the outer level.

Found with GCC -Wshadow.

13 years agoxenserver: monitor-external-ids remove redundant ovs-vsctl calls
Ethan Jackson [Fri, 17 Sep 2010 15:23:32 +0000 (08:23 -0700)]
xenserver: monitor-external-ids remove redundant ovs-vsctl calls

The number of ovs-vsctl calls required to add a new vif in
monitor-external-ids grew linearly with the number of vifs in the
system.  Changed to only do O(1) ovs-vsctl calls per vif addition.

13 years agoovs-vsctl: Remove default timeout.
Ben Pfaff [Fri, 17 Sep 2010 21:37:51 +0000 (14:37 -0700)]
ovs-vsctl: Remove default timeout.

On overloaded XenServers the current default timeout of 5 seconds can
occasionally be reached, which causes VM startup to fail.  This commit
fixes the problem by removing the default timeout and changing each
invocation of ovs-vsctl within the tree to specify its own timeout,
if appropriate.

Bug #3573.

13 years agobrcompat_mod: Check if user has CAP_NET_ADMIN in ioctl handler
Vivien Bernet-Rollande [Thu, 16 Sep 2010 17:56:55 +0000 (10:56 -0700)]
brcompat_mod: Check if user has CAP_NET_ADMIN in ioctl handler

This patch checks that the user calling ioctl() to create, delete, or
modify bridges has the CAP_NET_ADMIN capability. This prevents
unpriviledged users from modifying the bridge configuration through
brcompatd. The checks are actually the same performed in
net/bridge/br_ioctl.c by the Linux kernel.

Signed-off-by: Vivien Bernet-Rollande <vbr@soprive.net>
Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agodatapath: Check IS_ERR() in do_execute().
Jesse Gross [Wed, 15 Sep 2010 23:52:48 +0000 (16:52 -0700)]
datapath: Check IS_ERR() in do_execute().

flow_actions_alloc() returns an error code in the form of a pointer
but we checked that the pointer was not NULL, which is always true.
This caused oopses on allocation errors when we would write into
an invalid pointer.

NIC-234

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
13 years agodatapath: Increase maximum number of actions per flow.
Ben Pfaff [Tue, 14 Sep 2010 20:32:36 +0000 (13:32 -0700)]
datapath: Increase maximum number of actions per flow.

Until now the number of actions in a flow has been limited to what fits in
a page.  Each action is 8 bytes, and on 32-bit architectures there is a
12-byte header, so with 4-kB pages that limits flows to 510 actions.  We
and Citrix have noticed that OVS stops working properly after about 509
VIFs are added to a bridge.  According to log messages this is the reason:
at this point it is no longer possible to flood a packet to all ports.

This commit should help, by increasing the maximum number of actions in a
flow.  In the long term, though, we should adopt use of port groups or
otherwise reduce the number of actions needed to flood a packet.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Bug #3573.
NIC-234.

13 years agoxenserver: Don't delete pidfile when stopping monitor-external-ids
Justin Pettit [Fri, 10 Sep 2010 21:32:41 +0000 (14:32 -0700)]
xenserver: Don't delete pidfile when stopping monitor-external-ids

It's not necessary to explicitly delete the pidfile when stopping
monitor-external-ids through the init script, since the daemon will take
care of that.

13 years agoxenserver: Don't monitor external-ids until XAPI is up
Justin Pettit [Fri, 10 Sep 2010 21:20:49 +0000 (14:20 -0700)]
xenserver: Don't monitor external-ids until XAPI is up

monitor-external-ids can't complete all its tasks until XAPI is up.  The
daemon is usually started before XAPI, so it can miss events.  This
commit causes the daemon to block until XAPI is finished initializing.

13 years agoRename "xs-vif-mac" external_ids key to "attached-mac", for generality.
Ben Pfaff [Wed, 1 Sep 2010 23:49:19 +0000 (16:49 -0700)]
Rename "xs-vif-mac" external_ids key to "attached-mac", for generality.

This can be useful on systems other than XenServer so there is no reason
to make it looks XenServer-specific.

CC: Jeremy Stribling <strib@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agoofproto: Get enough headroom in fail-open when connected to controller.
Ben Pfaff [Wed, 1 Sep 2010 17:17:40 +0000 (10:17 -0700)]
ofproto: Get enough headroom in fail-open when connected to controller.

Since commit 750638bb "ofproto: Avoid ofpbuf_clone() for OFPAT_CONTROLLER
common case," send_packet_in() needs at least DPIF_RECV_MSG_PADDING bytes
of headroom, which ofpbuf_clone() doesn't supply.  This commit should fix
that.

This fixes an assertion failure in ofpbuf_prealloc_headroom() via
send_packet_in().

Reported-by: Justin Pettit <jpettit@nicira.com>
13 years agoofpbuf: Add ofpbuf_new_with_headroom(), ofpbuf_clone_with_headroom().
Ben Pfaff [Wed, 1 Sep 2010 19:55:38 +0000 (12:55 -0700)]
ofpbuf: Add ofpbuf_new_with_headroom(), ofpbuf_clone_with_headroom().

These new functions simplify an increasingly common usage pattern.

Suggested-by: Jesse Gross <jesse@nicira.com>
13 years agonetflow: Send multiple records for byte counts > UINT32_MAX
Justin Pettit [Wed, 1 Sep 2010 01:41:32 +0000 (18:41 -0700)]
netflow: Send multiple records for byte counts > UINT32_MAX

When a NetFlow record is to be sent for a flow that had more than 2^32
bytes, we used to set the byte count to UINT32_MAX.  With this change,
we will send out multiple records to account for all the traffic.

13 years agoXenServer builds barf on hyphens in versions. v1.1.0pre1
Justin Pettit [Wed, 1 Sep 2010 09:26:06 +0000 (02:26 -0700)]
XenServer builds barf on hyphens in versions.

13 years agoRelease Open vSwitch 1.1.0-pre1
Justin Pettit [Tue, 31 Aug 2010 21:16:14 +0000 (14:16 -0700)]
Release Open vSwitch 1.1.0-pre1

13 years agodatapath: Include net/udp.h in vport-capwap.c
Simon Horman [Tue, 31 Aug 2010 02:47:28 +0000 (11:47 +0900)]
datapath: Include net/udp.h in vport-capwap.c

net/udp.h is currently included indirectly via linux/ipv6.h which is
in turn included indirectly via linux/ip.h.  However, this breaks down
if CONFIG_IPV6 is not set, leading to a number of build errors.

Signed-off-by: Simon Horman <horms@verge.net.au>
[Jesse: shortened commit message]
Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agoDebian: Add Joe Perches to debian/copyright
Simon Horman [Tue, 31 Aug 2010 01:13:55 +0000 (10:13 +0900)]
Debian: Add Joe Perches to debian/copyright

This syncs debian/copyright with the AUTHORS file.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agodatapath: Include linux/version.h in action.h for LINUX_VERSION
Simon Horman [Mon, 30 Aug 2010 07:33:17 +0000 (16:33 +0900)]
datapath: Include linux/version.h in action.h for LINUX_VERSION

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agoAUTHORS: Add Joe Perches.
Jesse Gross [Mon, 30 Aug 2010 17:51:41 +0000 (10:51 -0700)]
AUTHORS: Add Joe Perches.

Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agotreewide: Use pr_fmt and pr_<level>
Joe Perches [Mon, 30 Aug 2010 07:24:54 +0000 (00:24 -0700)]
treewide: Use pr_fmt and pr_<level>

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Simon Horman <horms@verge.net.au>
[Jesse: Added missing pr_fmt in vport-gre.c and dp_sysfs_dp.c]
Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agodatapath: Add compat functions for pr_*.
Jesse Gross [Mon, 30 Aug 2010 17:56:49 +0000 (10:56 -0700)]
datapath: Add compat functions for pr_*.

In the earliest kernels that we support this family of macros
wasn't defined at all.  Later they were defined but did not include
the module name.  Finally, pr_warn was made a synonym for pr_warning.
This harmonizes the behavior across all kernels.

Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agotreewide: Remove trailing whitespace
Joe Perches [Mon, 30 Aug 2010 07:24:53 +0000 (00:24 -0700)]
treewide: Remove trailing whitespace

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agoINSTALL.Linux: Don't discourage building Debian packages.
Ben Pfaff [Mon, 30 Aug 2010 17:08:06 +0000 (10:08 -0700)]
INSTALL.Linux: Don't discourage building Debian packages.

For a while the Debian packages were not well maintained or regularly used,
but we at Nicira use them all the time now.  We now aim to have them
accepted into Debian downstream, so we should at least not discourage
users from trying them out.

Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agoRemove openvswitch-switch-config package.
Ben Pfaff [Mon, 30 Aug 2010 17:03:46 +0000 (10:03 -0700)]
Remove openvswitch-switch-config package.

This package was never used by many users, has not worked properly for a
while, and causes lintian warnings, so remove it.

CC: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agoDebian: openswitch-dbg should depend on the packages it has debugging symbols for
Simon Horman [Mon, 30 Aug 2010 07:32:38 +0000 (16:32 +0900)]
Debian: openswitch-dbg should depend on the packages it has debugging symbols for

See: http://lintian.debian.org/tags/dbg-package-missing-depends.html

Signed-off-by: Simon Horman <horms@verge.net.au>
13 years agoDebian: Add Homepage
Simon Horman [Mon, 30 Aug 2010 07:32:17 +0000 (16:32 +0900)]
Debian: Add Homepage

Signed-off-by: Simon Horman <horms@verge.net.au>
13 years agostream-ssl: Use OPENSSL_free() to free memory from X509_NAME_oneline().
Ben Pfaff [Fri, 27 Aug 2010 20:30:31 +0000 (13:30 -0700)]
stream-ssl: Use OPENSSL_free() to free memory from X509_NAME_oneline().

Reported-by: Tsvi Slonim <tsvi@toroki.com>
13 years agodatapath: Avoid accesses past the end of skbuff data in actions.
Ben Pfaff [Fri, 13 Aug 2010 17:46:12 +0000 (10:46 -0700)]
datapath: Avoid accesses past the end of skbuff data in actions.

Some of the flow actions that modify skbuff data did not check that the
skbuff was long enough before doing so.  This commit fixes that problem.

Previously, the strategy for avoiding this was to only indicate the layer-3
nw_proto field in the flow if the corresponding layer-4 header was fully
present, so that if, for example, nw_proto was IPPROTO_TCP, this meant
that a TCP header was present.  The original motivation for this patch was
to add corresponding code to only indicate a layer-2 dl_type if the
corresponding layer-3 header was fully present.  But I'm now convinced that
this approach is conceptually wrong, because the meaning of a layer-N
header should not be affected by the meaning of a layer-(N+1) header.

This commit switches to a new approach.  Now, when a header is missing, its
fields in the flow are simply zeroed and have no effect on the "type" field
for the outer header.  Responsibility for ensuring that a header is fully
present is now shifted to the actions that wish to modify that header.

Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agodatapath: Fix default value of skb transport_header.
Ben Pfaff [Fri, 27 Aug 2010 19:41:00 +0000 (12:41 -0700)]
datapath: Fix default value of skb transport_header.

This commit started out as simply better documenting flow_extract(),
but then I realized that nothing cares about transport_header in the
non-IP case, so don't bother with it at all.

Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agodatapath: Avoid pskb_may_pull() checks where not needed.
Ben Pfaff [Thu, 12 Aug 2010 22:37:47 +0000 (15:37 -0700)]
datapath: Avoid pskb_may_pull() checks where not needed.

These calls to pskb_may_pull() can be reduced to checks on skb->len because
in these contexts those headers will already have been pulled into the
skb linear area if it is there at all.

Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agodatapath: Report memory allocation errors in flow_extract().
Ben Pfaff [Fri, 27 Aug 2010 19:32:05 +0000 (12:32 -0700)]
datapath: Report memory allocation errors in flow_extract().

Until now flow_extract() has simply returned a bogus flow when memory
allocation errors occurred.  This fixes the problem by propagating the
error to the caller.

Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agolearning-switch: Ignore "packet_in"s caused by OFPP_CONTROLLER actions.
Ben Pfaff [Tue, 10 Aug 2010 18:23:02 +0000 (11:23 -0700)]
learning-switch: Ignore "packet_in"s caused by OFPP_CONTROLLER actions.

It seems best to ignore "packet_in"s caused by OFPP_CONTROLLER actions in
learning-switch, since someone might be experimenting and it's best not
to interfere with that.

13 years agoofproto: Avoid ofpbuf_clone() for OFPAT_CONTROLLER common case.
Ben Pfaff [Tue, 10 Aug 2010 18:05:01 +0000 (11:05 -0700)]
ofproto: Avoid ofpbuf_clone() for OFPAT_CONTROLLER common case.

This additionally optimizes the common case of the first packet of a flow
that consists only of an OFPAT_CONTROLLER action, by avoiding an
ofpbuf_clone() call along that path.

13 years agoofproto: Avoid user->kernel->user round-trip for many controller actions.
Ben Pfaff [Wed, 4 Aug 2010 21:08:26 +0000 (14:08 -0700)]
ofproto: Avoid user->kernel->user round-trip for many controller actions.

When an OpenFlow flow says to send packets to the controller, until now
ofproto has executed that using dpif_execute(), which passes the packet up
to the kernel.  The kernel queues the packet into its "action" queue, and
then later ofproto pulls the packet back down from the kernel and sends it
to the controller.

However, this is unnecessary.  Open vSwitch can just recognize in advance
that it will get the packet back and handle it directly, skipping the round
trip.  This commit implements this optimization.

This generally affects only the first packet in a flow, since generally the
rest come directly down from the kernel.  It only optimizes the "easy" case
where the first action in a flow is to send the packet to the controller,
since this seems to be the common case in the flows that I'm looking at
now.

13 years agoxenserver: Finish renaming system-level external_ids.
Ben Pfaff [Thu, 26 Aug 2010 20:57:11 +0000 (13:57 -0700)]
xenserver: Finish renaming system-level external_ids.

vswitch.xml was updated to describe system-id and xs-system-uuid but the
implementation of this update was incomplete.

CC: Justin Pettit <jpettit@nicira.com>
CC: Jeremy Stribling <strib@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agoconfigure: Enable OpenSSL support by default.
Ben Pfaff [Fri, 20 Aug 2010 18:26:03 +0000 (11:26 -0700)]
configure: Enable OpenSSL support by default.

Years ago some users had broken OpenSSL libraries that didn't actually
work, so we disabled OpenSSL by default.  By now, I hope that those users
have fixed their systems.

13 years agodpif-netdev: Expand tabs.
Ben Pfaff [Tue, 24 Aug 2010 23:00:46 +0000 (16:00 -0700)]
dpif-netdev: Expand tabs.

13 years agoAdd Nicira extension to OpenFlow for dropping spoofed ARP packets.
Ben Pfaff [Tue, 24 Aug 2010 23:00:27 +0000 (16:00 -0700)]
Add Nicira extension to OpenFlow for dropping spoofed ARP packets.

"ARP spoofing" is when a host claims an incorrect association between an
IP address and a MAC address for deceptive purposes.  OpenFlow by itself
can prevent a host from sending out ARP replies from an incorrect MAC
address in the Ethernet L2 header, but it cannot control the MAC addresses
inside the ARP L3 packet.  This commit adds a new action that can be used
to drop these spoofed packets.

CC: Paul Ingram <paul@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agovswitchd: Fix 100% CPU usage with bonds and --fake-proc-net.
Ben Pfaff [Thu, 26 Aug 2010 16:56:25 +0000 (09:56 -0700)]
vswitchd: Fix 100% CPU usage with bonds and --fake-proc-net.

The current date in milliseconds since the epoch is ~1,282,841,552,000,
which is greater than LONG_MAX of 4,294,967,295 on 32-bit systems, so
no matter what was stored into bond_next_fake_iface_update, it would always
appear to be expired.  It really needs to be a 64-bit number.  (This was
just a typo really.)

Since XenServer 5.5 requires --fake-proc-net, this probably fixes an
important bug there.

Reported-by: Luiz Henrique Ozaki <luiz.ozaki@gmail.com>
13 years agoxenserver: Add type-checking to monitor-external-ids script.
Ben Pfaff [Thu, 26 Aug 2010 16:39:54 +0000 (09:39 -0700)]
xenserver: Add type-checking to monitor-external-ids script.

Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agoxenserver: Block until change in poll loop to avoid 100% CPU consumption.
Ben Pfaff [Thu, 26 Aug 2010 16:38:52 +0000 (09:38 -0700)]
xenserver: Block until change in poll loop to avoid 100% CPU consumption.

Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agovswitchd: Fix "updelay" configuration for bonds.
Ben Pfaff [Thu, 26 Aug 2010 17:06:36 +0000 (10:06 -0700)]
vswitchd: Fix "updelay" configuration for bonds.

Reported-by: Michael Mao <mmao@nicira.com>
Bug #3521.

13 years agodatapath: Free up flow_extract() return value for reporting errors.
Ben Pfaff [Thu, 12 Aug 2010 22:12:28 +0000 (15:12 -0700)]
datapath: Free up flow_extract() return value for reporting errors.

flow_extract() can fail due to memory allocation errors in pskb_may_pull().
Currently it doesn't return those properly, instead just reporting a bogus
flow to the caller.  But its return value is currently in use for reporting
whether the packet was an IPv4 fragment.  This commit switches to reporting
that in the skb itself so that the return value can be reused to report
errors.

Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agodatapath: Remove skb->len >= ETH_HLEN check from flow_extract().
Ben Pfaff [Fri, 13 Aug 2010 17:47:44 +0000 (10:47 -0700)]
datapath: Remove skb->len >= ETH_HLEN check from flow_extract().

The callers ensure that this is already the case.

Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agodatapath: Use 'bool' instead of 'int' where appropriate.
Ben Pfaff [Fri, 13 Aug 2010 17:18:28 +0000 (10:18 -0700)]
datapath: Use 'bool' instead of 'int' where appropriate.

'bool' is better modern kernel style.

Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agodatapath: Use min() instead of open-coding it.
Ben Pfaff [Fri, 13 Aug 2010 16:43:04 +0000 (09:43 -0700)]
datapath: Use min() instead of open-coding it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agoxenserver: Add monitor-external-ids daemon
Justin Pettit [Tue, 24 Aug 2010 21:50:06 +0000 (14:50 -0700)]
xenserver: Add monitor-external-ids daemon

The monitor-external-ids daemon monitors the external_ids columns of the
Bridge and Interface OVSDB tables.  Its primary responsibility is to
set the "bridge-id" and "iface-id" keys in the Bridge and Interface
tables, respectively.  It also looks for the use of "network-uuids" in
the Bridge table and duplicates its value to the preferred
"xs-network-uuids".

Signed-off-by: Justin Pettit <jpettit@nicira.com>
13 years agoxenserver: Prepend XenServer external ids with "xs-"
Justin Pettit [Mon, 9 Aug 2010 22:07:32 +0000 (15:07 -0700)]
xenserver: Prepend XenServer external ids with "xs-"

Signed-off-by: Justin Pettit <jpettit@nicira.com>
13 years agoxenserver: Report the system type and version as external ids
Justin Pettit [Thu, 5 Aug 2010 01:52:17 +0000 (18:52 -0700)]
xenserver: Report the system type and version as external ids

The configuration schema defines the system-type and system-version
external-ids for the Open_vSwitch table.  This commit adds support for
reporting them on XenServer.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
13 years agovswitch: Break out XenServer-specific external ids
Justin Pettit [Wed, 4 Aug 2010 06:00:04 +0000 (23:00 -0700)]
vswitch: Break out XenServer-specific external ids

As we move to new platforms, not all external identifiers will be
universally unique, but the "-uuid" suffix seemingly prevents their use.
Create new identifiers without the "-uuid" suffix.  Change the existing
XenServer-specific external identifiers to contain a "xs-" prefix.  This
also allows a XenServer integrator to define identifiers different from
the XenServer UUIDs, but still leave them in the config database to be
used by other programs.

13 years agovswitch: Add port status column to Port table
Justin Pettit [Wed, 4 Aug 2010 05:21:43 +0000 (22:21 -0700)]
vswitch: Add port status column to Port table

Add "status" map to provide optional status of ports to Port table.

13 years agoDelete local copy of simplejson.
Ben Pfaff [Sat, 21 Aug 2010 22:39:27 +0000 (15:39 -0700)]
Delete local copy of simplejson.

The previous commit dropped usage of simplejson from the Python
code in the tree, because it did not provide adequate features to
support the JSON-RPC engine.  In particular simplejson is not a
"push parser"--you can't give it a byte or a character at a time
and have it tell you when it has read a whole JSON value.

13 years agoImplement initial Python bindings for Open vSwitch database.
Ben Pfaff [Wed, 25 Aug 2010 17:26:40 +0000 (10:26 -0700)]
Implement initial Python bindings for Open vSwitch database.

These initial bindings pass a few hundred of the corresponding tests
for C implementations of various bits of the Open vSwitch library API.
The poorest part of them is actually the Python IDL interface in
ovs.db.idl, which has not received enough attention yet.  It appears
to work, but it doesn't yet support writes (transactions) and it is
difficult to use.  I hope to improve it as it becomes clear what
semantics Python applications actually want from an IDL.

13 years agoreconnect: Refactor tests to use common macro.
Ben Pfaff [Sat, 21 Aug 2010 03:50:17 +0000 (20:50 -0700)]
reconnect: Refactor tests to use common macro.

This will make it easier to add tests for the Python implemenentation.

13 years agoovsdbmonitor: Fix uninstall.
Ben Pfaff [Mon, 23 Aug 2010 23:56:25 +0000 (16:56 -0700)]
ovsdbmonitor: Fix uninstall.

We install an ovsdbmonitor binary so we should uninstall it too.

13 years agodaemon: Improve comments.
Ben Pfaff [Mon, 23 Aug 2010 06:13:35 +0000 (23:13 -0700)]
daemon: Improve comments.

Elsewhere we put the name of command-line options that control global
variables in the comment, so do so here as well.

Also fix a comment typo.

13 years agoreconnect: Fix typo in comment.
Ben Pfaff [Sun, 22 Aug 2010 20:39:43 +0000 (13:39 -0700)]
reconnect: Fix typo in comment.

13 years agojson: Remove unused return value from json_parser_push().
Ben Pfaff [Sun, 22 Aug 2010 20:38:39 +0000 (13:38 -0700)]
json: Remove unused return value from json_parser_push().

No point in returning a value that no caller uses.

13 years agopoll-loop: Fix obsolete comment.
Ben Pfaff [Sun, 22 Aug 2010 19:52:35 +0000 (12:52 -0700)]
poll-loop: Fix obsolete comment.

The poll loop used to have support for autonomous subroutines, but it no
longer does.

13 years agojsonrpc: Indentation fix.
Ben Pfaff [Sat, 21 Aug 2010 05:26:25 +0000 (22:26 -0700)]
jsonrpc: Indentation fix.

13 years agostream, vconn: Fix comments.
Ben Pfaff [Mon, 23 Aug 2010 19:18:05 +0000 (12:18 -0700)]
stream, vconn: Fix comments.

All streams and all vconns are "active", so there's no point in noting that
requirement in comments.  (A long time ago, active and passive vconns were
conflated instead of having passive vconns broken out as pvconns.  But
active and passive streams have always been distinct.)

13 years agojson: Remove write-only variable from json_lex_number().
Ben Pfaff [Fri, 20 Aug 2010 16:13:20 +0000 (09:13 -0700)]
json: Remove write-only variable from json_lex_number().

13 years agoovsdb: Remove unused ovsdb_datum_from_json_unique().
Ben Pfaff [Tue, 17 Aug 2010 19:49:31 +0000 (12:49 -0700)]
ovsdb: Remove unused ovsdb_datum_from_json_unique().

This function was not used outside of the test-ovsdb program.  It seems
like we might as well remove it.

13 years agoxenserver: Add ovs-parse-leaks manpage to list of files.
Ben Pfaff [Wed, 25 Aug 2010 20:04:34 +0000 (13:04 -0700)]
xenserver: Add ovs-parse-leaks manpage to list of files.

Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agoutilities: Remove ovs-wdt.
Ben Pfaff [Wed, 25 Aug 2010 16:59:26 +0000 (09:59 -0700)]
utilities: Remove ovs-wdt.

We used ovs-wdt at Nicira for a while when we were working on building
hardware switches.  We don't use it anymore, so remove it from the tree.

CC: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agoutilities: Remove ovs-monitor.
Ben Pfaff [Wed, 25 Aug 2010 16:57:11 +0000 (09:57 -0700)]
utilities: Remove ovs-monitor.

The ovs-monitor script is now more than adequately replaced by the
--monitor option to the various daemons.

CC: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agoovs-parse-leaks: Add manpage.
Ben Pfaff [Wed, 25 Aug 2010 00:49:13 +0000 (17:49 -0700)]
ovs-parse-leaks: Add manpage.

CC: Simon Horman <horms@verge.net.au>
13 years agodatapath: Unconditionally call kfree_skb()
Simon Horman [Wed, 25 Aug 2010 03:10:32 +0000 (12:10 +0900)]
datapath: Unconditionally call kfree_skb()

kfree_skb() will ignore a NULL pointer.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agodebian: Use pfaffben@debian.org as uploader address for Ben Pfaff.
Ben Pfaff [Wed, 25 Aug 2010 00:12:23 +0000 (17:12 -0700)]
debian: Use pfaffben@debian.org as uploader address for Ben Pfaff.

I use pfaffben@debian.org as my contact address for Debian packages, so
use it here too.  I've had annoyed emails from folks when I am not
consistent about this, so fix it proactively.

13 years agoDebian: make debian/copyright more friendly to the ftpmasters
Simon Horman [Tue, 24 Aug 2010 00:54:58 +0000 (09:54 +0900)]
Debian: make debian/copyright more friendly to the ftpmasters

Signed-off-by: Simon Horman <horms@verge.net.au>
[list of copyright holders adjusted]
Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agonetdev-tunnel: Add CAPWAP userspace interface.
Jesse Gross [Thu, 12 Aug 2010 23:27:19 +0000 (19:27 -0400)]
netdev-tunnel: Add CAPWAP userspace interface.

Provide a userspace interface to the CAPWAP UDP transport
tunneling mechanism in the kernel.

Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agonetdev: Don't assume all netdevs are available at runtime.
Jesse Gross [Tue, 17 Aug 2010 22:09:53 +0000 (18:09 -0400)]
netdev: Don't assume all netdevs are available at runtime.

Currently we print a warning if a user tries to configure a
netdev that is not in the list that userspace knows about.
However, it is possible that a given netdev maybe be enabled but
when it tries to create a device it finds out that it can't
(not supported by kernel module, hardware not present, etc.).
This makes the behavior the same in both cases.

Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agodatapath: Add support for CAPWAP UDP transport.
Jesse Gross [Thu, 12 Aug 2010 00:55:58 +0000 (20:55 -0400)]
datapath: Add support for CAPWAP UDP transport.

Add support for the transport portion of the CAPWAP protocol as
an alternative to GRE for L2 over L3 tunneling.  This is not
full support for the CAPWAP protocol.  CAPWAP covers management
of wireless access points and describes a control protocol for
setting those devices up.  It also describes a data plane protocol
that allows packets to be tunneled to a controller for inspection.
This data plane protocol is the only component covered by this
commit.

Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agodatapath: Add support for tunnel fragmentation.
Jesse Gross [Mon, 16 Aug 2010 14:32:41 +0000 (10:32 -0400)]
datapath: Add support for tunnel fragmentation.

Up until now it was assumed that encapsulated packets larger than
the MTU would be fragmented by the IP stack.  However, some
tunneling protocols provide their own fragmentation mechanism.  This
adds the necessary support to the generic tunnel code to support
fragmentation.

Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agonetdev-gre: Genericize GRE netdev.
Jesse Gross [Wed, 11 Aug 2010 22:29:48 +0000 (18:29 -0400)]
netdev-gre: Genericize GRE netdev.

Since the GRE netdev doesn't actually implement any of the GRE
protocol, none of the code is really specific to GRE.  This commit
makes the netdev a little more generic so that additional tunnel
types can easily piggyback on it in the future.

Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agodatapath: Abstract tunneling implementation from GRE.
Jesse Gross [Wed, 11 Aug 2010 00:11:48 +0000 (20:11 -0400)]
datapath: Abstract tunneling implementation from GRE.

Much of the code in the GRE implementation is not specific to the
GRE protocol but is actually common to all types of tunnels.  In
order to support future types of tunnels, move this code into a
common library.

Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agodatapath: struct brport_attribute no longer has an owner element
Simon Horman [Mon, 23 Aug 2010 06:30:12 +0000 (15:30 +0900)]
datapath: struct brport_attribute no longer has an owner element

Between 2.6.35 and 2.6.36-rc1 the owner element of struct brport_attribute
was removed.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agodatapath: Use rtnl_link_stats64
Simon Horman [Mon, 23 Aug 2010 06:30:11 +0000 (15:30 +0900)]
datapath: Use rtnl_link_stats64

This adds compatibility with a series kernel changesets that
introduces 64bit statistics. The final changeset (to date) being
"net: Document that dev_get_stats() returns the given pointer".
The relevant changesets were added between 2.6.35 and 2.6.36-rc1.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agodatapath: use rx_handler_data pointer
Simon Horman [Mon, 23 Aug 2010 06:30:10 +0000 (15:30 +0900)]
datapath: use rx_handler_data pointer

This adds compatibility with kernel changeset
"bridge: use rx_handler_data pointer to store net_bridge_port pointer"
which was added between 2.6.35 and 2.6.36-rc1.

With this change it is now safe to (attempt to) insert both bridge and
datapath with newer (>=2.6.36) kernels, although whichever is inserted
second will fail to initialise on the call to netdev_rx_handler_register()

Signed-off-by: Simon Horman <horms@verge.net.au>
[Jesse: fixed merge conflicts in vport-netdev.c and netdevice.h]
Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agodatapath: Take a rcu_dereference() in netdev_get_vport()
Simon Horman [Mon, 23 Aug 2010 06:30:09 +0000 (15:30 +0900)]
datapath: Take a rcu_dereference() in netdev_get_vport()

Although not strictly necessary, this will make this
function more consistent when compatibility for 2.6.36 is added.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agodatapath: rtable may not have a u. member
Simon Horman [Mon, 23 Aug 2010 06:30:08 +0000 (15:30 +0900)]
datapath: rtable may not have a u. member

This brings the code up to sync with the kernel as
of changeset "net-next: remove useless union keyword",
which was added between 2.6.35 and 2.6.36-rc1

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agodatapath: Handle duplicate netdev in netdev_rx_handler_register()
Simon Horman [Mon, 23 Aug 2010 06:30:07 +0000 (15:30 +0900)]
datapath: Handle duplicate netdev in netdev_rx_handler_register()

For kernels that have netdev_rx_handler_register() (>=2.6.35),
duplicate netdevs are detected by netdev_rx_handler_register().
So by adding duplicate detection to the netdev_rx_handler_register()
compatibility code the explicit check in netdev_create() can be removed.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agodatapath: dont use non-existent receive hooks
Simon Horman [Mon, 23 Aug 2010 06:30:06 +0000 (15:30 +0900)]
datapath: dont use non-existent receive hooks

This adds compatibility with kernel changeset
of changeset "net: add rx_handler data pointer"
and thus "net: replace hooks in __netif_receive_skb V5",
which were added between 2.6.35 and 2.6.36-rc1

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agoterminal: Remove vlog modules.
Jesse Gross [Mon, 23 Aug 2010 17:42:19 +0000 (13:42 -0400)]
terminal: Remove vlog modules.

The terminal modules in vlog-modules.def weren't removed when the
code was, which breaks compilation due to a check for this
condition.

13 years agoRemove ezio-term and ovs-switchui utilities.
Ben Pfaff [Fri, 20 Aug 2010 19:37:01 +0000 (12:37 -0700)]
Remove ezio-term and ovs-switchui utilities.

These utilities were useful when Nicira was building switches with 16x2 LCD
front panel displays, but they aren't useful for other environments and
even Nicira does not use that kind of switch any longer.  So remove them
and all the build infrastructure on which they depended.

13 years agodatpath: Avoid reporting half updated statistics.
Jesse Gross [Thu, 29 Jul 2010 01:20:43 +0000 (18:20 -0700)]
datpath: Avoid reporting half updated statistics.

We enforce mutual exclusion when updating statistics by disabling
bottom halves and only writing to per-CPU state.  However, reading
requires looking at the statistics for foreign CPUs, which could be
in the process of updating them since there isn't a lock.  This means
we could get garbage values for 64-bit values on 32-bit machines or
byte counts that don't correspond to packet counts, etc.

This commit introduces a sequence lock for statistics values to avoid
this problem.  Getting a write lock is very cheap - it only requires
incrementing a counter plus a memory barrier (which is compiled away
on x86) to acquire or release the lock and will never block.  On
read we spin until the sequence number hasn't changed in the middle
of the operation, indicating that the we have a consistent set of
values.

Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agogre: Don't require incoming checksum.
Jesse Gross [Sat, 14 Aug 2010 16:25:58 +0000 (12:25 -0400)]
gre: Don't require incoming checksum.

The current meaning of the GRE checksum option is to include
checksums on transmit and require packets to have them on receive.
In addition, incoming packets with checksums are always validated
regardless of this option.  Requiring checksums on receive creates
surprising behavior and interoperability issues.  This disables the
requirement on receive.  The new behavior is that the sender decides
whether to checksum packets and the receiver will validate packets
with checksums (similar to UDP).

Signed-off-by: Jesse Gross <jesse@nicira.com>