sliver-openvswitch.git
11 years agoSetting tag sliver-openvswitch-1.9.90-3 sliver-openvswitch-1.9.90-3
Thierry Parmentelat [Fri, 22 Feb 2013 18:09:51 +0000 (19:09 +0100)]
Setting tag sliver-openvswitch-1.9.90-3
pulled mainstream - amazingly this is still known as 1.9.90 despite the size of changes

11 years agorename myslice => example_slice
Giuseppe Lettieri [Fri, 1 Feb 2013 13:42:32 +0000 (14:42 +0100)]
rename myslice => example_slice

This is to avoid confusion with the MySlice project, as
suggested by Ciro Sconamiglio.

11 years agoupdated info in the exp-tool/README
Giuseppe Lettieri [Fri, 1 Feb 2013 11:09:55 +0000 (12:09 +0100)]
updated info in the exp-tool/README

11 years agoMerge branch 'mainstream'
Giuseppe Lettieri [Thu, 31 Jan 2013 14:09:26 +0000 (15:09 +0100)]
Merge branch 'mainstream'

Conflicts:
lib/dpif-netdev.c

11 years agoovs-ctl: Fix a couple of typos.
Gurucharan Shetty [Wed, 30 Jan 2013 16:19:35 +0000 (08:19 -0800)]
ovs-ctl: Fix a couple of typos.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agonetdev-vport: Build on all platforms.
Ethan Jackson [Fri, 25 Jan 2013 21:30:40 +0000 (13:30 -0800)]
netdev-vport: Build on all platforms.

This patch removes the final bit of linux specific code which
prevents building netdev-vport everywhere.  With this, other
platforms automatically get access to patch ports, and (if their
datapath supports it), flow based tunneling.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agotests: Add tunnel unit tests.
Ethan Jackson [Wed, 9 Jan 2013 01:33:04 +0000 (17:33 -0800)]
tests: Add tunnel unit tests.

This commit adds unit tests which exercise the flow based
tunneling code added in previous patches.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agolib: Switch to flow based tunneling.
Ethan Jackson [Sat, 15 Dec 2012 03:14:54 +0000 (19:14 -0800)]
lib: Switch to flow based tunneling.

With this patch, ovs-vswitchd uses flow based tunneling
exclusively.  I.E. each kind of tunnel shares a single tunnel
backer in the datapath.  Tunnel headers are set by userspace using
the ipv4_tunnel datapath action.  And, the configuration of
individual tunnels is now a userspace responsibility, so
netdev-vport no longer marshals and unmarshals Netlink attributes
for tunnel configuration, instead only storing the configuration
internally.  There are still some significant pieces of work to do,
but the basic building blocks are there to begin testing.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Co-authored-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agotunnel: Userspace implementation of tunnel manipulation.
Jesse Gross [Thu, 20 Sep 2012 01:37:07 +0000 (18:37 -0700)]
tunnel: Userspace implementation of tunnel manipulation.

The kernel tunneling code currently needs to handle a large number
of operations when tunnel packets are encapsulated and
decapsulated.  Some examples of this are: finding the correct
tunnel port on receive, TTL and ToS inheritance, ECN handling, etc.
All of these can be done on a per-flow basis in userspace now that
we have both the inner and outer header information, which allows
us to both simplify the kernel and take advantage of userspace's
information.  Once tunnel packets are redirected into this code,
the redundant pieces can be removed from other places.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agonetdev: New function netdev_get_dpif_port().
Ethan Jackson [Mon, 17 Dec 2012 01:08:50 +0000 (17:08 -0800)]
netdev: New function netdev_get_dpif_port().

In future patches, a netdev's datapath port name may not
necessarily be the same as its device name. This patch prepares for
this by making the distinction in the netdev and dpif layers.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agopackets: Create global helper is_ip_any().
Ethan Jackson [Wed, 23 Jan 2013 03:38:32 +0000 (19:38 -0800)]
packets: Create global helper is_ip_any().

Used outside of meta-flow in future patches.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agodpif-netdev: Allow stub interfaces on the dummy datapath.
Ethan Jackson [Tue, 8 Jan 2013 22:37:23 +0000 (14:37 -0800)]
dpif-netdev: Allow stub interfaces on the dummy datapath.

Future patches will need to add netdevs to the dummy datapath which
can't actually send or receive packets.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto-dpif: Install drops for flows from invalid in_ports.
Ethan Jackson [Wed, 23 Jan 2013 23:38:10 +0000 (15:38 -0800)]
ofproto-dpif: Install drops for flows from invalid in_ports.

Before this patch, if a packet came in on a port which userspace
doesn't know about, it would be silently dropped without installing
a drop flow.  Historically, this has been fine because this
situation could only occur during transient reconfiguration
periods.  However, in future, this could occur when the tunneling
code decides to reject a packet due to invalid headers.  In this
case, it's preferable to drop the packet in the kernel to avoid a
high bandwidth stream of invalid packets DoSing the switch.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto-dpif: Require an in_port when tracing datapath flows.
Ethan Jackson [Thu, 24 Jan 2013 01:05:54 +0000 (17:05 -0800)]
ofproto-dpif: Require an in_port when tracing datapath flows.

All datapath flows should have an in_port, so it doesn't make a lot
of sense to allow omitting it when tracing.  If a user wants to
trace a flow which has no in_port, they can use the OpenFlow syntax
which doesn't go through ofproto_receive().

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto-dpif: Use ofproto_receive() in update_stats().
Ethan Jackson [Fri, 25 Jan 2013 04:07:51 +0000 (20:07 -0800)]
ofproto-dpif: Use ofproto_receive() in update_stats().

