]> git.proxmox.com Git - mirror_ovs.git/log
mirror_ovs.git
11 years agoovsdb: Do not leak error in ovsdb_server_compact()
Thomas Graf [Fri, 1 Nov 2013 16:44:52 +0000 (17:44 +0100)]
ovsdb: Do not leak error in ovsdb_server_compact()

Signed-off-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto: Calculate some group stats at ofproto layer
Simon Horman [Wed, 30 Oct 2013 09:17:08 +0000 (18:17 +0900)]
ofproto: Calculate some group stats at ofproto layer

It seems to make sense to set the reference count and number
of buckets at the protocol layer as it is known there.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto: Add group features test
Simon Horman [Wed, 30 Oct 2013 09:17:07 +0000 (18:17 +0900)]
ofproto: Add group features test

Lightly exercise group features

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto: Fail flow mod if it references a non-existent group
Simon Horman [Wed, 30 Oct 2013 09:17:06 +0000 (18:17 +0900)]
ofproto: Fail flow mod if it references a non-existent group

As per the OpenFlow1.3.2 specification, a flow mod should fail
if it references a non-existent group.

The change in this patch appears to be necessary to satisfy that
constraint. It is unclear to me whether or not is is sufficient.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto: Delete relevant flows on group del
Simon Horman [Wed, 30 Oct 2013 09:17:05 +0000 (18:17 +0900)]
ofproto: Delete relevant flows on group del

As pert the OpenFlow1.3.2 specification, delete flows that
reference a group when it is deleted.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agometa-flow: Make mf_parse() report bad masks as errors.
Ben Pfaff [Fri, 1 Nov 2013 00:18:38 +0000 (17:18 -0700)]
meta-flow: Make mf_parse() report bad masks as errors.

Reported-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoReturn no protocols if mask is supplied for unmaskable match
Simon Horman [Thu, 31 Oct 2013 04:00:02 +0000 (13:00 +0900)]
Return no protocols if mask is supplied for unmaskable match

Currently if a mask is supplied for an unmaskable match then NOT_REACHED()
is called. The effect of this for a user calling ovs-vsctl with a match
that includes a mask which is not permitted is to politely inform them of
the error of their ways by calling abort and segfaulting.

This patch takes an alternate approach to return no protocols which has the
has the effect when that ovs-vsctl is called with a match that includes a
mask which is not permitted an error message of the following form is
displayed.

ovs-ofctl: none of the usable flow formats (none) is among the allowed flow formats (OpenFlow10,NXM)

This patch also updates the ovs-ofctl test to test matches with masks
where possible.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoovs-ofctl: Add icmp_code test
Simon Horman [Thu, 31 Oct 2013 04:00:01 +0000 (13:00 +0900)]
ovs-ofctl: Add icmp_code test

This corrects what appears to be a typo by replacing
a duplicate icmp_type test with an icmp_code test.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodebian: Option to create tunnel through 'interfaces'.
Gurucharan Shetty [Thu, 31 Oct 2013 16:20:42 +0000 (09:20 -0700)]
debian: Option to create tunnel through 'interfaces'.

This is a port of commit 7b75828bf5654c (rhel: Option to create tunnel
through ifcfg scripts.) from rhel to debian's ifupdown script.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Use flow hash during flow lookup operation.
Pravin B Shelar [Wed, 30 Oct 2013 16:43:49 +0000 (09:43 -0700)]
datapath: Use flow hash during flow lookup operation.

Flow->hash can be used to detect hash collisions and avoid flow key
compare in flow lookup.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agoodp-util: Parse SCTP correctly.
Gurucharan Shetty [Wed, 30 Oct 2013 07:44:32 +0000 (00:44 -0700)]
odp-util: Parse SCTP correctly.

We should be looking at 'src_flow' instead of 'flow'. Otherwise,
parsing SCTP through odp_flow_key_to_mask will fail.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Simplify vport-netdev-hook compatibility code.
Pravin B Shelar [Tue, 29 Oct 2013 21:10:26 +0000 (14:10 -0700)]
datapath: Simplify vport-netdev-hook compatibility code.

Move compat code to netdev_rx_handler_register() definition.
It also adds type safety for netdev-hook.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agoclassifier: Rename struct cls_table as cls_subtable.
Jarno Rajahalme [Tue, 29 Oct 2013 23:39:52 +0000 (16:39 -0700)]
classifier: Rename struct cls_table as cls_subtable.

The naming of the classifier table has been a source of confusion,
since each OpenFlow table is implemented as a classifier, which
consists of multiple (sub)tables.  This name change hopefully makes
classifier related discussion a bit less confusing.

For consistency, relevant field names as well as the function and
variable names have been renamed in similar fashion.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto: Add support for sending OFPTYPE_ROLE_STATUS messages.
Alexandru Copot [Tue, 22 Oct 2013 08:40:03 +0000 (11:40 +0300)]
ofproto: Add support for sending OFPTYPE_ROLE_STATUS messages.

When a controller changes its role to MASTER, the others are marked
as SLAVE. This patch makes it possible to notify the controllers
of this change.

Signed-off-by: Alexandru Copot <alex.mihai.c@gmail.com>
Cc: Daniel Baluta <dbaluta@ixiacom.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoinclude/openflow: Add OpenFlow 1.4 header file
Alexandru Copot [Tue, 22 Oct 2013 08:40:02 +0000 (11:40 +0300)]
include/openflow: Add OpenFlow 1.4 header file

It contains only Set-Async-Config and Role status message definitions.

Signed-off-by: Alexandru Copot <alex.mihai.c@gmail.com>
Cc: Daniel Baluta <dbaluta@ixiacom.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agovtep: Bring BFD specification in vtep.xml into sync with OVS.
Ben Pfaff [Tue, 29 Oct 2013 20:01:07 +0000 (13:01 -0700)]
vtep: Bring BFD specification in vtep.xml into sync with OVS.

A number of new key-value pairs have been added to the bfd and bfd_status
columns of the OVS schema since the VTEP schema was created. To aid
interoperability between OVS instances and VTEPs, this patch brings
the VTEP schema into line with that of OVS.

CC: Bruce Davie <bdavie@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoImplement OFPT_QUEUE_GET_CONFIG_REQUEST and OFPT_QUEUE_GET_CONFIG_REPLY.
Venkitachalam Gopalakrishnan [Thu, 24 Oct 2013 22:54:03 +0000 (15:54 -0700)]
Implement OFPT_QUEUE_GET_CONFIG_REQUEST and OFPT_QUEUE_GET_CONFIG_REPLY.

Open vSwitch has never implemented this request and reply, even though they
have been in OpenFlow since version 1.0.  This commit adds an
implementation.

