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

6019 Commits

Author SHA1 Message Date
Ben Pfaff
380b39f729 INSTALL: Admit that only GNU make works.
I promised some time ago to take a look at fixing the behavior of the
Makefiles with non-GNU make, but it doesn't realistically seem that I will.

CC: Ed Maste <emaste@freebsd.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-04-15 09:09:46 -07:00
Pravin B Shelar
c65501ca49 datapath: Remove vport->linkname
This field is no longer used in datapath.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2013-04-12 16:13:32 -07:00
Pravin B Shelar
cd2a59e99c datapath: Simplify datapath locking.
Currently OVS uses combination of genl and rtnl lock to protect
datapath state.  This was done due to networking stack locking.
But this has complicated locking and there are few lock ordering
issues with new tunneling protocols.
Following patch simplifies locking by introducing new ovs mutex
and now this lock is used to protect entire ovs state.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2013-04-12 15:57:09 -07:00
Pravin B Shelar
55a6ee411e datapath: Add workqueue API to ovs compat workqueue.
Add work-queue api which are required for next commit.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2013-04-12 15:56:14 -07:00
Gurucharan Shetty
85f6063580 ovs-vsctl: Fix a segfault.
The following two commands results in a ovs-vsctl segfault.
ovs-vsctl -vfatal_signal:off --timeout=0 wait-until \
Open_vswitch . external_ids:blah="1"
/etc/init.d/openvswitch-switch restart

This patch fixes the segfault by properly setting the global
varibale, the_idl_txn to NULL when the underlying memory is
freed.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-04-12 14:12:40 -07:00
Gurucharan Shetty
0a69a5e4d4 ovs-ctl.in: Merge a single line function.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-04-12 14:05:41 -07:00
Ben Pfaff
b789803140 tests: Add test for ovs-vswitchd regression with empty db.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-04-12 10:13:46 -07:00
Ben Pfaff
8de6ab5d17 AUTHORS: Add Ansis Atteka.
I do not understand how this omission has gone on so long.

CC: Ansis Atteka <aatteka@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-04-11 16:28:47 -07:00
Ben Pfaff
ff02e9a537 bridge: Complete initial configuration even with empty database.
If the database was empty, that is, it did not even contain an Open_vSwitch
top-level configuration record, at ovs-vswitchd startup time, then
OVS failed to detach and used 100% CPU.  This commit fixes the problem.

This problem was introduced by commit 63ff04e826 (bridge: Only
complete daemonization after db commits initial config.).

This problem did not manifest if the initscripts supplied with Open vSwitch
were used, because those initscripts always initialize the database before
starting ovs-vswitchd, so this problem affects only users with hand-rolled
local OVS startup scripts.

Bug #16090.
Reported-by: Pravin Shelar <pshelar@nicira.com>
Tested-by: Pravin Shelar <pshelar@nicira.com>
Reported-by: Paul Ingram <paul@nicira.com>
Reported-by: Amre Shakimov <ashakimov@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ansis Atteka <aatteka@nicira.com>
2013-04-11 15:52:59 -07:00
Ben Pfaff
1c85959e0c memory: Avoid 100% CPU when there is nothing to report.
Commit b9de408768 (memory: Avoid an empty log message if there's nothing
to log.) introduced a 100% CPU usage condition when there is nothing to
log.  This fixes the problem.

Reported-by: Ansis Atteka <aatteka@nicira.com>
Acked-by: Ansis Atteka <aatteka@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-04-11 15:52:58 -07:00
Ansis Atteka
f28b6dd3f4 netlink-socket: Don't bother logging SO_RCVBUFFORCE failure
This patch fixes tests when they are run with "fakeroot debian/rules binary"
command.

The problem was that under fakeroot setsockopt() call could still return
EPERM and lead to a warning message being logged.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
2013-04-11 11:33:24 -07:00
Ben Pfaff
63ff04e826 bridge: Only complete daemonization after db commits initial config.
An earlier commit changed the Open vSwitch startup scripts so that they
connect to remote managers only after ovs-vswitchd does its initial
configuration, as signaled by ovs-vswitchd detaching from its parent
process.  However, a race window remains, because ovs-vswitchd detaching
does not mean that the database server has received and committed the
transaction, only that ovs-vswitchd has sent it.  This commit fixes that
race window, by changing ovs-vswitchd to complete detaching only after
the database server acknowledges the transaction.

