sliver-openvswitch.git
10 years agoovsdbmonitor: Remove.
Ben Pfaff [Fri, 10 Jan 2014 23:25:40 +0000 (15:25 -0800)]
ovsdbmonitor: Remove.

ovsdbmonitor was poorly maintained and not widely used.

Acked-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Add more thread safety annotations.
Ben Pfaff [Fri, 10 Jan 2014 19:36:35 +0000 (11:36 -0800)]
ofproto: Add more thread safety annotations.

These would have found the problem fixed in commit c7be3f559349 (connmgr:
Fix attempt to take mutex recursively when exiting fail-open.).

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoUpdate build requirements.
Ben Pfaff [Tue, 31 Dec 2013 22:23:34 +0000 (14:23 -0800)]
Update build requirements.

Libtool is now required as of commit 38b7a52b61 (openvswitch: Use libtool
and allow building shared libs).

It seems that a build requirement for Python slipped in a while back, for
generating ovs-vswitchd.conf.db.5, and no one complained, so we might as
well make it official.  (That will let us simplify some bits of the build,
too, since they won't have to be conditional on Python anymore, so I'm all
in favor of this change.)

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoconfigure: Make autoconf fail if libtool is not installed.
Ben Pfaff [Tue, 31 Dec 2013 22:20:01 +0000 (14:20 -0800)]
configure: Make autoconf fail if libtool is not installed.

Otherwise users get an error later like:
    ./configure: line 5093: syntax error near unexpected token
    `disable-shared' ./configure: line 5093: `LT_INIT(disable-shared)'
It's probably friendlier to make configuration fail earlier.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agofedora package: fix systemd ordering and deps.
Flavio Leitner [Thu, 9 Jan 2014 03:04:33 +0000 (01:04 -0200)]
fedora package: fix systemd ordering and deps.

There is a chicken and egg issue where common OVS
configuration uses a controller which is only accessible
via the network. So starting OVS before network.target
would break those configurations.

However, the network doesn't come up after boot because
OVS isn't started until after the network scripts tries
to configure the ovs.

This is partially fixed by commits:
   commit: 602453000e28ec1076c0482ce13c284765a84409
   rhel: Automatically start openvswitch service before bringing an ovs interfa

   commit: 3214851c31538e8690e31f95702f8927a8c0838b
   rhel: Add OVSREQUIRES to automatically bring up OpenFlow interface dependencies

But still there is the dependency issue between network.target
and openvswitch which this patch fixes it.  It provides two systemd
service units. One to run at any time (openvswitch-nonetwork.service)
which runs 'ovs-ctl start' and the other one (openvswith.service) to
run after network.target which works as a frontend to the admin.

The openvswitch-nonetwork.service is used internally by the
'ifup-ovs/ifdown-ovs' scripts when adding or removing ports to
the bridge or when the openvswitch.service is enabled by the admin.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
10 years agobfd: Fix cpath_down set failure.
Alex Wang [Thu, 9 Jan 2014 02:51:43 +0000 (18:51 -0800)]
bfd: Fix cpath_down set failure.

Commit ccc09689 (bfd: Implement Bidirectional Forwarding Detection.)
set the bfd local diagnostic to "Concatenated Path Down" in response
to the set of cpath_down only when the current local diagnostic is
"None".  However, since the bfd local diagnostic is not reset when
the bfd state is restored from last erroneous state, the set of
cpath_down will not update the local diagnostic in that case.

This commit fixes the bug by always checking for local diagnostic
change when cpath_down is set or reset.

Bug #22625
Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agodpif-netdev: Use separate threads for forwarding.
Ben Pfaff [Sat, 28 Dec 2013 01:00:30 +0000 (17:00 -0800)]
dpif-netdev: Use separate threads for forwarding.

For now, we use exactly two threads.  Presumably at some point we will want
to make this configurable.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodpif-netdev: Make thread-safety much more granular.
Ben Pfaff [Wed, 8 Jan 2014 23:58:11 +0000 (15:58 -0800)]
dpif-netdev: Make thread-safety much more granular.

This will allow for parallelism in multithreaded forwarding in an upcoming
commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodpif-netdev: Introduce new mutex to protect queues.
Ben Pfaff [Fri, 27 Dec 2013 17:42:51 +0000 (09:42 -0800)]
dpif-netdev: Introduce new mutex to protect queues.

This is a first step in making thread safety more granular in dpif-netdev,
to allow for multithreaded forwarding.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodpif-netdev: Break actions out into new struct dp_netdev_actions.
Ben Pfaff [Wed, 8 Jan 2014 22:37:13 +0000 (14:37 -0800)]
dpif-netdev: Break actions out into new struct dp_netdev_actions.

This is analogous to the split between rule and rule_actions in
ofproto.  As there, it will allow retaining a reference to a rule's
actions, while processing them, without having to retain a reference
to the rule itself.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodpif-netdev: Take advantage of ovs_refcount for dp_netdev.
Ben Pfaff [Sat, 28 Dec 2013 03:41:10 +0000 (19:41 -0800)]
dpif-netdev: Take advantage of ovs_refcount for dp_netdev.

By making "destroyed" own a reference, we can treat dp_netdev's ref_cnt
like any other in Open vSwitch.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-atomic: Introduce a new 'struct ovs_refcount'.
Ben Pfaff [Sat, 28 Dec 2013 03:39:24 +0000 (19:39 -0800)]
ovs-atomic: Introduce a new 'struct ovs_refcount'.

This is a thin wrapper around an atomic_uint.  It is useful anyhow because
each ovs_refcount_ref() or ovs_refcount_unref() call saves a few lines of
code.