This removes a bit of duplicate code, and will be necessary to
support future patches.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoroute-table: Add route_table_wait() to the stub implementation.
Ethan Jackson [Fri, 25 Jan 2013 22:54:31 +0000 (14:54 -0800)]
route-table: Add route_table_wait() to the stub implementation.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agodatapath: Remove kernel patch ports.
Jesse Gross [Fri, 25 Jan 2013 22:17:49 +0000 (14:17 -0800)]
datapath: Remove kernel patch ports.

Now that userspace implements patch ports completely internally,
it's possible to remove the kernel implementation of them.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agodatapath: Remove compatibility GRE identifier.
Jesse Gross [Fri, 25 Jan 2013 22:12:44 +0000 (14:12 -0800)]
datapath: Remove compatibility GRE identifier.

We want to move the GRE vport ID into the upstream range but in
order to ease the transition kept the old ID around for one release.
This removes the old value.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agodatapath: Remove tunnel configuration sequence number.
Jesse Gross [Fri, 25 Jan 2013 21:53:57 +0000 (13:53 -0800)]
datapath: Remove tunnel configuration sequence number.

When tunnel header caching was in use, it was necessary to detect
configuration changes that would invalidate the cache.  This was
done using a sequence number on the configuration.  However, now
that header caching has been removed the sequence number is no
longer necessary.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agodatapath: Remove vport MAC address configuration.
Jesse Gross [Fri, 25 Jan 2013 21:42:01 +0000 (13:42 -0800)]
datapath: Remove vport MAC address configuration.

The ability to retrieve and set MAC addresses on vports is only
necessary for tunnel ports (the addresses for actual devices can be
retrieved through direct Linux mechanisms).  Tunnel ports only used
the information for the purpose of generating path MTU discovery
packets, which has now been removed.  Current userspace code already
reflects these changes, so this drops the functionality from the
kernel.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agodatapath: Remove tunnel path MTU discovery support.
Jesse Gross [Fri, 25 Jan 2013 20:44:00 +0000 (12:44 -0800)]
datapath: Remove tunnel path MTU discovery support.

Path MTU discovery can improve tunnel performance in some cases
but is non-standard and can introduce problems in others.  As a
result it has already been deprecated and removed from userspace.
This removes the corresponding kernel support to simplify the
code.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agodatapath: Remove support for Don't Fragment inheritance.
Jesse Gross [Fri, 25 Jan 2013 20:38:45 +0000 (12:38 -0800)]
datapath: Remove support for Don't Fragment inheritance.

Inheritance of the Don't Fragment bit in tunnels will not be
supported with flow based tunneling and has already been removed
from userspace.  This removes the corresponding kernel support.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agoFAQ: Add entry describing upgrade order between userspace and kernel.
Jesse Gross [Mon, 28 Jan 2013 18:23:42 +0000 (10:23 -0800)]
FAQ: Add entry describing upgrade order between userspace and kernel.

There will be significant changes for tunneling between 1.9 and 1.10
so this describes how to smoothly upgrade.

Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoworker: Don't have worker abort when parent dies.
Justin Pettit [Sat, 26 Jan 2013 02:12:01 +0000 (18:12 -0800)]
worker: Don't have worker abort when parent dies.

Depending on how forcefully the parent process is killed, the worker
could abort when trying to read or write on their shared socket.  This
changes those errors from VLOG_ABORT to VLOG_FATAL so that a core isn't
generated.

Bug #14821

Reported-by: Amey Bhide <abhide@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agodatapath: Clear struct ovs_key_ipv4_tunnel padding.
Pravin B Shelar [Sat, 26 Jan 2013 02:09:07 +0000 (18:09 -0800)]
datapath: Clear struct ovs_key_ipv4_tunnel padding.

Following patch memset ovs_key_ipv4_tunnel padding area so that
packets from a flow would be mapped to same flow in kernel datapath
flow table.

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

11 years agoofproto: Maintain "expirable" list for "add" flow_mod with replaced rule.
Ben Pfaff [Sat, 26 Jan 2013 01:26:42 +0000 (17:26 -0800)]
ofproto: Maintain "expirable" list for "add" flow_mod with replaced rule.

Commit e503cc199 (ofproto: Optimise OpenFlow flow expiry) optimized
OpenFlow flow expiration by putting expirable flows on a list, but it
failed to remove flows from the list when they were replaced by a new
flow with an OpenFlow flow_mod "add" operation.  This commit fixes the
problem.

Found by valgrind.

CC: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto: Properly refresh rule modified time when nothing else changes.
Ben Pfaff [Fri, 25 Jan 2013 23:07:36 +0000 (15:07 -0800)]
ofproto: Properly refresh rule modified time when nothing else changes.

In Open vSwitch, a "modify" or "modify_strict" flow_mod is supposed to
refresh the flow's last-modified time even if nothing else changes, because
this interpretation makes the "learn" action more useful.  As commit
308881afb (ofproto: Reinterpret meaning of OpenFlow hard timeouts with
OFPFC_MODIFY.) notes:

    I finally found a good use for hard timeouts in OpenFlow, but they
    require a slight reinterpretation of the meaning of hard timeouts.
    Until now, a hard timeout meant that a flow would be removed the
    specified number of seconds after a flow was created.  Intervening
    modifications with OFPFC_MODIFY(_STRICT) had no effect on the hard
    timeout; the flow would still be deleted the specified number of
    seconds after its original creation.

    This commit changes the effect of OFPFC_MODIFY(_STRICT).  Now,
    modifying a flow resets its hard timeout counter.  A flow will time out
    the specified number of seconds after creation or after the last time
    it is modified, whichever comes later.

However, commit 080437614b (ofproto: Represent flow cookie changes as
operations too.) broke this behavior because it incorrectly optimized out
"modify" operations that didn't change the flow's actions or flow cookie.
This commit fixes the problem, and adds a test to prevent future
regression.

Thanks to Amar Padmanabhan <amar@nicira.com> for helping to track this
down.

