Skip to content

Commit

Permalink
Merge "master" branch into "db".
Browse files Browse the repository at this point in the history
  • Loading branch information
blp committed Dec 2, 2009
2 parents c3bb4bd + 6c88d57 commit 58fda1d
Show file tree
Hide file tree
Showing 84 changed files with 2,683 additions and 978 deletions.
34 changes: 20 additions & 14 deletions INSTALL.Linux
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ you will need the following software:
connections from an Open vSwitch to an OpenFlow controller. To
enable, configure with --enable-ssl=yes.

To compile the kernel module (which is required for operation), you
must also install the following:
To compile the kernel module, you must also install the following. If
you cannot build or install the kernel module, you may use the
userspace-only implementation, at a cost in performance. The
userspace implementation may also lack some features. Refer to
INSTALL.userspace for more information.

- A supported Linux kernel version. Please refer to README for a
list of supported versions.
Expand Down Expand Up @@ -58,7 +61,7 @@ If you are working from a Git tree or snapshot (instead of from a
distribution tarball), or if you modify the Open vSwitch build system,
you will also need the following software:

- Autoconf version 2.60 or later.
- Autoconf version 2.63 or later.

- Automake version 1.10 or later.

Expand Down Expand Up @@ -92,7 +95,12 @@ Building and Installing Open vSwitch for Linux
Once you have installed all the prerequisites listed above in the Base
Prerequisites section, follow the procedure below to build.

1. In the top source directory, configure the package by running the
1. If you pulled the sources directly from an Open vSwitch Git tree,
run boot.sh in the top source directory:

% ./boot.sh

2. In the top source directory, configure the package by running the
configure script. You can usually invoke configure without any
arguments:

Expand Down Expand Up @@ -128,16 +136,16 @@ Prerequisites section, follow the procedure below to build.
additional environment variables. For a full list, invoke
configure with the --help option.

2. Run make in the top source directory:
3. Run make in the top source directory:

% make

3. Become root by running "su" or another program.
4. Become root by running "su" or another program.

4. Run "make install" to install the executables and manpages into the
5. Run "make install" to install the executables and manpages into the
running system, by default under /usr/local.

5. If you built kernel modules, you may load them with "insmod", e.g.:
6. If you built kernel modules, you may load them with "insmod", e.g.:

% insmod datapath/linux-2.6/openvswitch_mod.ko

Expand All @@ -156,14 +164,12 @@ respectively.

At runtime, you may make ovs-vswitchd reload its configuration file
and update its configuration accordingly by sending it a SIGHUP
signal. The ovs-appctl utility can also be used to do this with a
command such as:
signal. The ovs-appctl utility can also be used to do this:

% ovs-appctl -t <pid> -e vswitchd/reload
% ovs-appctl vswitchd/reload

where <pid> is ovs-vswitchd's process ID. In the latter case,
ovs-appctl will not exit until the reload and reconfiguration is
complete.
In the latter case, ovs-appctl will wait for ovs-vswitchd to finish
reloading before it exits.

Bug Reporting
-------------
Expand Down
7 changes: 5 additions & 2 deletions INSTALL.bridge
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ to update system scripts to follow these steps.

4. Start ovs-vswitchd and ovs-brcompatd, e.g.:

% ovs-vswitchd -P -D -vANY:console:EMER /etc/ovs-vswitchd.conf
% ovs-brcompatd -P -D -vANY:console:EMER /etc/ovs-vswitchd.conf
% ovs-vswitchd --pidfile --detach -vANY:console:EMER \
/etc/ovs-vswitchd.conf

% ovs-brcompatd --pidfile --detach -vANY:console:EMER \
/etc/ovs-vswitchd.conf

5. Now you should be able to manage the Open vSwitch using brctl and
related tools. For example, you can create an Open vSwitch bridge,
Expand Down
63 changes: 63 additions & 0 deletions INSTALL.userspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Using Open vSwitch without kernel support
=========================================

Open vSwitch can operate, at a cost in performance, entirely in
userspace, without assistance from a kernel module. This file
explains how to install Open vSwitch in such a mode.

The userspace-only mode of Open vSwitch is considered experimental.
It has not been thoroughly tested.

This version of Open vSwitch should be built manually with "configure"
and "make". Debian packaging for Open vSwitch is also included, but
it has not been recently tested, and so Debian packages are not a
recommended way to use this version of Open vSwitch.

Building and Installing
-----------------------

The requirements and procedure for building, installing, and
configuring Open vSwitch are the same as those given in INSTALL.Linux.
You may omit configuring, building, and installing the kernel module,
and the related requirements.

On Linux, the userspace switch additionally requires the kernel
TUN/TAP driver to be available, either built into the kernel or loaded
as a module. If you are not sure, check for a directory named
/sys/class/misc/tun. If it does not exist, then attempt to load the
module with "modprobe tun".

The tun device must also exist as /dev/net/tun. If it does not exist,
then create /dev/net (if necessary) with "mkdir /dev/net", then create
/dev/net/tun with "mknod /dev/net/tun c 10 200".

