Skip to content

Commit

Permalink
netdev implementation for FreeBSD
Browse files Browse the repository at this point in the history
This patch adds new netdev classes that implement
"system" and "tap" devices on FreeBSD using the
libpcap library. This enables the use of the
"netdev" datapath_type of Open vSwitch on FreeBSD.

Signed-off-by: Gaetano Catalli <[email protected]>
Signed-off-by: Ed Maste <[email protected]>
Signed-off-by: Giuseppe Lettieri <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
giuseppelettieri authored and blp committed Jul 26, 2012
1 parent 22dd5ce commit f6eb6b2
Show file tree
Hide file tree
Showing 23 changed files with 1,770 additions and 34 deletions.
39 changes: 21 additions & 18 deletions INSTALL.Linux → INSTALL
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
How to Install Open vSwitch on Linux
====================================
How to Install Open vSwitch on Linux and FreeBSD
================================================

This document describes how to build and install Open vSwitch on a
generic Linux host. If you want to install Open vSwitch on a Citrix
XenServer, see INSTALL.XenServer instead.
generic Linux or FreeBSD host. If you want to install Open vSwitch on
a Citrix XenServer, see INSTALL.XenServer instead.

This version of Open vSwitch may be built manually with "configure"
and "make", as described below. You may also build Debian packages by
Expand All @@ -29,9 +29,9 @@ you will need the following software:
libssl is installed, then Open vSwitch will automatically build
with support for it.

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
To compile the kernel module on Linux, 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.

Expand Down Expand Up @@ -119,14 +119,14 @@ following software:
- libssl compatible with the libssl used for build, if OpenSSL was
used for the build.

- The Linux kernel version configured as part of the build.
- On Linux, the same kernel version configured as part of the build.