Signed-off: Venkitachalam Gopalakrishnan <gops@vmware.com>
Co-authored-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
11 years agoopenflow-1.2.h: Remove redundant definition of OFPST12_GROUP_FEATURES.
Ben Pfaff [Thu, 24 Oct 2013 21:34:17 +0000 (14:34 -0700)]
openflow-1.2.h: Remove redundant definition of OFPST12_GROUP_FEATURES.

Message types are defined in ofp-msgs.h these days.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
11 years agovswitch.xml: Improve documentation for BFD.
Ben Pfaff [Tue, 29 Oct 2013 19:41:17 +0000 (12:41 -0700)]
vswitch.xml: Improve documentation for BFD.

This update improves the BFD documentation in a few ways:

   - Demand mode is now supported.

   - Wordsmithing, spelling, etc.

   - Attempt to better explain decay_min_rx, forwarding_if_rx, and
     cpath_down.

   - Break into subgroups for configuration and status, to better explain
     which party sets which fields.

   - Reindents to match the rest of vswitch.xml.

Because of the reindentation, this patch may be easier to view with spacing
changes suppressed.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoTCP flags matching support.
Jarno Rajahalme [Mon, 28 Oct 2013 20:54:40 +0000 (13:54 -0700)]
TCP flags matching support.

    tcp_flags=flags/mask
        Bitwise  match on TCP flags.  The flags and mask are 16-bit num‐
        bers written in decimal or in hexadecimal prefixed by 0x.   Each
        1-bit  in  mask requires that the corresponding bit in port must
        match.  Each 0-bit in mask causes the corresponding  bit  to  be
        ignored.

        TCP  protocol  currently  defines  9 flag bits, and additional 3
        bits are reserved (must be transmitted as zero), see  RFCs  793,
        3168, and 3540.  The flag bits are, numbering from the least
significant bit:

        0: FIN No more data from sender.

        1: SYN Synchronize sequence numbers.

        2: RST Reset the connection.

        3: PSH Push function.

        4: ACK Acknowledgement field significant.

        5: URG Urgent pointer field significant.

        6: ECE ECN Echo.

        7: CWR Congestion Windows Reduced.

        8: NS  Nonce Sum.

        9-11:  Reserved.

        12-15: Not matchable, must be zero.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agoWiden TCP flags handling.
Jarno Rajahalme [Mon, 28 Oct 2013 20:54:39 +0000 (13:54 -0700)]
Widen TCP flags handling.

Widen TCP flags handling from 7 bits (uint8_t) to 12 bits (uint16_t).
The kernel interface remains at 8 bits, which makes no functional
difference now, as none of the higher bits is currently of interest
to the userspace.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: Enable all GSO features on internal port.
Pravin B Shelar [Fri, 25 Oct 2013 20:42:12 +0000 (13:42 -0700)]
datapath: Enable all GSO features on internal port.

OVS already can handle all types of segmentation offloads that
are supported by the kernel.
Following patch specifically enables UDP and IPV6 segmentation
offloads.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agoofproto: Use ofproto_check_ofpacts() from modify_flows__().
Ben Pfaff [Fri, 25 Oct 2013 21:00:43 +0000 (14:00 -0700)]
ofproto: Use ofproto_check_ofpacts() from modify_flows__().

Until now this code has called ofpacts_check() directly, but that omits
the additional check that the ofproto_check_ofpacts() wrapper includes.

Reported-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
11 years agoofproto: Avoid abandoning an ofopgroup without committing it.
Ben Pfaff [Fri, 25 Oct 2013 20:31:50 +0000 (13:31 -0700)]
ofproto: Avoid abandoning an ofopgroup without committing it.

Commit e3b5693319c (Fix table checking for goto table instruction.) moved
action checking into modify_flows__(), for good reason, but as a side
effect made modify_flows__() abandon and never commit the ofopgroup that it
started, if action checking failed.  This commit fixes the problem.

The following commands, run under "make sandbox", illustrate the problem.
Without this change, the final command hangs because the barrier request
that ovs-ofctl sends never gets a response (because barriers wait for all
ofopgroups to complete, which never happens).  With this commit, the
commands complete quickly:

ovs-vsctl add-br br0
ovs-vsctl set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13
ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:2
ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:1

Reported-by: Jarno Rajahalme <jrajahalme@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agolib: Remove unreachable JSONRPC case
Joe Stringer [Tue, 22 Oct 2013 17:03:08 +0000 (10:03 -0700)]
lib: Remove unreachable JSONRPC case

jsonrpc_session_recv() handles echo replies prior to this.

Found by inspection.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agojsonrpc: Only compose message to log if it's really going to be logged.
Ben Pfaff [Fri, 25 Oct 2013 16:22:37 +0000 (09:22 -0700)]
jsonrpc: Only compose message to log if it's really going to be logged.

This suppresses a testsuite failure when the testsuite is run from a
directory whose name contains a non-ASCII character.  I'd rather fix the
problem but webpages like the following make it sound difficult or
impossible on Python 2.x: http://stackoverflow.com/a/11742928

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agotests: Skip Python daemon tests in directory with non-ASCII name.
Ben Pfaff [Fri, 25 Oct 2013 16:22:36 +0000 (09:22 -0700)]
tests: Skip Python daemon tests in directory with non-ASCII name.

The Debian autobuild machines run their builds inside a top-level
directory named /«BUILDDIR».  That name contains two non-ASCII characters
that cause the Python code in the interface-reconfigure and ovs-monitor-ipsec
tests to fail.  The problem seems to be related to the locale, because
switching to a UTF-8 locale allows the tests to proceed farther but does
not fix the problem.  I was not able to easily fix the actual problem.
Web searches turn up articles that imply that the problem is not
reasonably fixable with Python 2.x, e.g.:
    http://stackoverflow.com/a/11742928

This commit instead avoids the problem by skipping these tests if the
current working directory's name contains non-ASCII characters.  This is
a legitimate solution only because interface-reconfigure and
ovs-monitor-ipsec run from initscripts and thus their current working
directories are system directories.  (Also, the current working directory
matters much less when run in a real environment because the --root-prefix
option that causes the issue is not used in a real environment.)

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agotests: use full table names in ovs-vsctl commands
Ansis Atteka [Thu, 24 Oct 2013 22:36:29 +0000 (15:36 -0700)]
tests: use full table names in ovs-vsctl commands

It is more obvious to figure out what exactly test is doing
if ovs-vsctl commands contain full table names.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto: Report multipart buffer overflow.
YAMAMOTO Takashi [Thu, 24 Oct 2013 03:07:44 +0000 (12:07 +0900)]
ofproto: Report multipart buffer overflow.

Because our size of the multipart request buffer is effectively 0,
always report multipart buffer overflow error for multipart requests
with "more" flag set.

While this might be simpler if done in ofp-msgs.c, i put this in
ofproto.c because it seems like a better place to implement the
buffering logic if/when desirable.

