cascardo/ovs.git
11 years agoodp-utils: Print human readable ipv4-tunnel-key flags.
Pravin B Shelar [Thu, 15 Nov 2012 05:10:54 +0000 (21:10 -0800)]
odp-utils: Print human readable ipv4-tunnel-key flags.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
11 years agoodp-utils: Refactor slow_path_reason parse and format functions.
Pravin B Shelar [Thu, 15 Nov 2012 05:10:22 +0000 (21:10 -0800)]
odp-utils: Refactor slow_path_reason parse and format functions.

These functions are used in next patch.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
11 years agovswitchd: Fix function prototype of packet_set_ipv6()
Pravin B Shelar [Wed, 14 Nov 2012 01:20:22 +0000 (17:20 -0800)]
vswitchd: Fix function prototype of packet_set_ipv6()

Follwoing patch fixes sparse error:
lib/packets.c:643:1: error: symbol 'packet_set_ipv6' redeclared
with different type (originally declared at lib/packets.h:493)
- incompatible argument 6 (different base types)

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
11 years agodatapath: add ipv6 'set' action
Ansis Atteka [Mon, 5 Nov 2012 13:53:32 +0000 (15:53 +0200)]
datapath: add ipv6 'set' action

This patch adds ipv6 set action functionality. It allows to change
traffic class, flow label, hop-limit, ipv6 source and destination
address fields.

Acked-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
11 years agosparse: Add ip6_rthdr struct to the ip6.h
Ansis Atteka [Wed, 7 Nov 2012 17:14:34 +0000 (19:14 +0200)]
sparse: Add ip6_rthdr struct to the ip6.h

Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
11 years agoofp-msgs: Accept all versions of OpenFlow "hello" messages.
Ben Pfaff [Fri, 9 Nov 2012 21:38:19 +0000 (13:38 -0800)]
ofp-msgs: Accept all versions of OpenFlow "hello" messages.

Since the ofp-msgs code was introduced, only "hello" messages for versions
of OpenFlow actually understood (to some extent) by Open vSwitch could be
decoded correctly.  This commit corrects that, by making every version of
OpenFlow immutable messages acceptable.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agotunnel: Zero keys if marked as not present.
Jesse Gross [Wed, 7 Nov 2012 01:55:43 +0000 (17:55 -0800)]
tunnel: Zero keys if marked as not present.

If a key used to find a port then we mark it as being not present
(previously this was accomplished by setting it to zero).  However,
we also still pass the key to userspace which could lead to an
inconsistent state.  This also zeros out the key as before in order
to make our reported results consistent.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agodatapath: Allow GRE64 to use flow based tunneling.
Jesse Gross [Tue, 6 Nov 2012 21:22:28 +0000 (13:22 -0800)]
datapath: Allow GRE64 to use flow based tunneling.

There's no reason why GRE64 can't be configured using flow based
tunneling.  Since that's the direction we are moving, everything
should support that.  Once this special casing is removed, it's
possible to unify the tunnel parameter parsing code since both
GRE and CAPWAP are the same.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agodatapath: Shorten flow tunneling flags.
Jesse Gross [Tue, 6 Nov 2012 20:45:19 +0000 (12:45 -0800)]
datapath: Shorten flow tunneling flags.

The names for the flags used by flow based tunneling are pretty long.
This shortens them a little by removing the word FLOW, which is a
distinction that won't be meaningful in the near future.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agodatapath: Don't allow flows installed with only TUN_ID.
Jesse Gross [Mon, 5 Nov 2012 23:47:41 +0000 (15:47 -0800)]
datapath: Don't allow flows installed with only TUN_ID.

Tunnel ports now always include full outer IP information, even if
userspace can't understand it.  Since our flows our exact match this
information must also be provided when setting up flows.  Since flows
with only OVS_KEY_ATTR_TUN_ID keys don't contain all of this information
they can never be hit and we should just reject them at setup time.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agodatapath: Don't write into IPV4_TUNNEL data when using TUN_ID.
Jesse Gross [Mon, 5 Nov 2012 19:30:35 +0000 (11:30 -0800)]
datapath: Don't write into IPV4_TUNNEL data when using TUN_ID.

When the IPV4_TUNNEL action is executed, a pointer in the skb is
directly assigned the address of the action, which is protected by
RCU.  If a TUN_ID action is later executed it will write into the
action, which is not allowed by RCU.  This avoids the problem by
making a copy of the data and writing into the copy.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agodatapath: Include OVS_KEY_ATTR_IPV4_TUNNEL in upstream range.
Jesse Gross [Mon, 5 Nov 2012 19:08:47 +0000 (11:08 -0800)]
datapath: Include OVS_KEY_ATTR_IPV4_TUNNEL in upstream range.

During development it was preferable to keep OVS_KEY_ATTR_IPV4_TUNNEL
in the non-upstream range of identifiers to avoid conflicts or
compatibility issues as it evolved.  However, since the intention is
to get it upstream, it makes sense to move it down now to avoid issues
with compatibility when upgrading.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agosocket-util: Report fd of -1 on error in inet_open_active().
Ben Pfaff [Wed, 7 Nov 2012 20:55:53 +0000 (12:55 -0800)]
socket-util: Report fd of -1 on error in inet_open_active().

inet_open_active() is documented to report a fd of -1 when an error occurs.
All three of its callers rely on this, by checking only the fd to determine
whether there was an error.  This means that if the call to
set_nonblocking() or set_dscp() or connect() failed, then the callers would
try to use a fd that had already been closed, wreaking havoc.

This fixes a bug introduced in commit a4efa3fc5d (socket-util: Close socket
on failed dscp modification.)