Bug #14841.
Reported-by: Hiroshi Tanaka <htanaka@vmware.com>
CC: Amar Padmanabhan <amar@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agovconn: Initialize 'recv_any_version' member of struct vconn in vconn_init().
Ben Pfaff [Fri, 25 Jan 2013 23:18:48 +0000 (15:18 -0800)]
vconn: Initialize 'recv_any_version' member of struct vconn in vconn_init().

This uninitialized data caused failures in the test "ofproto -
eviction upon table overflow (OpenFlow 1.2)" for some developers and in
some circumstances.

Found by valgrind.

Reported-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agolinux: Increase accuracy of ingress_policing_rate at low rates
Thomas Graf [Fri, 25 Jan 2013 19:13:55 +0000 (20:13 +0100)]
linux: Increase accuracy of ingress_policing_rate at low rates

The current method of calculating the ingress policer rate
can lead to inaccuracy if ingress_policing_rate is set to
a smallish values because the rate is divided by 8 first
which causes rounding errors.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodpif-linux: Report dropped lost messages at WARN level.
Justin Pettit [Fri, 25 Jan 2013 22:29:41 +0000 (14:29 -0800)]
dpif-linux: Report dropped lost messages at WARN level.

Messages about packets being lost are logged at level WARN, but when
they were generated at a high rate, those consolidated messages were
logged at ERR.  This changes to consolidated messages to be logged at
WARN, too.

Thanks to Ben Pfaff for quickly suggesting the culprit.

Bug #14783

Reported-by: James Schmidt <jschmidt@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agorhel: Add OVSREQUIRES to automatically bring up OpenFlow interface dependencies
Thomas Graf [Fri, 25 Jan 2013 16:31:56 +0000 (17:31 +0100)]
rhel: Add OVSREQUIRES to automatically bring up OpenFlow interface dependencies

The use of OpenFlow controllers may require for a subset of
the network (typically the management network intrerface) to be
brought up before the openvswitch service is started.

The newly introduced key "OVSREQUIRES" allows to specify a
list of interfaces that need the be brought up before the
openvswitch service is autostarted. It is also possible to
build a chain of bridge dependencies.

TYPE=OVSBridge
OVSREQURIES="em1"
[...]

A special UPPEDSTACK var that is passed along avoids getting
lost in dependency loops.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agorhel: Automatically start openvswitch service before bringing an ovs interface up...
Thomas Graf [Fri, 25 Jan 2013 14:06:57 +0000 (15:06 +0100)]
rhel: Automatically start openvswitch service before bringing an ovs interface up or down

This patch modifies the ifup/ifdown scripts to automatically
start the openvswitch service before ovs-vsctl is invoked thus
not making it mandatory to auto-start openvswitch on boot.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto: Optimise OpenFlow flow expiry
Simon Horman [Tue, 15 Jan 2013 04:20:57 +0000 (13:20 +0900)]
ofproto: Optimise OpenFlow flow expiry

Optimise OpenFlow flow expiry by placing expirable flows on a list.
This optimises scanning of flows for expiry in two ways:

* Flows that will never expire are not traversed.

  This addresses a case seen in the field.  With 1,000,000 flows that
  are not expirable, this dramatically reduces CPU utilization to
  approximately zero.

* Empirically list traversal appears faster than the code it replaces.

  With 1,000,000 expirable flows present an otherwise idle system I
  observed CPU utilisation of around 20% with the existing code but
  around 10% with this new code.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agorconn: Fix null pointer dereference in rconn_add_monitor().
Ben Pfaff [Fri, 4 Jan 2013 20:41:01 +0000 (12:41 -0800)]
rconn: Fix null pointer dereference in rconn_add_monitor().

rconn_add_monitor() tries to check the version of the controller
connection being monitored, so that it can decide what OpenFlow version to
tell the monitor connection to negotiate.  But at any given time an rconn
may not have a controller connection (e.g. during backoff), so rc->vconn
may be null and thus vconn_get_version(rc->vconn) dereferences a null
pointer.

Fixing the problem in a local way would require the rconn to remember the
previous version negotiated, and that fails if the rconn hasn't yet
connected or if the next connection negotiates a new version.

This commit instead adds the ability to a vconn to accept any OpenFlow
message version and modifies "ovs-ofctl snoop" to use that feature, thus
removing the need to negotiate the "correct" version on snoops.

Bug #14265.
Reported-by: Pratap Reddy <preddy@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoovs-ofctl: Use vconn_open() instead of vconn_open_block() in open_vconn__().
Ben Pfaff [Fri, 4 Jan 2013 20:37:17 +0000 (12:37 -0800)]
ovs-ofctl: Use vconn_open() instead of vconn_open_block() in open_vconn__().

All of the paths in open_vconn__(), except the one path that calls
vconn_open() directly, just start the connection and do not block until
it completes.  This changes the remaining path to work the same way.

This will be important in an upcoming commit when in some cases we need to
take an action between opening and connecting.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agonetdev-dummy: Test LACP negotiation.
Ben Pfaff [Fri, 10 Aug 2012 22:18:36 +0000 (15:18 -0700)]
netdev-dummy: Test LACP negotiation.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto-dpif: Implement patch ports in userspace.
Ethan Jackson [Thu, 20 Dec 2012 23:32:03 +0000 (15:32 -0800)]
ofproto-dpif: Implement patch ports in userspace.

This commit moves responsibility for implementing patch ports from
the datapath to ofproto-dpif.  There are two main reasons to do
this.

The first is a matter of design:  ofproto-dpif both has more
information than the datapath, and is better suited to handle the
complexity required to implement patch ports.