An option question: what to do for the following messages with the
same xid?  especially for the last message which doesn't have the
"more" flag set?  it would be neater to detect and drop them.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto: Report correct errors for unsupported stats/multipart requests.
YAMAMOTO Takashi [Thu, 24 Oct 2013 03:07:43 +0000 (12:07 +0900)]
ofproto: Report correct errors for unsupported stats/multipart requests.

The correct error in that case is OFPERR_OFPBRC_BAD_STAT,
not OFPERR_OFPBRC_BAD_TYPE.

Currently, the only example of unsupported stats/multipart request is
OFPTYPE_TABLE_FEATURES_STATS_REQUEST.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agopackage: Make Fedora RPMs build after vtep changes.
Kyle Mestery [Thu, 24 Oct 2013 19:35:14 +0000 (15:35 -0400)]
package: Make Fedora RPMs build after vtep changes.

Add the appropriate vtep files into the Fedora RPM build
to make this work on master again.

Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoofp-print: Update a printf format for the recent pin.total_len change.
YAMAMOTO Takashi [Thu, 24 Oct 2013 02:58:54 +0000 (11:58 +0900)]
ofp-print: Update a printf format for the recent pin.total_len change.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoconnmgr: Fix an abort.
YAMAMOTO Takashi [Thu, 24 Oct 2013 02:58:53 +0000 (11:58 +0900)]
connmgr: Fix an abort.

Fix a problem introduced by commit cfa955b083c5617212a29a03423e063ff6cb350a.
(connmgr: Fix packet-in reason for OpenFlow1.3 table-miss flow entries.).

ofconn might not be connected here, in that case
ofputil_protocol_to_ofp_version aborts.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Per cpu flow stats.
Pravin B Shelar [Wed, 23 Oct 2013 21:34:39 +0000 (14:34 -0700)]
datapath: Per cpu flow stats.

With mega flow implementation ovs flow can be shared between
multiple CPUs which makes stats updates highly contended
operation. Following patch allocates separate stats for each
CPU to make stats update scalable.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agolib/ofp-actions: Enforce action consistency.
Jarno Rajahalme [Wed, 23 Oct 2013 19:52:57 +0000 (12:52 -0700)]
lib/ofp-actions: Enforce action consistency.

OpenFlow 1.1+ specs encourage switches to verify action consistency
at flow setup time.  Implement this for OpenFlow 1.1+ only to not
break any current OF 1.0 based use.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-actions: Make union ofp_action more generic.
Ben Pfaff [Wed, 23 Oct 2013 20:46:57 +0000 (13:46 -0700)]
ofp-actions: Make union ofp_action more generic.

Make union ofp_action more generic by allowing it to be used for
all actions.  OFP_ACTION_ALIGN (which is 8, as the sizeof(union
ofp_action) used to be) is now used where sizeof union ofp_action
was used before.  On the same note, variable name 'n_actions' is
changed to 'max_actions' as the number of actions cannot be simply
divided when actions have various sizes.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoAdd OF11 SET IP TTL action.
Jarno Rajahalme [Wed, 23 Oct 2013 00:20:44 +0000 (17:20 -0700)]
Add OF11 SET IP TTL action.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoAdd OF11 set IPv4 ECN action.
Jarno Rajahalme [Wed, 23 Oct 2013 00:20:43 +0000 (17:20 -0700)]
Add OF11 set IPv4 ECN action.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoAllow OFPACT_SET_IP_DSCP to act on both IPv4 and IPv6 packets.
Ben Pfaff [Wed, 23 Oct 2013 16:58:34 +0000 (09:58 -0700)]
Allow OFPACT_SET_IP_DSCP to act on both IPv4 and IPv6 packets.

This removes semantic differences between different OpenFlow
versions, making it easier to translate between them.
Also, rename OFPACT_SET_IPV4_DSCP to OFPACT_SET_IP_DSCP.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoFix ovs-ofctl documentation.
Jarno Rajahalme [Wed, 23 Oct 2013 00:20:40 +0000 (17:20 -0700)]
Fix ovs-ofctl documentation.

State that if decrementing makes a TTL zero, controller notifications
may be sent.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agopinsched: Eliminate function callback in interface.
Ben Pfaff [Wed, 23 Oct 2013 04:58:58 +0000 (21:58 -0700)]
pinsched: Eliminate function callback in interface.

I'm not a fan of function callbacks because I feel that they obscure
interfaces.  This eliminates the function callback used until now in
the pinsched code.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoconnmgr: Fix packet-in reason for OpenFlow1.3 table-miss flow entries.
YAMAMOTO Takashi [Wed, 23 Oct 2013 04:50:23 +0000 (21:50 -0700)]
connmgr: Fix packet-in reason for OpenFlow1.3 table-miss flow entries.

As per spec, make packet-in reason for OpenFlow1.3 table-miss flow
entries no_match rather than action.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agofail-open: Add function to identify fail-open's flows.
Ben Pfaff [Wed, 23 Oct 2013 04:36:22 +0000 (21:36 -0700)]
fail-open: Add function to identify fail-open's flows.

This seems slightly cleaner than embedding this logic directing into
ofproto-dpif, since it is an interface that theoretically could be useful
to other ofproto providers.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-util: Use correct cookie value in "packet_in"s when no flow involved.
Ben Pfaff [Tue, 22 Oct 2013 23:57:46 +0000 (16:57 -0700)]
ofp-util: Use correct cookie value in "packet_in"s when no flow involved.

OpenFlow 1.3 uses all-1-bits in a packet_in to indicate that the packet_in
was not generated by a flow, but Open vSwitch incorrectly used 0.  This
fixes the problem.

For consistency, this commit also changes NXT_PACKET_IN to use all-1-bits
for this case, event though NXT_PACKET_IN was previously defined to use
zero.  This doesn't appear to make a difference for the NVP controller; if
it causes a problem for some other controller then I will revert that part
of the change.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-util: Improve comments on struct ofputil_packet_in.
Ben Pfaff [Tue, 22 Oct 2013 23:38:46 +0000 (16:38 -0700)]
ofp-util: Improve comments on struct ofputil_packet_in.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoconnmgr: Move send_len from ofputil_packet_in to ofproto_packet_in.
Ben Pfaff [Tue, 22 Oct 2013 23:32:13 +0000 (16:32 -0700)]
connmgr: Move send_len from ofputil_packet_in to ofproto_packet_in.

send_len is not directly part of the OpenFlow packet_in message, at least
given that it is partially redundant with packet_len.  send_len is, rather,
a request to the connmgr that expresses how many bytes the action requested
be sent to the controller, but the connmgr cannot always honor it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoconnmgr: Move controller_id from ofputil_packet_in to ofproto_packet_in.
Ben Pfaff [Tue, 22 Oct 2013 23:21:10 +0000 (16:21 -0700)]
connmgr: Move controller_id from ofputil_packet_in to ofproto_packet_in.

