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

19894 Commits

Author SHA1 Message Date
Ian Campbell
f7fed00035 datapath: Use HAVE_PROTO_DATA_VALID when defining vswitch_skb_checksum_setup
The purpose of the non-empty variant of vswitch_skb_checksum_setup is to
synchronise the proto_data_valid and proto_csum_blank fields into the
standard skb csum/ip_summed fields, therefore it is more correct to key
off of HAVE_PROTO_DATA_VALID.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2009-11-19 10:25:57 -08:00
Ben Pfaff
e8cf6733e4 datapath: Fix warning building datapath on pre-2.6.24 kernels.
The Linux 'min' macro checks that its arguments have the same type, and
if not the compiler reports a message about incompatible pointer types.
On pre-2.6.24 kernels skb_headroom() returns int, so this code was
firing a warning:
       unsigned headroom = max(min_headroom, skb_headroom(skb));

This commit makes skb_headroom() return an unsigned int regardless of
kernel version.
2009-11-18 15:56:57 -08:00
Ben Pfaff
6a33828dbc datapath: Check for proto_data_valid member instead of kernel version.
Commit 5ef800a69 "datapath: Copy Xen's checksumming fields when doing
skb_copy" should copy proto_data_valid between sk_buffs when that field
is present.  However the check for CONFIG_XEN plus kernel version 2.6.18
isn't sufficient, because SLES 11 kernels are version 2.6.27 but do have
this field.

This commit adds a configure-time check for the presence of the member
instead of attempting to guess based on the kernel version.

Thanks to Ian Campbell for reporting this problem.

CC: <Ian.Campbell@citrix.com>
2009-11-18 15:19:50 -08:00
Ben Pfaff
d17ee8689b Merge citrix branch into master. 2009-11-18 14:14:29 -08:00
Jesse Gross
0cd8a05ec0 datapath: Allow minimum headroom to be set when copying buffers.
If we need to copy an sk_buff in order to make it writable, allow
the minimum headroom to be specified.  This ensures that if we
need to add additional data, such as a VLAN tag, we will not have
to make a second copy.

Solves bug #2197 in certain situations.
2009-11-18 13:51:55 -08:00
Jesse Gross
5ef800a690 datapath: Copy Xen's checksumming fields when doing skb_copy.
Two fields that control checksumming were added to sk_buff in
Xen: proto_data_valid and proto_csum_blank.  These fields are copied
when doing a skb_clone but not in other functions such as skb_copy,
which can lead to checksum errors in TCP and UDP when offloading is
enabled in the guest.  To fix this we manually copy these fields,
though ideally this should be fixed upstream in Xen.

Bug #2299
2009-11-18 13:40:36 -08:00
Ben Pfaff
7c9e113b71 datapath: Fix build with kernel header layout recently adopted by Debian.
Recent Debian kernel-header packages divide kernel headers into two
directories: the "common" headers that are not architecture-specific,
which go in a directory named like
    /usr/src/kernel-headers-2.6.31-1-common,
and architecture-specific headers in a directory named, e.g.
    /usr/src/kernel-headers-2.6.31-1-686.
OVS needs to look at the ones in the "common" directory as part of its
configuration process, but the build directory provided on --with-l26 is
the architecture-specific directory.  We also need the
architecture-specific directory, since it is the one that we use as part
of the "make", so we can't simply make the user specify the common
directory on --with-l26.  Furthermore, there is no easy-to-see link
between the two directories, except as part of the text in a Makefile,
which is not the easiest language to parse.

This commit attempts to kluge around the problem by using the Debian
directory naming.  If the build directory does not contain the headers,
then we replace the last component of its name by "-common" and check
for the headers there.  This is not ideal, but it does solve the actual
problem at hand.