Bug #13750.
Reported-by: Scott Hendricks <shendricks@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agonetdev-vport: Fix warning due to new GRE type.
Ethan Jackson [Tue, 6 Nov 2012 02:26:52 +0000 (18:26 -0800)]
netdev-vport: Fix warning due to new GRE type.

This patch fixes the following warning caused by a switch case
which was not handled.

lib/netdev-vport.c:144:5: error: enumeration value
‘OVS_VPORT_TYPE_FT_GRE’ not handled in switch

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agodatapath: Add missing bug.h file
Pravin B Shelar [Mon, 5 Nov 2012 23:12:59 +0000 (15:12 -0800)]
datapath: Add missing bug.h file

Commit 51f4701be1 (datapath: Fix sparse warning for symbol
'BUILD_BUG_ON_NOT_POWER_OF_2') missed file bug.h. Commiting it now.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
11 years agodatapath: improve ipv6_find_hdr() function for IPv6 'set' action
Ansis Atteka [Tue, 6 Nov 2012 15:12:38 +0000 (17:12 +0200)]
datapath: improve ipv6_find_hdr() function for IPv6 'set' action

This patch prepares ipv6_find_hdr() function so that it could be
able to skip routing headers, where segements_left is 0. This is
required for us to handle multiple routing header case correctly.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
11 years agodatapath: Add ipv6_find_hdr() compatibility function.
Ansis Atteka [Tue, 6 Nov 2012 11:39:58 +0000 (13:39 +0200)]
datapath: Add ipv6_find_hdr() compatibility function.

Implementation of the IPv6 'set' action depends on ipv6_find_exthdr()
function to find routing header. By looking at the routing headers,
it is possible to tell, whether L4 checksums will need to be
recalculated, whenever the destination address is changed in
the main IPv6 header.

This function will need to be customized so that it would skip all
routing headers, where segements_left is equal to 0.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
11 years agodatapath: Remove flow refcount functionality.
Jesse Gross [Tue, 30 Oct 2012 23:34:50 +0000 (16:34 -0700)]
datapath: Remove flow refcount functionality.

Header caching previously required the ability to maintain the lifetime
of flows across RCU boundaries.  However, now that header caching is
gone we can simplfy the code and make it match the upstream version.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
11 years agodatapath: Add support for 3.6 kernel.
Pravin B Shelar [Mon, 5 Nov 2012 22:13:20 +0000 (14:13 -0800)]
datapath: Add support for 3.6 kernel.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: Remove tunnel header caching.
Pravin B Shelar [Mon, 5 Nov 2012 22:13:02 +0000 (14:13 -0800)]
datapath: Remove tunnel header caching.

Tunnel caching was added to reduce CPU utilization on TX path
by caching packet header, So performance gain is directly proportional
to number of skbs transferred.  But with help of offloads skb are getting
larger. So there are less number of skbs.  Therefore header caching does
not shows similar gains we seen in past.  And now kernel 3.6 has removed
dst caching from networking which makes header caching even more tricky.
So this commit removes header caching from OVS tunnelling.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: Fix sparse warning for symbol 'BUILD_BUG_ON_NOT_POWER_OF_2'
Pravin B Shelar [Mon, 5 Nov 2012 21:41:02 +0000 (13:41 -0800)]
datapath: Fix sparse warning for symbol 'BUILD_BUG_ON_NOT_POWER_OF_2'

BUILD_BUG_ON_NOT_POWER_OF_2 symbol is moved from kernel.h to
bug.h in 3.4.  Therefore sparse is giving warning:

include/linux/bug.h:15:9: warning: preprocessor token
BUILD_BUG_ON_NOT_POWER_OF_2 redefined
ovs/datapath/linux/compat/include/linux/kernel.h:44:9:
this was the original definition

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agonetdev: Deprecate CAPWAP support.
Pravin B Shelar [Mon, 5 Nov 2012 21:40:17 +0000 (13:40 -0800)]
netdev: Deprecate CAPWAP support.

The CAPWAP implementation is just the encapsulation format and
therefore really not the full protocol.  While there were some
uses of it (primarily hardware support and UDP transport).  But
these are most likely better provided by VXLAN.  As a result,
CAPWAP will be removed no earlier than February 2013.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
11 years agodatapath: enable encap for capwap.
Pravin B Shelar [Mon, 5 Nov 2012 21:39:00 +0000 (13:39 -0800)]
datapath: enable encap for capwap.

kernel 3.5 added a switch to turn on UDP encap, capwap needs
to enable it.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: Add Upstream id for GRE type.
Pravin B Shelar [Mon, 5 Nov 2012 21:38:34 +0000 (13:38 -0800)]
datapath: Add Upstream id for GRE type.

Once GRE is upstream it will have new type to have continuous sequence
of ids for vport type.  Following patch adds this ID to have
compatibility with it.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agoProcess RARP packets with ethertype 0x8035 similar to ARP packets.
Mehak Mahajan [Mon, 5 Nov 2012 21:28:25 +0000 (13:28 -0800)]
Process RARP packets with ethertype 0x8035 similar to ARP packets.

With this commit, OVS will match the data in the RARP packets having
ethertype 0x8035, in the same way as the data in the ARP packets.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
11 years agoodp: Enable parsing ipv4_tunnel key.
Jesse Gross [Thu, 1 Nov 2012 22:50:16 +0000 (15:50 -0700)]
odp: Enable parsing ipv4_tunnel key.

We can format ipv4_tunnel keys from the kernel but can't currently
parse them.  Userspace doesn't know how to do anything with this
information but this support enables utilities like ovs-dpctl and
ovs-appctl ofproto/trace to show useful information.