controller_id isn't part of the OpenFlow message, so it shouldn't be in
ofputil_packet_in.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto, ofp-util: Begin disentangling packet-in wire format and handling.
Ben Pfaff [Tue, 22 Oct 2013 23:16:31 +0000 (16:16 -0700)]
ofproto, ofp-util: Begin disentangling packet-in wire format and handling.

struct ofputil_packet_in mixes data included in OpenFlow packet_in messages
with data that used internally by ofproto and connmgr to queue and route
packet_ins.  This commit begins disentangling these purposes by adding a
new struct ofproto_packet_in that wraps struct ofputil_packet_in.  Adding
this new level of indirection causes a lot of code churn, so this commit
mainly takes care of that to make the remaining changes easier to read.

This commit does move the list node used for queuing packet_ins into the
new wrapper structure.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Add backport for __always_unused.
Jesse Gross [Tue, 22 Oct 2013 22:23:16 +0000 (15:23 -0700)]
datapath: Add backport for __always_unused.

Reported-by: Ben Pfaff <bpfaff@vmware.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoUpdate AUTHORS
Joe Stringer [Mon, 21 Oct 2013 20:11:01 +0000 (13:11 -0700)]
Update AUTHORS

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agodpif-linux: collect and display mega flow mask stats
Andy Zhou [Mon, 21 Oct 2013 21:37:34 +0000 (14:37 -0700)]
dpif-linux: collect and display mega flow mask stats

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: collect mega flow mask stats
Andy Zhou [Mon, 21 Oct 2013 21:37:33 +0000 (14:37 -0700)]
datapath: collect mega flow mask stats

Collect mega flow mask stats. ovs-dpctl show command can be used to
display them.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoclassifier: Fix a typo.
Gurucharan Shetty [Fri, 18 Oct 2013 08:23:34 +0000 (01:23 -0700)]
classifier: Fix a typo.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto: Fix coding style.
Gurucharan Shetty [Thu, 17 Oct 2013 11:25:19 +0000 (04:25 -0700)]
ofproto: Fix coding style.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agoodp-execute: Fix possible segfault.
Alex Wang [Sat, 19 Oct 2013 00:27:51 +0000 (17:27 -0700)]
odp-execute: Fix possible segfault.

In current code, the odp_execute_actions() function does not check
the value of "userspace" function pointer before invoking it.  This
patch adds a check for it.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-actions: Distinguish OF1.1/1.2 push_mpls from OF1.3+.
Joe Stringer [Thu, 17 Oct 2013 01:15:08 +0000 (10:15 +0900)]
ofp-actions: Distinguish OF1.1/1.2 push_mpls from OF1.3+.

In OpenFlow 1.1 and 1.2, the push_mpls action pushes the MPLS label after
any existing VLAN tag.  In OpenFlow 1.3, it pushes the label before any
existing VLAN tag.  Until now, the action parser didn't distinguish these
cases.  This commit adds support.  Nothing yet actually changes the
behavior of push_mpls.

enum ofpact_mpls_position contributed by Ben Pfaff.

Signed-off-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto: Send only one OFPT_FLOW_REMOVED message when a flow expires.
Ben Pfaff [Fri, 18 Oct 2013 23:32:40 +0000 (16:32 -0700)]
ofproto: Send only one OFPT_FLOW_REMOVED message when a flow expires.

Commit 15aaf59932a3 (ofproto: Add global locking around flow table
changes.) introduced doubled messages for expirations.

Reported-by: John Hurley <john.hurley@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
11 years agoovs-vtep: Don't flood to multiple 'uknown-dsts'.
Gurucharan Shetty [Fri, 18 Oct 2013 20:06:50 +0000 (13:06 -0700)]
ovs-vtep: Don't flood to multiple 'uknown-dsts'.

This commit changes VTEP simulator's flooding logic as follows:

1. Traffic coming from a VTEP physical port will only be flooded
to all the physical ports in the same VTEP that belongs to that logical
switch and to ONLY one of the devices that have been marked as 'unknown-dst'

2. Traffic coming from any device that has 'unknown-dst' marked, will only be
flooded by VTEP to its physical ports that belong to that logical switch.

Bug #20144.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
11 years agoconfigure: check for uuid python module
Ansis Atteka [Fri, 18 Oct 2013 04:32:19 +0000 (21:32 -0700)]
configure: check for uuid python module

After introducing commit a5ae88ff8a276e86c842ac102145432662bf711a
"ovsdb-doc: generate vswitch.[pic|gv] files only if dot tool is
available" Open vSwitch did not build anymore on hosts that did not
have uuid python module installed (for example, we still support
XenServer that still uses old python 2.4 and hence does not have uuid).

After this commit ./configure will check whether uuid module is present
and, if it isn't, then it will add python/compat to the PYTHONPATH.

Acked-By: Ben Pfaff <blp@nicira.com>
Signed-Off-By: Ansis Atteka <aatteka@nicira.com>
Issue: 20476

11 years agoFAQ: Fix misspelling.
Ben Pfaff [Fri, 18 Oct 2013 18:20:31 +0000 (11:20 -0700)]
FAQ: Fix misspelling.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoFAQ: Add Q&A about bridge compatibility.
Ben Pfaff [Fri, 18 Oct 2013 17:29:19 +0000 (10:29 -0700)]
FAQ: Add Q&A about bridge compatibility.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Add support for Linux 3.11
Pravin B Shelar [Mon, 14 Oct 2013 22:26:40 +0000 (15:26 -0700)]
datapath: Add support for Linux 3.11

Kernel 3.11 has support for extended GRE API required for
OVS datapath,  But vxlan still needs out of tree tunneling
compatibility.  Therefore to simplify, all tunneling modules
are forced to use compat tunneling.

CC: James Page <james.page@ubuntu.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agosocket-util: Add symlink based workaround for long pathnames.
YAMAMOTO Takashi [Thu, 17 Oct 2013 16:47:57 +0000 (09:47 -0700)]
socket-util: Add symlink based workaround for long pathnames.

The existing /proc workaround only works on Linux.  Symlinks are more
widely available.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Co-authored-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoOPENFLOW-1.1+: Add an item to improve action translation.
Ben Pfaff [Wed, 11 Sep 2013 16:31:49 +0000 (09:31 -0700)]
OPENFLOW-1.1+: Add an item to improve action translation.

Reported-by: Torbjorn Tornkvist <kruskakli@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoxenserver: Add VTEP packaging.
Justin Pettit [Fri, 18 Oct 2013 02:45:09 +0000 (19:45 -0700)]
xenserver: Add VTEP packaging.