The second is performance.  My setup is a virtual machine with two
basic learning bridges connected by patch ports.  I used
ovs-benchmark to ping the virtual router IP residing outside the
VM.  Over a 60 second run, "ovs-benchmark rate" improves from
14618.1 to 19311.9 transactions per second, or a 32% improvement.
Similarly, "ovs-benchmark latency" improves from 6ms to 4ms.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto-dpif: Refresh stats before ovs-appctl dpif/dump-flows.
Ethan Jackson [Tue, 15 Jan 2013 02:02:27 +0000 (18:02 -0800)]
ofproto-dpif: Refresh stats before ovs-appctl dpif/dump-flows.

As a matter of convenience, this patch refreshes the statistics
when ovs-appctl dpif/dump-flows is called.  Hopefully this will
prevent users from being confused because statistics they were
expecting to see haven't made it from the datapath into the switch
yet.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto-dpif: Scope revalidation state to dpif_backers.
Ethan Jackson [Sat, 22 Dec 2012 01:22:46 +0000 (17:22 -0800)]
ofproto-dpif: Scope revalidation state to dpif_backers.

Before this patch, the "need_revalidate" flag and the
"revalidate_set" tag_set where maintained separately for each
ofproto.  This won't work in future patches when a flow table
change in one ofproto can require revalidation in another entirely
separate ofproto.  For this reason, this patch scopes these flags
to the dpif_backers.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoovsdb: Fix double-free in ovsdb_jsonrpc_session_close().
Ben Pfaff [Thu, 24 Jan 2013 20:27:53 +0000 (12:27 -0800)]
ovsdb: Fix double-free in ovsdb_jsonrpc_session_close().

ovsdb_session_destroy() was called twice but it should only be called once.

This double-free is unlikely to cause problems in practice because it only
triggers if there were ever more than two outstanding requests in the
session at a time (because the only data being freed is an hmap, which
does not allocate any heap memory unless the hmap has more than two
elements).

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto: Avoid wild write removing OFPP_LOCAL port in dealloc_ofp_port().
Ben Pfaff [Thu, 24 Jan 2013 19:51:54 +0000 (11:51 -0800)]
ofproto: Avoid wild write removing OFPP_LOCAL port in dealloc_ofp_port().

Found by valgrind.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoremove nonfinalized pltaps from sync list
Giuseppe Lettieri [Thu, 24 Jan 2013 14:42:00 +0000 (15:42 +0100)]
remove nonfinalized pltaps from sync list

This was causing 100% cpu usage due to immediate
wake-ups of the main loop.

11 years agouse zu/zd in printf to avoid warnings on 32bit
Giuseppe Lettieri [Thu, 24 Jan 2013 13:55:26 +0000 (14:55 +0100)]
use zu/zd in printf to avoid warnings on 32bit

11 years agoproper type for internal port of planetlab dpif
Giuseppe Lettieri [Thu, 24 Jan 2013 13:52:38 +0000 (14:52 +0100)]
proper type for internal port of planetlab dpif

do_add_port() directly calls dpif_netdev_port_open_type(), so
we cannot rely on virtual method dispatch to have our
dpif_planetlab_port_open_type() called.

11 years agouse ovs_assert instead of assert
Giuseppe Lettieri [Thu, 24 Jan 2013 13:22:44 +0000 (14:22 +0100)]
use ovs_assert instead of assert

11 years agoMerge branch 'mainstream'
Giuseppe Lettieri [Thu, 24 Jan 2013 10:05:16 +0000 (11:05 +0100)]
Merge branch 'mainstream'

11 years agofix compilation warnings
Giuseppe Lettieri [Thu, 24 Jan 2013 10:01:18 +0000 (11:01 +0100)]
fix compilation warnings

11 years agoFAQ: Add QoS section.
Ben Pfaff [Thu, 24 Jan 2013 00:09:46 +0000 (16:09 -0800)]
FAQ: Add QoS section.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agobridge: Fix bug in equal_pathnames().
Ben Pfaff [Wed, 23 Jan 2013 23:12:10 +0000 (15:12 -0800)]
bridge: Fix bug in equal_pathnames().

Reported-by: Pavithra Ramesh <paramesh@vmware.com>
Acked-by: Pavithra Ramesh <paramesh@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto-dpif: Fix minor memory leak when creating dpif_backers.
Ethan Jackson [Tue, 22 Jan 2013 23:43:15 +0000 (15:43 -0800)]
ofproto-dpif: Fix minor memory leak when creating dpif_backers.

Found by inspection.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agohash: Replace primary hash functions by murmurhash.
Ben Pfaff [Thu, 17 Jan 2013 00:14:42 +0000 (16:14 -0800)]
hash: Replace primary hash functions by murmurhash.

murmurhash is faster than Jenkins and slightly higher quality, so switch to
it for hashing words.

The best timings I got for hashing for data lengths of the following
numbers of 32-bit words, in seconds per 1,000,000,000 hashes, were:

words     murmurhash      Jenkins hash
-----     ----------      ------------
   1           8.4              10.4
   2          10.3              10.3
   3          11.2              10.7
   4          12.6              18.0
   5          13.9              18.3
   6          15.2              18.7

In other words, murmurhash outperforms Jenkins for all input lengths other
than exactly 3 32-bit words (12 bytes).  (It's understandable that Jenkins
would have a best case at 12 bytes, because Jenkins works in 12-byte
chunks.)  Even in the case where Jenkins is faster, it's only by 5%.  On
average within this data set, murmurhash is 15% faster, and for 4-word
input it is 30% faster.

We retain Jenkins for flow_hash_symmetric_l4() and flow_hash_fields(),
which are cases where the hash value is exposed externally.

This commit appears to improve "ovs-benchmark rate" results slightly by
a few hundred connections per second (under 1%), when used with an NVP
controller.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agohash: Change mhash_finish() data measurement from words to bytes.
Ben Pfaff [Fri, 14 Dec 2012 22:50:06 +0000 (14:50 -0800)]
hash: Change mhash_finish() data measurement from words to bytes.