Bug #13785

Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoMakefile: Allow "make modules_install" to work from top-level directory.
Ben Pfaff [Thu, 1 Nov 2012 20:54:20 +0000 (13:54 -0700)]
Makefile: Allow "make modules_install" to work from top-level directory.

INSTALL recommends running "make modules_install" but it didn't mention
that this has to be done from datapath/linux.  This commit makes this work
from the top-level build directory.

(Another solution would be to update INSTALL, but this approach seems a
little easier for the user.)

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agonetdev-vport: Warn users that pmtud is deprecated
Ansis Atteka [Mon, 29 Oct 2012 16:12:03 +0000 (18:12 +0200)]
netdev-vport: Warn users that pmtud is deprecated

This is a complementary patch to the other one I sent out previously.
The purpose of it is to make it more obvious that tunnel pmtud is
deprecated and will be removed soon.

Requested-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
11 years agonetdev-vport: Disable Path MTU Discovery by default
Ansis Atteka [Mon, 22 Oct 2012 07:04:28 +0000 (10:04 +0300)]
netdev-vport: Disable Path MTU Discovery by default

In near future we will switch to the flow-based tunneling and drop path
MTU discovery support. This patch prepares for that by changing the default
PMTUD value from 'enabled' to 'disabled'.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
11 years agoPrepare for 1.9.0.
Ben Pfaff [Wed, 24 Oct 2012 23:11:38 +0000 (16:11 -0700)]
Prepare for 1.9.0.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Fix zero key tunnels.
Pravin B Shelar [Wed, 24 Oct 2012 22:47:59 +0000 (15:47 -0700)]
datapath: Fix zero key tunnels.

Datapath tunneling check for flag OVS_FLOW_TNL_F_KEY is failing,
causing it to drop packet. This only happens on tunnels with
zero key as vswitchd does not generate set-tunnel action. Set
tunnel action sets this flags for given action. To fix this issue
the check is dropped.

Bug #13666

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agoAllow processing of RARP packets.
Mehak Mahajan [Wed, 24 Oct 2012 02:00:02 +0000 (19:00 -0700)]
Allow processing of RARP packets.

With this commit, the datapath will process the ARP header for
RARP packets.  It also fixes a bug whereby if the ARP opcode is
something other than ARP request or reply, the key_len is not
adjusted to include ARP info.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agoovs-ctl.in: Ability to save flows and kernel datapath config.
Gurucharan Shetty [Thu, 18 Oct 2012 22:44:37 +0000 (15:44 -0700)]
ovs-ctl.in: Ability to save flows and kernel datapath config.

Add a new command - "restart" to ovs-ctl. Calling this command
will save and restore the Openflow flows on each bridge while
stopping and starting the userspace daemons respectively.

Also, during a force-reload-kmod, save the flows and kernel datapath
configuration. Use the saved datapath configuration while readding
the kernel module and the flows while starting the userspace daemons.

Feature #13555.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoUpdate INSTALL.Fedora to mention Fedora 17 instead of Fedora 15
Kyle Mestery [Mon, 22 Oct 2012 20:12:43 +0000 (16:12 -0400)]
Update INSTALL.Fedora to mention Fedora 17 instead of Fedora 15

Reflect the fact Fedora RPM support was recently implemented
on Fedora 17 instead of Fedora 15.

Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agolib: Accomodate FreeBSD return value for ssl connection.
Ed Maste [Tue, 23 Oct 2012 13:50:10 +0000 (13:50 +0000)]
lib: Accomodate FreeBSD return value for ssl connection.

On FreeBSD I see ECONNRESET being returned from check_connection_completion
in ssl_connect.  This happens before entering the SSL states, which return
EPROTO on failure.

Signed-off-by: Ed Maste <emaste@adaranet.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoARP packets must have print arp_tpa/arp_spa instead of nw_dst/nw_src.
Mehak Mahajan [Mon, 22 Oct 2012 21:03:54 +0000 (14:03 -0700)]
ARP packets must have print arp_tpa/arp_spa instead of nw_dst/nw_src.

With a previous commit 953cc1888321346e6c4175fbc0a3f66d34913ea3, the
ovs logs were re-formatted such that they can be input into the
ofproto/trace.  For ARP packets, ofproto/trace expects arp_tpa/arp_spa
instead of nw_dst/nw_src.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoDo not print ICMP fields for non IP packets.
Mehak Mahajan [Mon, 22 Oct 2012 21:01:40 +0000 (14:01 -0700)]
Do not print ICMP fields for non IP packets.

The packet's nw_proto field overlaps with the ARP opcode field.  The
nw_proto for ICMP packets is 1.  Hence when the packet is an ARP
request (opcode 1), we erroneously print the ICMP code and ICMP type
for ARP frames as well.  With this commit, the ICMP code and ICMP
type will be printed only if the packet is an IP packet and the
nw_proto is ICMP.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoChange logging format for flows to that accepted by ofproto/trace.
Mehak Mahajan [Mon, 22 Oct 2012 21:00:35 +0000 (14:00 -0700)]
Change logging format for flows to that accepted by ofproto/trace.

flow_format() logs packets contents.  However, the format used is not
the format accepted by ofproto/trace.  Hence it becomes difficult to
trace the packets using the debugs printed.  With this commit, the
logging of the packet contents is done in a format that is accepted
by ofproto/trace.  This will make debugging easier.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoovs-pki: Unique subject DNs for certificate requests.
Gurucharan Shetty [Mon, 22 Oct 2012 17:52:41 +0000 (10:52 -0700)]
ovs-pki: Unique subject DNs for certificate requests.

Some applications expect subject DNs to be unique.