This commit also changes all the potential direct users over to use the new
data structure.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-atomic: Add atomic_destroy() and use everywhere it is needed.
Ben Pfaff [Wed, 8 Jan 2014 18:42:12 +0000 (10:42 -0800)]
ovs-atomic: Add atomic_destroy() and use everywhere it is needed.

C11 is able to require that atomics don't need to be destroyed, but some
of the OVS implementations do.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-atomic: New functions atomic_flag_init(), atomic_flag_destroy().
Ben Pfaff [Thu, 9 Jan 2014 01:13:28 +0000 (17:13 -0800)]
ovs-atomic: New functions atomic_flag_init(), atomic_flag_destroy().

Standard C11 doesn't need these functions because it is able to require
implementations not to need them.  But we can't construct a portable
implementation that does not need them in every case, so this commit adds
them.

These functions are only needed for atomic_flag objects that are
dynamically allocated (because statically allocated objects can use
ATOMIC_FLAG_INIT).  So far there aren't any of those, but an upcoming
commit will introduce one.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agodpif-netdev: Remove max_mtu tracking.
Ben Pfaff [Mon, 23 Dec 2013 23:46:22 +0000 (15:46 -0800)]
dpif-netdev: Remove max_mtu tracking.

Normally all the ports have the same mtu anyhow, so there is little
advantage in keeping track of the maximum mtu on a per-bridge basis.  In
upcoming commits, tracking mtu will require more locking and present
even less advantage (because the packet buffer will become per-thread, so
that reallocating once per thread becomes essentially a null cost).

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agodpif-netdev: Use hmap instead of list+array for tracking ports.
Ben Pfaff [Wed, 25 Dec 2013 00:08:57 +0000 (16:08 -0800)]
dpif-netdev: Use hmap instead of list+array for tracking ports.

The goal is to make it easy to divide the ports into groups for handling
by threads.  It seems easy enough to do that by hash value, and a little
harder otherwise.

This commit has the side effect of raising the maximum number of ports from
256 to UINT32_MAX-1.  That is why some tests need to be updated:
previously, internally generated port names like "ovs_vxlan_4341" were
ignored because 4341 is bigger than the previous limit of 256.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agodpif-netdev: Use new "ovsthread_counter" to track dp statistics.
Ben Pfaff [Mon, 23 Dec 2013 22:04:13 +0000 (14:04 -0800)]
dpif-netdev: Use new "ovsthread_counter" to track dp statistics.

ovsthread_counter is an abstract interface that could be implemented
different ways.  The initial implementation is simple but less than
optimally efficient.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodpif: Remove unused 'get_max_ports' from provider interface.
Ben Pfaff [Mon, 23 Dec 2013 22:34:01 +0000 (14:34 -0800)]
dpif: Remove unused 'get_max_ports' from provider interface.

Nothing ever called this function.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agonetdev-dummy: Make netdev_rx_wait() wakeups work cross-thread for dummies.
Ben Pfaff [Thu, 26 Dec 2013 06:27:25 +0000 (22:27 -0800)]
netdev-dummy: Make netdev_rx_wait() wakeups work cross-thread for dummies.

Until now, netdev_dummy_rx_wait() has only checked whether the receive
queue for the dummy device is currently empty.  This has worked OK because
in practice packets were queued to dummy devices only from the same thread
that attempted to receive them.  An upcoming commit will use different
threads for these purposes, so this commit switches to a notification
method that works cross-thread.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agonetdev-dummy: Remove unused member 'listening' from struct netdev_dummy.
Ben Pfaff [Thu, 26 Dec 2013 01:15:20 +0000 (17:15 -0800)]
netdev-dummy: Remove unused member 'listening' from struct netdev_dummy.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif-upcall: Slightly simplify udpif_upcall_handler().
Ben Pfaff [Sat, 28 Dec 2013 00:29:24 +0000 (16:29 -0800)]
ofproto-dpif-upcall: Slightly simplify udpif_upcall_handler().

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto/trace: Show megaflow fields in each resubmit.
Alex Wang [Thu, 9 Jan 2014 00:52:15 +0000 (16:52 -0800)]
ofproto/trace: Show megaflow fields in each resubmit.

This commit makes the ofproto/trace show the megaflow fields
for each resubmit.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto/trace: Change output field name.
Alex Wang [Thu, 9 Jan 2014 00:52:14 +0000 (16:52 -0800)]
ofproto/trace: Change output field name.

This commit changes the output field name from "Relevant fields"
to "Megaflow".

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto/trace: Remove the unused variables.
Alex Wang [Thu, 9 Jan 2014 00:52:13 +0000 (16:52 -0800)]
ofproto/trace: Remove the unused variables.

This commit removes the unused variables in ofproto_trace() function.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto/trace: Use final flow to compute "Relevant fields".
Alex Wang [Thu, 9 Jan 2014 00:52:12 +0000 (16:52 -0800)]
ofproto/trace: Use final flow to compute "Relevant fields".

Commit bcd2633a (ofproto-dpif: Store relevant fields for wildcarding
in facet.) introduced the bug that uses original input flow as final
flow to compute the "Relevant fields" in ofproto/trace ouput.  This
commit fixes this bug.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoutilities: Wrong command syntax in ovs-vsctl manpage.
Daniele Venturino [Thu, 9 Jan 2014 00:03:07 +0000 (16:03 -0800)]
utilities: Wrong command syntax in ovs-vsctl manpage.

The command shown in the man page to disable the STP protocol on a bridge
is:

        ovs-vsctl clear Bridge br0 stp_enable

Calling that, the following warning message is returned:

        ovs-vsctl: "clear" operation cannot be applied to column stp_enable
        of table Bridge, which is not allowed to be empty