murmurhash includes an xor with the number of bytes hashed in its finishing
step.  Until now, we've only had murmurhash for full words, but an upcoming
commit adds murmurhash for bytes, so the finishing function will need to
take a count of bytes instead.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agohash: Correct implementation of mhash_finish().
Ben Pfaff [Fri, 14 Dec 2012 21:43:54 +0000 (13:43 -0800)]
hash: Correct implementation of mhash_finish().

With rotates instead of shifts, the upper and lower 16 bits of the returned
hash are always the same.

I noticed this while working on replacing Jenkins hash by murmurhash,
because some of the database unit tests started failing, e.g. "row
hashing (scalars)".

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agotests: Fix dependencies on hash function in ofproto-dpif tests.
Ben Pfaff [Wed, 16 Jan 2013 05:48:25 +0000 (21:48 -0800)]
tests: Fix dependencies on hash function in ofproto-dpif tests.

These tests relied on luck to ensure that OpenFlow ports received the
expected OpenFlow port numbers.  With a different hash function, or (I
expect) on a big-endian architecture, the port numbers were assigned
differently and the tests failed.

This commit fixes the problem by requesting the specific expected port
numbers explicitly.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agodatapath: Return correct error code when dumping flow actions.
Jesse Gross [Mon, 21 Jan 2013 11:59:17 +0000 (03:59 -0800)]
datapath: Return correct error code when dumping flow actions.

Currently, if there isn't enough space to store the actions in a
flow during a dump we return -ENOMEM.  However, the standard error
in this situation is -EMSGSIZE so this changes the behavior to match.
This issue was introduced in 354d4c98a8cdaae3525848f564e58a9016bcd3af
 (datapath: Fix nelink attribute size for flow.).

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Don't dump partial action lists in flows.
Ben Pfaff [Mon, 21 Jan 2013 11:59:16 +0000 (03:59 -0800)]
datapath: Don't dump partial action lists in flows.

After commit 9b405f1aa8d175dc63ad3ffe5d0fe05d5ee09162 (datapath: More
flexible kernel/userspace tunneling attribute.), it was possible for a
flow dump to return a partial action list.  It's better to return no
action list at all in this situation since then userspace will know
that it should request the full thing if it wants rather than have
incorrect results.  Therefore, this prevents those partial lists in
situations where we have a very large number of actions.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoRevert "datapath: Avoid null deref when GSO is for verifying header integrity only."
Jesse Gross [Mon, 21 Jan 2013 13:23:32 +0000 (05:23 -0800)]
Revert "datapath: Avoid null deref when GSO is for verifying header integrity only."

This reverts commit 00c7faf3e5b7d4020e995a1429cf94313f197171.

In general, it should not be possible have a NULL return value from
skb_gso_segment() since we're not actually trying to verify the
header integrity.  No other callers with similar needs have NULL
checks.  The actual cause of the problem was LRO packets, which
OVS isn't equipped to handle.  The commit
33e031e99cc630baf1b0cb9256710dee7d9ab66d (datapath: Move LRO check
from transmit to receive.) solves that problem by fixing the LRO
check.  In order to avoid possibly masking any other problems, this
reverts the GSO check which should no longer be needed.

Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: Move LRO check from transmit to receive.
Jesse Gross [Mon, 21 Jan 2013 13:13:32 +0000 (05:13 -0800)]
datapath: Move LRO check from transmit to receive.

Commit 24b019f808211a95078efd916064af0975ca5733 (datapath: Disable
LRO from userspace instead of the kernel.) accidentally moved the
check for LRO packets from the receive path to transmit.  Since
this check is supposed to protect OVS (and other parts of the system)
from packets that it cannot handle it is obviously not useful on
egress.  Therefore, this commit moves it back to the receive side.

The primary problem that this caused is upcalls to userspace tried
to segment the packet even though no segmentation information is
available.  This would later cause NULL pointer dereferences when
skb_gso_segment() did nothing.

Bug #14772

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Avoid null deref when GSO is for verifying header integrity only.
Ben Pfaff [Mon, 21 Jan 2013 22:29:15 +0000 (14:29 -0800)]
datapath: Avoid null deref when GSO is for verifying header integrity only.

skb_gso_segment() has the following comment:

 *    It may return NULL if the skb requires no segmentation.  This is
 *    only possible when GSO is used for verifying header integrity.

Somehow queue_gso_packets() has never hit this case before, but some
failures have suddenly been reported.  This commit should fix the problem.

Additional commentary by Jesse: We shouldn't normally be hitting this case
because we're actually trying to do GSO, not header validation.  However, I
guess the guest/backend must be generating a packet with an MSS, which
tricks us into thinking that it's GSO, but no GSO is actually requested.
In the case of the bridge, header validation does take place so the
situation is handled already.  It seems not ideal that the network backend
doesn't sanitize these packets but it's probably good that we handle
it in any case.

Bug #14772.
Reported-by: Deepesh Govindan <dgovindan@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agoofproto: Remove redundant call to ofconn_get_ofproto
Ben Pfaff [Mon, 21 Jan 2013 15:37:21 +0000 (07:37 -0800)]
ofproto: Remove redundant call to ofconn_get_ofproto

This is a cosmetic change. Remove the redundant call to ofconn_get_ofproto
in handle_flow_mod.

Signed-off-by: Paraneetharan Chandrasekaran <paraneetharanc@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Fix nelink attribute size for flow.
Pravin B Shelar [Mon, 21 Jan 2013 07:15:07 +0000 (23:15 -0800)]
datapath: Fix nelink attribute size for flow.

Following patch fixes flow buffer size calculation to allocate
sufficient memory for all nested attributes in new tunnel
attribute.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Bug #14767

11 years agodatapath: Fix Flow dump operation.
Pravin B Shelar [Mon, 21 Jan 2013 07:14:36 +0000 (23:14 -0800)]
datapath: Fix Flow dump operation.