Bug #13609.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agotimeval: Simplify poll interval logging.
Ethan Jackson [Fri, 19 Oct 2012 01:56:48 +0000 (18:56 -0700)]
timeval: Simplify poll interval logging.

log_poll_interval() is a little bit too aggressive, and is
therefore less useful than it could be.  This patch removes the
mean interval calculation, and simply logs if the poll loop took
longer than 1 second instead.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoovs-vsctl: Do not accept any arguments to "del-manager" command.
Ben Pfaff [Mon, 15 Oct 2012 23:47:49 +0000 (16:47 -0700)]
ovs-vsctl: Do not accept any arguments to "del-manager" command.

It doesn't use them and never has.

Found when I accidentally typed this command with some arguments and it
worked, surprising me.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Tunnel port without destination IP.
Pravin B Shelar [Sat, 20 Oct 2012 19:18:05 +0000 (12:18 -0700)]
datapath: Tunnel port without destination IP.

Following patch allow port create without any parameters. This is
required for compatibility with future flow based tunneling
where each type would have single vport with all parameter
wild carded. So that all packet for all ports are received on
the port and same port is used for sending all traffic for
that tunnel type.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Optimize flow key match for non tunnel flows.
Pravin B Shelar [Sat, 20 Oct 2012 19:17:15 +0000 (12:17 -0700)]
datapath: Optimize flow key match for non tunnel flows.

Following patch adds start offset for sw_flow-key, so that we can
skip tunneling information in key for non-tunnel flows.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Add support for tun_key to Open vSwitch datapath
Kyle Mestery [Sat, 20 Oct 2012 19:15:24 +0000 (12:15 -0700)]
datapath: Add support for tun_key to Open vSwitch datapath

This is a first pass at providing a tun_key which can be
used as the basis for flow-based tunnelling. The
tun_key includes and replaces the tun_id in both struct
ovs_skb_cb and struct sw_tun_key.

This patch allows all existing tun_id behaviour to still work. Existing
users of tun_id are redirected to tun_key->tun_id to retain compatibility.
However, when the userspace code is updated to make use of the new
tun_key, the old behaviour will be deprecated and removed.

NOTE: With these changes, the tunneling code no longer assumes input and
output keys are symmetric.  If they are not, PMTUD needs to be disabled
for tunneling to work.

Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Reviewed-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agoovs-ctl: Fix implementation of --extra-dbs.
Henry Mai [Fri, 19 Oct 2012 17:22:42 +0000 (10:22 -0700)]
ovs-ctl: Fix implementation of --extra-dbs.

Commit b4e8d1705 (ovsdb-server: Add support for multiple databases.)
added the --extra-dbs option to ovs-ctl but failed to add a specific
database name to the SSL options passed to ovsdb-server.  This meant
that ovsdb-server would fail to start if --extra-dbs were actually
used, because it didn't know which database to look in for the SSL
settings.

Signed-off-by: Henry Mai <hmai@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-actions: Implement writing to metadata field
Joe Stringer [Thu, 18 Oct 2012 17:37:37 +0000 (02:37 +0900)]
ofp-actions: Implement writing to metadata field

In OpenFlow 1.1, we add support for OFPIT_WRITE_METADATA. This allows us to
write to the metadata field. Internally it is represented using ofpact_metadata.

We introduce NXAST_WRITE_METADATA to handle writing to the metadata field in
OpenFlow 1.0+. This structure reflects OFPIT_WRITE_METADATA.

When writing out the structure to OpenFlow 1.1, it uses the OFPIT_WRITE_METADATA
instruction only, and not the new NXAST action (which would be redundant).

Signed-off-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-actions: Prefer OFPAT11_DEC_TTL to NXAST_DEC_TTL for OpenFlow 1.1+.
Ben Pfaff [Thu, 18 Oct 2012 18:12:38 +0000 (11:12 -0700)]
ofp-actions: Prefer OFPAT11_DEC_TTL to NXAST_DEC_TTL for OpenFlow 1.1+.

When "dec_ttl" is specified as the name of an action, in OpenFlow 1.1 and
later we should prefer to use the standardized action, rather than the
Nicira extension.

Reported-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Isaku Yamahata <yamahata@valinux.co.jp>
11 years agoofp-parse: Remove unreachable code.
Ben Pfaff [Thu, 18 Oct 2012 18:10:55 +0000 (11:10 -0700)]
ofp-parse: Remove unreachable code.

OFPUTIL_OFPAT11_DEC_NW_TTL does not have a name in the table of actions'
names, so this code in parse_named_action() can never be reached.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Isaku Yamahata <yamahata@valinux.co.jp>
11 years agonicira-ext: Clarify behavior of overlapping src and dst for NXAST_REG_MOVE.
Ben Pfaff [Tue, 16 Oct 2012 18:01:27 +0000 (11:01 -0700)]
nicira-ext: Clarify behavior of overlapping src and dst for NXAST_REG_MOVE.

Reported-by: Pankaj Thakkar <thakkar@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofpaction: support OF11 pop_vlan
Isaku Yamahata [Wed, 17 Oct 2012 18:51:58 +0000 (03:51 +0900)]
ofpaction: support OF11 pop_vlan

This patch adds support of OF11+ pop_vlan.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
[blp@nicira.com added a test]
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-util: Again allow OpenFlow port 0 in commands and actions.
Ben Pfaff [Wed, 17 Oct 2012 20:29:34 +0000 (13:29 -0700)]
ofp-util: Again allow OpenFlow port 0 in commands and actions.