It seems correct to use the command:

        ovs-vsctl set Bridge br0 stp_enable=false

Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Use kmem_cache_free() instead of kfree()
Wei Yongjun [Wed, 8 Jan 2014 14:07:52 +0000 (06:07 -0800)]
datapath: Use kmem_cache_free() instead of kfree()

memory allocated by kmem_cache_alloc() should be freed using
kmem_cache_free(), not kfree().

Fixes: e298e5057006 ('openvswitch: Per cpu flow stats.')
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agoFix !HAVE_NETLINK build
YAMAMOTO Takashi [Wed, 8 Jan 2014 06:07:30 +0000 (15:07 +0900)]
Fix !HAVE_NETLINK build

Fix a regression introduced by commit 4b97b70d
("ofproto-dpif: Enable NXAST_SAMPLE only if the datapath supports it.")

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Fix a vlan-splinter megaflow bug
Andy Zhou [Tue, 7 Jan 2014 08:17:25 +0000 (00:17 -0800)]
ofproto-dpif: Fix a vlan-splinter megaflow bug

When vlan-splinter is enabled, ovs receives non-vlan flows from the
kernel vlan ports, vlan tag is then added to the incoming flow before
xlating, so that they look like those received from a trunk port.

In case megaflow is enabled, xlating may set vlan masks during rule
processing as usual. If those vlan masks were serialized and downloaded
to the kernel (this bug), those mega flows will be rejected due to
unexpected vlan mask encapsulation, since the original kernel flows do
not have vlan tags. This bug does not break connectivity, but impacts
performance since all traffic received on vlan splinter ports will now
be handled by vswitchd, as no datapath flows can be successfully
installed.

This fix is to make sure no vlan mask encapsulation is generated for
the datapath flow if its in_port was re-written by vlan-splinter
receiving logic.

Bug #22567

Signed-off-by: Andy Zhou <azhou@nicira.com>
10 years agonetdev: Update rx_recv documentation for NULL case
Simon Horman [Tue, 7 Jan 2014 05:33:37 +0000 (14:33 +0900)]
netdev: Update rx_recv documentation for NULL case

Replace truncated description of when rx_recv() may be NULL
with text used for other fields of netdev_class.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-xlate: Correct check for MPLS LSE
Simon Horman [Tue, 7 Jan 2014 04:48:08 +0000 (13:48 +0900)]
ofproto-dpif-xlate: Correct check for MPLS LSE

zero is a valid MPLS LSE so it is not valid check against
that value for MPLS LSE presence. Instead, check against
the flow's dl_type which should be an MPLS type if an LSE is present.

This problem appears to have been introduced by
b2dd70be133bf86c ("Native Set-Field action.").

Cc: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Check for backported sctp_compute_cksum().
Jesse Gross [Fri, 3 Jan 2014 23:44:28 +0000 (15:44 -0800)]
datapath: Check for backported sctp_compute_cksum().

This is backported by RHEL7.

Reported-by: Ashok Byahatti <ashok.byahatti@embrane.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
10 years agoFAQ: Add entry on GRE module conflicts.
Jesse Gross [Fri, 3 Jan 2014 17:31:38 +0000 (09:31 -0800)]
FAQ: Add entry on GRE module conflicts.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agoodp-util: Simplify logic in odp_flow_key_to_flow__().
Ben Pfaff [Tue, 31 Dec 2013 18:36:19 +0000 (10:36 -0800)]
odp-util: Simplify logic in odp_flow_key_to_flow__().

Simplify (a && b) || (!a && c) to just a ? b : c.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoodp-util: Avoid null dereference in parse_8021q_onward().
Ben Pfaff [Tue, 31 Dec 2013 19:32:16 +0000 (11:32 -0800)]
odp-util: Avoid null dereference in parse_8021q_onward().

For parsing a mask, this code in parse_8021q_onward() always read out
the OVS_KEY_ATTR_VLAN attribute without first checking whether it existed.
The correct behavior, implemented by this commit, appears to be treating
the VLAN as wildcarded and to continue parsing the flow.

Bug #22312.
Reported-by: Krishna Miriyala <miriyalak@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agodpif: Use explicit packet metadata.
Jarno Rajahalme [Mon, 30 Dec 2013 23:58:58 +0000 (15:58 -0800)]
dpif: Use explicit packet metadata.

This helps reduce confusion about when a flow is a flow and when it is
just metadata.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoodp-execute: Consolidate callbacks.
Jarno Rajahalme [Mon, 30 Dec 2013 23:58:58 +0000 (15:58 -0800)]
odp-execute: Consolidate callbacks.

Use one callback instead of many, helps in adding new functionality
later on.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agotests: Make some tests more robust.
Jarno Rajahalme [Mon, 30 Dec 2013 23:42:36 +0000 (15:42 -0800)]
tests: Make some tests more robust.

These tests break if OVS internal hash function is changed.  Some of
this is due to dependency on the order in which elements are iterated
from hash maps, or the algorithm used is just dependent on the
specific hash values produced for specific inputs (groups).  These
changes make these test cases more robust, so that they will not break
so easily due to OVS internal hash function implementation changes.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agobfd: Make bfd decay test robust.
Alex Wang [Mon, 30 Dec 2013 23:15:52 +0000 (15:15 -0800)]
bfd: Make bfd decay test robust.

With ovs multithreading implementation, the bfd decay test
becomes fragile due to its high dependency on timing sequence.
This commit removes these dependencies and makes the test robust.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Enable NXAST_SAMPLE only if the datapath supports it.
Ben Pfaff [Mon, 30 Dec 2013 22:49:25 +0000 (14:49 -0800)]
ofproto-dpif: Enable NXAST_SAMPLE only if the datapath supports it.

This prevents using an older datapath from breaking forwarding.