Using the Userspace Datapath with ovs-vswitchd
----------------------------------------------

To use ovs-vswitchd in userspace mode, give the bridge a name that
begins with "netdev:" in the configuration file. For example:

bridge.netdev:br0.port=eth0
bridge.netdev:br0.port=eth1
bridge.netdev:br0.port=eth2

ovs-vswitchd will create a TAP device as the bridge's local interface,
named the same as the bridge minus the "netdev:" prefix, as well as
for each configured internal interface.

Using the Userspace Datapath with ovs-openflowd
-----------------------------------------------

To use ovs-openflowd in userspace mode, specify a datapath name that
begins with "netdev:", and specify --ports with the names of the ports
that should be included in the datapath as argument. For example:

ovs-openflowd netdev:br0 --ports=eth0,eth1,eth2

ovs-openflowd will create a TAP device as the bridge's local
interface, named the same as the bridge minus the "netdev:" prefix.

Bug Reporting
-------------

Please report problems to [email protected].
2 changes: 2 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ AM_CPPFLAGS += -I $(top_srcdir)/include
AM_CPPFLAGS += -I $(top_srcdir)/lib

AM_CFLAGS = -Wstrict-prototypes
AM_CFLAGS += $(WARNING_FLAGS)

if NDEBUG
AM_CPPFLAGS += -DNDEBUG
Expand All @@ -29,6 +30,7 @@ CLEANFILES =
DISTCLEANFILES =
EXTRA_DIST = INSTALL.bridge \
INSTALL.Linux \
INSTALL.userspace \
INSTALL.OpenFlow \
INSTALL.SSL \
INSTALL.XenServer \
Expand Down
15 changes: 12 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@ vSwitch supports the following features:
* Support for OpenFlow
* Compatibility layer for the Linux bridging code

Open vSwitch supports Linux 2.6.15 and up, with testing focused on
2.6.18 with Centos and Xen patches and version 2.6.26 from kernel.org.
Open vSwitch also has special support for Citrix XenServer hosts.
The included Linux kernel module supports Linux 2.6.15 and up, with
testing focused on 2.6.18 with Centos and Xen patches and version
2.6.26 from kernel.org. Open vSwitch also has special support for
Citrix XenServer hosts.

Open vSwitch can also operate, at a cost in performance, entirely in
userspace, without assistance from a kernel module. This userspace
implementation should be easier to port than the kernel-based switch.
It is considered experimental.

What's here?
------------
Expand Down Expand Up @@ -85,6 +91,9 @@ read INSTALL.bridge.
To build RPMs for installing Open vSwitch on a Citrix XenServer host
or resource pool, read INSTALL.XenServer.

To install Open vSwitch without using a kernel module, read
INSTALL.userspace.

To learn set up SSL support for Open vSwitch, read INSTALL.SSL.

Each Open vSwitch userspace program is accompanied by a manpage. Many
Expand Down
85 changes: 57 additions & 28 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,62 @@
# See the License for the specific language governing permissions and
# limitations under the License.