Commit c6100d92142b (ovs-ofctl: Accept port keywords, OF1.1 port numbers,
reject port number 0.) intentionally prohibited using port 0, which is not
a valid OpenFlow port number, in OpenFlow commands and actions.  However,
since then we have discovered that the NVP controller uses port 0 in
"resubmit" actions and hence in flow matches as well.  This seems like a
valid enough use case; after all, the port number in a resubmit action is
really just an arbitrary number that need not (and preferably does not)
refer to an actual OpenFlow port.  Therefore, this commit restores the
ability to use port 0.

(Only functions that parse OpenFlow commands and actions from strings, not
those that interpret binary OpenFlow coming in on OpenFlow connections,
were affected by this prohibition, so this only comes up in corner cases
anyhow.)

Reported-by: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-util: Separate output, error reporting in ofputil_port_from_string().
Ben Pfaff [Wed, 17 Oct 2012 20:10:08 +0000 (13:10 -0700)]
ofp-util: Separate output, error reporting in ofputil_port_from_string().

When I wrote this function I didn't think that port 0 was important (it's
not a valid OpenFlow port number) so I used a return value of 0 to indicate
an error.  However, my assumption turns out to be wrong, so this commit
changes the interface to use the return value only for error reporting
and store the parsed port number into a pointer passed in as a parameter.

This commit doesn't change the behavior of ofputil_port_from_string().

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agolib: support OF11 dec_nw_ttl
Isaku Yamahata [Wed, 17 Oct 2012 22:02:04 +0000 (07:02 +0900)]
lib: support OF11 dec_nw_ttl

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
[blp@nicira.com changed code to use "dec_ttl" instead of "dec_nw_ttl"]
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoutilities: New helper ovs-parse-backtrace.
Ethan Jackson [Mon, 15 Oct 2012 19:42:48 +0000 (12:42 -0700)]
utilities: New helper ovs-parse-backtrace.

The new ovs-parse-backtrace utility makes the output of ovs-appctl
backtrace more human readable by removing duplicate traces and
converting addresses to function names.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agotimeval: Optionally enable cached timing at configure time.
Ethan Jackson [Wed, 17 Oct 2012 01:16:16 +0000 (18:16 -0700)]
timeval: Optionally enable cached timing at configure time.

Often when developing, it would be convenient to force OVS to
either enable or disable cached timing so that a feature can be
tested under both strategies.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agom4: Remove trailing whitespace.
Ethan Jackson [Wed, 17 Oct 2012 01:16:37 +0000 (18:16 -0700)]
m4: Remove trailing whitespace.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agostream.py: un-decorator Stream.register_method
Isaku Yamahata [Wed, 17 Oct 2012 18:18:16 +0000 (03:18 +0900)]
stream.py: un-decorator Stream.register_method

c38f8724aeb994fd840fa4283a07e38c3c114d68 made stream.py not use class
decorator. So Stream.register need not to be decorator any more.
So simplify it.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agostream.py: Don't use class decorators.
Reid Price [Wed, 17 Oct 2012 00:23:26 +0000 (17:23 -0700)]
stream.py: Don't use class decorators.

Commit 8cc820 (python/ovs/stream: teach stream.py tcp socket) made a
change that used class decorators.  Unfortunately, they were not
introduced until Python 2.6.  XenServer uses Python 2.4, so the change
caused some Python-based daemons not to start.  This commit uses an
alternate syntax suggested by Reid Price.

Bug #13580

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Reid Price <reid@nicira.com>
11 years agoofp-actions: Remove unused variable.
Ethan Jackson [Tue, 16 Oct 2012 22:40:27 +0000 (15:40 -0700)]
ofp-actions: Remove unused variable.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agotimeval: Block SIGALRM when sleeping.
Ethan Jackson [Tue, 16 Oct 2012 00:05:35 +0000 (17:05 -0700)]
timeval: Block SIGALRM when sleeping.