CC: Romain Lenglet <rlenglet@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agobridge: Fix reversed string parsing in bridge_configure_flow_miss_model().
Alex Wang [Mon, 30 Dec 2013 22:21:40 +0000 (14:21 -0800)]
bridge: Fix reversed string parsing in bridge_configure_flow_miss_model().

This commit fixes a command matching error introduced by commit
7155fa52f (ofproto-dpif: Add 'force-miss-model' configuration).

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoconnmgr: Log when a packet-in is dropped due to queue overflow.
Ben Pfaff [Thu, 5 Dec 2013 17:21:14 +0000 (09:21 -0800)]
connmgr: Log when a packet-in is dropped due to queue overflow.

Reported-by: Anton Matsiuk <anton.matsiuk@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agonetdev-linux: Simplify get_stats_via_netlink().
Ben Pfaff [Wed, 4 Dec 2013 23:46:55 +0000 (15:46 -0800)]
netdev-linux: Simplify get_stats_via_netlink().

There's no need to obtain the ifindex, because RTM_GETLINK is happy to take
the interface name.  There's no need to do a full nl_policy_parse(),
because we only need a single attribute.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agonetdev-linux: Drop support for pre-2.6.19 kernels.
Ben Pfaff [Wed, 4 Dec 2013 23:43:31 +0000 (15:43 -0800)]
netdev-linux: Drop support for pre-2.6.19 kernels.

The OVS kernel module requires 2.6.32 or later, so there's no reason for
userspace to support older kernels.  This commit removes the special
fallback code for retrieving Linux netdev stats in pre-2.6.19 kernels,
which should no longer be useful.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-monitor: Remove monitor_init().
Alex Wang [Fri, 20 Dec 2013 23:12:58 +0000 (15:12 -0800)]
ofproto-dpif-monitor: Remove monitor_init().

Commit 881d47a9fa9 (monitor: Replace monitor_seq with periodic
wakeup.) removes the global "struct seq" in ofproto-dpif-monitor
module.  This change makes the monitor_init() no longer needed.

This commit removes the monitor_init() from ofproto-dpif-monitor.c.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agotests: Remove \r from source tree.
Ben Pfaff [Mon, 30 Dec 2013 19:35:41 +0000 (11:35 -0800)]
tests: Remove \r from source tree.

An ovsdb-server test had a literal carriage return in a check that
validates a directory name.  It isn't really necessary (who puts a carriage
return in a directory name?) and it does cause problems for passing around
patches via email, so just delete it.

CC: Arun Sharma <arun.sharma@calsoftinc.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoMakefile.am: Always use C locale for "sort" and "comm".
Ben Pfaff [Tue, 24 Dec 2013 16:37:32 +0000 (08:37 -0800)]
Makefile.am: Always use C locale for "sort" and "comm".

Otherwise, if the user changes locales between running the "dist-hook-git"
and "distfiles" targets (e.g. in different invocations of "make"), then
the "dist-hook-git" target might falsely report that the distribution is
missing files.

Reported-by: John Darrington <john@darrington.wattle.id.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoAdd common definitions for Windows builds.
Alin Serdean [Thu, 19 Dec 2013 18:23:12 +0000 (18:23 +0000)]
Add common definitions for Windows builds.

Signed-off-by: Alin Serdean <aserdean at cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agobfd: Notify connectivity_seq on rmt_state changes.
Joe Stringer [Wed, 25 Dec 2013 00:50:53 +0000 (16:50 -0800)]
bfd: Notify connectivity_seq on rmt_state changes.

The bfd module did not previously change the global connectivity_seq
when the remote state changed, which means that such state changes may
not be propagated to the database. This is particularly bad if this is
the last state transition to happen in an otherwise stable environment.
This patch checks for transitions in remote state, and ensures that the
main thread will update the database when these happen.

Bug #22136.

Co-authored-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Verbosity option for dpif/dump-flows command.
Gurucharan Shetty [Tue, 24 Dec 2013 01:43:48 +0000 (17:43 -0800)]
ofproto-dpif: Verbosity option for dpif/dump-flows command.

The display of port names instead of port number for in_port
is considered useful. Enabling the verbosity option also lets
you see all the wildcarded fields and can be helpful.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-parse: Check port number only after parsing it in parse_output().
Daisuke Kotani [Mon, 23 Dec 2013 09:19:48 +0000 (18:19 +0900)]
ofp-parse: Check port number only after parsing it in parse_output().

This patch allows to set max_len to UINT16_MAX in parse_output
if output port is OFPP_CONTROLLER.

Signed-off-by: Daisuke Kotani <kotani@net.ist.i.kyoto-u.ac.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agostdio: New module, initially to provide working [v]snprintf() on Windows.
Ben Pfaff [Tue, 24 Dec 2013 17:18:42 +0000 (09:18 -0800)]
stdio: New module, initially to provide working [v]snprintf() on Windows.

This should transparently define snprintf() and vsnprintf() wrappers for
use on Windows.

CC: Saurabh Shah <ssaurabh@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Make check_table_id generic
Simon Horman [Mon, 23 Dec 2013 12:54:59 +0000 (21:54 +0900)]
ofproto: Make check_table_id generic

Update check_table_id() so that rather than returning a flow_mod specific
error it simply returns true of false. And update callers accordingly.

This is in preparation for using check_table_id() in conjunction
with table_mod.

Also update check_table_id to use OFPTT_ALL.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoINSTALL.NetBSD: Some installation/setup notes for NetBSD
YAMAMOTO Takashi [Tue, 24 Dec 2013 01:39:58 +0000 (10:39 +0900)]
INSTALL.NetBSD: Some installation/setup notes for NetBSD