It is still possible for unusual events to cause ovs-vswitchd to detach
before ephemeral columns are filled in.  There is always a slim possibility
that the transaction will fail or that some other client has added new
bridges, ports, etc. while ovs-vswitchd was configuring using an old
configuration.  The latter race is inherent to the design of the system
and cannot be avoided without radical changes.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ansis Atteka <aatteka@nicira.com>
Bug #15983.
2013-04-10 18:11:27 -07:00
Ben Pfaff
0ffe45370d ovs-ctl: Connect to remote OVSDB managers only after ovs-vswitchd starts.
Until now, ovs-ctl has started ovsdb-server with the full set of remote
managers configured.  This means that ovsdb-server immediately connects to
these managers, before ovs-vswitchd even starts.  Because the Open vSwitch
schema has several ephemeral columns, there will be considerable startup
churn in the database.   For example, ovs-vswitchd will initially fill in
the datapath-id and ofport columns as it starts and sets up the initial
configuration.  This churn wastes bandwidth to the remote managers and has
potential for confusing them.

This commit reduces the churn by changing ovs-ctl so that ovsdb-server
connects to the remote managers only after ovs-vswitchd has finished its
initial configuration.  This means that remote managers will initially
see a filled-in database, not one that has its ephemeral columns empty.

This commit does not mean that managers can ignore the possibility that
some columns have not yet been filled in.  For example, some columns will
still be briefly blank after a new bridge or a new port is added at
runtime, because adding a bridge or port occurs in one transaction (made by
the client adding the port, e.g. ovs-vsctl) and filling in those columns
happens in a different transaction (made by ovs-vswitchd).  But this commit
does reduce the quantity of empty columns that I would expect a database
client to observe in practice.

Reported-by: Jeff Merrick <jmerrick@vmware.com>
CC: Amar Padmanabhan <amar@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ansis Atteka <aatteka@nicira.com>
Bug #15983.
2013-04-10 18:11:19 -07:00
Ben Pfaff
b421d2af0a ovsdb-server: Add commands for adding and removing remotes at runtime.
This will make it possible, in later commits, to make ovsdb-server connect
to OVS managers only after ovs-vswitchd has completed its initial
configuration.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ansis Atteka <aatteka@nicira.com>
2013-04-10 18:11:12 -07:00
Ben Pfaff
c02cf07b18 ovsdb-server: Refactor parsing of remote names to avoid ovs_fatal().
The current users of parse_db_column() are content to terminate with a
fatal error if parsing fails.  An upcoming commit requires more flexibility,
so this commit refactors parse_db_column() to make this possible.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ansis Atteka <aatteka@nicira.com>
2013-04-10 18:11:06 -07:00
Ben Pfaff
808311f6d9 sset: New function sset_sort().
This will have its first caller in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ansis Atteka <aatteka@nicira.com>
2013-04-10 18:10:58 -07:00
Andy Zhou
9872172a0a datapath.h Fix a stale comment.
Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2013-04-10 14:55:17 -07:00
Ethan Jackson
fa717215da dpif-linux: Reset epoll() on channel deletion.
The list of epoll events contains references to channels which may
be stale when one of those channels is deleted.  The safest thing
to do is simply refresh epoll() whenever a channel is deleted.

Bug #16057.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2013-04-10 13:05:04 -07:00
Ethan Jackson
31098e3f6b tests: Add test-sflow to .gitignore.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2013-04-09 15:22:31 -07:00
Jarno Rajahalme
6796e6ff1f Remove unused struct xlate_reg_state definition.
Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-04-09 10:45:28 -07:00
Gurucharan Shetty
5902b4ed6d rhel, xenserver: Punch holes through firewall for VXLAN.
Bug #15518.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-04-08 10:40:05 -07:00
Ben Pfaff
8d3efc1c0e python.ovs.db.idl: Fix Row.delete() of a row already committed to the db.
Row.delete() handled the case of deleting a row that was added within the
current transaction, but not yet committed, but it did not correctly handle
the case of deleting a row that belonged to the database before the
transaction started.  This fixes the problem.

Reported-by: Yeming Zhao <zhaoyeming@gmail.com>
Tested-by: Yeming Zhao <zhaoyeming@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-04-08 10:44:40 -07:00
Gurucharan Shetty
ed87900d26 ovs-lib: Do not tee the ovs-ctl o/p in case of strace.
Running the OVS daemons with strace option enabled
will block if we pipe the output. We use tee
to log the output of ovs-ctl to ovs-ctl.log

This patch disables the startup script logging when we run the
OVS daemons with the strace option.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-04-07 08:59:37 -07:00
Ethan Jackson
4464589ee7 ofproto-dpif: Disable miss handling in rule_get_stats().
rule_get_stats() is often called when iterating over every rule in
the flow table.  To ensure up-to-date statistics, rule_get_stats()
calls push_all_stats() which can cause flow misses to be handled.
When using the learn action, this can cause rules to be added (and
potentially removed) from the OpenFlow table.  This could corrupt
the caller's data structures, leading to a segmentation fault.
This patch fixes the issue by disabling flow miss handling from
within rule_get_stats().