Commit 00a16895 (timeval: Don't require signals for time_alarm().)
Incorrectly disabled signals when when CACHE_TIME was disabled.  In
fact, the reverse was correct.  As a result of this bug, OVS would
wake once every 100ms unnecessarily.  It shouldn't have affected
correctness otherwise.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoinstruction/clear-actions: string parser/formater, of packet decoder/encoder
Isaku Yamahata [Fri, 5 Oct 2012 06:56:57 +0000 (15:56 +0900)]
instruction/clear-actions: string parser/formater, of packet decoder/encoder

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoinstruction: support goto-table action
Isaku Yamahata [Fri, 5 Oct 2012 06:56:56 +0000 (15:56 +0900)]
instruction: support goto-table action

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agopython/ovs/socket_util: don't use Exception, but ValueError
Isaku Yamahata [Mon, 15 Oct 2012 21:57:27 +0000 (06:57 +0900)]
python/ovs/socket_util: don't use Exception, but ValueError

67656b9ff297f305b3bfcca2868e8e870e108283
used Exception, but it should be more specific error.
Use ValueError instread of Exception.

Suggested-by: Reid Price <reid@nicira.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoovs-pki: Increase the validity days for self-signed certificates.
Gurucharan Shetty [Mon, 15 Oct 2012 21:41:31 +0000 (14:41 -0700)]
ovs-pki: Increase the validity days for self-signed certificates.

For self-signed certificates, increase validity from the default
30 days to 6 years.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agopython/ovs/stream: teach stream.py tcp socket
Isaku Yamahata [Thu, 27 Sep 2012 09:28:08 +0000 (18:28 +0900)]
python/ovs/stream: teach stream.py tcp socket

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agopython/ovs/socket_util: add tcp related helper functions which will be used by tcp
Isaku Yamahata [Thu, 27 Sep 2012 09:28:07 +0000 (18:28 +0900)]
python/ovs/socket_util: add tcp related helper functions which will be used by tcp

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agotimeval: Add new "backtrace" appctl command.
Ethan Jackson [Fri, 12 Oct 2012 22:18:26 +0000 (15:18 -0700)]
timeval: Add new "backtrace" appctl command.

Often, it can be quite difficult to debug performance issues in
Open vSwitch.  Typically one needs to run something like gprof, but
that requires rebuilding and installing on the affected system
which is often problematic.  This patch adds a light weight
profiling solution which can be used in these situations.  The
ovs-appctl backtrace command prints out backtraces taken at 100
millisecond intervals over a 5 second period of time.  It is
currently only supported on systems which have the execinfo library
and enable time caching.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agocfm: Scope CFM packets to key zero.
Ethan Jackson [Fri, 12 Oct 2012 20:19:35 +0000 (13:19 -0700)]
cfm: Scope CFM packets to key zero.

Before this patch, when a tunnel is configured with key=flow, CFM
didn't verify that incoming packets had the appropriate key of
zero.  This could cause the CFM module to consume packets which
weren't actually intended for it.

Bug #13542.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoofp-errors: Merge OF1.0 "all tables full" with OF1.1+ "table full".
Ben Pfaff [Fri, 12 Oct 2012 17:15:11 +0000 (10:15 -0700)]
ofp-errors: Merge OF1.0 "all tables full" with OF1.1+ "table full".

These codes represent essentially the same condition and only one of them
exists in any given version of OpenFlow, so merge them together into a
single OFPERR_* code.

Reported-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto: Fix typo in macro name.
Ben Pfaff [Fri, 12 Oct 2012 20:18:41 +0000 (13:18 -0700)]
ofproto: Fix typo in macro name.

I like the sound of "evicton" but it isn't a real word.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto: Do not add flow on flow mod if new_cookie is UINT64_MAX
Simon Horman [Fri, 12 Oct 2012 00:26:28 +0000 (09:26 +0900)]
ofproto: Do not add flow on flow mod if new_cookie is UINT64_MAX

Internally a new_cookie value UINT64_MAX is used for
an OpenFlow 1.2 flow mod whose command is not Add.
Open Flow 1.2 does not permit adding flows for such commands.
Also, UINT64_MAX is a prohibited cookie value, and the
existing code created a flow with that value as for the cookie.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-print: Do not display flow mod cookie if it is UINT64_MAX
Simon Horman [Fri, 12 Oct 2012 00:26:29 +0000 (09:26 +0900)]
ofp-print: Do not display flow mod cookie if it is UINT64_MAX

Internally UINT64_MAX is used to denote that the cookie
should not be changed, so it seems appropriate
to omit this value when pretty printing flow mods.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-util: Correct setting of Flow Mod cookie on encode
Simon Horman [Fri, 12 Oct 2012 00:26:27 +0000 (09:26 +0900)]
ofp-util: Correct setting of Flow Mod cookie on encode

When the command of a Flow Mod messages is ADD the cookie should be set as
fm->new_cookie, this is the new cookie value to be set. Otherwise it
should be set as fm->cookie, internally this is the cookie value to match.

Also remove 'XXX' marker from the matching code in the decoder.
I am now comfortable with the implementation.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-msgs: Open Flow 1.1 and 1.2 Queue Status Messages
Simon Horman [Fri, 12 Oct 2012 04:03:04 +0000 (13:03 +0900)]
ofp-msgs: Open Flow 1.1 and 1.2 Queue Status Messages

This allows for encoding and decoding Open Flow 1.1 and 1.2 Queue Stats
Request and Reply messages.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-util: Correct comment above ofputil_append_port_stat()
Simon Horman [Fri, 12 Oct 2012 04:01:05 +0000 (13:01 +0900)]
ofp-util: Correct comment above ofputil_append_port_stat()

This function changed a few times before it was merged,
unfortunately at some point the comment wasn't kept in sync
with the changes.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-msgs: Update for OpenFlow 1.1 & 1.2 Port Desc Stats
Simon Horman [Fri, 12 Oct 2012 04:00:38 +0000 (13:00 +0900)]
ofp-msgs: Update for OpenFlow 1.1 & 1.2 Port Desc Stats

* Split OFPRAW_OFPST_PORT_DESC_REPLY into OpenFlow 1.0
  and OpenFlow 1.1+ versions.
* Allow OFPRAW_OFPST_PORT_DESC_REQUEST to be used for
  OpenFlow 1.0+ instead of only OpenFlow 1.0.

This appears to be necessary and sufficient to allow encoding of Port Desc
Stats reply messages and decoding of Port Desc Stats request messages. Or
in other words both the client and server side of ovs-ofctl dump-ports-desc

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoUse enum ofperr in ofputil_decode_flow_removed()
Simon Horman [Fri, 12 Oct 2012 00:24:34 +0000 (09:24 +0900)]
Use enum ofperr in ofputil_decode_flow_removed()

The return type of both ofputil_decode_flow_removed() and nx_pull_match()
is enum ofperr so it makes sense for error be of that type too.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agolib: Use FreeBSD libc function for proctitle
Ed Maste [Thu, 11 Oct 2012 20:58:17 +0000 (20:58 +0000)]
lib: Use FreeBSD libc function for proctitle

FreeBSD libc's setproctitle provides the same interface as proctitle_set so
use it directly.

Signed-off-by: Ed Maste <emaste@adaranet.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agolib: Move addition of program_name to proctitle_set
Ed Maste [Thu, 11 Oct 2012 20:49:38 +0000 (20:49 +0000)]
lib: Move addition of program_name to proctitle_set

Signed-off-by: Ed Maste <emaste@adaranet.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agonicira-ext: Correct and improve nx_flow_update_abbrev comment.
Ben Pfaff [Thu, 11 Oct 2012 17:56:12 +0000 (10:56 -0700)]
nicira-ext: Correct and improve nx_flow_update_abbrev comment.

Notifications always precede a barrier that follows a given flow_mod,
not a barrier that precedes a flow_mod as the text here previously claimed.

Also, the text about abbreviated notifications is equally applicable
to normal, unabbreviated notifications, so say that explicitly.

Reported-by: Jean Tourrilhes <jt@hpl.hp.com>
Acked-by: Jean Tourrilhes <jt@hpl.hp.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-msgs: Open Flow 1.1 and 1.2 Port Status Messages
Simon Horman [Sat, 6 Oct 2012 10:39:49 +0000 (19:39 +0900)]
ofp-msgs: Open Flow 1.1 and 1.2 Port Status Messages

This allows for encoding and decoding Open Flow 1.1 and 1.2 Port Stats
Request and Reply message

Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com added ofputil_count_port_stas(), simplified
 interface of ofputil_decode_port_stats(), style changes]
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoMakefile.am: Distribute INSTALL.Fedora.
Ben Pfaff [Wed, 10 Oct 2012 17:09:12 +0000 (10:09 -0700)]
Makefile.am: Distribute INSTALL.Fedora.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agobuild: Add support for building RPMs for Fedora Linux
Ralf Spenneberg [Tue, 2 Oct 2012 18:31:55 +0000 (14:31 -0400)]
build: Add support for building RPMs for Fedora Linux