dnl OVS_CHECK_LINUX(OPTION, VERSION, VARIABLE, CONDITIONAL)
dnl OVS_CHECK_LINUX26
dnl
dnl Configure linux kernel source tree
AC_DEFUN([OVS_CHECK_LINUX], [
AC_ARG_WITH([$1],
[AC_HELP_STRING([--with-$1=/path/to/linux-$2],
[Specify the linux $2 kernel sources])],
[path="$withval"], [path=])dnl
if test -n "$path"; then
path=`eval echo "$path"`
AC_DEFUN([OVS_CHECK_LINUX26], [
AC_ARG_WITH([l26],
[AC_HELP_STRING([--with-l26=/path/to/linux-2.6],
[Specify the linux 2.6 kernel sources])],
[KBUILD26="$withval"], [KBUILD26=])dnl
if test -n "$KBUILD26"; then
KBUILD26=`eval echo "$KBUILD26"`
AC_MSG_CHECKING([for $path directory])
if test -d "$path"; then
AC_MSG_RESULT([yes])
$3=$path
AC_SUBST($3)
# The build directory is what the user provided.
# Make sure that it exists.
AC_MSG_CHECKING([for Linux 2.6 build directory])
if test -d "$KBUILD26"; then
AC_MSG_RESULT([$KBUILD26])
AC_SUBST(KBUILD26)
else
AC_MSG_RESULT([no])
AC_ERROR([source dir $path doesn't exist])
AC_ERROR([source dir $KBUILD26 doesn't exist])
fi
AC_MSG_CHECKING([for $path kernel version])
patchlevel=`sed -n 's/^PATCHLEVEL = //p' "$path/Makefile"`
sublevel=`sed -n 's/^SUBLEVEL = //p' "$path/Makefile"`
# Debian breaks kernel headers into "source" header and "build" headers.
# We want the source headers, but $KBUILD26 gives us the "build" headers.
# Use heuristics to find the source headers.
AC_MSG_CHECKING([for Linux 2.6 source directory])
KSRC26=$KBUILD26
if test ! -e $KSRC26/include/linux/kernel.h; then
KSRC26=`(cd $KBUILD26 && pwd -P) | sed 's,-[[^-]]*$,-common,'`
if test ! -e $KSRC26/include/linux/kernel.h; then
AC_MSG_ERROR([cannot find source directory])
fi
fi
AC_MSG_RESULT([$KSRC26])
AC_MSG_CHECKING([for kernel version])
patchlevel=`sed -n 's/^PATCHLEVEL = //p' "$KSRC26/Makefile"`
sublevel=`sed -n 's/^SUBLEVEL = //p' "$KSRC26/Makefile"`
if test -z "$patchlevel" || test -z "$sublevel"; then
AC_ERROR([cannot determine kernel version])
fi
AC_MSG_RESULT([2.$patchlevel.$sublevel])
if test "2.$patchlevel" != '$2'; then
AC_ERROR([Linux kernel source in $path is not version $2])
if test "2.$patchlevel" != '2.6'; then
if test "$BUILD26" = "$KSRC26"; then
AC_ERROR([Linux kernel in $KBUILD26 is not version 2.6])
else
AC_ERROR([Linux kernel in build tree $KBUILD26 (source tree $KSRC26) is not version 2.6])
fi
fi
if ! test -e "$path"/include/linux/version.h || \
! test -e "$path"/include/linux/autoconf.h; then
AC_MSG_ERROR([Linux kernel source in $path is not configured])
if ! test -e "$KBUILD26"/include/linux/version.h || \
! test -e "$KBUILD26"/include/linux/autoconf.h; then
AC_MSG_ERROR([Linux kernel source in $KBUILD26 is not configured])
fi
m4_if($2, [2.6], [OVS_CHECK_LINUX26_COMPAT])
OVS_CHECK_LINUX26_COMPAT
fi
AM_CONDITIONAL($4, test -n "$path")
AM_CONDITIONAL(L26_ENABLED, test -n "$KBUILD26")
])

dnl OVS_GREP_IFELSE(FILE, REGEX, IF-MATCH, IF-NO-MATCH)
Expand Down Expand Up @@ -103,7 +124,7 @@ AC_DEFUN([OVS_CHECK_LOG2_H], [
dnl OVS_CHECK_LINUX26_COMPAT
dnl
dnl Runs various Autoconf checks on the Linux 2.6 kernel source in
dnl the directory in $KSRC26.
dnl the directory in $KBUILD26.
AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [
rm -f datapath/linux-2.6/kcompat.h.new
mkdir -p datapath/linux-2.6
Expand All @@ -123,6 +144,13 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [
[OVS_DEFINE([HAVE_CSUM_UNFOLD])])
OVS_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], [skb_cow],
[OVS_DEFINE([HAVE_SKB_COW])])
# Check for the proto_data_valid member in struct sk_buff. The [^@]
# is necessary because some versions of this header remove the
# member but retain the kerneldoc comment that describes it (which
# starts with @). The brackets must be doubled because of m4
# quoting rules.
OVS_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], [[[^@]]proto_data_valid],
[OVS_DEFINE([HAVE_PROTO_DATA_VALID])])
OVS_CHECK_LOG2_H
OVS_CHECK_VETH
if cmp -s datapath/linux-2.6/kcompat.h.new \
Expand Down Expand Up @@ -194,16 +222,17 @@ AC_DEFUN([OVS_CHECK_CC_OPTION],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,)], [ovs_cv_name[]=yes], [ovs_cv_name[]=no])
CFLAGS="$ovs_save_CFLAGS"])
if test $ovs_cv_name = yes; then
m4_if([$2], [], [;], [$2])
m4_if([$2], [], [:], [$2])
else
m4_if([$3], [], [:], [$3])
fi
])

dnl OVS_ENABLE_OPTION([OPTION])
dnl Check whether the given C compiler OPTION is accepted.
dnl If so, add it to CFLAGS.
dnl If so, add it to WARNING_FLAGS.
dnl Example: OVS_ENABLE_OPTION([-Wdeclaration-after-statement])
AC_DEFUN([OVS_ENABLE_OPTION],
[OVS_CHECK_CC_OPTION([$1], [CFLAGS="$CFLAGS $1"])])
[OVS_CHECK_CC_OPTION([$1], [WARNING_FLAGS="$WARNING_FLAGS $1"])
AC_SUBST([WARNING_FLAGS])])
dnl ----------------------------------------------------------------------
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ OVS_ENABLE_OPTION([-Wno-override-init])

AC_ARG_VAR(KARCH, [Kernel Architecture String])
AC_SUBST(KARCH)
OVS_CHECK_LINUX(l26, 2.6, KSRC26, L26_ENABLED)
OVS_CHECK_LINUX26

AC_CONFIG_FILES([Makefile
datapath/Makefile
Expand Down
Loading

0 comments on commit 58fda1d

Please sign in to comment.