Tested with Debian's linux-headers-2.6.31-1-686 and with a few older
sets of headers that do not use this scheme.
2009-11-18 13:03:46 -08:00
Ben Pfaff
d377243b85 Document userspace switch. 2009-11-18 12:57:18 -08:00
Ben Pfaff
b9edf64b05 ovsdb: Make ovsdb-server tests pass even when @RUNDIR@ is not writable. 2009-11-18 12:43:50 -08:00
Ben Pfaff
8fcf509ed6 ovsdb: Add more tests for "monitor" feature. 2009-11-18 12:43:30 -08:00
Ben Pfaff
23f37a975e ovsdb-server: Fix crash for invalid parameters to "monitor" request.
Thanks to Jeremy Stribling <strib@nicira.com> for reporting the problem.
2009-11-18 11:32:16 -08:00
Ben Pfaff
37c9895288 Update documentation to mention correct Autoconf version prerequisite. 2009-11-18 10:03:34 -08:00
Ben Pfaff
a8425c53c5 ovsdb: Monitor support. 2009-11-17 16:02:46 -08:00
Ben Pfaff
1fd13cde12 jsonrpc: Add logging for messages sent and received, at DBG level.
This made it much easier to see problems while developing some
ovsdb-server features.
2009-11-17 16:02:46 -08:00
Ben Pfaff
aa78de9dcb ovsdb-server: Add "exit" unixctl command and --unixctl option.
This makes writing predictable test scripts easier.
2009-11-17 16:02:38 -08:00
Justin Pettit
460d80629b datapath: Remove unused print_flow() function 2009-11-17 09:51:34 -08:00
Justin Pettit
de3f65ea52 datapath: Cleanup tab/space issues in datapath 2009-11-16 18:48:29 -08:00
Justin Pettit
5f21d20e65 vconn: Fix endian issue in unknown action type error message 2009-11-16 18:48:28 -08:00
Justin Pettit
e423eca6e9 ovs-ofctl: Add support for transport and network modification actions
Add support to ovs-ofctl for modifying the network source and destination
IP address with the "mod_nw_src" and "mod_nw_dst" actions, respectively.
And support modifying the TCP/UDP source and destination ports with the
"mod_tp_src" and "mod_tp_dst" actions, respectively.
2009-11-16 18:48:26 -08:00
Justin Pettit
2d70a31ace ofproto: Support missing set_nw_dst and set_tp_dst translations
The function that translates OpenFlow actions into datapath actions was
missing definitions for OFPAT_SET_NW_DST and OFPAT_SET_TP_DST.  This
meant those actions would not occur in the datapath.
2009-11-16 18:12:44 -08:00
Justin Pettit
985224ac0c datapath: Calculate proper checksum for set_tp_src/dst action
When the set_tp_src or set_tp_dst action is used, the calculation for
where the checksum is located was wrong.  This caused the checksum to
not be updated and packet corruption in the bad offset.
2009-11-16 18:11:40 -08:00
Justin Pettit
fb344b867b ovs-appctl: Fix shadow variable that could cause segfault
The variable "socket_name" contains the name of the unix domain socket
to be used for communicating with the OVS process.  If the target does
not begin with a "/", the socket name is determined based on a pidfile.
A shadow copy of "socket_name" was kept in the block that looks at the
pidfile, which would cause the function-level one to not be set.  This
removes that shadow copy.
2009-11-16 18:11:39 -08:00
Ben Pfaff
4d0101a032 ovsdb-parser: Fix logic in ovsdb_parser_member().
I don't know why this test was written as it was.  The new test makes more
sense, and may be more correct as well.
2009-11-16 16:56:07 -08:00
Ben Pfaff
22f156fd06 ovsdb-server: Ignore replies to echo requests.
Until this commit, ovsdb-server would send off echo requests when the
connection became idle, but then it would terminate the connection when
the reply arrived, because it didn't recognize that it was a reply to its
own request (!).
2009-11-16 16:56:07 -08:00
Ben Pfaff
21ff1aee1b ovsdb: Add tests for file storage and for ovsdb-server. 2009-11-16 15:20:01 -08:00
Ben Pfaff
6d65eee8b1 ovsdb-client: New command "transact". 2009-11-16 15:20:01 -08:00
Ben Pfaff
eb077b264f ovsdb-server: Maintain the database lock with --detach.
Before this commit, "ovsdb-server --detach" would detach after it opened
the database file, which meant that the child process did not hold the
file lock on the database file (because a forked child process does not
inherit its parents' locks).  This commit fixes the problem by making
ovsdb-server open the database only after it has detached.  This fix, in
turn, required that daemonize() not chdir to /, because this would break
databases whose names are given relative to the current directory, and so
this commit also changes ovsdb-server to do so later.
2009-11-16 15:20:01 -08:00
Ben Pfaff
b93d3b6cb2 ovsdb: Refactor JSON-RPC database server implementation.
This refactoring breaks up jsonrpc-server.c in a more modular fashion, in
preparation for adding code for table monitors.
2009-11-16 10:55:29 -08:00
Ben Pfaff
bd06962ad3 ovsdb: Add replication support and refactor files in terms of replication.
An upcoming commit will add support for replicating tables across JSON-RPC
connection.  As a prerequisite ovsdb itself must support basic replication.
This commit adds that support and then reimplements the ovsdb file storage
in terms of that replication.
2009-11-16 10:55:29 -08:00
Ben Pfaff
41709cccb8 ovsdb: Rename ovsdb_file to ovsdb_log.
This prepares for introducing a new, higher-level ovsdb_file that
encapsulates ovsdb storage in a file.
2009-11-16 10:55:27 -08:00
Ben Pfaff
6e79e2104c ovsdb: Fix use of non-array for JSON-RPC parameters.
JSON-RPC requires that "params" be an array, but we weren't observing this
properly in the ovsdb specifications or code.

Thanks to Jeremy Stribling for pointing out the problem.
2009-11-16 09:20:40 -08:00
Ben Pfaff
124f9671b7 ovsdb-parser: Fix indentation. 2009-11-16 09:19:36 -08:00
Justin Pettit
4836f9f2bf ofproto: Update time of super-rule to match sub-rule
Rules keep track of their creation and last used time.  When a sub-rule
is updated, it wasn't updating the time of its super-rule.  This commit
fixes that behavior.

Thanks to Jesse Gross for the help tracking this down.
2009-11-14 14:20:16 -08:00
Justin Pettit
436cf33bb7 ovs-openflowd: Setup default listener
By default, ovs-openflowd was not listening for any management
connections.  Tools such as ovs-ofctl attempt to use a default location
based on the datapath name.  This change creates that default listener.
2009-11-13 15:51:44 -08:00
Jesse Gross
8fe1a59d28 ofproto: Don't send OpenFlow flow expirations hidden rules.
We were reporting flow expirations for the hidden exact match flows
with the stats set to zero.  These are an implementation detail and
can confuse controllers, so don't report them.

CC: David Erickson <derickso@stanford.edu>
2009-11-13 12:44:03 -08:00
Jesse Gross
42c3641cc4 ofproto: Distinguish stats from before and after action changes.
When a rule is revalidated and the actions change don't lump all
the stats together.  This will clear the stats in the datapath
and send a NetFlow expiration message.  This could already happen
before in certain circumstances so this change makes it more
consistent.
2009-11-13 12:43:58 -08:00
Justin Pettit
e7e3f48570 ofproto: Correct structure length assertion for ofp_action_vlan_pcp 2009-11-13 11:15:35 -08:00
Ian Campbell
c4b1912e82 xenserver: interface-reconfigure and vif hotplug relicensing.
As part of the Open Sourcing of xapi (the XenServer toolstack) via the
XenCloud project (announcement in [0]). The upstream versions of
interface-reconfigure and the vif hotplug script have been re-licensed
under an LGPL v2.1 + exception license. The exception applies to other
files in the upstream repository and doesn't particularly make sense for
these scripts but it is included to maintain the uniformity of the
license for the upstream repository.

This patch synchronises the licenses headers on those scripts with the
upstream version. Since those headers refer to a file called LICENSE in
the upstream repository I have included a copy here, slightly modified
to indicate precisely which files it applies to.

Git shows[1] that only myself and Nicira employees have made
modifications to these scripts in the openvswitch repository. The
licensing change has been okayed by Keith Amidon on behalf of Nicira.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

[0]
http://lists.xensource.com/archives/html/xen-devel/2009-11/msg00117.html
2009-11-13 09:52:13 -08:00
Justin Pettit
b4785c1e43 ofp-print: Add missing error types 2009-11-12 15:46:35 -08:00
Jesse Gross
14986b312e ofproto: Correctly credit stats for displaced rules.
When a rule displaces another, we are supposed to credit the stats
for packets that have already been processed to the displaced rule
before we eject it from the datapath.  However, we were instead
crediting the new rule.
2009-11-12 14:31:39 -08:00
Ben Pfaff
1b0f0f17b3 ovsdb-client: Support listening for incoming connections too.
This makes it easier to test ovsdb-server's support for active connections.
It might also be useful occasionally, too.
2009-11-12 12:58:57 -08:00
Ben Pfaff
6c2882f90c ovsdb-server: Reconnect to clients specified on --connect. 2009-11-12 12:58:53 -08:00
Ben Pfaff
8d76bcca4d stream: New function pstream_accept_block(). 2009-11-12 12:57:26 -08:00
Ben Pfaff
3ed497fc10 New "reconnect" library for managing network connection attempts.
This library implements the reconnection FSM used by the "rconn" library.
Therefore, it makes sense to change rconn to use this, and I have a patch
to do that, but I am not applying it at the moment to avoid changing unrelated
code on the "db" branch.
2009-11-12 12:56:21 -08:00
Ben Pfaff
8ecd53084c svec: New function svec_is_empty(). 2009-11-12 12:56:21 -08:00
Ben Pfaff
031472d9e2 vswitch: Only one Open vSwitch daemon is supported per database. 2009-11-12 12:56:21 -08:00
Jesse Gross
f1bd68ab58 bridge: Fix segfault when updating learning table for deleted port.
A function call using in_port was accidentally moved before the check
to see if it is null.  in_port can be null if a port was deleted but
an update is still pending.  This moves the call after the check.

Bug #2313
2009-11-11 17:15:10 -08:00
Jesse Gross
42061b2a5b mirroring: Preserve key for disabling learning.
Don't delete the key for disabling MAC learning on a given VLAN
after a reboot.  Also logs when learning is disabled.
2009-11-11 16:00:05 -08:00
Jesse Gross
e96a4d8035 bridge: Feed flow stats into learning table.
Update the learning table to keep it current with flows actually
going through the datapath.  This ensures that entries do not age
out when they are actively being used.

Feature #2209
2009-11-11 15:58:21 -08:00
Jesse Gross
46d6f36f04 ofproto: Update stats for exact match flows before expiration.
When a wildcarded flow is expired we remove all of the subrules to
collect their stats before sending a flow expiration message.  However,
we were only removing exact match flows after the expiration message
is composed.  This uninstalls it first.

CC: David Erickson <derickso@stanford.edu>
2009-11-11 11:13:37 -08:00