Mainly for ovs developers who kindly want to test on NetBSD
but not familiar with it.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Avoid leaving a broken def
YAMAMOTO Takashi [Tue, 24 Dec 2013 01:04:08 +0000 (10:04 +0900)]
ofproto: Avoid leaving a broken def

On errors, don't leave a broken ipfix-entries.def, which might cause
mysterious errors later.
(Probably the most common cause is the lack of python xml libraries.)

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoPrepare for post-2.1.0 (2.1.90).
Justin Pettit [Tue, 24 Dec 2013 00:17:50 +0000 (16:17 -0800)]
Prepare for post-2.1.0 (2.1.90).

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoPrepare for 2.1.0.
Justin Pettit [Tue, 24 Dec 2013 00:15:46 +0000 (16:15 -0800)]
Prepare for 2.1.0.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: compat: Configure check GRE DEMUX.
Pravin B Shelar [Mon, 23 Dec 2013 03:43:58 +0000 (19:43 -0800)]
datapath: compat: Configure check GRE DEMUX.

RHEL6-openstack kernel has backported gre DEMUX module,
Therefore add configure check to detect it.

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

10 years agodatapath: compat: Add configure check for lockdep_rtnl_is_held()
Pravin B Shelar [Fri, 20 Dec 2013 23:34:40 +0000 (15:34 -0800)]
datapath: compat: Add configure check for lockdep_rtnl_is_held()

RHEL6-openstack kernel has backported lockdep_rtnl_is_held().

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: compat: Fix skb_has_frag_list definition.
Pravin B Shelar [Fri, 20 Dec 2013 22:30:28 +0000 (14:30 -0800)]
datapath: compat: Fix skb_has_frag_list definition.

RHEL6-openstack kernel has already replaced skb_has_frags
with skb_has_frag_list().

Fix compilation error on RHEL6-openstack.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agobitmap: add bitmap_count1 function
Ben Pfaff [Mon, 23 Dec 2013 20:56:14 +0000 (12:56 -0800)]
bitmap: add bitmap_count1 function

Signed-off-by: Alexander Wu <alexander.wu@huawei.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-dev.py: Pass leak-check=full to valgrind.
Ethan Jackson [Thu, 12 Dec 2013 03:04:10 +0000 (19:04 -0800)]
ovs-dev.py: Pass leak-check=full to valgrind.

This valgrind leak checker isn't really useful without this.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
10 years agocompiler.h: Update documentation
Joe Stringer [Fri, 20 Dec 2013 20:52:52 +0000 (12:52 -0800)]
compiler.h: Update documentation

OVS_LOCKS_EXCLUDED doesn't exist. This should be OVS_EXCLUDED.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoNEWS: Mention new ovs-ofctl ofp-parse-pcap command.
Ben Pfaff [Mon, 23 Dec 2013 18:41:14 +0000 (10:41 -0800)]
NEWS: Mention new ovs-ofctl ofp-parse-pcap command.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-ofctl: New command "ofp-parse-pcap" to dump OpenFlow from PCAP files.
Ben Pfaff [Fri, 22 Nov 2013 21:17:23 +0000 (13:17 -0800)]
ovs-ofctl: New command "ofp-parse-pcap" to dump OpenFlow from PCAP files.

Based on the number of people who ask about Wireshark support for OpenFlow,
this is likely to be widely useful.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agopcap-file: Add timestamp support for reading and writing pcap files.
Ben Pfaff [Fri, 22 Nov 2013 19:42:06 +0000 (11:42 -0800)]
pcap-file: Add timestamp support for reading and writing pcap files.

Only the write support is initially useful, but an upcoming commit will add
a user for the read support.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofpbuf: New function ofpbuf_shift().
Ben Pfaff [Fri, 22 Nov 2013 19:42:42 +0000 (11:42 -0800)]
ofpbuf: New function ofpbuf_shift().

An upcoming commit will add the first user.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: bug.h missing from distfiles
Chris Luke [Sun, 22 Dec 2013 22:43:33 +0000 (14:43 -0800)]
datapath: bug.h missing from distfiles

commit 7c359202 introduced datapath/linux/compat/include/bug.h
but did not include it in datapath/linux/Modules.mk, which results
in the following build error:

> The distribution is missing the following files:
> datapath/linux/compat/include/linux/bug.h

Signed-off-by: Chris Luke <chris_luke@cable.comcast.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: Fix sparse warning on BUILD_BUG_ON_INVALID()
Andy Zhou [Sat, 21 Dec 2013 00:18:58 +0000 (16:18 -0800)]
datapath: Fix sparse warning on BUILD_BUG_ON_INVALID()

Sparse gives the following warnings when compile against Linux kernel
3.5:

 CHECK   /root/projs/ovs/openvswitch/datapath/linux/skbuff-openvswitch.c
 include/linux/mm.h:405:9: error: undefined identifier
 'BUILD_BUG_ON_INVALID'
 include/linux/mm.h:405:9: error: not a function <noident>

The same issue may also exist in kernel 3.6.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
10 years agobfd: Send FINAL immediately after receiving POLL.
Alex Wang [Fri, 20 Dec 2013 22:53:52 +0000 (14:53 -0800)]
bfd: Send FINAL immediately after receiving POLL.

Commit 307464a11 (ofproto-dpif-monitor: Use heap to order the mport
wakeup time.) makes bfd only send packet at specified periodic instant.
This fails to meet the RFC5880 requirement, which requires bfd send
FINAL immediately after receiving POLL.

This commit fixes the above issue by scheduling bfd to send FINAL
within 100 ms after receiving POLL.

Signed-off-by: Alex Wang <alexw@nicira.com>
10 years agodatapath: Check for backported netdev_features_t.
Jesse Gross [Tue, 17 Dec 2013 18:22:40 +0000 (10:22 -0800)]
datapath: Check for backported netdev_features_t.