Following patch adds null check while inserting new netlink attribute.
This was introduced by commit 9b405f1aa8d175d (datapath: More
flexible kernel/userspace tunneling attribute.)

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Bug #14767

11 years agodatapath: More flexible kernel/userspace tunneling attribute.
Pravin B Shelar [Sat, 19 Jan 2013 02:10:59 +0000 (18:10 -0800)]
datapath: More flexible kernel/userspace tunneling attribute.

Following patch breaks down single ipv4_tunnel netlink attribute into
individual member attributes. It will help when we extend tunneling
parameters in future.

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

11 years agodebian: Change openvswitch restart logic for kernel package.
Gurucharan Shetty [Thu, 17 Jan 2013 18:08:47 +0000 (10:08 -0800)]
debian: Change openvswitch restart logic for kernel package.

Currently, every time we install the non-dkms openvswitch kernel package,
we restart openvswitch. This has no useful effect when an Open vSwitch kernel
module is already loaded, because "/etc/init.d/openvswitch restart" does not
load the new version of the kernel module.

With this patch, we start openvswitch if there is no kernel module
currently loaded (which is a case for a fresh install of openvswitch). This
will load the kernel module.

If someone wants to use the latest kernel module after an upgrade, they need
to run "/etc/init.d/openvswitch-switch force-reload-kmod" manually.

Issue #13556
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoofproto: Add "actions=" to drop action in "ovs-appctl bridge/dump-flows".
Justin Pettit [Thu, 17 Jan 2013 08:31:20 +0000 (00:31 -0800)]
ofproto: Add "actions=" to drop action in "ovs-appctl bridge/dump-flows".

The function flow_stats_ds() did its own formatting when there were no
actions, but this didn't include "action=".  There's actually no reason
to special-case this, since ofpact_format() properly handles actions
with a zero length and prints it properly.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agodpif-netdev: Limit scope of vlan in dp_netdev_execute_actions
Simon Horman [Thu, 17 Jan 2013 06:24:59 +0000 (15:24 +0900)]
dpif-netdev: Limit scope of vlan in dp_netdev_execute_actions

This is to make the code consistent with the proposed MPLS changes
and avoid cluttering the top of the NL_ATTR_FOR_EACH_UNSAFE loop.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoNEWS: Mention that bridge compatibility is gone.
Ben Pfaff [Thu, 17 Jan 2013 18:32:30 +0000 (10:32 -0800)]
NEWS: Mention that bridge compatibility is gone.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodpif-linux: Fix segfault when a port already exists.
Justin Pettit [Wed, 16 Jan 2013 23:53:14 +0000 (15:53 -0800)]
dpif-linux: Fix segfault when a port already exists.

Commit 78a2d59c (dpif-linux.c: Let the kernel pick a port number if one
not requested.) changed the logic for port assignment, but didn't
properly handle some error conditions.  An attempt to add a tunnel port
that already exists would lead to a segfault.  This commit fixes the
logic to stop processing and return an error.

Reported-by: Gurucharan Shetty <shettyg@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoMakefile.am: add check that <assert.h> is not used from unexpected files.
Ben Pfaff [Wed, 7 Nov 2012 18:16:27 +0000 (10:16 -0800)]
Makefile.am: add check that <assert.h> is not used from unexpected files.

In general, with a few specific exceptions, ovs_assert is now preferred
over assert, so this commit adds a check for that in the top-level
Makefile.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoRemove useless use of <assert.h>.
Ben Pfaff [Tue, 6 Nov 2012 21:15:44 +0000 (13:15 -0800)]
Remove useless use of <assert.h>.

These files #included <assert.h> but didn't ever use assert.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoReplace most uses of assert by ovs_assert.
Ben Pfaff [Tue, 6 Nov 2012 21:14:55 +0000 (13:14 -0800)]
Replace most uses of assert by ovs_assert.

This is a straight search-and-replace, except that I also removed #include
<assert.h> from each file where there were no assert calls left.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoutil: Introduce ovs_assert macro.
Ben Pfaff [Thu, 17 Jan 2013 00:03:03 +0000 (16:03 -0800)]
util: Introduce ovs_assert macro.

An occasionally significant problem with the standard "assert" macro is
that it writes the failure message to stderr.  In our daemons, stderr is
generally redirected to /dev/null.  It's more useful to write the failure
message to the log, which is what the new ovs_assert macro introduced in
this patch does.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoovs-ctl.in: Restore ofport values across force-reload-kmod.
Gurucharan Shetty [Fri, 11 Jan 2013 21:40:23 +0000 (13:40 -0800)]
ovs-ctl.in: Restore ofport values across force-reload-kmod.

If we want to upgrade from pre-1.10 branch to 1.10 or later
and restore flows across force-reload-kmod, we need to maintain
the value of ofport.

To do this, we fetch the value of ofport before the upgrade and use
it to populate the column 'ofport_request' after ovsdb is upgraded.
We need to do this before vswitchd is restarted as vswitchd
needs the ofport_request column populated before it starts.

Issue #13556
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoovs-save: Add a helper command to maintain ofport value.
Gurucharan Shetty [Fri, 11 Jan 2013 21:01:55 +0000 (13:01 -0800)]
ovs-save: Add a helper command to maintain ofport value.

This patch adds a helper command: save-ofports. The command
will o/p a shell script that will set the 'ofport_request' column
of the interface table with the value of the corresponding ofport.

This command takes a list of bridges as input and will be used by
a future commit to restore the ofport value across force-reload-kmod.

This command is only useful while trying to upgrade from a pre-1.10
branch to 1.10 or a later branch.

Issue #13556
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoovs-vsctl: Add --if-exists option to many database commands.
Ben Pfaff [Tue, 15 Jan 2013 21:23:53 +0000 (13:23 -0800)]
ovs-vsctl: Add --if-exists option to many database commands.

