Shu Shen [Thu, 13 Nov 2014 00:29:59 +0000 (16:29 -0800)]
openflow: Add OpenFlow 1.4 packet-in reasons.
Signed-off-by: Shu Shen <shu.shen@radisys.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Thomas Graf [Thu, 13 Nov 2014 11:28:45 +0000 (12:28 +0100)]
rhel: Include pkgconfig and update header install in Fedora/RHEL spec.
As headers are installed by 'make install' now, the explicit install
instructions can be be removed from the spec file.
The spec file has been including <config.h> plus all headers in lib/ so
far which is dangerous:
* config.h is a description of the capabilities of the build machine
where the package was built. Although it may hint on what is
included in the library, the defines do not necessarily hold true on
another build machine.
* Some headers in lib/ do not contain proper prefixes and pollute the
global header name space. Do not include them anymore. Properly
cleaned up headers will be exposed in openvswitch/ and openflow/
For the RHEL spec, both pkgconfig and headers are omitted as no -devel
package exists yet.
Cc: Flavio Leitner <fbl@redhat.com>
Suggested-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Thomas Graf [Thu, 13 Nov 2014 11:28:44 +0000 (12:28 +0100)]
lib: Add support for pkgconfig for libsflow.
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Thomas Graf [Thu, 13 Nov 2014 11:28:43 +0000 (12:28 +0100)]
lib: Add support for pkgconfig for libovsdb.
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Thomas Graf [Thu, 13 Nov 2014 11:28:42 +0000 (12:28 +0100)]
lib: Add support for pkgconfig for libofproto.
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Rob Adams [Thu, 13 Nov 2014 11:28:41 +0000 (12:28 +0100)]
lib: Add support for pkgconfig for libopenvswitch.
Add rule to generate pkgconfig .pc file from configure.
Install pkg-config file to $(libdir)/pkgconfig
Signed-off-by: Rob Adams <readams@readams.net>
Acked-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Thomas Graf [Thu, 13 Nov 2014 11:28:40 +0000 (12:28 +0100)]
include: Install openflow/ and openvswitch/ headers.
Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Alex Wang [Fri, 7 Nov 2014 21:27:05 +0000 (13:27 -0800)]
dpif-netdev: Allow direct destroy of 'struct dp_netdev_port'.
Before this commit, when 'struct dp_netdev_port' is deleted from
'dpif-netdev' datapath, if there is pmd thread, the pmd thread
will release the last reference to the port and ovs-rcu postpone
the destroy. However, the delayed close of object like 'struct
netdev' could cause failure in immediate re-add or reconfigure of
the same device.
To fix the above issue, this commit uses condition variable and
makes the main thread wait for pmd thread to release the reference
when deleting port. Then, the main thread can directly destroy the
port.
Reported-by: Cian Ferriter <cian.ferriter@intel.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Alex Wang [Fri, 7 Nov 2014 21:02:05 +0000 (13:02 -0800)]
ofproto-dpif-xlate: Allow direct destroy of previous config.
Before this commit, the ofproto-dpif-xlate module uses ovs-rcu to
postpone the destroy of previous configuration. However, the delayed
close of object like 'struct netdev' could cause failure in immediate
re-add or reconfigure of the same device.
To fix the above issue, this commit makes the ofproto-dpif-xlate
module call ovsrcu_synchronize(), which waits for all threads
to finish the use of reference to previous config. Then, the
module can just directly destroy the previous config.
Reported-by: Cian Ferriter <cian.ferriter@intel.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Alex Wang [Sat, 8 Nov 2014 01:11:07 +0000 (17:11 -0800)]
dpif-netdev: Move 'struct dp_netdev_port' initialization before use.
There is a portion of the 'struct dp_netdev_port' initialization
that is placed after the reload of pmd threads. This means in
theory, there could be a race where pmd threads access half-
initialized struct. Although such race has not been seen, it
makes sense to fully initialize the struct before use.
Found by code inspection.
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Jarno Rajahalme [Wed, 12 Nov 2014 23:22:35 +0000 (15:22 -0800)]
classifier: Integrate insert_rule() into classifier_replace().
insert_rule() only had one caller and this makes the code easier to
understand.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Jarno Rajahalme [Wed, 12 Nov 2014 23:22:35 +0000 (15:22 -0800)]
tests: Fix ovs-ofctl rule with importance test case.
Sort the flow dump results to always have them in consistent order.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Pravin B Shelar [Tue, 11 Nov 2014 19:53:47 +0000 (11:53 -0800)]
openvswitch: Userspace tunneling.
Following patch adds support for userspace tunneling. Tunneling
needs three more component first is routing table which is configured by
caching kernel routes and second is ARP cache which build automatically
by snooping arp. And third is tunnel protocol table which list all
listening protocols which is populated by vswitchd as tunnel ports
are added. GRE and VXLAN protocol support is added in this patch.
Tunneling works as follows:
On packet receive vswitchd check if this packet is targeted to tunnel
port. If it is then vswitchd inserts tunnel pop action which pops
header and sends packet to tunnel port.
On packet xmit rather than generating Set tunnel action it generate
tunnel push action which has tunnel header data. datapath can use
tunnel-push action data to generate header for each packet and
forward this packet to output port. Since tunnel-push action
contains most of packet header vswitchd needs to lookup routing
table and arp table to build this action.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Wed, 12 Nov 2014 00:42:24 +0000 (16:42 -0800)]
Fix misspellings of "OpenFlow".
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Flavio Leitner <fbl@redhat.com>
Pravin B Shelar [Mon, 10 Nov 2014 20:46:11 +0000 (12:46 -0800)]
util: Introduce ovs_scan_len()
This is similar to ovs_scan but takes int pointer as extra
parameter, this pointer point to starting index of the string.
On successful scan this API stores number of characters
scanned. This API is useful for parsing complex odp actions
e.g. tun_push action.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Pravin B Shelar [Mon, 10 Nov 2014 20:45:57 +0000 (12:45 -0800)]
tunnel: Convert rwlock to fat-rwlock.
Tunnel lookup is done in slow path but DPDK tunneling
slow path is called in PMD context. Therefore it is
better to convert rwlock to fat rwlock.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Amit Bose [Wed, 12 Nov 2014 14:06:08 +0000 (15:06 +0100)]
lib: Avoid using C++ keywords as variable names in header files.
Otherwise C++ programs can't #include the headers.
Signed-off-by: Amit Bose <bose@noironetworks.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Thomas Graf [Wed, 12 Nov 2014 14:06:02 +0000 (15:06 +0100)]
include: Use #include <.*> in public headers.
Required to make the headers installable.
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Thomas Graf [Wed, 12 Nov 2014 14:06:00 +0000 (15:06 +0100)]
lib: Document --enable-shared configure switch
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Thomas Graf [Wed, 12 Nov 2014 14:05:59 +0000 (15:05 +0100)]
lib: Correctly pass collected AM_LDFLAGS to linker
AM_LDFLAGS is not automatically passed to individual library LDFLAGS
and must be passed in explicitly.
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Wed, 12 Nov 2014 06:24:12 +0000 (15:24 +0900)]
ofp-parse: Parse bucket commands of group mod.
(Draft) OpenFlow 1.5 adds bucket commands to group mod.
This patch allows parsing of them as a step towards supporting them.
ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Wed, 12 Nov 2014 06:24:10 +0000 (15:24 +0900)]
ofp-util: Provide bucket list helper functions
This is in preparation for supporting the bucket commands of
(draft) Open Flow 1.5 group mod messages.
Also document ofputil_bucket_check_duplicate_id() for good measure.
ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Wed, 12 Nov 2014 06:24:09 +0000 (15:24 +0900)]
ofp-util: Enhance error logging during encoding group mod messages.
In preparation for supporting (draft) OpenFlow 1.5
group mod commands enhance the error logging of them.
ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Wed, 12 Nov 2014 06:24:08 +0000 (15:24 +0900)]
ofp-util: Do not allow buckets for OFPGC15_REMOVE_BUCKET.
ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Gurucharan Shetty [Wed, 12 Nov 2014 15:23:00 +0000 (07:23 -0800)]
tests: Skip a sflow test for Windows.
AT_XFAIL_IF cannot be used here because it lets the tests
run first and then say that the failure is expected. In this
particular test, the utilities simply hang blocking all
other tests. So use AT_SKIP_IF instead.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Gurucharan Shetty [Wed, 12 Nov 2014 14:56:10 +0000 (06:56 -0800)]
INSTALL.Windows: Add a TODO for QOS.
Also, remove the entry that talks about the need for atomic support
on Windows as that has already been added.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Simon Horman [Wed, 12 Nov 2014 06:45:17 +0000 (15:45 +0900)]
ofproto: Test that group commands fail for OpenFlow 1.0
Groups are not supported by OpenFlow 1.0
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Eitan Eliahu [Wed, 12 Nov 2014 09:31:27 +0000 (01:31 -0800)]
datapath-windows: Update port property.
Update Hyper-V port properties on NDIS property port set callback.
Driver update the port friendly name in its internal table.
Since the NIC Create callback won't be called after we need to maintain the
NIC and THE OVS states of the Vport.
Setting a new friendly name was tested in the following states:
[1] The port is disconnected
[2] The port is connected but not OVS user mode counter port
[3] The port is connected and an OCS port associated with it
Signed-off-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Alin Serdean [Tue, 11 Nov 2014 18:45:32 +0000 (18:45 +0000)]
datapath-windows: Add functionality to return OVSPortName given a VM
This commit adds functionality to return the ElementName of all the VNIC of a
given virtual machine name.
The function returns all the allocated ports including the ones which the OVS
port name was not set.
The default OVS port name that is set is the following:
"ElementName : Dynamic Ethernet Switch Port".
Example of usage:
Import-Module OVS.psm1
Get-VMNetworkAdapterWithOvsPort test_ubuntu_1
$a = Get-VMNetworkAdapterWithOvsPort test_2_1
$a | findstr ElementName
Requested-by: Nithin Raju <nithin@vmware.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/51
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Tested-by: Nithin Raju <nithin@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Thomas Graf [Wed, 12 Nov 2014 09:22:02 +0000 (10:22 +0100)]
travis: Add building of shared library to CI matrix.
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Scott Mann [Sat, 8 Nov 2014 03:02:09 +0000 (19:02 -0800)]
Build: Add support for shared libraries and versioning.
These changes allow for the building of shared libraries by providing
the --enable-shared option to configure. In particular, lib/libopenvwitch.so,
lib/libsflow.so, ofproto/libofproto.so, and ovsdb/libovsdb.so will be built.
Original behavior of building static remains the same.
Additionally, versioning is introduced to each of the libraries objects
paving the way for APIs to be built around them. A detailed comment
outlining the rules for changing a version number is provided in
configure.ac. Note that at this time, the version number is set to
1.0.0, no API is specified yet, and there are no requirements to
maintain any sort of compatibility in any of the libraries.
Signed-off-by: Scott Mann <smann@noironetworks.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Tue, 11 Nov 2014 23:50:51 +0000 (15:50 -0800)]
util: Add be32_prefix_mask().
Shifting a 32-bit entity by 32 bits is undefined behavior. As we have 3
cases where we may hit this, it is a time to introduce a helper for
this.
VMware-BZ: #
1355026
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Ben Pfaff [Tue, 11 Nov 2014 16:19:27 +0000 (08:19 -0800)]
ovs-atomic: Prefer Clang intrinsics over <stdatomic.h>.
On my Debian "jessie" system, <stdatomic.h> provided by GCC 4.9 is busted
when Clang 3.5 tries to use it. Even a trivial program like this:
#include <stdatomic.h>
void
foo(void)
{
_Atomic(int) x;
atomic_fetch_add(&x, 1);
}
yields:
atomic.c:7:5: error: address argument to atomic operation must be a
pointer to integer or pointer ('_Atomic(int) *' invalid)
The Clang-specific version of ovs-atomic.h stills works, though, so this
commit works around the problem.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Neil McKee [Fri, 27 Jun 2014 18:19:59 +0000 (11:19 -0700)]
sflow: Export LAG, PORTNAME, and OPENFLOWPORT information also.
Export standard sFlow LAG, PORTNAME and OPENFLOWPORT structures with each
counter-sample. Add unit-test for sFlow-LAG. Adjust other unit-tests to
accommodate these new annotations.
The sFlow-LAG structures are important for topology discovery, for
troubleshooting LAG instability, and for correctly combining
sFlow feeds from multiple sources.
The OPENFLOWPORT and PORTNAME structures are important for systems that
aim to combine sFlow monitoring with OpenFlow controls, as they
provide straightforward mapping (1) between sFlow agent IP and OpenFlow
datapath-id, and (2) between interface name,ifIndex and OpenFlow
port number.
Signed-off-by: Neil McKee <neil.mckee@inmon.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Tue, 11 Nov 2014 03:39:24 +0000 (12:39 +0900)]
ofproto: Add OpenFlow 1.5 group tests.
This motivation for this change is to exercise
(draft) OpenFlow 1.5 group messages.
ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Tue, 11 Nov 2014 03:39:23 +0000 (12:39 +0900)]
ofproto: Add OpenFlow 1.3 group stats test.
This is to exercise OpenFlow 1.3 group stats replies
messages which include a duration.
ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Tue, 11 Nov 2014 03:39:22 +0000 (12:39 +0900)]
ofp-parse: Parse (draft) OpenFlow 1.5 bucket ids.
This is part of support for (draft) OpenFlow 1.5 flow mod messages.
This adds support for specifying the bucket_id of buckets of groups in
ovs-ofctl and documents that accordingly.
ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
[blp@nicira.com tweaked the documentation]
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Tue, 11 Nov 2014 03:39:21 +0000 (12:39 +0900)]
ofp-print: Support printing of (draft) OpenFlow 1.5 group messages with bucket actions
ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Tue, 11 Nov 2014 03:39:20 +0000 (12:39 +0900)]
ofp-print: Print bucket ids of OpenFlow 1.5 group messages.
ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
[blp@nicira.com changed ofp_print_bucket_id()]
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Tue, 11 Nov 2014 03:39:19 +0000 (12:39 +0900)]
ofp-util: Encoding and decoding of (draft) OpenFlow 1.5 group messages.
This provides the bulk of the ofproto side of support for
OpenFlow 1.5 group messages. It provides for encoding and decoding
of updated group mod and group desc reply messages. This includes
a new bucket format and their properties.
Open Flow 1.5 Groups also have properties but as no non-experimenter
properties are defined this patch does not provide parsing or encoding
of group properties.
ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
[blp@nicira.com fixed minor bugs and style issues]
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Tue, 11 Nov 2014 03:39:18 +0000 (12:39 +0900)]
openflow: Add types for (draft) OpenFlow 1.5 group mod.
ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Thomas Graf [Tue, 11 Nov 2014 13:51:46 +0000 (14:51 +0100)]
travis: Enable -Wsparse-error and fail on new sparse warnings
A new option -Wsparse-error has been introduced to sparse in the
commits:
4d8811 sparse: Make -Werror turn warnigns into errors
fe57af rename -Werror to -Wsparse-error
which makes sparse fail on warnings. Start using the sparse git tree
for verification and make use of the new flag.
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Tue, 11 Nov 2014 04:27:26 +0000 (20:27 -0800)]
tests: Avoid nonportable use of bash-specific {a..b..c} construct.
Reported-by: Alex Wang <alexw@nicira.com>
Reported-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Simon Horman [Tue, 11 Nov 2014 03:39:17 +0000 (12:39 +0900)]
ofp-errors: Add (draft) OpenFlow 1.5 group mod errors.
Add OFPERR_OFPGMFC_UNKNOWN_BUCKET and OFPERR_OFPGMFC_BUCKET_EXISTS
which are part of (draft) OpenFlow 1.5 groups.
ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
YAMAMOTO Takashi [Mon, 10 Nov 2014 07:31:47 +0000 (16:31 +0900)]
ovs-router: Fix build on NetBSD
Split the linux-specific part of ovs-router.h
into ovs-router-linux.h.
The breakage was introduced by
commit
d9b4ebc5d15202bedad06969353435a4c1951c71
("route-table: Use classifier to store routing table.")
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Tue, 11 Nov 2014 01:39:25 +0000 (17:39 -0800)]
AUTHORS: Add Shu Shen.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Shu Shen [Tue, 11 Nov 2014 00:35:08 +0000 (16:35 -0800)]
ofproto: Fix supported group types.
Previously the types field is uninited and leds to no supported type
being reported in OFPMP_GROUP_FEATURES message.
Signed-off-by: Shu Shen <shu.shen@radisys.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Wed, 5 Nov 2014 18:10:13 +0000 (10:10 -0800)]
Fix setting transport ports with frags.
Packets with 'LATER' fragment do not have a transport header, so it is
not possible to either match on or set transport ports on such
packets. Matching is prevented by augmenting mf_are_prereqs_ok() with
a nw_frag 'LATER' bit check. Setting the transport headers on such
packets is prevented in three ways:
1. Flows with an explicit match on nw_frag, where the LATER bit is 1:
existing calls to the modified mf_are_prereqs_ok() prohibit using
transport header fields (port numbers) in OXM/NXM actions
(set_field, move). SET_TP_* actions need a new check on the LATER
bit.
2. Flows that wildcard the nw_frag LATER bit: At flow translation
time, add calls to mf_are_prereqs_ok() to make sure that we do not
use transport ports in flows that do not have them.
3. At action execution time, do not set transport ports, if the packet
does not have a full transport header. This ensures that we never
call the packet_set functions, that require a valid transport
header, with packets that do not have them. For example, if the
flow was created with a IPv6 first fragment that had the full TCP
header, but the next packet's first fragment is missing them.
3 alone would suffice for correct behavior, but 1 and 2 seem like a
right thing to do, anyway.
Currently, if we are setting port numbers, we will also match them,
due to us tracking the set fields with the same flow_wildcards as the
matched fields. Hence, if the incoming port number was not zero, the
flow would not match any packets with missing or truncated transport
headers. However, relying on no packets having zero port numbers
would not be very robust. Also, we may separate the tracking of set
and matched fields in the future, which would allow some flows that
blindly set port numbers to not match on them at all.
For TCP in case 3 we use ofpbuf_get_tcp_payload() that requires the
whole (potentially variable size) TCP header to be present. However,
when parsing a flow, we only require the fixed size portion of the TCP
header to be present, which would be enough to set the port numbers
and fix the TCP checksum.
Finally, we add tests testing the new behavior.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Wed, 5 Nov 2014 18:10:13 +0000 (10:10 -0800)]
miniflow_extract: Properly handle small IP packets.
Ethernet frames may contain padding after the IP payload. When
parsing IP packets, check the IP total size (IPv4) or IP payload size
(IPv6) to detect the size of l2 padding. The l2 padding size is
stored in the ofpbuf to prevent ofpbuf_pull from entering the padding,
as well as to allow ofpbuf_l4_size() to return the size of the IP
payload without the l2 padding.
This helps avoiding parsing truncated transport headers, for example.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Mon, 10 Nov 2014 21:14:29 +0000 (13:14 -0800)]
ofproto-dpif: Clean up table lookup code.
Keep knowledge about ofproto-dpif internal rules within ofproto-dpif.
This removes duplication of code (accross multiple files), and allows
making the ofproto-dpif-xlate interface a bit smaller.
'may_packet_in' was previously not honored for the
'LOOKUP_VERDICT_DEFAULT' case. Now it is, but this change did not
break any unit tests.
Also, previously in the 'LOOKUP_VERDICT_CONTROLLER' case packet-in
messages would have been generated when the in_port could not be found
('config' was set to zero in this case, causing 'OFPUTIL_PC_NO_PACKET_IN'
flag to be zero as well). This patch changes this behavior and never
issues packet-in messages when the in_port cannot be found. This did
not break any unit tests either.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Mon, 10 Nov 2014 21:14:29 +0000 (13:14 -0800)]
ofproto-dpif-xlate: Remove xbridge->frag.
It it no longer used, so better remove it.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Mon, 10 Nov 2014 21:14:29 +0000 (13:14 -0800)]
rule_dpif_lookup_from_table: Check frags only once.
Move the frags handling check up in the call chain, so that it is done
once for each rule_dpif_lookup_from_table() call.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Mon, 10 Nov 2014 04:47:58 +0000 (13:47 +0900)]
ofp-util: Refactor decoding of OpenFlow 1.1 group desc reply messages.
This refactoring is in preparation for supporting encoding
of (draft) OpenFlow 1.5 group mod messages.
ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Mon, 10 Nov 2014 04:47:57 +0000 (13:47 +0900)]
ofp-util: Refactor encoding of OpenFlow 1.1 group desc reply messages.
This refactoring is in preparation for supporting encoding
of (draft) OpenFlow 1.5 group mod messages.
ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Mon, 10 Nov 2014 04:47:56 +0000 (13:47 +0900)]
ofp-util: Refactor decoding of OpenFlow 1.1 group mod messages.
This refactoring is in preparation for supporting encoding
of (draft) OpenFlow 1.5 group mod messages.
ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Mon, 10 Nov 2014 04:47:55 +0000 (13:47 +0900)]
ofp-util: Rename OpenFlow 1.1 buckets decoder.
Rename ofputil_pull_buckets() as ofputil_pull_buckets11()
to denote that it decodes OpenFlow 1.1 buckets (also used in
OpenFlow 1.2 to 1.4).
This refactoring is in preparation for supporting decoding
of (draft) OpenFlow 1.5 group mod messages and their
buckets.
ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Mon, 10 Nov 2014 04:47:54 +0000 (13:47 +0900)]
ofp-util: Break out encoding of OpenFlow 1.1 group mod messages.
This refactoring is in preparation for supporting encoding
of (draft) OpenFlow 1.5 group mod messages.
ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Mon, 10 Nov 2014 04:47:53 +0000 (13:47 +0900)]
ofp-util: Provide helper to encode OpenFlow 1.1 group buckets.
The group bucket encoding code appears in two places
in almost identical form. Consolidate this into
a helper function.
The helper name includes ofp11 as later patches
will add an ofp15 version to support (draft) OpenFlow 1.5 buckets.
ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Rishi Bamba [Fri, 7 Nov 2014 12:48:48 +0000 (18:18 +0530)]
Add support for OpenFlow 1.4+ "importance" values.
This patch enables a user to set importance for a new rule via add-flow
OF1.4+ in the OVS and display the same via dump-flows command OF1.4+.
The changes are made in accordance with OpenFlow 1.4 specs to implement
eviction on the basis of "importance". This patch also enhances the
diff-flows & replace-flows CLI for addition of importance parameter in
a rule.
This doesn't actually implement eviction on the basis of importance, which
will happen in a later patch.
Signed-off-by: Rishi Bamba <rishi.bamba@tcs.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Mon, 10 Nov 2014 16:43:31 +0000 (08:43 -0800)]
id-pool: Fix memory leak.
This dates back to the previous location of the code in ofproto-dpif-rid.
I will backport.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Mon, 10 Nov 2014 04:47:49 +0000 (13:47 +0900)]
id-pool: Refactor id_pool_alloc_id to allow any 32 bit value to be an id
id_pool_alloc_id() was created by breaking out the recirculation
allocation code. As it is now a library call it makes sense to remove
the restriction that id 0 is reserved.
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Mon, 10 Nov 2014 04:47:48 +0000 (13:47 +0900)]
id-pool: Re-factor recirculation id allocator into standalone id pool.
Refactor the lock-free portion of the recirculation id allocator
into stand-alone id pool. This is in preparation for re-using
that portion to allocate bucket ids which are part of (draft)
OpenFlow 1.5 groups.
ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Pravin B Shelar [Sat, 8 Nov 2014 15:24:42 +0000 (07:24 -0800)]
datapath: fix coding style.
Kernel datapath code has diverged from upstream code. This
makes porting patches between these two code bases harder
than it needs to be. Following patch fixes this by fixing
coding style issues on this branch.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Pravin B Shelar [Sat, 8 Nov 2014 16:14:21 +0000 (08:14 -0800)]
datapath: Fix few mpls issues.
Found during MPLS upstreaming. Also sync-up MPLS header files
with upstream code.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Simon Horman [Sat, 8 Nov 2014 21:53:52 +0000 (13:53 -0800)]
datapath: Rename last_action() as nla_is_last() and move to netlink.h
The original motivation for this change was to allow the helper to be used
in files other than actions.c as part of work on an odp select group
action.
It was as pointed out by Thomas Graf that this helper would be best off
living in netlink.h. Furthermore, I think that the generic nature of this
helper means it is best off in netlink.h regardless of if it is used more
than one .c file or not. Thus, I would like it considered independent of
the work on an odp select group action.
Cc: Thomas Graf <tgraf@suug.ch>
Cc: Pravin Shelar <pshelar@nicira.com>
Cc: Andy Zhou <azhou@nicira.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Ankur Sharma [Wed, 5 Nov 2014 20:12:03 +0000 (12:12 -0800)]
datapath-windows: Remove a not needed debug message from Flow.c.
Signed-off-by: Ankur Sharma <ankursharma@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Mon, 3 Nov 2014 19:23:11 +0000 (11:23 -0800)]
classifier: Clean up destroy_subtable.
Add asserts to make sure the containers within are already empty.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Mon, 27 Oct 2014 17:57:28 +0000 (10:57 -0700)]
classifier: Constify fields.
Some struct cls_match and cls_subtable fields were already documented
of being const. Make them const and use CONST_CAST where appropriate
to initialize them.
This will help catch future errors modifying those fields after
initialization.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Mon, 3 Nov 2014 17:56:54 +0000 (09:56 -0800)]
classifier: Make classifier_find_rule_exactly() lockless.
struct cls_match 'list' member was recently changed to an rculist.
This allows classifier_find_rule_exactly() to be made lockless.
Since subtable's 'max_priority' member would still require a lock, we
no longer check it before calling find_equal(). This adds a hash
table lookup in cases where the subtable may already be known to not
contain any rule of the target priority.
classifier_find_rule_exactly() is never called on the fastpath, so
this should not be significant.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Thu, 6 Nov 2014 22:55:29 +0000 (14:55 -0800)]
classifier: Constify RCU pointers.
Returning const struct cls_rule pointers from the classifier API helps
callers to remember that they should not modify the rules returned.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:50:06 +0000 (16:50 -0200)]
rhel: Fix tunnel port ifup/ifdown failure.
The tunnel port is invisible to the OS, so there is
no reason to call OTHERSCRIPT in the ifup/ifdown scripts.
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:51 +0000 (16:45 -0200)]
fedora-spec: remove unneeded db initialization
The DB initialization is done by ovs-ctl script as well,
so remove the duplicated code from the spec.
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:50 +0000 (16:45 -0200)]
fedora-spec: added systemd post/postun/pre/preun sections
The systemd requires some actions when the package is
installed, upgraded or removed. This patch adds the
needed RPM sections with the missing systemd actions.
There is a change in behavior - the service is not enabled
or started by default.
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:49 +0000 (16:45 -0200)]
fedora-spec: move sysconfig template
Move the sysconfig template close to other systemd lines.
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:48 +0000 (16:45 -0200)]
fedora-spec: break long lines in %install
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:47 +0000 (16:45 -0200)]
fedora-spec: remove uneeded lines
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:46 +0000 (16:45 -0200)]
fedora-spec: use empty lines to split blocks in %install
Use empty lines to split blocks to improve readability.
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:45 +0000 (16:45 -0200)]
fedora-spec: set permission mode with 4 digits
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:44 +0000 (16:45 -0200)]
fedora-spec: fix indentation in %install section
Use spaces instead of tabs as the other lines
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:43 +0000 (16:45 -0200)]
fedora-spec: use RPM macros in %install section
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:42 +0000 (16:45 -0200)]
fedora-spec: do not replace logrotate cfg if modified
Don't overwrite if the logrotate configuration
file is modified.
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:41 +0000 (16:45 -0200)]
fedora-spec: convert missing man-pages to use macro
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:40 +0000 (16:45 -0200)]
fedora-spec: use macro for /usr/share
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:39 +0000 (16:45 -0200)]
fedora-spec: use macro for /usr/bin
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:38 +0000 (16:45 -0200)]
fedora-spec: use macro for /usr/sbin
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:37 +0000 (16:45 -0200)]
fedora-spec: break %doc long line
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:36 +0000 (16:45 -0200)]
fedora-spec: sort man-pages and use macros
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:35 +0000 (16:45 -0200)]
fedora-spec: the db and id must be owned
Both conf.db and system-id.conf needs to be owned, so
spec now list them in the %files section. However,
they are not shipped with the rpm (%ghost)
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:34 +0000 (16:45 -0200)]
fedora-spec: use default tarball dirs name
The default tarball directory follows the standard.
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:33 +0000 (16:45 -0200)]
fedora-spec: _smp_mflags macro must be conditional
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:32 +0000 (16:45 -0200)]
fedora-spec: obsolete controller subpackage
Once upon a time there was a controller subpackage
that was obsoleted
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:31 +0000 (16:45 -0200)]
fedora-spec: Enable PIE
Package guidelines request to enable PIE.
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:30 +0000 (16:45 -0200)]
fedora-spec: add openvswitch-devel subpackage
This provides static library, libopenswitch.a and the openvswitch
header files needed to build an external application in a separate
RPM package.
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:29 +0000 (16:45 -0200)]
fedora-spec: add openvswitch-test package
Put the utilities that are useful to diagnose performance
and connectivity issues in Open vSwitch setup into another
package since they are not needed in most cases.
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:28 +0000 (16:45 -0200)]
fedora-spec: add python-openvswitch subpackage
This creates a subpackage called python-openvswitch
providing python bidings for the Open vSwitch database.
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:27 +0000 (16:45 -0200)]
fedora-spec: use %configure macro
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:26 +0000 (16:45 -0200)]
fedora-spec: more simple description
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:25 +0000 (16:45 -0200)]
fedora-spec: added more requires
The minimum recommended kernel for fedora is
3.15.0-0 due to be the first one including the
upstream kernel commit below:
commit
4f647e0a3c37b8d5086214128614a136064110c3
Author: Flavio Leitner <fbl@redhat.com>
Date: Thu Mar 27 11:05:34 2014 -0300
openvswitch: fix a possible deadlock and lockdep warning
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:24 +0000 (16:45 -0200)]
fedora-spec: removed extra space
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 6 Nov 2014 18:45:23 +0000 (16:45 -0200)]
fedora-spec: Added buildrequires
This is needed to ensure all the packages are
installed on the system to be able to build
Open vSwitch.
This also permits to use yum-builddep(1) to
automatically install the dependencies on the
system.
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>