Add RPM specfiles for building OVS for Fedora Linux. This
allows users of the upstream project the ability to
generate RPMs for their Open vSwitch needs.

Signed-off-by: Ralf Spenneberg <ralf@spenneberg.net>
[kmestery@cisco.com made substantial changes including
 writing documentation]
Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Allow GRE64 tunnels without any key.
Pravin B Shelar [Wed, 10 Oct 2012 00:13:05 +0000 (17:13 -0700)]
datapath: Allow GRE64 tunnels without any key.

Now GRE64 deals with tunnel with no key and tunnel with zero key
as a same. This behaviour is different than standard GRE.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: Fix GRE tunnel without any key.
Pravin B Shelar [Tue, 9 Oct 2012 23:08:39 +0000 (16:08 -0700)]
datapath: Fix GRE tunnel without any key.

Commit 2de795adb96 (datapath: 64-bit GRE support) introduced a bug
for tunnels with no key. Following patch fixes it by setting tunnel
type to GRE type.

Bugs: 13511
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agoconfig: Add explicit support for building on ESX.
Ethan Jackson [Fri, 5 Oct 2012 20:24:21 +0000 (13:24 -0700)]
config: Add explicit support for building on ESX.

The ESX userspace looks quite a bit like linux, but has some key
differences which need to be specially handled in the build.  To
distinguish between ESX and systems which use the linux datapath
module, this patch adds two new macros "ESX" and "LINUX_DATAPATH".
It uses these macros to disable building code on ESX which only
applies to a true Linux environment.  In addition, it adds a new
route-table-stub implementation which is required for the build to
complete successfully on ESX.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agodatapath: 64-bit GRE support
Pravin B Shelar [Sat, 6 Oct 2012 00:55:02 +0000 (17:55 -0700)]
datapath: 64-bit GRE support

Extend GRE to have a 64-bit key. Use GRE sequence number to
store upper 32-bits of the key, but this is not standard way of
using GRE sequence number.

Bug #13186
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agotimeval: Recover from failed timer_create() calls.
Ethan Jackson [Fri, 5 Oct 2012 01:38:59 +0000 (18:38 -0700)]
timeval: Recover from failed timer_create() calls.

The timer_create() system call is not supported in ESX and returns
an error when called.  Aborting when this system call fails seems a
bit extreme. So instead, this patch simply falls back to disabling
the cached time optimization.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agotimeval: Don't require signals for time_alarm().
Ethan Jackson [Fri, 5 Oct 2012 00:57:16 +0000 (17:57 -0700)]
timeval: Don't require signals for time_alarm().

Before this patch, time_alarm() used the SIGALRM handler to notify
the poll loop that it should exit the program.  Instead, this patch
simply implements time_alarm() directly in the pool loop.  This
significantly simplifies the code, while removing a call to
timer_create() which is not currently supported on ESX.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto-dpif: Avoid zeroing tunnel info in handle_miss_upcalls().
Ben Pfaff [Thu, 4 Oct 2012 22:11:39 +0000 (15:11 -0700)]
ofproto-dpif: Avoid zeroing tunnel info in handle_miss_upcalls().

Commit 296e07ace0f (flow: Extend struct flow to contain tunnel outer
header.) changed the tunnel ID parameter of flow_extract() from an integer
passed by value to a structure passed by pointer.  Before flow_extract()
reads the tunnel ID, it zeros the entire flow parameter.  This means that,
if a caller passes the address of the tunnel member of the flow as the
tunnel ID, then flow_extract() zeros the tunnel data before it reads and
copies the tunnel data (that it just zeroed).  The result is that the
tunnel data is ignored.

This commit fixes the problem by making the caller that did this use a
separate flow structure instead of trying to be clever.

Bug #13461.
CC: Pankaj Thakkar <thakkar@nicira.com>
Reported-by: Michael Hu <mhu@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoovsdb/jsonrpc-server: ovsdb-server closes accepted connections immediately.
Mehak Mahajan [Thu, 4 Oct 2012 19:33:05 +0000 (12:33 -0700)]
ovsdb/jsonrpc-server: ovsdb-server closes accepted connections immediately.