A few ovs-vsctl commands have accepted --if-exists options for some time,
to make it possible to execute them in cases where it doesn't really
matter if the records they touch exist.  This commit adds this option to
other commands.

This is intended for initial use with "ovs-vsctl set interface <iface>
ofport_request=<number>" commands in ovs-ctl for upgrades from OVS 1.9
to later versions.

This makes a very small incompatible change to the ovs-vsctl "get"
command: previously with --if-exists, only keys in map columns were
allowed to be missing; now with --if-eixsts, also records are allowed
to be missing.

CC: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agobridge: Remove restriction on socket name.
Pavithra Ramesh [Tue, 15 Jan 2013 20:23:46 +0000 (12:23 -0800)]
bridge: Remove restriction on socket name.

Following patch removes restriction on the listening socket name that gets
configured as bridge controller. Currently, we only connect to sockets in a
specific directory with the name of the bridge. This patch removes the
restriction on the bridge name, keeping the directory restriction.

Bug #14029.
Signed-off-by: Pavithra Ramesh <paramesh@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agonetdev: Add NULL get_tunnel_config for BSD.
Ed Maste [Wed, 16 Jan 2013 14:57:52 +0000 (09:57 -0500)]
netdev: Add NULL get_tunnel_config for BSD.

Commit f431bf7d78f3212d32bb3d122f783c5c796a1576 (netdev: Parse and make
available tunnel configuration.) added new method get_tunnel_config to
netdev_class but did not update netdev-bsd.

Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agopython: Workaround UNIX socket path length limits
James Page [Wed, 16 Jan 2013 11:12:09 +0000 (11:12 +0000)]
python: Workaround UNIX socket path length limits

From aa28e8bfb646a54ba91e3545f3c0b9db39eddb7f Mon Sep 17 00:00:00 2001
From: James Page <james.page@ubuntu.com>
Date: Wed, 16 Jan 2013 10:52:59 +0000
Subject: [PATCH] python: Workaround UNIX socket path length limits
To: dev@openvswitch.org

UNIX socket paths have a limit in terms of length.  On Linux
this is 103 characters.

This is a problem in Debian/Ubuntu buildds which can generate
quite long paths.

This patch works around this issue by detecting when socket
connection/binding fails due to this issue and accessing the
socket path using a file descriptor path in /proc/self/fd.

The workaround is limited to Linux.

This is based on similar code in the C parts of OpenvSwitch.

Signed-off-by: James Page <james.page@ubuntu.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoAUTHORS: Add James Page.
Jesse Gross [Wed, 16 Jan 2013 17:20:34 +0000 (09:20 -0800)]
AUTHORS: Add James Page.

Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: support Linux 3.8 kernel
James Page [Wed, 16 Jan 2013 11:19:21 +0000 (11:19 +0000)]
datapath: support Linux 3.8 kernel

Add Linux 3.8 kernel to the range of supported kernel versions.

Signed-off-by: James Page <james.page@ubuntu.com>
[jesse: Update NEWS and FAQ]
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoMerge branch 'mainstream'
Giuseppe Lettieri [Wed, 16 Jan 2013 15:24:43 +0000 (16:24 +0100)]
Merge branch 'mainstream'

Conflicts:
lib/dpif-netdev.c

11 years agonetdev: Parse and make available tunnel configuration.
Ethan Jackson [Tue, 8 Jan 2013 00:56:04 +0000 (16:56 -0800)]
netdev: Parse and make available tunnel configuration.

Future patches will need to know the details of a netdev's tunnel
configuration from outside the netdev library.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agotunnels: Remove support for df_inherit from userspace.
Ethan Jackson [Mon, 7 Jan 2013 23:48:12 +0000 (15:48 -0800)]
tunnels: Remove support for df_inherit from userspace.

This will be required to support flow based tunneling.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto-dpif: Maintain tun_id across action lists.
Jesse Gross [Tue, 15 Jan 2013 21:45:41 +0000 (13:45 -0800)]
ofproto-dpif: Maintain tun_id across action lists.

Previously, a tunnel ID received on input would be used by default
on output if the packet was later sent out a tunnel.  This was not
actually intentional behavior - tunnel information is not supposed
to carry over.  However, it is useful in the case where move actions
are used to load the original tunnel ID into registers for further
processing or additional lookups in resubmits since otherwise the
information is lost before handling actions.

When the initial components for flow based tunneling were introduced
this behavior for tunnel headers caused problems since it resulted
in packets being sent to the IP address they were originally received
on.  All of this behavior was "fixed" in commit
47d4a9db26329f9d93eb945c1fcc0e248cf2656a (ofproto-dpif: Initialize
tunnel metadata in both 'flow' and 'base_flow'.), breaking the use
cases the require tun_id during action processing.

For the time being, at least, this restores the original behavior
for tun_id, while keeping the new behavior for the rest of the
tunnel headers.  The latter are not exposed through OpenFlow and
therefore do not have similar complications.  If we do expose these
headers then we might have to revist this.

Thanks to Ben Pfaff for identifying the commit that introduced the
problem.

Bug #14625

Reported-by: Michael Hu <humichael@vmware.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agobond: Fix comment on bond_entry::tag
Zoltan Kiss [Sat, 5 Jan 2013 21:42:16 +0000 (21:42 +0000)]
bond: Fix comment on bond_entry::tag

The hash entry tag connects to facet(s), not slaves.

Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-print.c: Fix remaining port number prints.
Jarno Rajahalme [Mon, 14 Jan 2013 12:43:53 +0000 (14:43 +0200)]
ofp-print.c: Fix remaining port number prints.

Use ofputil_format_port() to print port numbers so that special ports
will be printed out as symbolic names (e.g., LOCAL) instead of numbers.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agonetdev-vport: Create new TUNNEL_CLASS macro.
Ethan Jackson [Wed, 9 Jan 2013 04:01:24 +0000 (20:01 -0800)]
netdev-vport: Create new TUNNEL_CLASS macro.

