ofp-print.c: Fix remaining port number prints.

Use ofputil_format_port() to print port numbers so that special ports
will be printed out as symbolic names (e.g., LOCAL) instead of numbers.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
bond: Fix comment on bond_entry::tag

The hash entry tag connects to facet(s), not slaves.

Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif: Maintain tun_id across action lists.

Previously, a tunnel ID received on input would be used by default
on output if the packet was later sent out a tunnel.  This was not
actually intentional behavior - tunnel information is not supposed
to carry over.  However, it is useful in the case where move actions
are used to load the original tunnel ID into registers for further
processing or additional lookups in resubmits since otherwise the
information is lost before handling actions.

When the initial components for flow based tunneling were introduced
this behavior for tunnel headers caused problems since it resulted
in packets being sent to the IP address they were originally received
on.  All of this behavior was "fixed" in commit
47d4a9db26329f9d93eb945c1fcc0e248cf2656a (ofproto-dpif: Initialize
tunnel metadata in both 'flow' and 'base_flow'.), breaking the use
cases the require tun_id during action processing.

For the time being, at least, this restores the original behavior
for tun_id, while keeping the new behavior for the rest of the
tunnel headers.  The latter are not exposed through OpenFlow and
therefore do not have similar complications.  If we do expose these
headers then we might have to revist this.

Thanks to Ben Pfaff for identifying the commit that introduced the
problem.

Bug #14625

Reported-by: Michael Hu <humichael@vmware.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
tunnels: Remove support for df_inherit from userspace.

This will be required to support flow based tunneling.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
netdev: Parse and make available tunnel configuration.

Future patches will need to know the details of a netdev's tunnel
configuration from outside the netdev library.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
datapath: support Linux 3.8 kernel

Add Linux 3.8 kernel to the range of supported kernel versions.

Signed-off-by: James Page <james.page@ubuntu.com>
[jesse: Update NEWS and FAQ]
Signed-off-by: Jesse Gross <jesse@nicira.com>
AUTHORS: Add James Page.

Signed-off-by: Jesse Gross <jesse@nicira.com>
python: Workaround UNIX socket path length limits

From aa28e8bfb646a54ba91e3545f3c0b9db39eddb7f Mon Sep 17 00:00:00 2001
From: James Page <james.page@ubuntu.com>
Date: Wed, 16 Jan 2013 10:52:59 +0000
Subject: [PATCH] python: Workaround UNIX socket path length limits
To: dev@openvswitch.org

UNIX socket paths have a limit in terms of length.  On Linux
this is 103 characters.

This is a problem in Debian/Ubuntu buildds which can generate
quite long paths.

This patch works around this issue by detecting when socket
connection/binding fails due to this issue and accessing the
socket path using a file descriptor path in /proc/self/fd.

The workaround is limited to Linux.

This is based on similar code in the C parts of OpenvSwitch.

Signed-off-by: James Page <james.page@ubuntu.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
netdev: Add NULL get_tunnel_config for BSD.

Commit f431bf7d78f3212d32bb3d122f783c5c796a1576 (netdev: Parse and make
available tunnel configuration.) added new method get_tunnel_config to
netdev_class but did not update netdev-bsd.

Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
bridge: Remove restriction on socket name.

Following patch removes restriction on the listening socket name that gets
configured as bridge controller. Currently, we only connect to sockets in a
specific directory with the name of the bridge. This patch removes the
restriction on the bridge name, keeping the directory restriction.

Bug #14029.
Signed-off-by: Pavithra Ramesh <paramesh@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ovs-vsctl: Add --if-exists option to many database commands.

A few ovs-vsctl commands have accepted --if-exists options for some time,
to make it possible to execute them in cases where it doesn't really
matter if the records they touch exist.  This commit adds this option to
other commands.

This is intended for initial use with "ovs-vsctl set interface <iface>
ofport_request=<number>" commands in ovs-ctl for upgrades from OVS 1.9
to later versions.

This makes a very small incompatible change to the ovs-vsctl "get"
command: previously with --if-exists, only keys in map columns were
allowed to be missing; now with --if-eixsts, also records are allowed
to be missing.

CC: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ovs-save: Add a helper command to maintain ofport value.

This patch adds a helper command: save-ofports. The command
will o/p a shell script that will set the 'ofport_request' column
of the interface table with the value of the corresponding ofport.

This command takes a list of bridges as input and will be used by
a future commit to restore the ofport value across force-reload-kmod.

This command is only useful while trying to upgrade from a pre-1.10
branch to 1.10 or a later branch.

Issue #13556
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
ovs-ctl.in: Restore ofport values across force-reload-kmod.

If we want to upgrade from pre-1.10 branch to 1.10 or later
and restore flows across force-reload-kmod, we need to maintain
the value of ofport.

To do this, we fetch the value of ofport before the upgrade and use
it to populate the column 'ofport_request' after ovsdb is upgraded.
We need to do this before vswitchd is restarted as vswitchd
needs the ofport_request column populated before it starts.

Issue #13556
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
util: Introduce ovs_assert macro.

An occasionally significant problem with the standard "assert" macro is
that it writes the failure message to stderr.  In our daemons, stderr is
generally redirected to /dev/null.  It's more useful to write the failure
message to the log, which is what the new ovs_assert macro introduced in
this patch does.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Replace most uses of assert by ovs_assert.

This is a straight search-and-replace, except that I also removed #include
<assert.h> from each file where there were no assert calls left.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Remove useless use of <assert.h>.

These files #included <assert.h> but didn't ever use assert.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Makefile.am: add check that <assert.h> is not used from unexpected files.

In general, with a few specific exceptions, ovs_assert is now preferred
over assert, so this commit adds a check for that in the top-level
Makefile.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
dpif-linux: Fix segfault when a port already exists.

Commit 78a2d59c (dpif-linux.c: Let the kernel pick a port number if one
not requested.) changed the logic for port assignment, but didn't
properly handle some error conditions.  An attempt to add a tunnel port
that already exists would lead to a segfault.  This commit fixes the
logic to stop processing and return an error.

Reported-by: Gurucharan Shetty <shettyg@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>