2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-29 21:38:13 +00:00

10798 Commits

Author SHA1 Message Date
Jesse Gross
11b8d04900 nx-match: Handle receiving variable length fields.
This adds support for receiving variable length fields encoded in
NXM/OXM and mapping them into OVS internal structures. In order
for this to make sense, we need to define some semantics:

There are three lengths that matter in this process: the maximum
size of the field (represented as the existing mf->n_bytes), the
size of the field in the incoming NXM (given by the length in the
NXM header), and the currently configured length of the field
(defined by the consumer of the field and outside the scope of
this patch).

Fields are modeled as being their maximum length and have the
characteristics expected by exsiting code (i.e. exact match fields
have masks that are all 1's for the whole field, etc.). Incoming
NXMs are stored in the field in the least significant bits. If
the NXM length is larger than the field, is is truncated, if it
is smaller it is zero-extended. When the field is consumed, the
component that needs data picks the configured length out of the
generated field.

In most cases, the configured and NXM lengths will be equal and
these edge cases do not matter. However, since we cannot easily
enforce that the lengths match (and might not even know what the
right length is, such as in the case of a string parsed by
ovs-ofctl), these semantics should provide deterministic results
that are easy to understand and not require most existing code
to be aware of variable length fields.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-06-25 11:08:57 -07:00
Jesse Gross
899bb63d41 nx-match: Support variable length header lookup.
Currently we treat the entire NXM/OXM header, including length,
as an ID to define a field. However, this does not allow for
multiple lengths of a particular field.

If a field has been marked as variable, we should ignore the length
when looking up the field and only use the class and field. We
continue to use the length for non-variable fields to ensure that
we don't accept something that can never match.

Signed-off-by: Jesse Gross <jesse@nicira.com>
2015-06-25 11:08:57 -07:00
Jesse Gross
f047e84689 metaflow: Allow fields to be marked as variable length.
Until now, all fields that OVS can match against have been fixed
size (variable length headers can be skipped during parsing but
the match is fixed). However, Geneve options can vary in size
so we must not require the size of these fields to be known
at compile time.

This allows data types to be annotated with not only their size
but whether the field can be smaller than that. The following
patches will change OpenFlow parsing based on that.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-06-25 11:08:57 -07:00
Jesse Gross
3ee6026aba bitmap: Convert single bitmap functions to 64-bit.
Currently the functions to set, clear, and iterate over bitmaps
only operate over 32 bit values. If we convert them to handle
64 bit bitmaps, they can be used in more places.

Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-06-25 11:08:31 -07:00
Ben Pfaff
099772c025 tests: Use taskkill if tskill is not available, on Windows.
This is not the minimal change; it "improves" the rest of the code as well.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
2015-06-25 10:45:05 -07:00
Sumit Garg
f5cd74291d python: Fix issue with probes for JSONRPC connections
When opening a JSONRPC connection, the health probes
are incorrectly getting turned off for connections
that need probes.

In other words, when stream_or_pstream_needs_probes()
return non-zero, the probes are gettting disabled as
the probe interval is getting set to zero. This leads
to incorrect behavior such that probes are:

  - not getting turned off for unix: connections
  - getting turned off for tcp:/ssl: connections

The changes in this commit fix this issue.

Signed-off-by: Sumit Garg <sumit@extremenetworks.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-06-25 08:54:01 -07:00
Sumit Garg
7a5568826f python: Fix writing to non-"alert" column for newly inserted row.
When 'alert' was turned off on a column, the code was erroring out when
value for that column was being set in a newly inserted row. This is
because the row._data was None at this time.

It seems that new rows are not initialized to defaults and that's why the
NULL error happens.  IMO a newly inserted row should automatically get
intialized to default values.  This new behavior can be implemented as a
separate improvement sometime in the future.

For now, I don't see an issue with adding the additional check. This new
check can continue as-is even after the new behavior is implemented.

Signed-off-by: Sumit Garg <sumit@extremenetworks.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-06-25 08:53:38 -07:00
Sumit Garg
9614403da9 python: Fix attempt to use a bool as a function.
A bool (has_lock) was being accessed as a function call leading to a
runtime exception.

Signed-off-by: Sumit Garg <sumit@extremenetworks.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-06-25 08:51:17 -07:00
Alin Serdean
3e2e758813 tests: Reduce user burden for running "make check".
With this commit, users do not have to manually add the pthread-win32
DLL directory to their PATH.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Co-authored-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-06-25 08:37:54 -07:00
Thadeu Lima de Souza Cascardo
c4bb1f8b6e ofproto-dpif: Fix coding style.
Identation was one extra level at ofproto_unixctl_mcast_snooping_show.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-06-24 17:37:14 -07:00
Russell Bryant
e9e8bcdf9a ovn: Add get/set-enabled to ovn-nbctl.
This patch adds support for getting and setting the 'enabled' column
for logical ports using ovn-nbctl.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-06-24 17:30:22 -07:00
Russell Bryant
95a9a275cc ovn: Add logical port 'enabled' state.
This patch adds a new column to the Logical_Port table of the
OVN_Northbound database called 'enabled'.  The purpose is to allow a
port to be administratively enabled or disabled.  It is sometimes
useful to keep a port and its related configuration, but temporarily
disable it, which means no traffic is allowed in or out of the port.

The implementation is fairly non-invasive as it only required minor
changes to the logical pipeline.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-06-24 17:27:06 -07:00
Ben Pfaff
99635791ad Makefiles: Move xml2nroff rule from ovn directory to top level.
Originally only the OVN documentation used the XML format, but now it's
used outside the ovn directory (initially for ovs-sim.1) so it's more
logical to have the xml->nroff rule at the top level.

Reported-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
2015-06-24 16:55:48 -07:00
Ben Pfaff
d5651b84e7 nx-match: Fix typo in comment.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2015-06-24 16:10:29 -07:00
Ben Pfaff
6016cd36bd nx-match: Fix distribution of hash function for NXM/OXM headers.
NXM/OXM headers as represented in this file are 64-bit long and the low
bits are essentially constant (almost always 0) so using hash_int(),
which takes an uint32_t, is going to be a useless hash function.  This
commit fixes the problem.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2015-06-24 11:24:06 -07:00
Sorin Vinturis
885648d972 datapath-windows: Wrong cleanup of newly created multiple NBLs
Bug found in OvsPartialCopyToMultipleNBLs function in the cleanup part of
the code. Before completing the current NBL (newNbl) the NEXT link for the
following NBL (firstNbl) was broken, instead of the current one (newNbl).

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/87
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-06-24 10:59:57 -07:00
Andy Zhou
a0cba5c2f1 ovsdb: Flush JSON cache only when necessary
Currently, JSON cache is always flushed whenever the monitor receives
a transaction. This patch improves the JSON cache efficiency by only
flush the JSON cache when a transaction causes client visible
changes, avoiding unnecessary flushes.

Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-06-23 17:07:07 -07:00
Andy Zhou
58de87cc8e ovsdb: Only update monitor when necessary
Some DB modification transactions won't affect the columns of a monitor.
Skip those updates.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-06-23 17:06:57 -07:00
Andy Zhou
23cbedb70b ovsdb: add ovsdb_monitor_row_update_type()
The logic of determining row update type will be useful in the following
patch. Make it into a function.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-06-23 17:05:20 -07:00
Sorin Vinturis
1c21873505 datapath-windows: Return success for already existing WFP objects
There are cases when the WFP callout or sublayer, being persistent
objects, already exists when we try to register the OVS callout. In
this cases, when trying to add again these WFP objects the return code
is STATUS_FWP_ALREADY_EXISTS, which we are interpreting as an error.
This is incorrect and this patch changes that.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/84
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-06-23 11:45:43 -07:00
Ben Pfaff
ab70cd3042 Makefiles: Stop distributing files because building them requires Python.
A long time ago, the Open vSwitch build did not depend on Python (whereas
the runtime did), so the "make dist" based distribution included the
results of Python build tools.  Later, the build began using Python,
but the distribution still included some of those results, because no one
had gone to the trouble of changing them.  This commit changes the
Makefiles not to distribute Python-generated files but instead to just
generate them at build time.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-06-23 11:08:52 -07:00
Ben Pfaff
e23812fc60 Increase prerequisite from Python 2.4 to Python 2.7.
This means that users of XenServer 6.5 and earlier will need to install
Python 2.7.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-06-23 11:08:52 -07:00
Ben Pfaff
7102846b86 nroff: Fix the escape of '.'.
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
2015-06-23 11:06:51 -07:00
Alex Wang
31d2b7c027 db-ctl-base: Improve show command.
This commit adds improvement to 'show' command logic and allows it
to print key->table_ref maps.  The direct effect can be observed
from the tests/vtep-ctl.at change.  The improvement will also be
used in the ovn-sbctl implementation.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-06-23 09:43:24 -07:00
Alex Wang
3935f67dbc vtep-ctl: Use db-ctl-base.
This commit makes vtep-ctl use db-ctl-base to avoid duplicate code.
As an addition, a 'show' command is added to vtep-ctl.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-06-23 09:43:24 -07:00
Alex Wang
f6a2e15619 db-ctl-base: Librarize database command manual.
This commit extracts the database command manual and puts it into
db-ctl-base.man.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-06-23 09:43:24 -07:00
Alex Wang
af046a16ec db-ctl-base: Librarize show command.
This commit extracts the 'show' command code and puts it into the
db-ctl-base module.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-06-23 09:43:24 -07:00
Alex Wang
51a73ff06e db-ctl-base: Librarize code in parse_options().
This commit extracts general code from parse_options() and puts it into
db-ctl-base module.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-06-23 09:43:24 -07:00
Alex Wang
07ff77ccb8 db-ctl-base: Make common database command code into library.
This commit extracts common database command (e.g. ovs-vsctl, vtep-ctl)
code into a new library module, db-ctl-base.  Specifically, the module
unifies the command syntax and common database-operating commands like
(get, list, find, set ...), and provides apis which allow user to create
more specific commands.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-06-23 09:43:23 -07:00
Alex Wang
29c3a9f5d8 ovs-vsctl: Simplify code.
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-06-23 09:43:23 -07:00
Gurucharan Shetty
2dd7d60c64 Add a few OVN files as part of DISTCLEANFILES.
Reported-by: Ian Stokes <ian.stokes@intel.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Tested-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
2015-06-23 09:37:26 -07:00
Alin Serdean
8164a70407 tests: Remove the windows service in case it failed to start
In case the ovsdb-server failed to start, the defined service was not
properly cleaned.

Add a run-if-false command in case the service failed to start.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2015-06-23 07:40:27 -07:00
Alin Serdean
2f2695a2ca bfd: Add OVS_VSWITCHD_STOP to bfd unit tests
On Windows the following tests hang unless we also call
the OVS_VSWITCHD_STOP macro to stop the executable.

Tested on Windows and Linux

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2015-06-23 07:36:54 -07:00
Ben Pfaff
0eb48fe138 ofproto-dpif-xlate: Add support for OpenFlow group chaining.
Requested-by: Vinllen Chen <cvinllen@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
2015-06-22 15:18:10 -07:00
Gurucharan Shetty
7da07bce32 tests: Adjust output of vconn for windows.
Recent tests added for openflow atomic bundle support
looks for Linux specific output in logs. Adjust them
so that tests pass in Windows too.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
2015-06-22 10:47:09 -07:00
Gurucharan Shetty
b00659934f ofproto.at: Don't specify the specific error.
On Windows, we don't do a good job of translating errors to Linux
type errors.  So in the tests, don't look for a specific type of
error.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
2015-06-22 10:31:21 -07:00
Gurucharan Shetty
4b131a01d8 rpms: Exclude OVN files from openvswitch packages.
Currently rhel rpm does not build because of OVN files. This
patch only fixes the build failures. We eventually may have
to add OVN packages for RHEL, Xenserver and Debian.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-06-22 10:26:11 -07:00
Alin Serdean
d54ac8032c utilities: Ignore generated files.
Add
utilities/ovs-sim
utilities/ovs-sim.1

Found by issuing make.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-06-19 19:48:37 -07:00
Sorin Vinturis
18b19ad911 datapath-windows: Initialize reference count when enabling extension
When the extension is initialized the global reference count, used for
preventing early deallocation of the switch extension, is set to 1.
Enabling and then disabling the extension leaves the latter reference
count to zero. Because of this the switch context fails to be acquired,
i.e OvsAcquireSwitchContext returns zero, and that affects driver's
communication to the userspace.

The solution is to initialize the reference count each time the extension
is enabled.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Nithin Raju <nithin@vmware.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/86
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2015-06-19 12:57:12 -07:00
Nithin Raju
0b623ad5a8 datapath-windows: use correct dst port during Vxlan Tx
A previous commit used the wrong DST port in the UDP header during Vxlan
Tx which caused Vxlan tunneling to break. Fixing it here..

Also included is a cosmetic fix in OvsDetectTunnelRxPkt() where we were
using htons() instead of ntohs(). Doesn't make a difference in practice
though.

One more change is, OvsIpHlprCbVxlan() has been nuked since it is not
used. Not sure if it is worth being resurrected.

Testing done: Ping across Vxlan tunnel and Stt tunnel.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Reported-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2015-06-19 12:57:07 -07:00
Justin Pettit
2d34dbd9e1 Merge remote-tracking branch 'origin/master' into ovn4 2015-06-18 22:02:55 -07:00
Jesse Gross
5262eea1b8 odp-util: Convert flow serialization parameters to a struct.
Serializing between userspace flows and netlink attributes currently
requires several additional parameters besides the flows themselves.
This will continue to grow in the future as well. This converts
the function arguments to a parameters struct, which makes the code
easier to read and allowing irrelevant arguments to be omitted.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
2015-06-18 16:42:48 -07:00
Justin Pettit
c4c7e593f5 Prepare for post-2.4.0 (2.4.90).
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2015-06-18 12:12:07 -07:00
Justin Pettit
e100e45310 Prepare for 2.4.0.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2015-06-18 12:11:20 -07:00
Sorin Vinturis
cc84898c4c datapath-windows: Return pending for IRPs completed later
Return STATUS_PENDING for IRPs that are completed later in another
thread.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/83
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-06-18 09:05:38 -07:00
Ben Pfaff
85bed1db2d AUTHORS: Add Thadeu Lima de Souza Cascardo.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-06-17 11:14:31 -07:00
Thadeu Lima de Souza Cascardo
e3102e42ef Add IGMPv3 support.
Support IGMPv3 messages with multiple records. Make sure all IGMPv3
messages go through slow path, since they may carry multiple multicast
addresses, unlike IGMPv2.

Tests done:

* multiple addresses in IGMPv3 report are inserted in mdb;
* address is removed from IGMPv3 if record is INCLUDE_MODE;
* reports sent on a burst with same flow all go to userspace;
* IGMPv3 reports go to mrouters, i.e., ports that have issued a query.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-06-17 11:09:33 -07:00
Thadeu Lima de Souza Cascardo
d29f137b65 ofproto-dpif-xlate: Make IGMP packets always take slow path.
IGMP packets need to take the slow path. Otherwise, packets that match
the same flow will not be processed by OVS. That might prevent OVS from
updating the expire time for entries already in the mdb, but also to
lose packets with different addresses in the payload.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-06-17 11:07:28 -07:00
Ben Pfaff
d7c3b1deb0 ovn: Remove completed items from TODO.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
2015-06-17 09:10:27 -07:00
Ben Pfaff
f303f87e0f lacp: Remove packed attribute from struct lacp_pdu.
The packed annotation doesn't do anything here because all of the members
in the structure are naturally aligned.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Acked-by: Ethan Jackson <ethan@nicira.com>
2015-06-17 09:09:25 -07:00