Add VTEP files so XenServer build doesn't fail.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agorhel: Add VTEP packaging.
Justin Pettit [Fri, 18 Oct 2013 02:41:08 +0000 (19:41 -0700)]
rhel: Add VTEP packaging.

Add VTEP files so RHEL build doesn't fail.

Bug #20487

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agovswitchd: Use vswitch-specific variable name in automake.mk.
Justin Pettit [Thu, 17 Oct 2013 21:58:17 +0000 (14:58 -0700)]
vswitchd: Use vswitch-specific variable name in automake.mk.

The variable OVSDB_DOT_DIAGRAM_ARG is describing the vswitch dot file,
so use the name VSWITCH_DOT_DIAGRAM_ARG to prevent confusion in the
generated makefile.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agovtep: Add Debian packaging.
Justin Pettit [Wed, 9 Oct 2013 00:27:12 +0000 (17:27 -0700)]
vtep: Add Debian packaging.

Co-authored-by: David Yang <davidy@vmware.com>
Signed-off-by: David Yang <davidy@vmware.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agovtep: Initial checkin of ovs-vtep.
Justin Pettit [Tue, 8 Oct 2013 23:04:15 +0000 (16:04 -0700)]
vtep: Initial checkin of ovs-vtep.

ovs-vtep is a VTEP emulator that uses Open vSwitch for forwarding.

Co-authored-by: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agovtep: Add vtep-ctl command.
Justin Pettit [Tue, 8 Oct 2013 22:57:01 +0000 (15:57 -0700)]
vtep: Add vtep-ctl command.

The vtep-ctl command provides a user interface to manipulate the VTEP
OVSDB schema.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agovtep: Initial checkin of vtep schema.
Bruce Davie [Tue, 8 Oct 2013 21:37:51 +0000 (14:37 -0700)]
vtep: Initial checkin of vtep schema.

The hardware VTEP OVSDB schema specifies relations that a VTEP can use
to integrate physical ports into logical switches maintained by a
network virtualization controller such as NVP.

Co-authored-by: Ben Pfaff <blp@nicira.com>
Co-authored-by: Kenneth Duda <kduda@aristanetworks.com>
Co-authored-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Bruce Davie <bdavie@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Kenneth Duda <kduda@aristanetworks.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agoovsdb-dot: Include arrows by default.
Ben Pfaff [Thu, 20 Dec 2012 19:02:32 +0000 (11:02 -0800)]
ovsdb-dot: Include arrows by default.

When ovsdb-dot generates diagrams for use in the manpages, the dot2pic
postprocessor makes nicer output if the arrowheads are omitted (dot2pic
adds the arrowheads itself).  But for other uses that don't go through
the postprocessor, we generally want the arrowheads.  So this commit adds
an option.  On the principle that the default should be the least
surprising to a naive user, arrowheads are included by default.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
11 years agoMore accurate wildcarding and fragment handling.
Jarno Rajahalme [Thu, 17 Oct 2013 21:28:20 +0000 (14:28 -0700)]
More accurate wildcarding and fragment handling.

This patch gets rid of the need for having explicit padding in struct
flow as new fields are being added.  flow_wildcards_init_exact(), which
used to set bits in both compiler generated and explicit padding, is
removed.  match_wc_init() is now used instead, which generates the mask
based on a given flow, setting bits only in fields which make sense.

Places where random bits were placed in struct flow have been changed to
only set random bits on fields that are significant in the given context.
This avoids setting padding bits.

- lib/flow:
  - Properly initialize struct flow also in places we used to zero out
    padding before.
  - Add flow_random_hash_fields() used for testing.
  - Remove flow_wildcards_init_exact() to avoid initializing
     masks where compiler generated padding has bits set.
- lib/match.c match_wc_init(): Wildcard transport layer fields for later
  fragments, remove match_init_exact(), which used
  flow_wildcards_init_exact().
- tests/test-flows.c: use match_wc_init() instead of match_init_exact()
- tests/flowgen.pl: generate more accurate packets and flows when
  fragmenting, mark unavailable fields as wildcarded.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoovsdb-doc: generate vswitch.[pic|gv] files only if dot tool is available
Ansis Atteka [Fri, 11 Oct 2013 20:17:07 +0000 (13:17 -0700)]
ovsdb-doc: generate vswitch.[pic|gv] files only if dot tool is available

These are auto-generated files, so it would be better not to keep them
inside Open vSwitch repository.

Behaviour before this patch was that if dot tool was not present on
the system, then ovs-vswitchd.conf.db.5 would have used pre-generated
vswitch.pic file that was already checked in the git repository. After
this patch ovs-vswitchd.conf.db.5 will simply not have a dot diagram,
if dot was not present at the time when Open vSwitch was built.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
11 years agoinclude/openflow: Move union ofp_action away from headers.
Jarno Rajahalme [Wed, 16 Oct 2013 23:16:03 +0000 (16:16 -0700)]
include/openflow: Move union ofp_action away from headers.

union ofp_action cannot remain in the OF 1.0 header as it is expanded
to include actions from later versions.  Also, it is not part of the
protocol interface and will be easier to update where it is actually
used.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoovs-dpctl: Add a 'filter' option to match wildcarded 'dump-flows'.
Gurucharan Shetty [Sun, 13 Oct 2013 19:44:20 +0000 (12:44 -0700)]
ovs-dpctl: Add a 'filter' option to match wildcarded 'dump-flows'.

With mega-flows, many flows in the kernel datapath are wildcarded.
For someone that is debugging a system and wants to find a particular
flow and its actions, it is a little hard to zero-in on the flow
because some fields are wildcarded.

With the filter='$filter' option, we can now filter on the o/p
of 'ovs-dpctl dump-flows'.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agonx-match: Fix comments.
YAMAMOTO Takashi [Wed, 16 Oct 2013 08:26:19 +0000 (17:26 +0900)]
nx-match: Fix comments.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-util: Fix a comment.
YAMAMOTO Takashi [Wed, 16 Oct 2013 08:26:18 +0000 (17:26 +0900)]
ofp-util: Fix a comment.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-actions: Consistently use helper function.
YAMAMOTO Takashi [Wed, 16 Oct 2013 08:26:17 +0000 (17:26 +0900)]
ofp-actions: Consistently use helper function.

No functional changes.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-parse: Fix padding parsing write-actions.
YAMAMOTO Takashi [Thu, 17 Oct 2013 15:51:23 +0000 (08:51 -0700)]
ofp-parse: Fix padding parsing write-actions.

For longer term, "nested" variants of some ofpact functions
which using ofpbuf->l3 might be desirable.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-actions: Fix some ofpbuf usage problems in write-actions code.
YAMAMOTO Takashi [Thu, 17 Oct 2013 15:51:23 +0000 (08:51 -0700)]
ofp-actions: Fix some ofpbuf usage problems in write-actions code.