This is apparently used by CentOS 6.5.

Reported-by: Phil Daws <uxbod@splatnix.net>
Reported-by: Edouard Bourguignon <madko@linuxed.net>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agolinux: Report supported user features to the kernel
Thomas Graf [Thu, 19 Dec 2013 15:20:42 +0000 (16:20 +0100)]
linux: Report supported user features to the kernel

Following commit (''netlink: Do not enforce alignment of last Netlink
attribute''), signal the ability to receive unaligned Netlink messages
to the datapath to enable utilization of zerocopy optimizations.

Opening a datapath is now done by issueing a OVS_DP_CMD_SET in order
to overwrite previously set user features.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agoovs-check-dead-ifs: Flush buffer before calling execvp.
Gurucharan Shetty [Fri, 20 Dec 2013 17:30:21 +0000 (09:30 -0800)]
ovs-check-dead-ifs: Flush buffer before calling execvp.

According to Python documentation here for execvp:
http://docs.python.org/2/library/os.html
"The current process is replaced immediately. Open file objects
and descriptors are not flushed, so if there may be data buffered
on these open files, you should flush them using sys.stdout.flush()
or os.fsync() before calling an exec* function.

Without the flush, we will miss the print statements before that
if we redirect the o/p to a file.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-print: Print durations with at least three decimals.
Ben Pfaff [Fri, 20 Dec 2013 16:39:27 +0000 (08:39 -0800)]
ofp-print: Print durations with at least three decimals.

Occasionally I run a command like this:
    watch -n.1 ovs-ofctl dump-flows br0
to see how flows change over time.  Until now, it has been more difficult
than necessary to spot real changes, because flows "jump around" as the
number of decimals printed for duration changes from moment to moment.
That is, you might see
    cookie=0x0, duration=4.566s, table=0, n_packets=0, ...
one moment, and then
    cookie=0x0, duration=4.8s, table=0, n_packets=0, ...
the next moment.  Shortening 4.8 to 4.800 shifts everything following it
two places to the left, creating a visual jump.

This commit avoids that problem by always printing at least three decimals
if we print any.  There can still be an occasional jump if a duration is
exactly on a second boundary, but that only happens 1/1000 of the time.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agolib/flow: Skip minimask value checks.
Jarno Rajahalme [Fri, 20 Dec 2013 16:16:31 +0000 (08:16 -0800)]
lib/flow: Skip minimask value checks.

We allow zero 'values' in a miniflow for it to have the same map
as the corresponding minimask.  Minimasks themselves never have
zero data values, though.  Document this and optimize the code
accordingly.

v2:
- Made miniflow_get_map_in_range() to return data offset instead of
  a pointer via the last parameter.
- Simplified minimatch_hash_in_range() by removing pointer arithmetic.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agotests/learn.at: Workaround a race
YAMAMOTO Takashi [Fri, 20 Dec 2013 10:31:06 +0000 (19:31 +0900)]
tests/learn.at: Workaround a race

This test seems to assume that the switch completes
processing of the first packet before start processing
the second one.  I don't see any code ensuring that.
Workaround the problem by giving 1 second for the upcall.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agotimeval: Workaround for threaded test failures
YAMAMOTO Takashi [Fri, 20 Dec 2013 10:31:05 +0000 (19:31 +0900)]
timeval: Workaround for threaded test failures

BFD tests have the code like the following.

    # wait for a while to stablize everything.
    for i in `seq 0 9`; do ovs-appctl time/warp 500; done

They no longer work as intended because BFD code is run in a
separate monitor thread these days.  The loop merely "warp"
the time by 5000.  The monitor thread should have been woken
at least once, but it's far from "wait for a while to stablize
everything."

This commit mitigates the problem by sleeping a little in the
appctl handler.  This is not ideal but makes BFD tests success
on my environment.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agotests/ofproto-dpif.at: Workaround a race
YAMAMOTO Takashi [Fri, 20 Dec 2013 10:31:04 +0000 (19:31 +0900)]
tests/ofproto-dpif.at: Workaround a race

This test seems to assume only the first packets in flows
counted as 'miss'.  I don't see any code ensuring that.
The test would fail if the upcall handler for the flow doesn't
run fast enough.  Workaround the problem by giving 1 second
for the miss upcall.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-upcall: Reduce log level of "Spent unreasonably long" msg
YAMAMOTO Takashi [Fri, 20 Dec 2013 10:31:03 +0000 (19:31 +0900)]
ofproto-dpif-upcall: Reduce log level of "Spent unreasonably long" msg

This message can be caused by a time warp and make tests fail.

The message was introduced by commit e79a6c83.
("ofproto: Handle flow installation and eviction in upcall.")

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agotests/ofproto.at: Avoid stdout/stderr ordering assumptions
YAMAMOTO Takashi [Fri, 20 Dec 2013 10:31:02 +0000 (19:31 +0900)]
tests/ofproto.at: Avoid stdout/stderr ordering assumptions

Stop assuming the order of outputs from separate streams.
(stdout and stderr)

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agotests/ofproto-dpif.at: Portability improvement
YAMAMOTO Takashi [Fri, 20 Dec 2013 10:31:01 +0000 (19:31 +0900)]
tests/ofproto-dpif.at: Portability improvement

The output of "wc -l" have leading spaces on some platforms.
(NetBSD, OSX, ...)