Bug #15999.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2013-04-06 18:22:33 -07:00
Romain Lenglet
ca03aae04a vlog: extend syslog format to make OVS logs easier to filter
Prepend "ovs|" to syslog logs to make them easier to filter out of all
LOG_DAEMON logs.

Signed-off-by: Romain Lenglet <rlenglet@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-04-05 09:00:22 -05:00
Andy Zhou
3af56aefe0 ovs-appctl: dpif/show display bug fix
Fixes a bug where per ofproto moving average stats did not update
when there is no active dp flows.

Reported-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
2013-03-29 09:40:22 -07:00
Jarno Rajahalme
0239c8604b tests/lacp.at: Fix comment.
Fix residue from an earlier patch.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-04-03 05:54:26 -07:00
Ben Pfaff
b9de408768 memory: Avoid an empty log message if there's nothing to log.
I spotted this in a case where I ran ovsdb-server, by hand, on an empty
database.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-04-03 05:52:12 -07:00
Thomas Graf
778ea0a463 datapath: Don't insert empty OVS_VPORT_ATTR_OPTIONS attribute
The port specific options are currently unused resulting in an
empty OVS_VPORT_ATTR_OPTIONS nested attribute being inserted
into every OVS_VPORT_CMD_GET message.

Don't insert OVS_VPORT_ATTR_OPTIONS if no options are present.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
[jesse: Options are used by tunnels but the concept still applies.]
Signed-off-by: Jesse Gross <jesse@nicira.com>
2013-04-02 16:34:28 -07:00
Ethan Jackson
62bd7349ad ofproto-dpif: Don't rate limit facet_learn() with fin_timeouts.
In the standard case, rate limiting facet_learn() to once ever
500ms, makes sense.  The worst that can happen is a learning entry
is expired half a second to early.  However, when using
fin_timeouts, we really need react quickly to delete the newly
stale flow.

Bug #15915.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2013-04-02 12:32:22 -07:00
Ethan Jackson
27a88d1373 ofproto: Increase default flow-eviction-threshold.
The flow-eviction-threshold presents a trade off between the
expense of maintaining large numbers of datapath flows, and the
benefit of avoid unnecessary flow misses.  In some large Open
vSwitch deployments, we've seen the previous default flow eviction
threshold negatively impact performance with reasonably typical
traffic patterns.  This patch increases the default to a level
which should represent a better trade off: still relatively safe,
but much more amenable to large numbers of long lived flows.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2013-04-01 15:59:32 -07:00
Ethan Jackson
e20b574602 ofproto-dpif: Push statistics less frequently.
The most natural place to push facet statistics is in
update_stats() where they're pulled from the datapath.  However,
under load, update_stats() can be called as many as 10 times per
second causing us to push statistics so frequently it hurts
performance.  By pushing statistics much less frequently, this
patch generates a roughly 8% improvement in TCP_CRR performance.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2013-04-01 15:59:29 -07:00
Ethan Jackson
8fa4d1d0bf ofproto-dpif: Run fast internally.
ofproto-dpif is responsible for quite a few book keeping tasks in
addition to handling flow misses.  Many of these tasks (flow
expiration, flow revalidation, etc) can take many hundreds of
milliseconds, during which no misses can be handled.  The ideal
long term solution to this problem, is to isolate flow miss
handling into it's own thread.  However, for now this patch
provides a 5% increase in TCP_CRR performance, and smooths out
results during revalidations.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2013-04-01 15:59:10 -07:00
Ethan Jackson
8844e03542 ofproto-dpif: Systematically push stats upon request.
Commit bf1e8ff (ofproto-dpif: Push statistics in rule_get_stats()),
started down the road towards pushing stats on demand, but it
didn't go quite far enough.  First, it neglected to push stats in
port_get_stats() and mirror_get_stats().  Second, it only pushes
stats for a single ofproto, making it incomplete when patch ports
are used.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2013-04-01 15:59:10 -07:00
Ben Pfaff
c86073a000 netdev: Remove netdev_is_open(), which has no users.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
2013-04-01 15:49:32 -07:00
Ben Pfaff
7e3dfa3bc7 netdev: Remove netdev_exists(), which has no users.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
2013-04-01 15:49:31 -07:00
Gurucharan Shetty
9c12d2ec75 rhel: Add depmod.d conf file for rhel6 kmod package.
It looks like for Centos6.4, there is an upstream openvswitch
kernel module already installed. When we try to install kmod-openvswitch
package from this tree's pre-1.10 branches, we get the following warning:
"brcompat.ko needs unknown symbol ovs_dp_ioctl_hook".

Also, after installing the kmod-openvswitch package, if we run
"modprobe openvswitch", the upstream kernel module gets loaded.
We should instead load the kernel module compiled from this tree.

This patch fixes both the above issues.