There are a lot of tunnels, and they all use the exact same
functions, so it makes sense to collapse their initialization into
a macro.

Suggested-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoalloc_ofp_port does not allocate the port number correctly
Krishna Kondaka [Fri, 11 Jan 2013 05:20:22 +0000 (21:20 -0800)]
alloc_ofp_port does not allocate the port number correctly

alloc_ofp_port() does not allocate the port number correctly if the port
number passed initially is already in use. The following if block

if (ofp_port >= ofproto->max_ports
            || bitmap_is_set(ofproto->ofp_port_ids, ofp_port)) {

is entered when either of the two conditions is true but the while block
after this is not entered if the second condition above is true and the
first condition is false.

This results in an existing port_number to be re-assigned!

Signed-off-by: Krishna Kondaka <kkondaka@vmware.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoFAQ: Update question about OpenFlow version support.
Ben Pfaff [Thu, 10 Jan 2013 19:28:26 +0000 (11:28 -0800)]
FAQ: Update question about OpenFlow version support.

We've had a lot of questions about this on the mailing lists recently, and
it would be nice to have an authoritative answer to cut and paste.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agoworker: Remove unreachable statement.
Ben Pfaff [Fri, 11 Jan 2013 01:19:58 +0000 (17:19 -0800)]
worker: Remove unreachable statement.

Nothing ever breaks out of the loop, so this statement couldn't be reached.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agosocket-util: Use CONST_CAST in send_iovec_and_fs().
Ben Pfaff [Fri, 11 Jan 2013 01:10:41 +0000 (17:10 -0800)]
socket-util: Use CONST_CAST in send_iovec_and_fs().

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agoworker: Make worker_request_iovec() verify that it is not being reentered.
Ben Pfaff [Fri, 11 Jan 2013 01:16:01 +0000 (17:16 -0800)]
worker: Make worker_request_iovec() verify that it is not being reentered.

This function cannot easily be reentrant because the inner call would
interrupt and corrupt the data being sent by the outer call.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agoworker: Do not use poll_block() in worker_send_iovec().
Ben Pfaff [Fri, 11 Jan 2013 01:22:24 +0000 (17:22 -0800)]
worker: Do not use poll_block() in worker_send_iovec().

The following call stack was possible:

    poll_block()
        -> vlog
            -> worker_send_iovec()
                -> poll_block()

which caused corruption because poll_block() is not reentrant.

Bug #14616.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agovlog: Avoid calling worker_request() reentrantly.
Ben Pfaff [Fri, 11 Jan 2013 01:14:03 +0000 (17:14 -0800)]
vlog: Avoid calling worker_request() reentrantly.

The following call stack was possible:

    vlog
        -> worker_request()
            -> poll_block()
                -> vlog
                     -> worker_request()

which caused problems because worker_request() is not reentrant.  In a
little more detail, the second worker_request() shoves its RPC protocol
data into the middle of the first.  This means that, first, you get
some binary crud in the log (the header for the second RPC).  And,
second, text from the first RPC log message gets treated by the worker
as the subsequent RPC's header.  That, in turn, typically causes the
worker to try to xmalloc() a huge number of bytes (0x20000000 or more,
since "space" has ASCII value 0x20), which causes the worker to die
with "virtual memory exhausted".  The main process then dies because
the worker's death closes the socket it uses to communicate with it
("connection reset").

Bug #14616.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agodpif-linux: Give each port its own userspace-kernel channel.
Justin Pettit [Sat, 5 Jan 2013 02:34:26 +0000 (18:34 -0800)]
dpif-linux: Give each port its own userspace-kernel channel.

Userspace-kernel communication is a possible bottleneck when OVS is
receiving a large number of flow set up requests.  To help prevent a bad
actor from consuming too much of this resource, we introduced channels
to segegrate traffic.  Previously, we created 17 channels and
round-robin assigned ports to one of 16 channels (the 17th was reserved
for use by the system).  This meant if there were more than 16 ports,
sharing of channels would occur.

This commit creates a new channel for each port, so that there is no
more sharing and better isolation.  The special system port uses the
"ovs-system"'s channel (port 0), since it is not heavily loaded.

This also fixes an issue introduced in commit acf60855 (ofproto-dpif:
Use a single underlying datapath across multiple bridges.) where ports
that were added at run-time were given the special system channel.

Issue #12073

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agodpif-linux: Log the correct port-PID mapping.
Justin Pettit [Sat, 5 Jan 2013 18:43:49 +0000 (10:43 -0800)]
dpif-linux: Log the correct port-PID mapping.

When adding a port, the code previously logged the requested port number
(which is generally UINT32_MAX) instead of the assigned port number.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoofproto-dpif: Use proper special value for the reserved PID.
Justin Pettit [Sat, 5 Jan 2013 02:21:27 +0000 (18:21 -0800)]
ofproto-dpif: Use proper special value for the reserved PID.

The compose_slow_path() function used UINT16_MAX for
dpif_port_get_pid(), when it should be UINT32_MAX to get the proper
reserved PID.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agonetdev-vport: Remove useless struct netdev_vport.
Ethan Jackson [Wed, 26 Dec 2012 20:33:23 +0000 (12:33 -0800)]
netdev-vport: Remove useless struct netdev_vport.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agodatapath: Use FIELD_SIZEOF() in dp_init().
YOSHIFUJI Hideaki [Thu, 10 Jan 2013 17:41:16 +0000 (09:41 -0800)]
datapath: Use FIELD_SIZEOF() in dp_init().

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoAdd Openflow 1.3 test for asynchronous message control.
Jarno Rajahalme [Fri, 7 Dec 2012 13:48:24 +0000 (15:48 +0200)]
Add Openflow 1.3 test for asynchronous message control.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>