2012-09-14T05:38:26Z|00001|jsonrpc|WARN|tcp:127.0.0.1:6634: receive error: Con
ovsdb-client: transaction failed (Connection reset by peer)
NOTE: This occurs intermittently depending on how ovsdb-server runs.
      Running ovsdb-client on a remote machine increases the possibility.

This is because ovsdb-server closes newly accepted tcp connection.
The following changesets caused it. struct jsonrpc_session::dscp isn't set
based on listening socket's dscp value.
- ovsdb-server creates passive connection and listens on it.
- ovsdb-server accepts connection by ovsdb_jsonrpc_server_run().
  The accepted socket inherits from the listening sockets.
  ovsdb_jsonrpc_server_run() creates json session, but leaves dscp of
  struct jsonrpc_session zero.
- On calling reconfigure_from_db(), it resets dscp value to
  all jsonrpc sessions. Eventually jsonrpc_session_set_dscp() is called.
  Then jsonrpc_session_force_reconnect() closes the connection.

With this patch,
- struct jsonrpc_session::dscp is correctly set based on
  listening sockets dscp value.
- dscp of listening socket is changed dynamically by setsockopt.
  This leaves a window where accepted socket may have old dscp.
  But it is ignored for now because it would complicates codes
  too much.

The related change sets:
0442efd9b1a88d923b56eab6b72b6be8231a49f7
  Reapplying the dscp changes: No need to restart DB/OVS on changing
  dscp value.
59efa47adf3234ec51541405726d033173851285
  Revert DSCP update changes.
b2e18db292cd4962af3248f11e9f17e6eaf9c033
  No need to restart DB / OVS on changing dscp value.
f125905cdd3dc0339ad968c0a70128807884b400
  Allow configuring DSCP on controller and manager connections.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
11 years agoAvoid requiring autom4te when it won't necessarily be needed.
Ben Pfaff [Thu, 4 Oct 2012 22:55:43 +0000 (15:55 -0700)]
Avoid requiring autom4te when it won't necessarily be needed.

Commit 7fd3e43db07 (tests: Allow environment specified autom4te.) added a
requirement for Autom4te without anyone noticing it in advance.  This
caused a build failure in the XenServer DDK, which doesn't have Autom4te.
Since Autom4te is only needed if the testsuite is modified, this commit
makes it optional.

(Autom4te is part of Autoconf.)

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoFix vswitch-idl.ovsidl build rule with separate source and build dirs.
Ben Pfaff [Thu, 4 Oct 2012 22:53:14 +0000 (15:53 -0700)]
Fix vswitch-idl.ovsidl build rule with separate source and build dirs.

Before commit e3a880272 (lib: Specify idl location more precisely.), the
files named in VSWITCH_IDL_FILES were relative to the source directory.
That commit made them inconsistent: one remained relative to the source
directory, the other became relative to the build directory.  This meant
that if the source and build directories differed, the ovsdb-idlc
invocation had no change of succeeding.

This commit fixes the problem by making the file names consistently
relative to the build directory and then adjusting the ovsdb-idlc
invocation to expect that.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agodatapath: Print device when warning about over MTU packets.
Jesse Gross [Thu, 4 Oct 2012 20:34:36 +0000 (13:34 -0700)]
datapath: Print device when warning about over MTU packets.

If an attempt is made to transmit a packet that is over the device's
MTU then we log it using the datapath's name.  However, it is much
more helpful to use the device name instead.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agotests: Allow environment specified autom4te.
Ethan Jackson [Wed, 3 Oct 2012 22:58:54 +0000 (15:58 -0700)]
tests: Allow environment specified autom4te.

In the ESX build system, autom4te is in a funny location specified
by an environment variable.  Before this patch, this environment
variable was overridden by the tests automake file.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agolib: Specify idl location more precisely.
Ethan Jackson [Wed, 3 Oct 2012 22:58:27 +0000 (15:58 -0700)]
lib: Specify idl location more precisely.

For some reason, the ESX build tools seem to be confused about the
location of 'lib'.  This patch specifies it more directly.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoofp-util: Set Packet In Format: Use prevailing OpenFlow version
Simon Horman [Thu, 4 Oct 2012 02:41:16 +0000 (11:41 +0900)]
ofp-util: Set Packet In Format: Use prevailing OpenFlow version

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoflow: Fix struct flow size build assertion failure.
Jesse Gross [Wed, 3 Oct 2012 18:29:05 +0000 (11:29 -0700)]
flow: Fix struct flow size build assertion failure.

The new struct flow_tnl contains an extra four bytes of padding on
64-bit machines but we currently assert that the total struct flow
is a fixed size.  The size difference isn't actually a problem
because both are multiples of 4 and the build assertion is only
intended to remind people to update FLOW_WC_SEQ when new fields are
added.  This changes the assertion to fix just the non-tunnel field
size.

Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoflow: Extend struct flow to contain tunnel outer header.
Jesse Gross [Fri, 14 Sep 2012 03:11:08 +0000 (20:11 -0700)]
flow: Extend struct flow to contain tunnel outer header.

Soon the kernel will begin supplying the information about the outer
IP header for tunneled packets and userspace will need to be able to
track it as part of the flow.  For the time being this is only used
internally by OVS and not exposed outwards to OpenFlow.  As a result,
this threads the information throughout userspace but simply stores
the existing tun_id in it.

Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agotests: jemalloc debug config for FreeBSD 9 and 10.
Ed Maste [Tue, 2 Oct 2012 15:45:23 +0000 (15:45 +0000)]
tests: jemalloc debug config for FreeBSD 9 and 10.

Signed-off-by: Ed Maste <emaste@adaranet.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>