Bug #15829.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-04-01 15:11:56 -07:00
Ben Pfaff
60533a405b jsonrpc-server: Disconnect connections that queue too much data.
Consider this situation:

    * OVSDB client A executes transactions very quickly for a long time.

    * OVSDB client B monitors the tables that A modifies, but (either
      because B is connected over a slow network, or because B is slow to
      process updates) cannot keep up.

In this situation, the data that ovsdb-server has queued to send B grows
without bound and eventually ovsdb-server runs out of memory.  This commit
avoids the problem by noticing that more data is queued to B than necessary
to express the whole contents of the database and dropping the connection
to B.  When B reconnects later, it can then fetch the contents of the
database using less data than was previously queued to it.

(This is not entirely hypothetical.  We have seen this behavior in
intentional stress tests.)

Bug #15637.
Reported-by: Jeff Merrick <jmerrick@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-04-01 13:20:04 -07:00
Ben Pfaff
0ea7bec76d ovsdb-data: New functions for predicting serialized length of data.
These will be used for the first time in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-04-01 13:20:04 -07:00
Ben Pfaff
1600fa6853 json: New function json_serialized_length().
This will be used for the first time in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-04-01 13:16:59 -07:00
Neil Mckee
8073dd318b tests: Add sFlow test.
This patch adds an sFlow test to the test suite.

I have only tested this on a Fedora 17 OS.

Signed-off-by: Neil Mckee <neil.mckee@inmon.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-04-01 13:08:31 -07:00
Thomas Graf
d11dbe6176 datapath: Use ETH_ALEN to define ethernet addresses
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2013-03-29 18:47:25 -07:00
Jesse Gross
8773132685 datapath: Provide simple version of if_ether.h on non-Linux systems.
Signed-off-by: Jesse Gross <jesse@nicira.com>
2013-03-29 18:47:25 -07:00
Thomas Graf
e297c6b790 datapath: Move common genl notify code into ovs_notify()
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2013-03-29 18:24:06 -07:00
Thomas Graf
0afa23732d datapath: Refine Netlink message size calculation and kill FLOW_BUFSIZE
Kills the FLOW_BUFSIZE constant which needs to be calculated manually
and replaces it with key_attr_size() based on nla_total_size().
Calculates the size of datapath messages instead of relying on
NLMSG_DEFAULT_SIZE and moves the existing message size calculations
into own functions for clarity.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2013-03-29 18:18:58 -07:00
Thomas Graf
bf3d6fce94 datapath: Use nla_memcpy() to memcpy() data from attributes
Less error prone as it takes into account the length of both the
destination buffer and the source attribute and documents when
data is copied from an attribute.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2013-03-29 18:10:31 -07:00
Thomas Graf
7c3072cc44 datapath: Specify the minimal length of OVS_PACKET_ATTR_PACKET in the policy
Specifying the minimal length in the policy makes it reuseable
and documents the interface.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2013-03-29 18:03:05 -07:00
Ben Pfaff
8e63fd14f9 lacp: Stop time to avoid dependency on real time in negotiation test.
Commit f3103dfa00 (lacp.at: Change timing of lacp - negotiation test)
fixed test failures for the lacp negotiation test on some systems, but
made it crop up on others where it hadn't appeared before.

My guess is that this commit is the real fix.  If it isn't, then we
will probably just have to remove the test or disable it, much as I
hate doing that.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-03-28 14:10:42 -07:00
Simon Horman
7cd4615505 datapath: net: add ETH_P_802_3_MIN
Add a new constant ETH_P_802_3_MIN, the minimum ethernet type for
an 802.3 frame. Frames with a lower value in the ethernet type field
are Ethernet II.

Also update all the users of this value that David Miller and
I could find to use the new constant.

Also correct a bug in util.c. The comparison with ETH_P_802_3_MIN
should be >= not >.

As suggested by Jesse Gross.

Compile tested only.

Cc: David Miller <davem@davemloft.net>
Cc: Jesse Gross <jesse@nicira.com>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Bart De Schuymer <bart.de.schuymer@pandora.be>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Cc: netfilter-devel@vger.kernel.org
Cc: bridge@lists.linux-foundation.org
Cc: linux-wireless@vger.kernel.org
Cc: linux1394-devel@lists.sourceforge.net
Cc: linux-media@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: dev@openvswitch.org
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2013-03-28 12:01:17 -07:00
Jarno Rajahalme
f3103dfa00 lacp.at: Change timing of lacp - negotiation test
The "lacp - negotiation" test (# 3) used to always fail when running
multiple tests in parallel (-j2).  The reduced simulated wait time
(from 4 seconds to 2.5 seconds) seems to still give the expected result,
and works also when running multiple tests in parallel.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-03-28 07:55:32 -07:00