- For optional support of ingress policing, the "tc" program from
iproute2 (part of all major distributions and available at
- For optional support of ingress policing on Linux, the "tc" program
from iproute2 (part of all major distributions and available at
http://www.linux-foundation.org/en/Net:Iproute2).

You should ensure that /dev/urandom exists. To support TAP devices,
you must also ensure that /dev/net/tun exists.
On Linux you should ensure that /dev/urandom exists. To support TAP
devices, you must also ensure that /dev/net/tun exists.

To run the ovsdbmonitor tool, the machine must also have the following
software:
Expand All @@ -144,13 +144,13 @@ software:
(On Debian "lenny" the above can be installed with "apt-get install
python-json python-qt4 python-zopeinterface python-twisted-conch".)

Building and Installing Open vSwitch for Linux
==============================================
Building and Installing Open vSwitch for Linux or FreeBSD
=========================================================

Once you have installed all the prerequisites listed above in the Base
Prerequisites section, follow the procedure below to build.

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

% ./boot.sh
Expand Down Expand Up @@ -191,10 +191,13 @@ Prerequisites section, follow the procedure below to build.
additional environment variables. For a full list, invoke
configure with the --help option.

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

% make

On FreeBSD you may need to use GNU make (gmake) or NetBSD make
(bmake) instead of the native make.

For improved warnings if you installed "sparse" (see
"Prerequisites"), add C=1 to the "make" command line.

Expand Down Expand Up @@ -322,15 +325,15 @@ also upgrade the database schema:
- If there is no important data in your database, then you may
delete the database file and recreate it with ovsdb-tool,
following the instructions under "Building and Installing Open
vSwitch for Linux".
vSwitch for Linux or FreeBSD".

- If you want to preserve the contents of your database, back it
up first, then use "ovsdb-tool convert" to upgrade it, e.g.:

% ovsdb-tool convert /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema

4. Start the Open vSwitch daemons as described under "Building and
Installing Open vSwitch for Linux" above.
Installing Open vSwitch for Linux or FreeBSD" above.

Bug Reporting
-------------
Expand Down
6 changes: 3 additions & 3 deletions INSTALL.KVM
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

This document describes how to use Open vSwitch with the Kernel-based
Virtual Machine (KVM). This document assumes that you have read and
followed INSTALL.Linux to get Open vSwitch setup on your Linux system.
followed INSTALL to get Open vSwitch setup on your Linux system.

Setup
-----

First, follow the setup instructions in INSTALL.Linux to get a working
First, follow the setup instructions in INSTALL to get a working
Open vSwitch installation.

KVM uses tunctl to handle various bridging modes, which you can
Expand Down Expand Up @@ -43,7 +43,7 @@ switch='br0'
ovs-vsctl del-port ${switch} $1
--------------------------------------------------------------------

At the end of INSTALL.Linux, it describes basic usage of creating
At the end of INSTALL, it describes basic usage of creating
bridges and ports. If you haven't already, create a bridge named
br0 with the following command:

Expand Down
2 changes: 1 addition & 1 deletion INSTALL.Libvirt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
This document describes how to use Open vSwitch with Libvirt 0.9.11 or
later. The Open vSwitch support in Libvirt 0.9.11 eliminates the need to
use OVS Linux Bridge compatibility layer (brcompatd) and interface up/down
scripts. This document assumes that you followed INSTALL.Linux or installed
scripts. This document assumes that you followed INSTALL or installed
Open vSwitch from distribution packaging such as a .deb or .rpm. The Open
vSwitch support is included by default in Libvirt 0.9.11. Consult
www.libvirt.org for instructions on how to build the latest Libvirt, if your
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.RHEL
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

This document describes how to build and install Open vSwitch on a Red
Hat Enterprise Linux (RHEL) host. If you want to install Open vSwitch
on a generic Linux host, see INSTALL.Linux instead.
on a generic Linux host, see INSTALL instead.

We have tested these instructions with RHEL 5.6 and RHEL 6.0.

Expand Down
4 changes: 2 additions & 2 deletions INSTALL.SSL
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ with OpenSSL. SSL support ensures integrity and confidentiality of
the OpenFlow connections, increasing network security.

This file explains how to configure an Open vSwitch to connect to an
OpenFlow controller over SSL. Refer to INSTALL.Linux for instructions
on building Open vSwitch with SSL support.
OpenFlow controller over SSL. Refer to INSTALL for instructions on
building Open vSwitch with SSL support.

Open vSwitch uses TLS version 1.0 or later (TLSv1), as specified by
RFC 2246, which is very similar to SSL version 3.0. TLSv1 was
Expand Down
6 changes: 3 additions & 3 deletions INSTALL.XenServer
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

This document describes how to build and install Open vSwitch on a
Citrix XenServer host. If you want to install Open vSwitch on a
generic Linux host, see INSTALL.Linux instead.
generic Linux or BSD host, see INSTALL instead.

These instructions have been tested with XenServer 5.6 FP1.

Expand All @@ -19,8 +19,8 @@ RPMs for Citrix XenServer is the DDK VM available from Citrix.
./configure; make dist" in the Git tree. You cannot run this in
the DDK VM, because it lacks tools that are necessary to bootstrap
the Open vSwitch distribution. Instead, you must run this on a
machine that has the tools listed in INSTALL.Linux as prerequisites
for building from a Git tree.
machine that has the tools listed in INSTALL as prerequisites for
building from a Git tree.

2. Copy the distribution tarball into /usr/src/redhat/SOURCES inside
the DDK VM.
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.bridge
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ that the Open vSwitch kernel modules are loaded before the Linux
kernel bridge module.

1. Build, install, and start up the Open vSwitch kernel modules and
userspace programs as described in INSTALL.Linux.
userspace programs as described in INSTALL.

It is important to run "make install", because some Open vSwitch
programs expect to find files in locations selected at installation
Expand Down
6 changes: 5 additions & 1 deletion INSTALL.userspace
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Building and Installing
-----------------------

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

Expand All @@ -31,6 +31,10 @@ 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".

On FreeBSD, the userspace switch additionally requires the kernel
tap(4) driver to be available, either built into the kernel or loaded
as a module.

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

Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ EXTRA_DIST = \
CodingStyle \
DESIGN \
FAQ \
INSTALL \
INSTALL.KVM \
INSTALL.Libvirt \
INSTALL.Linux \
INSTALL.RHEL \
INSTALL.SSL \
INSTALL.XenServer \
Expand Down
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
post-v1.8.0
------------------------
- FreeBSD is now a supported platform, thanks to code contributions from
Gaetano Catalli, Ed Maste, and Giuseppe Lettieri.
- ovs-bugtool: New --ovs option to report only OVS related information.
- New %t and %T log escapes to identify the subprogram within a
cooperating group of processes or threads that emitted a log message.
Expand Down
3 changes: 3 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ available at http://www.apache.org/licenses/LICENSE-2.0.html
Open vSwitch
Copyright (c) 2007, 2008, 2009, 2010, 2011 Nicira, Inc.

Open vSwitch BSD port
Copyright (c) 2011 Gaetano Catalli

Apache Portable Runtime
Copyright 2008 The Apache Software Foundation.

Expand Down
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Open vSwitch also provides some tools:
What other documentation is available?
--------------------------------------

To install Open vSwitch on a regular Linux machine, read INSTALL.Linux.
To install Open vSwitch on a regular Linux machine, read INSTALL.

For answers to common questions, read FAQ.

Expand All @@ -101,7 +101,7 @@ or resource pool, read INSTALL.XenServer.
To build RPMs for installing Open vSwitch on a Red Hat Enterprise
Linux host, read INSTALL.RHEL.

To use Open vSwitch with KVM on Linux, read INSTALL.Linux, then
To use Open vSwitch with KVM on Linux, read INSTALL, then
INSTALL.KVM.

To use Open vSwitch with Libvirt, read INSTALL.Libvirt.
Expand Down
2 changes: 1 addition & 1 deletion acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ AC_DEFUN([OVS_CHECK_IF_PACKET],
[Define to 1 if net/if_packet.h is available.])
fi])

dnl Checks for net/if_dl.h
dnl Checks for net/if_dl.h.
AC_DEFUN([OVS_CHECK_IF_DL],
[AC_CHECK_HEADER([net/if_dl.h],
[HAVE_IF_DL=yes],
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ AC_SYS_LARGEFILE
AC_SEARCH_LIBS([pow], [m])
AC_SEARCH_LIBS([clock_gettime], [rt])
AC_SEARCH_LIBS([timer_create], [rt])
AC_SEARCH_LIBS([pcap_open_live], [pcap])

OVS_CHECK_COVERAGE
OVS_CHECK_NDEBUG
Expand Down
1 change: 1 addition & 0 deletions debian/copyright.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Upstream Copyright Holders:
Copyright (c) 2010 Jean Tourrilhes - HP-Labs.
Copyright (c) 2008,2009,2010 Citrix Systems, Inc.
and authors listed above.
Copyright (c) 2011 Gaetano Catalli

License:

Expand Down
3 changes: 3 additions & 0 deletions lib/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ endif

if HAVE_IF_DL
lib_libopenvswitch_a_SOURCES += \
lib/netdev-bsd.c \
lib/rtbsd.c \
lib/rtbsd.h \
lib/route-table-bsd.c
endif

Expand Down
Loading

0 comments on commit f6eb6b2

Please sign in to comment.