This code kept a pointer to data that might have been reallocated.

For longer term, "nested" variants of some ofpact functions
which using ofpbuf->l3 might be desirable.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto-dpif-monitor: Use heap to order the mport wakeup time.
Alex Wang [Wed, 16 Oct 2013 03:32:34 +0000 (03:32 +0000)]
ofproto-dpif-monitor: Use heap to order the mport wakeup time.

Before this commit, each time ofproto-dpif-monitor thread wakes up,
all monitored ports will be iterated over.  This adds a huge overhead
to the monitor thread.  This commit uses a heap to order the wakeup
time of monitored ports.  So each time the monitor thread is waken up,
it will only iterate those monitored ports that have timed out.

This commit greatly increases the number of monitored interfaces
openvswitch could support.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agocfm: Add cfm_wake_time() function.
Alex Wang [Wed, 16 Oct 2013 03:32:33 +0000 (03:32 +0000)]
cfm: Add cfm_wake_time() function.

This commit adds a new function "cfm_wake_time()" that returns the
next wakeup time associated with the "struct cfm".

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agobfd: Add bfd_wake_time() function.
Alex Wang [Wed, 16 Oct 2013 03:32:32 +0000 (03:32 +0000)]
bfd: Add bfd_wake_time() function.

This commit adds a new function "bfd_wake_time()" that returns the
next wakeup time associated with the "struct bfd".

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoheap: Change type of "priority" in "struct heap".
Alex Wang [Wed, 16 Oct 2013 03:32:31 +0000 (03:32 +0000)]
heap: Change type of "priority" in "struct heap".

This commit changes the variable type of priority in "struct heap"
from uint32_t to uint64_t.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto-dpif-monitor: Run ofproto-dpif-monitor in a thread.
Alex Wang [Wed, 16 Oct 2013 03:32:30 +0000 (03:32 +0000)]
ofproto-dpif-monitor: Run ofproto-dpif-monitor in a thread.

This commit moves the ofproto-dpif-monitor module into a
dedicated thread.  This helps eliminate the burden of main
thread having to wake up very frequently for periodic
interface monitoring (bfd, cfm).  Thusly, this commit greatly
increases the number of bfd/cfm sessions that can be supported
by ovs.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agotests: Relax the requirement of bfd tests on timing.
Alex Wang [Wed, 16 Oct 2013 03:32:29 +0000 (03:32 +0000)]
tests: Relax the requirement of bfd tests on timing.

Before this commit, the bfd related tests check the change of
states with very strict timing requirement.  This makes the tests
fragile, especially when ofproto-dpif-monitor module is moved to
its own thread.

Thusly, this commit relaxes the requirement on timing, making the
tests more reliable.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agodatapath: fix vport-netdev unregister
Alexei Starovoitov [Wed, 16 Oct 2013 22:28:23 +0000 (15:28 -0700)]
datapath: fix vport-netdev unregister

The combination of two commits:
commit 8e4e1713e4
("openvswitch: Simplify datapath locking.")
commit 2537b4dd0a
("openvswitch:: link upper device for port devices")

introduced a bug where upper_dev wasn't unlinked upon
netdev_unregister notification

The following steps:

  modprobe openvswitch
  ovs-dpctl add-dp test
  ip tuntap add dev tap1 mode tap
  ovs-dpctl add-if test tap1
  ip tuntap del dev tap1 mode tap

are causing multiple warnings:

[   62.747557] gre: GRE over IPv4 demultiplexor driver
[   62.749579] openvswitch: Open vSwitch switching datapath
[   62.755087] device test entered promiscuous mode
[   62.765911] device tap1 entered promiscuous mode
[   62.766033] IPv6: ADDRCONF(NETDEV_UP): tap1: link is not ready
[   62.769017] ------------[ cut here ]------------
[   62.769022] WARNING: CPU: 1 PID: 3267 at net/core/dev.c:5501 rollback_registered_many+0x20f/0x240()
[   62.769023] Modules linked in: openvswitch gre vxlan ip_tunnel libcrc32c ip6table_filter ip6_tables ebtable_nat ebtables nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack xt_CHECKSUM iptable_mangle ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp llc vhost_net macvtap macvlan vhost kvm_intel kvm dm_crypt iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi hid_generic mxm_wmi eeepc_wmi asus_wmi sparse_keymap dm_multipath psmouse serio_raw usbhid hid parport_pc ppdev firewire_ohci lpc_ich firewire_core e1000e crc_itu_t binfmt_misc igb dca ptp pps_core mac_hid wmi lp parport i2o_config i2o_block video
[   62.769051] CPU: 1 PID: 3267 Comm: ip Not tainted 3.12.0-rc3+ #60
[   62.769052] Hardware name: System manufacturer System Product Name/P8Z77 WS, BIOS 3007 07/26/2012
[   62.769053]  0000000000000009 ffff8807f25cbd28 ffffffff8175e575 0000000000000006
[   62.769055]  0000000000000000 ffff8807f25cbd68 ffffffff8105314c ffff8807f25cbd58
[   62.769057]  ffff8807f2634000 ffff8807f25cbdc8 ffff8807f25cbd88 ffff8807f25cbdc8
[   62.769059] Call Trace:
[   62.769062]  [<ffffffff8175e575>] dump_stack+0x55/0x76
[   62.769065]  [<ffffffff8105314c>] warn_slowpath_common+0x8c/0xc0
[   62.769067]  [<ffffffff8105319a>] warn_slowpath_null+0x1a/0x20
[   62.769069]  [<ffffffff8162a04f>] rollback_registered_many+0x20f/0x240
[   62.769071]  [<ffffffff8162a101>] rollback_registered+0x31/0x40
[   62.769073]  [<ffffffff8162a488>] unregister_netdevice_queue+0x58/0x90
[   62.769075]  [<ffffffff8154f900>] __tun_detach+0x140/0x340
[   62.769077]  [<ffffffff8154fb36>] tun_chr_close+0x36/0x60
[   62.769080]  [<ffffffff811bddaf>] __fput+0xff/0x260
[   62.769082]  [<ffffffff811bdf5e>] ____fput+0xe/0x10
[   62.769084]  [<ffffffff8107b515>] task_work_run+0xb5/0xe0
[   62.769087]  [<ffffffff810029b9>] do_notify_resume+0x59/0x80
[   62.769089]  [<ffffffff813a41fe>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[   62.769091]  [<ffffffff81770f5a>] int_signal+0x12/0x17
[   62.769093] ---[ end trace 838756c62e156ffb ]---
[   62.769481] ------------[ cut here ]------------
[   62.769485] WARNING: CPU: 1 PID: 92 at fs/sysfs/inode.c:325 sysfs_hash_and_remove+0xa9/0xb0()
[   62.769486] sysfs: can not remove 'master', no directory
[   62.769486] Modules linked in: openvswitch gre vxlan ip_tunnel libcrc32c ip6table_filter ip6_tables ebtable_nat ebtables nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack xt_CHECKSUM iptable_mangle ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp llc vhost_net macvtap macvlan vhost kvm_intel kvm dm_crypt iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi hid_generic mxm_wmi eeepc_wmi asus_wmi sparse_keymap dm_multipath psmouse serio_raw usbhid hid parport_pc ppdev firewire_ohci lpc_ich firewire_core e1000e crc_itu_t binfmt_misc igb dca ptp pps_core mac_hid wmi lp parport i2o_config i2o_block video
[   62.769514] CPU: 1 PID: 92 Comm: kworker/1:2 Tainted: G        W    3.12.0-rc3+ #60
[   62.769515] Hardware name: System manufacturer System Product Name/P8Z77 WS, BIOS 3007 07/26/2012
[   62.769518] Workqueue: events ovs_dp_notify_wq [openvswitch]
[   62.769519]  0000000000000009 ffff880807ad3ac8 ffffffff8175e575 0000000000000006
[   62.769521]  ffff880807ad3b18 ffff880807ad3b08 ffffffff8105314c ffff880807ad3b28
[   62.769523]  0000000000000000 ffffffff81a87a1f ffff8807f2634000 ffff880037038500
[   62.769525] Call Trace:
[   62.769528]  [<ffffffff8175e575>] dump_stack+0x55/0x76
[   62.769529]  [<ffffffff8105314c>] warn_slowpath_common+0x8c/0xc0
[   62.769531]  [<ffffffff81053236>] warn_slowpath_fmt+0x46/0x50
[   62.769533]  [<ffffffff8123e7e9>] sysfs_hash_and_remove+0xa9/0xb0
[   62.769535]  [<ffffffff81240e96>] sysfs_remove_link+0x26/0x30
[   62.769538]  [<ffffffff81631ef7>] __netdev_adjacent_dev_remove+0xf7/0x150
[   62.769540]  [<ffffffff81632037>] __netdev_adjacent_dev_unlink_lists+0x27/0x50
[   62.769542]  [<ffffffff8163213a>] __netdev_adjacent_dev_unlink_neighbour+0x3a/0x50
[   62.769544]  [<ffffffff8163218d>] netdev_upper_dev_unlink+0x3d/0x140
[   62.769548]  [<ffffffffa033c2db>] netdev_destroy+0x4b/0x80 [openvswitch]
[   62.769550]  [<ffffffffa033b696>] ovs_vport_del+0x46/0x60 [openvswitch]
[   62.769552]  [<ffffffffa0335314>] ovs_dp_detach_port+0x44/0x60 [openvswitch]
[   62.769555]  [<ffffffffa0336574>] ovs_dp_notify_wq+0xb4/0x150 [openvswitch]
[   62.769557]  [<ffffffff81075c28>] process_one_work+0x1d8/0x6a0
[   62.769559]  [<ffffffff81075bc8>] ? process_one_work+0x178/0x6a0
[   62.769562]  [<ffffffff8107659b>] worker_thread+0x11b/0x370
[   62.769564]  [<ffffffff81076480>] ? rescuer_thread+0x350/0x350
[   62.769566]  [<ffffffff8107f44a>] kthread+0xea/0xf0
[   62.769568]  [<ffffffff8107f360>] ? flush_kthread_worker+0x150/0x150
[   62.769570]  [<ffffffff81770bac>] ret_from_fork+0x7c/0xb0
[   62.769572]  [<ffffffff8107f360>] ? flush_kthread_worker+0x150/0x150
[   62.769573] ---[ end trace 838756c62e156ffc ]---
[   62.769574] ------------[ cut here ]------------
[   62.769576] WARNING: CPU: 1 PID: 92 at fs/sysfs/inode.c:325 sysfs_hash_and_remove+0xa9/0xb0()
[   62.769577] sysfs: can not remove 'upper_test', no directory
[   62.769577] Modules linked in: openvswitch gre vxlan ip_tunnel libcrc32c ip6table_filter ip6_tables ebtable_nat ebtables nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack xt_CHECKSUM iptable_mangle ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp llc vhost_net macvtap macvlan vhost kvm_intel kvm dm_crypt iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi hid_generic mxm_wmi eeepc_wmi asus_wmi sparse_keymap dm_multipath psmouse serio_raw usbhid hid parport_pc ppdev firewire_ohci lpc_ich firewire_core e1000e crc_itu_t binfmt_misc igb dca ptp pps_core mac_hid wmi lp parport i2o_config i2o_block video
[   62.769603] CPU: 1 PID: 92 Comm: kworker/1:2 Tainted: G        W    3.12.0-rc3+ #60
[   62.769604] Hardware name: System manufacturer System Product Name/P8Z77 WS, BIOS 3007 07/26/2012
[   62.769606] Workqueue: events ovs_dp_notify_wq [openvswitch]
[   62.769607]  0000000000000009 ffff880807ad3ac8 ffffffff8175e575 0000000000000006
[   62.769609]  ffff880807ad3b18 ffff880807ad3b08 ffffffff8105314c ffff880807ad3b58
[   62.769611]  0000000000000000 ffff880807ad3bd9 ffff8807f2634000 ffff880037038500
[   62.769613] Call Trace:
[   62.769615]  [<ffffffff8175e575>] dump_stack+0x55/0x76
[   62.769617]  [<ffffffff8105314c>] warn_slowpath_common+0x8c/0xc0
[   62.769619]  [<ffffffff81053236>] warn_slowpath_fmt+0x46/0x50
[   62.769621]  [<ffffffff8123e7e9>] sysfs_hash_and_remove+0xa9/0xb0
[   62.769622]  [<ffffffff81240e96>] sysfs_remove_link+0x26/0x30
[   62.769624]  [<ffffffff81631f22>] __netdev_adjacent_dev_remove+0x122/0x150
[   62.769627]  [<ffffffff81632037>] __netdev_adjacent_dev_unlink_lists+0x27/0x50
[   62.769629]  [<ffffffff8163213a>] __netdev_adjacent_dev_unlink_neighbour+0x3a/0x50
[   62.769631]  [<ffffffff8163218d>] netdev_upper_dev_unlink+0x3d/0x140
[   62.769633]  [<ffffffffa033c2db>] netdev_destroy+0x4b/0x80 [openvswitch]
[   62.769636]  [<ffffffffa033b696>] ovs_vport_del+0x46/0x60 [openvswitch]
[   62.769638]  [<ffffffffa0335314>] ovs_dp_detach_port+0x44/0x60 [openvswitch]
[   62.769640]  [<ffffffffa0336574>] ovs_dp_notify_wq+0xb4/0x150 [openvswitch]
[   62.769642]  [<ffffffff81075c28>] process_one_work+0x1d8/0x6a0
[   62.769644]  [<ffffffff81075bc8>] ? process_one_work+0x178/0x6a0
[   62.769646]  [<ffffffff8107659b>] worker_thread+0x11b/0x370
[   62.769648]  [<ffffffff81076480>] ? rescuer_thread+0x350/0x350
[   62.769650]  [<ffffffff8107f44a>] kthread+0xea/0xf0
[   62.769652]  [<ffffffff8107f360>] ? flush_kthread_worker+0x150/0x150
[   62.769654]  [<ffffffff81770bac>] ret_from_fork+0x7c/0xb0
[   62.769656]  [<ffffffff8107f360>] ? flush_kthread_worker+0x150/0x150
[   62.769657] ---[ end trace 838756c62e156ffd ]---
[   62.769724] device tap1 left promiscuous mode

This patch also affects moving devices between net namespaces.

OVS used to ignore netns move notifications which caused problems.
Like:
  ovs-dpctl add-if test tap1
  ip link set tap1 netns 3512
and then removing tap1 inside the namespace will cause hang on missing dev_put.

With this patch OVS will detach dev upon receiving netns move event.

Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agooftest: Update default controller port number to match recent OFTest.
Ben Pfaff [Wed, 16 Oct 2013 16:28:47 +0000 (09:28 -0700)]
oftest: Update default controller port number to match recent OFTest.

Also, document how to work around it if you use an older OFTest.

Reported-by: Simon Horman <horms@verge.net.au>
Reported-by: Lori Jakab <lojakab@cisco.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto: Re-use port numbers of ports that were deleted an hour ago.
Gurucharan Shetty [Mon, 14 Oct 2013 20:36:41 +0000 (13:36 -0700)]
ofproto: Re-use port numbers of ports that were deleted an hour ago.

We have a least recently used algorithm for assigning ofport values
to newly created ports. i.e., when we don't have any unused ofport
numbers, we use ofport numbers from the oldest deleted port.
What this means is that after using ~65000 previously unused ofport
numbers, we will have to go through all of the possible ports
to see which one was least recently used. This will eventually
slow down ofport allocation.

With this commit, any port that was deleted more than an hour ago is
considered never to have been used. So it's ofport number becomes
free to be used.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agoovs-dpctl-top: in_port field is now the default view
Mark Hamilton [Tue, 8 Oct 2013 20:46:53 +0000 (13:46 -0700)]
ovs-dpctl-top: in_port field is now the default view

This facilitates adding filtering since limiting output based on the in_port
is a natural first step.

Script mode was not changed allowing output to be piped through grep to
filter content.

Signed-off-by: Mark Hamilton <mhamilton@nicira.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agonetdev-dummy: Count rx packets regardless of source
Simon Horman [Wed, 16 Oct 2013 10:17:01 +0000 (19:17 +0900)]
netdev-dummy: Count rx packets regardless of source

This alters the way rx packets are accounted for by
counting them when they are processed by netdev_dummy_rx_recv(),
which seems to be a common path used by all received packets.

Previously accounting was done earlier, in netdev_dummy_receive(),
however this does not appear to count packets that are received via
a socket.

This resolves packet counting errors reported by the following
OFtest tests:

port_stats.MultiFlowStats
port_stats.SingleFlowStats
pktact.WildcardPriorityWithDelete
pktact.WildcardPriority

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoOPENFLOW-1.1+: note on table-miss
YAMAMOTO Takashi [Tue, 15 Oct 2013 08:12:22 +0000 (17:12 +0900)]
OPENFLOW-1.1+: note on table-miss

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoAnnounce that ovs-vswitchd is now multi-threaded.
Justin Pettit [Tue, 15 Oct 2013 22:36:40 +0000 (15:36 -0700)]
Announce that ovs-vswitchd is now multi-threaded.

Might be worth mentioning the biggest change in 2.0.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agoconnmgr: Always send full packet in packet_in when not buffering.
YAMAMOTO Takashi [Tue, 15 Oct 2013 08:08:30 +0000 (17:08 +0900)]
connmgr: Always send full packet in packet_in when not buffering.

According to the specs, if a packet is not buffered for some reasons,
we should send the entire packet, regardless of max_len.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoSet datapath mask bits when setting a flow field.
Jarno Rajahalme [Tue, 15 Oct 2013 19:40:38 +0000 (12:40 -0700)]
Set datapath mask bits when setting a flow field.

Since at the datapath interface we do not have set actions for
individual fields, but larger sets of fields for a given protocol
layer, the set action will in practice only ever apply to exactly
matched flows for the given protocol layer.  For example, if the
reg_load changes the IP TTL, the corresponding datapath action will
rewrite also the IP addresses and TOS byte.  Since these other field
values may not be explicitly set, they depend on the incoming flow field
values, and are hence all of them are set in the wildcards masks, when
the action is committed to the datapath.  For the rare case, where the
reg_load action does not actually change the value, and no other flow
field values are set (or loaded), the datapath action is skipped, and
no mask bits are set.  Such a datapath flow should, however, be
dependent on the specific field value, so the corresponding wildcard
mask bits must be set, lest the datapath flow be applied to packets
containing some other value in the field and the field value remain
unchanged regardless of the incoming value.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agometa-flow: Add mf_mask_field_and_prereqs().
Jarno Rajahalme [Tue, 15 Oct 2013 19:40:37 +0000 (12:40 -0700)]
meta-flow: Add mf_mask_field_and_prereqs().

Sets mask bits for the given field and its prerequisite fields.
Needed for unwildcarding the proper bits from datapath masks.
Removed old prototype for mf_force_prereqs().

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoSet release date for 2.0.0.
Justin Pettit [Tue, 15 Oct 2013 22:04:20 +0000 (15:04 -0700)]
Set release date for 2.0.0.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agovxlan: Optimize vxlan rcv
Pravin B Shelar [Fri, 11 Oct 2013 19:40:13 +0000 (12:40 -0700)]
vxlan: Optimize vxlan rcv

vxlan-udp-recv function lookup vxlan_sock struct on every packet
recv by using udp-port number. we can use sk->sk_user_data to
store vxlan_sock and avoid lookup.

This commit also allows us to get rid of socket hash table.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agotests: fix failure when $PKIDIR contains uuid-like string
YAMAMOTO Takashi [Tue, 15 Oct 2013 14:38:06 +0000 (23:38 +0900)]
tests: fix failure when $PKIDIR contains uuid-like string

this fixes a test failure with my working directory:
    /disks/ea6a5743-ad5f-11e2-9410-08606e7f74e7/git/openvswitch

stop filtering uuid as it's unnecessary for this specific test case.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>