This fixes a test failure introduced by commit e79a6c83.
("ofproto: Handle flow installation and eviction in upcall.")

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agotests/daemon-py.at: Skip if no python
YAMAMOTO Takashi [Fri, 20 Dec 2013 10:31:00 +0000 (19:31 +0900)]
tests/daemon-py.at: Skip if no python

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years ago.gitignore: add /libtool
Lorand Jakab [Fri, 20 Dec 2013 10:46:53 +0000 (12:46 +0200)]
.gitignore: add /libtool

The ./configure script now generates a 'libtool' file in the top-level
directory.  Add it to .gitignore

Signed-off-by: Lorand Jakab <lojakab@cisco.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Handle flow installation and eviction in upcall.
Ethan Jackson [Tue, 24 Sep 2013 20:39:56 +0000 (13:39 -0700)]
ofproto: Handle flow installation and eviction in upcall.

This patch moves flow installation and eviction from ofproto-dpif and
the main thread, into ofproto-dpif-upcall.  This performs
significantly better (approximately 2x TCP_CRR improvement), and
allows ovs-vswitchd to maintain significantly larger datapath flow
tables.  On top of that, it significantly simplifies the code,
retiring "struct facet" and friends.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agounixctl: Make dpif/dump-flows fetch kernel flows.
Joe Stringer [Wed, 20 Nov 2013 22:25:43 +0000 (14:25 -0800)]
unixctl: Make dpif/dump-flows fetch kernel flows.

Previously we used facets for ovs-appctl dpif/dump-flows commands.
This switches to fetching flows directly from the dpif.  This is
necessary because future patches remove facets and subfacet entirely.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Fix build failure on RHEL 6.4
Pravin B Shelar [Wed, 18 Dec 2013 18:57:33 +0000 (10:57 -0800)]
datapath: Fix build failure on RHEL 6.4

Patch fixes following build failure:-

make[4]: Entering directory
`/usr/src/kernels/2.6.32-358.18.1.el6.x86_64'
  CC [M]  openvswitch/datapath/linux/actions.o
In file included from
openvswitch/datapath/linux/actions.c:21:
openvswitch/datapath/linux/compat/include/linux/skbuff.h:273:
error: redefinition of â€˜__skb_fill_page_desc’
include/linux/skbuff.h:1123: note: previous definition of
‘__skb_fill_page_desc’ was here
-----

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agoentropy: Add Windows support.
Alin Serdean [Thu, 19 Dec 2013 17:20:17 +0000 (09:20 -0800)]
entropy: Add Windows support.

Signed-off-by: Alin Serdean <aserdean at cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoxenserver: Fix build failures because of libraries in /usr/lib.
Gurucharan Shetty [Thu, 19 Dec 2013 05:35:09 +0000 (21:35 -0800)]
xenserver: Fix build failures because of libraries in /usr/lib.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Fix deadlock during stats update.
Pravin B Shelar [Tue, 17 Dec 2013 23:43:30 +0000 (15:43 -0800)]
datapath: Fix deadlock during stats update.

Stats-read needs to lock stats but same lock is taken in stats
update in irq context. Therefore it needs to disable irq to
avoid following deadlock :-

BUG: soft lockup - CPU#1 stuck for 23s! [ovs-vswitchd:1425]
CPU 1
Pid: 1425, comm: ovs-vswitchd Tainted: G           O 3.2.39-server-nn23 #1 VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform
RIP: 0010:[<ffffffff8103db22>]  [<ffffffff8103db22>] __ticket_spin_lock+0x22/0x30
RSP: 0018:ffff88003fd03b30  EFLAGS: 00000297
RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000050
RDX: 0000000000000002 RSI: ffff88003d0a9900 RDI: ffff88003ae19598
RBP: ffff88003fd03b30 R08: 0000000000000000 R09: ffff88003ad44048
R10: 0000000000000001 R11: 0000000000000001 R12: ffff88003fd03aa8
R13: ffffffff8164e5de R14: ffff88003fd03b30 R15: ffff88003ae19580
FS:  00007ffb0b428940(0000) GS:ffff88003fd00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f3c0ef94000 CR3: 00000000250e2000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process ovs-vswitchd (pid: 1425, threadinfo ffff88002514a000, task ffff8800250aae00)
Stack:
 ffff88003fd03b40 ffffffff8164596e ffff88003fd03b70 ffffffffa027622d
 ffff88003d0a9900 ffffe8ffffd03800 ffff8800297f5a80 ffff88003fd03ba8
 ffff88003fd03c60 ffffffffa02759af ffff88003fd03de0 ffff88003fd03e4c
Call Trace:
 <IRQ>
 [<ffffffff8164596e>] _raw_spin_lock+0xe/0x20
 [<ffffffffa027622d>] ovs_flow_stats_update+0x5d/0x100 [openvswitch]
 [<ffffffffa02759af>] ovs_dp_process_received_packet+0x8f/0x130 [openvswitch]
 [<ffffffffa027c0ca>] ovs_vport_receive+0x2a/0x30 [openvswitch]
 [<ffffffffa027db18>] netdev_frame_hook+0xb8/0x120 [openvswitch]
 [<ffffffffa027da60>] ? free_port_rcu+0x30/0x30 [openvswitch]
 [<ffffffff81539318>] __netif_receive_skb+0x1c8/0x620
 [<ffffffff8153a4c0>] netif_receive_skb+0x80/0x90
 [<ffffffff8115f14c>] ? ksize+0x1c/0xc0
 [<ffffffff8153a610>] napi_skb_finish+0x50/0x70
 [<ffffffff8153ac15>] napi_gro_receive+0xf5/0x140
 [<ffffffffa00368ae>] vmxnet3_rq_rx_complete+0x51e/0x7c0 [vmxnet3]
 [<ffffffff8101ac90>] ? nommu_map_sg+0xe0/0xe0
 [<ffffffffa0036da5>] vmxnet3_poll_rx_only+0x45/0xc0 [vmxnet3]
 [<ffffffff8153ae64>] net_rx_action+0x134/0x290
 [<ffffffff8103db0d>] ? __ticket_spin_lock+0xd/0x30
 [<ffffffff8106e1a8>] __do_softirq+0xa8/0x210
 [<ffffffff8164596e>] ? _raw_spin_lock+0xe/0x20
 [<ffffffff8164fd6c>] call_softirq+0x1c/0x30
 [<ffffffff81016215>] do_softirq+0x65/0xa0
 [<ffffffff8106e58e>] irq_exit+0x8e/0xb0
 [<ffffffff81650633>] do_IRQ+0x63/0xe0
 [<ffffffff81645e2e>] common_interrupt+0x6e/0x6e

-----------
Bug #21853
Reported-by: Pawan Shukla <shuklap@vmware.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agoofproto-dpif: Get rid of mirror_mask_ffs() function.
Ben Pfaff [Wed, 18 Dec 2013 17:20:49 +0000 (09:20 -0800)]
ofproto-dpif: Get rid of mirror_mask_ffs() function.

There's no need for it because we have the equivalent (actually more
convenient) function raw_ctz(), which works with any integer type.

Signed-off-by: Ben Pfaff <blp@nicira.com>
CC: Alin Serdean <aserdean@cloudbasesolutions.com>
CC: Gurucharan Shetty <shettyg@nicira.com>
10 years agorhel: Fix build failures because of libraries in /usr/lib.
Gurucharan Shetty [Wed, 18 Dec 2013 17:05:40 +0000 (09:05 -0800)]
rhel: Fix build failures because of libraries in /usr/lib.

Reported-by: Igor Sever <igor@xorops.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-tcpdump: Fix tcpdump patch breakage due to libtool.
Ben Pfaff [Wed, 18 Dec 2013 21:47:16 +0000 (13:47 -0800)]
ofp-tcpdump: Fix tcpdump patch breakage due to libtool.

The recently introduced use of libtool, in commit 38b7a52b618b98
(openvswitch: Use libtool and allow building shared libs) broke the
tcpdump patch.  This fixes the problem.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agoAUTHORS: update my entry
YAMAMOTO Takashi [Wed, 18 Dec 2013 08:21:23 +0000 (17:21 +0900)]
AUTHORS: update my entry

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agonetdev-bsd: remove an unused variable
YAMAMOTO Takashi [Wed, 18 Dec 2013 08:16:15 +0000 (17:16 +0900)]
netdev-bsd: remove an unused variable

this is a leftover of commit da4a6191.
("netdev: Globally track port status changes")

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoINSTALL: Mention --enable-Werror.
Ben Pfaff [Wed, 18 Dec 2013 05:44:25 +0000 (21:44 -0800)]
INSTALL: Mention --enable-Werror.

I think that some developers haven't noticed this, but it's useful, so
mention it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agoofproto: Add table config to struct ofproto
Simon Horman [Mon, 16 Dec 2013 08:53:22 +0000 (17:53 +0900)]
ofproto: Add table config to struct ofproto

Add table config to to struct ofproto and set it
when a table mod message is received.

This is in preparation for changing the behaviour of the switch
based on table config.

Cc: Andy Zhou <azhou@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodpif-netdev: Remove unnecessary parameters from dp_netdev_port_input()
Simon Horman [Wed, 27 Nov 2013 05:08:41 +0000 (14:08 +0900)]
dpif-netdev: Remove unnecessary parameters from dp_netdev_port_input()

The skb_priority, pkt_mark and tunl parameters of dp_netdev_port_input()
are always passed as 0, 0 and NULL respectively. So rather than
passing these values to dp_netdev_port_input() just use them directly.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoopenvswitch: Use libtool and allow building shared libs
Helmut Schaa [Fri, 13 Dec 2013 17:54:28 +0000 (18:54 +0100)]
openvswitch: Use libtool and allow building shared libs

Currently openvswitch builds all libraries static only. However,
libopenvswitch is linked into nearly all openvswitch executables
making it hardly possible to run openvswitch on embedded devices
(for example running OpenWrt).

Convert openvswitch to use libtool for building its internal libs.
This allows "--enable-shared" and "--enable-static" as configure
arguments. Default is "--disable-shared" thus keeping the current
behavior with the only change that static libs are installed by
"make install".

Since the openvswitch library interfaces are internal and thus not
stable (yet) encode the openvswitch version into the library name:
libopenvswitch-2.0.90.so

Binary size is reduced to around 1/3 when using shared libs.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agocfm: Add test for fault_override
Joe Stringer [Mon, 16 Dec 2013 18:08:08 +0000 (10:08 -0800)]
cfm: Add test for fault_override

This patch adds tests for the cfm fault_override feature which can be
set through "ovs-appctl cfm/set-fault <port> <value>". It brings up two
ports with CFM, sets a fault, then checks that the fault status has
propagated correctly to the CFM module and the database. Finally, it
sets the fault override behaviour to normal and checks that the fault
has gone away.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoDo not free uninitialized packets.
Jarno Rajahalme [Tue, 17 Dec 2013 23:54:30 +0000 (15:54 -0800)]
Do not free uninitialized packets.

Commit da546e0 (dpif: Allow execute to modify the packet.) uninitializes
the "dpif_upcall.packet" of "struct upcall" when dpif_recv() returns error.
The packet ofpbuf is likely uninitialized in this case, hence calling
ofpbuf_uninit() on it will likely cause a SEGFAULT.

This commit fixes this bug by only uninitializing packet's ofpbuf on
successfully received upcalls.

A note warning about this is added on the comment of dpif_recv() in
dpif.c and dpif-provider.h.

Reported-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>