Jarno Rajahalme [Thu, 5 Jan 2017 00:10:56 +0000 (16:10 -0800)]
ofp-parse: Allow match field names in actions and brackets in matches.
Allow using match field names in addition to the canonical register
names in actions (including 'load', 'move', 'push', 'pop', 'output',
'multipath', 'bundle_load', and 'learn'). Allow also leaving out the
trailing '[]' to indicate full field. These changes allow simpler
syntax similar to 'set_field' to be used also elsewhere.
Correspondingly, allow the '[start..end]' syntax to be used in matches
in addition to the more explicit 'value/mask' notation. For example,
to match on the value 2 of the bits 14..15 of NXM_NX_REG0, the match
could include:
... reg0[14..15]=2 ...
instead of
... reg0=0x8000/0xc000 ...
Note that only contiguous masks can be specified with the bracket
notation.
Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
Enable operations (including "list") on DHCP_Options and DHCPv6_Options
tables via ovn-sbctl. These are currently the only OVN_Southbound
tables that ovn-sbctl does not support.
Example:
$ ovn-sbctl -f table list DHCPv6_Options
_uuid code name type
------------------------------------ ---- ------------- ------ 8646bb15-5e88-4432-a21a-4e22a2976482 23 dns_server "ipv6" 564e98e9-ee23-447b-a7c5-c36ca05059fa 24 domain_search str 8c6cb059-5bb5-4ef8-960b-f002c769589e 2 server_id mac 525e8fc6-7921-48eb-8bd3-fe5cb5dd0142 5 ia_addr "ipv6"
Signed-off-by: Lance Richardson <lrichard@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
There was a bug when using hacking with flake8 3.x. This bug has since
been resolved [1], meaning we no longer need to call out the need to use
the older version of flake8.
[1] https://review.openstack.org/#/c/335965/
Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Ben Pfaff <blp@ovn.org>
Alin Serdean [Wed, 28 Dec 2016 22:27:17 +0000 (22:27 +0000)]
ovs-thread: Avoid pthread_rwlockattr_t on Windows.
A recent commit fixed ovs_rwlock_init() to pass the pthread_rwlockattr_t
that it initialized to pthread_rwlock_init(). According to POSIX
documentation this is correct, but on Windows the current implementation of
pthreads does not support a pre-initialized attribute. Please see a fork
of the implementation
https://github.com/GerHobbelt/pthread-win32/blob/19fd5054b29af1b4e3b3278bfffbb6274c6c89f5/pthread_rwlock_init.c#L59-L63
This is the same implementation as the official version found under:
ftp://sourceware.org/pub/pthreads-win32/)
A short debug output from `vswitch` to confirm the above:
This patch is critical because the majority (over 800) of the unit tests
are failing.
Fixes: 1a15f390afd6 ("lib/ovs-thread: set prefer writer lock for ovs_rwlock_init()") Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Shashank Ram <rams@vmware.com>
[blp@ovn.org changed the details of the approach] Signed-off-by: Ben Pfaff <blp@ovn.org>
The recently published 'ovs' theme [1] copies the styling of the Open
vSwitch website. Start using this, with fallbacks for users who do not
have the package installed.
This extends support for building docs to users of Sphinx 1.2 as the
previous theme - bizstyle - was only available in 1.3+.
[1] https://pypi.python.org/pypi/ovs-sphinx-theme
Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Ben Pfaff <blp@ovn.org>
Sugesh Chandran [Mon, 2 Jan 2017 22:27:48 +0000 (14:27 -0800)]
netdev-dpdk: Enable Rx checksum offloading feature on DPDK physical ports.
Add Rx checksum offloading feature support on DPDK physical ports. By default,
the Rx checksum offloading is enabled if NIC supports. However,
the checksum offloading can be turned OFF either while adding a new DPDK
physical port to OVS or at runtime.
The rx checksum offloading can be turned off by setting the parameter to
'false'. For eg: To disable the rx checksum offloading when adding a port,
OR (to disable at run time after port is being added to OVS)
'ovs-vsctl set Interface dpdk0 options:rx-checksum-offload=false'
Similarly to turn ON rx checksum offloading at run time,
'ovs-vsctl set Interface dpdk0 options:rx-checksum-offload=true'
The Tx checksum offloading support is not implemented due to the following
reasons.
1) Checksum offloading and vectorization are mutually exclusive in DPDK poll
mode driver. Vector packet processing is turned OFF when checksum offloading
is enabled which causes significant performance drop at Tx side.
2) Normally, OVS generates checksum for tunnel packets in software at the
'tunnel push' operation, where the tunnel headers are created. However
enabling Tx checksum offloading involves,
*) Mark every packets for tx checksum offloading at 'tunnel_push' and
recirculate.
*) At the time of xmit, validate the same flag and instruct the NIC to do the
checksum calculation. In case NIC doesnt support Tx checksum offloading,
the checksum calculation has to be done in software before sending out the
packets.
No significant performance improvement noticed with Tx checksum offloading
due to the e overhead of additional validations + non vector packet processing.
In some test scenarios, it introduces performance drop too.
Rx checksum offloading still offers 8-9% of improvement on VxLAN tunneling
decapsulation even though the SSE vector Rx function is disabled in DPDK poll
mode driver.
Alin Balutoiu [Tue, 3 Jan 2017 20:10:53 +0000 (20:10 +0000)]
Python tests: Set CREATE_NO_WINDOW flag for Popen
On Windows if the flag CREATE_NO_WINDOW is not
specified when using subprocess.Popen, a new
window will appear with the new process.
The window is not necessary for the tests.
This patch addresses this issue by adding
the flag CREATE_NO_WINDOW for all subprocess.Popen
calls if the machine is running Windows.
Signed-off-by: Alin Balutoiu <abalutoiu@cloudbasesolutions.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions> Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Alin Balutoiu [Tue, 3 Jan 2017 20:10:52 +0000 (20:10 +0000)]
Python tests: Daemon ported to Windows
Instead of using os.fork (not supported on Windows),
subprocess.Popen is used and os.pipe was replaced
with Windows pipes.
To be able to identify the child process, an extra
parameter was added to daemon process '--pipe-handle'.
This parameter contains the parent Windows pipe handle
which is used by the child to notify the parent about
the startup.
The PID file is created directly on Windows, without
using a temporary file because the symbolic link does
not inherit the file lok set on the temporary file.
Alin Balutoiu [Tue, 3 Jan 2017 20:10:51 +0000 (20:10 +0000)]
Python tests: Ported UNIX sockets to Windows
Unix sockets (AF_UNIX) are not supported on Windows.
The replacement of Unix sockets on Windows is implemented
using named pipes, we are trying to mimic the behaviour
of unix sockets.
Instead of using Unix sockets to communicate
between components Named Pipes are used. This
makes the python sockets compatible with the
Named Pipe used in Windows applications.
Joe Stringer [Thu, 22 Dec 2016 18:58:26 +0000 (10:58 -0800)]
test-l7.py: Tidy up and python3-ify.
Haul test-l7.py into the 202nd decade by supporting python3.
TFTPY still doesn't support python3, so work around this by handling
import syntax errors so that even if tftpy is installed in a python3
environment, test-l7.py will not throw an exception while attempting to
load it.
Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
Alin Serdean [Thu, 29 Dec 2016 00:25:34 +0000 (00:25 +0000)]
datapath-windows: Conntrack disable type truncation warning
Compiling with the WDK 10 gave the following warning:
Warning C4311 'type cast': pointer truncation from 'POVS_CT_ENTRY' to 'UINT32'
ovsext (OVSExt\ovsext) Conntrack.c 1139
This patch disables the warning on the file Conntrack.c.
Guoshuai Li [Thu, 29 Dec 2016 15:47:58 +0000 (23:47 +0800)]
OVN-HA: Fix data loss after OVNDB promotion
When master node shuts down, both VIP and OVNDB Master are expected
to be moved over to the backup node.
However, the VIP must be started after the OVNDB has been promoted.
Otherwise, the database content can be whipped out, since the OVSDB
running in the backup state can reconnect to the VIP that just moved
over, thus removing the database content.
See also: http://clusterlabs.org/doc/en-US/Pacemaker/1.1-pcs/html/
Pacemaker_Explained/s-resource-ordering.html
Signed-off-by: Guoshuai Li <ligs@dtdream.com> Signed-off-by: Andy Zhou <azhou@ovn.org>
Ben Pfaff [Wed, 28 Dec 2016 17:31:42 +0000 (09:31 -0800)]
ovn-trace: New --ovs option to also print OpenFlow flows.
Sometimes seeing the OpenFlow flows that back a given logical flow can
provide additional insight. This commit adds a new --ovs option to
ovn-trace that makes it connect to Open vSwitch over OpenFlow and retrieve
and print the OpenFlow flows behind each logical flow encountered during
a trace.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
conntrack: Do not create new connections from ICMP errors.
ICMP error packets (e.g. destination unreachable messages) are
considered 'related' to another connection and are treated as part of
that.
However:
* We shouldn't create new entries in the connection table if the
original connection is not found. This is consistent with what the
kernel does.
* We certainly shouldn't call valid_new() on the packet, because
valid_new() assumes the packet l4 type (might be TCP, UDP or ICMP)
to be consistent with the conn_key nw_proto type.
Found by inspection.
Fixes: a489b16854b5("conntrack: New userspace connection tracker.") Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Darrell Ball <dlu998@gmail.com>
Ben Pfaff [Fri, 23 Dec 2016 21:45:00 +0000 (13:45 -0800)]
debian: Also restrict ovn-docker package to Linux.
The Debian packages for OVS have only supported Linux so far, but the
ovn-docker package was mistakenly marked as Architecture: any instead
of linux-any, which caused build failures. This fixes the problem.
(Perhaps OVS packaging for Debian should also support BSD, but that
would be a bigger change.)
Reported-at: https://buildd.debian.org/status/fetch.php?pkg=openvswitch&arch=kfreebsd-amd64&ver=2.6.2%7Epre%2Bgit20161223-1&stamp=1482518318&file=log Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
Ben Pfaff [Fri, 23 Dec 2016 17:23:43 +0000 (09:23 -0800)]
rconn: Avoid abort for ill-behaved remote.
If an rconn peer fails to send a hello message, the version number doesn't
get set. Later, if the peer delays long enough, the rconn attempts to send
an echo request but assert-fails instead because it doesn't know what
version to use. This fixes the problem.
The debian packages are ready. This patch fixes the
bug #831924 reported at debian bug tracking system.
With this patch, openvswitch-2.6.1 will be upload to
the Debian archive. If we build the packages with
"dpkg-buildpackage --target binary-indep", an error
state arises. debian/rules should be modified so that
the build-indep and binary-indep target generates
the architecture independent packages. If there are
things not be handled properly,let me know.
Reported-at: https://people.debian.org/~lucas/logs/2016/07/20/openvswitch_2.5.1~pre+git20160626-2_unstable_archallonly.log Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech> Signed-off-by: Ben Pfaff <blp@ovn.org>
Stephen Finucane [Fri, 23 Dec 2016 11:46:29 +0000 (11:46 +0000)]
doc: Correct type of highlighting
Some recent changes marked code as Powershell when in fact it was DOS or
bash shell. This incorrect highlighting actually breaks the local build
(where warnings are treated as errors) as pygments is unable to lex all
the code as PowerShell. Fix these types.
Signed-off-by: Stephen Finucane <stephen@that.guru> Fixes: b8d24cc8a ("doc: Misc Windows doc formatting fixes") Signed-off-by: Ben Pfaff <blp@ovn.org>
Ben Pfaff [Wed, 21 Dec 2016 17:15:59 +0000 (09:15 -0800)]
lacp: Select a may-enable IF as the lead IF
A reboot of one switch in an MC-LAG bond makes all bond links
to go down, causing a total connectivity loss for 3 seconds.
Packet capture shows that spurious LACP PDUs are sent to OVS with
a different MAC address (partner system id) during the final
stages of the MC-LAG switch reboot.
The current code selects a lead interface based on information
in the LACP PDU, regardless of its synchronization state. If a
non-synchronized interface is selected as the OVS lead interface
then all other interfaces are forced down as their stored partner
system id differs and the bond ends up with no working interface.
The bond recovers within three seconds after the last spurious
message.
To avoid the problem, this commit requires a lead interface
to be synchronized. In case no synchronized interface exists,
the selection of lead interface is done as in the current code.
Signed-off-by: Torgny Lindberg <torgny.lindberg@ericsson.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Zoltán Balogh [Tue, 13 Dec 2016 17:27:37 +0000 (17:27 +0000)]
odp-execute: Optimize IP header modification in OVS datapath
I measured the packet processing cost of OVS DPDK datapath for different
OpenFlow actions. I configured OVS to use a single pmd thread and
measured the packet throughput in a phy-to-phy setup. I used 10G
interfaces bounded to DPDK driver and overloaded the vSwitch with 64
byte packets through one of the 10G interfaces.
The processing cost of the dec_ttl action seemed to be gratuitously high
compared with other actions.
I looked into the code and saw that dec_ttl is encoded as a masked
nested attribute in OVS_ACTION_ATTR_SET_MASKED(OVS_KEY_ATTR_IPV4).
That way, OVS datapath can modify several IP header fields (TTL, TOS,
source and destination IP addresses) by a single invocation of
packet_set_ipv4() in the odp_set_ipv4() function in the
lib/odp-execute.c file. The packet_set_ipv4() function takes the new
TOS, TTL and IP addresses as arguments, compares them with the actual
ones and updates the fields if needed. This means, that even if only TTL
needs to be updated, each of the four IP header fields is passed to the
callee and is compared to the actual field for each packet.
The odp_set_ipv4() caller function possesses information about the
fields that need to be updated in the 'mask' structure. The idea is to
spare invocation of the packet_set_ipv4() function but use its code
parts directly. So the 'mask' can be used to decide which IP header
fields need to be updated. In addition, a faster packet processing can
be achieved if the values of local variables are
calculated right before their usage.
| T | T | I | I |
| T | O | P | P | Vanilla OVS || + new patch
| L | S | s | d | (nsec/packet) || (nsec/packet)
-------+---+---+---+---+---------------++---------------
output | | | | | 67.19 || 67.19
| X | | | | 74.48 || 68.78
| | X | | | 74.42 || 70.07
| | | X | | 84.62 || 78.03
| | | | X | 84.25 || 77.94
| | | X | X | 97.46 || 91.86
| X | | X | X | 100.42 || 96.00
| X | X | X | X | 102.80 || 100.73
The table shows the average processing cost of packets in nanoseconds
for the following actions:
output; output + dec_ttl; output + mod_nw_tos; output + mod_nw_src;
output + mod_nw_dst and some of their combinations.
I ran each test five times. The values are the mean of the readings
obtained.
I added OVS_LIKELY to the 'if' condition for the TTL field, since as far
as I know, this field will typically be decremented when any field of
the IP header is modified.
Signed-off-by: Zoltán Balogh <zoltan.balogh@ericsson.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
zangchuanqiang [Fri, 16 Dec 2016 02:28:11 +0000 (10:28 +0800)]
lib/ovs-thread: set prefer writer lock for ovs_rwlock_init()
An alternative "writer nonrecursive" rwlock allows recursive
read-locks to succeed only if there are no threads waiting for the
write-lock. In the function ovs_rwlock_init(), there exist a problem,
the parameter of 'attr' is not used to set the attributes of ovs_rwlock 'l_',
just because use pthread_rwlock_init(&l->lock, NULL) to init l->lock.
The attr object needs to be passed to the pthread_rwlock_init()
call in order to make use of it.
Signed-off-by: zangchuanqiang <zangchuanqiang@huawei.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Lance Richardson [Thu, 22 Dec 2016 19:45:50 +0000 (14:45 -0500)]
table: correct documented default format in man pages
There are currently five users of the table formatting library,
all of which default to "list" except for ovsdb-client which
defaults to "table". The library current default is "table",
and the table.man man page fragment only considers ovs-vsctl
to use something other than "table" as a default.As a result,
the man pages for ovn-sbctl and vtep-ctl are currently incorrect
(these options aren't documented in the ovn-nbctl man page, which
will need to be addressed in a future patch).
Fix by making the library default format "list" and handling
ovsdb-client as the exception.
Signed-off-by: Lance Richardson <lrichard@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Joe Stringer [Tue, 20 Dec 2016 21:28:25 +0000 (13:28 -0800)]
system-traffic: Introduce OVS_START_L7 macro.
All of the commands starting L7 servers duplicate detailed specifics
which inhibits readability, and makes it difficult to ensure that the
servers are ready before the test proceeds. Add a new macro that
provides simpler semantics from the test perspective and hide the
details in the macro. A followup patch will extend this macro to ensure
that servers are ready to serve requests before the test proceeds.
Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
When IGMP or MLD packets arrive their content is used without the checksum
being verified. With this change the checksum is verified, and the packet
is not used for multicast snooping on failure.
Signed-off-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
route-table: Stop netlink log message when routes withdrawn
When a route is withdrawn (blackholed) the netlink message doesn't include
an RTA_OIF element. This results in an "unexpected netlink message
contents" log message because this element is not optional.
Given that the netlink message will be ignored anyway, and subsequent
error checking will cope with missing RTA_OIF, the element should be
optional in order to suppress unnecessary log messages.
Signed-off-by: Tony van der Peet <tony.vanderpeet@alliedtelesis.co.nz> Signed-off-by: Ben Pfaff <blp@ovn.org>
Aaron Conole [Fri, 9 Dec 2016 16:22:28 +0000 (11:22 -0500)]
lib/dpdk: No more deferred release
DPDK documentation is recently updated to reflect that DPDK does not
hold any references to, nor take ownership of, the argv/argc elements.
With that understanding, let's just release the memory asap.
Signed-off-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
William Tu [Wed, 21 Dec 2016 22:22:01 +0000 (14:22 -0800)]
system-traffic: Fix clone test.
The existing clone test fails the system testsuite. The patch provides
fix, removes the unused at_ns2, and uses "ovs-ofctl monitor" to validate
the packet contents after actions inside a clone.
Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Joe Stringer <joe@ovn.org>
Alin Serdean [Tue, 6 Dec 2016 02:58:30 +0000 (02:58 +0000)]
build-windows: Propagate PACKAGE_VERSION to the driver files
This patch propagates the automake value 'PACKAGE_VERSION' to the driver
specific information files, overwriting the Visual Studio default value of
Version, when building the driver via msys.
Alin Serdean [Tue, 6 Dec 2016 02:58:30 +0000 (02:58 +0000)]
datapath-windows: Force driver version to depend on a variable
The following components use Windows driver information:
- System (inf file); used during device installation
- Resource file (rc file); used by applications when looking over the driver
file(sys)
Currently we have the following for the driver version number:
- (inf file) generated value from the build timestamp
- (rc file) predefined value
This patch forces both files to depend on a variable: '$(Version)'.
This is a predefined variable from Visual Studio.
To achieve the above we change the current project settings used by the
'stampinf' utility and we define a new preprocessor value named
'VersionWithCommas' (which is obtained by replacing all
'.' with ',' from $(Version) ).
Certain values from the resource file are expected to use ',' instead of '.' .
The resource file has been updated to use the new values when generating
information about the driver (sys).
The variable '$(Version' can be changed from the command line via the
'msbuild' utility.
Stephen Finucane [Wed, 14 Dec 2016 10:07:57 +0000 (10:07 +0000)]
doc: Split dpdk, dpdk-advanced into multiple docs
Combined, the dpdk and dpdk-advanced installation documents provide a
lot of useful information, but most of this information is unrelated to
installation. Rework these documents, completely breaking up the
dpdk-advanced document into multiple smaller documents in other sections
and moving non-install aspects of the dpdk document into these sections.
This aims to tie the DPDK docs into the documentation structure.
Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Ben Pfaff <blp@ovn.org>
Stephen Finucane [Wed, 21 Dec 2016 20:39:54 +0000 (20:39 +0000)]
doc: Prefer use of 'code-block' directive
The '::' element previously preferred is shorter, but does not allow for
non-Python syntax highlighting. New documentation should make use of
syntax highlighting wherever possible.
Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Ben Pfaff <blp@ovn.org>
Stephen Finucane [Wed, 21 Dec 2016 20:39:53 +0000 (20:39 +0000)]
doc: Misc Windows doc formatting fixes
There are a couple of minor issues with this document:
- Some commands intended to be run in the MinGW shell are prefixed with
'>', suggesting they are in fact PowerShell commands
- PowerShell syntax highlighting is not enabled
- Indentation is off for a couple of blocks
Resolve all of these through use of the 'code-block' element and a lot
of random fixes.
Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Ben Pfaff <blp@ovn.org>
Stephen Finucane [Wed, 21 Dec 2016 20:39:52 +0000 (20:39 +0000)]
doc: Resolve issues with Windows guide
The formatting of this file was broken in a recent commit. Resolve this
issue.
Signed-off-by: Stephen Finucane <stephen@that.guru> Fixes: a0c03adff6c2 ("Windows: document multiple NIC support setup") Cc: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Han Zhou [Wed, 21 Dec 2016 20:32:16 +0000 (12:32 -0800)]
ovn-controller: Fix duplicated flow add attempts in table 32.
In commit 475f0a2c it introduced a priority 150 flow for filtering
the sending of traffic received from vxlan tunnels back out tunnels.
However, it added the flow for every remote port processing, which
results in continuous logs about duplicated flows. We only need to
install this flow once per physical_run() loop iteration.
Signed-off-by: Han Zhou <zhouhan@gmail.com> Acked-by: Darrell Ball <dball@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Ben Pfaff [Tue, 6 Dec 2016 21:48:50 +0000 (13:48 -0800)]
ofproto: Update access rules for 'flow_cookie'.
The 'flow_cookie' member of struct rule is read during flow translation
without holding a mutex, breaking the documented OVS_GUARDED access rule.
However, the flow_cookie member is actually never modified after a rule is
initialized, so this commit changes the access rules to reflect that.
When the add-port command fails, vsctl reports the failure and just
suggests to check the logs for more details.
ovs-vswitchd fills the error column in the Interface table with a
description of the error, so it might be helpful to print that.
This is useful especially for dpdk devices, because the port naming
change could use a better error reporting.
I'm planning another patch to make sure that ovs-vswitch writes
appropriates information in the error column, after the dpdk port naming
changes are merged.
CC: Ben Pfaff <blp@ovn.org> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org>
Mickey Spiegel [Tue, 20 Dec 2016 21:23:46 +0000 (13:23 -0800)]
ovn-controller: Log chassis claiming lport only when changes occur.
With recent OVN commits, the logic for a chassis to claim
or release a logical port was consolidated. This is a
good thing. However, there was a logic change that
resulted in VLOG_INFO being generated every time on the
ovn-controller. This patch changes the logic so that
VLOG_INFO is only generated when there is a change, for
example when the chassis claims an lport the first time.
Signed-off-by: Mickey Spiegel <mickeys.dev@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Ben Pfaff [Wed, 21 Dec 2016 00:17:31 +0000 (16:17 -0800)]
ovsdb-idlc: Initialize nonnull string columns for inserted rows.
When a schema column has type "exactly one string", the corresponding
struct member has type "char *" and the documented and expected behavior
is that the string should always be nonnull. (The code generator even
adds a comment /* Always nonnull. */ in the struct definition.) In the
case where a value is not available, the string is supposed to be
initialized to "" instead of to NULL.
However, the IDL code for inserting a new row did not properly initialize
the column to "", instead leaving it NULL. This could cause null pointer
dereferences in corner cases.
Ben Pfaff [Tue, 20 Dec 2016 21:15:51 +0000 (13:15 -0800)]
tests: Regenerate atlocal when running tests.
A previous patch fixed double rebuilds when running tests in some cases.
That patch removed dependencies from targets in tests/automake.mk that
were redundant because the "all" target already depended on them. A
dependency on tests/atlocal was also removed in the belief that "all"
depended on tests/atlocal. This belief was incorrect, which meant that
tests/atlocal would not get regenerated if it was removed or out of date.
This commit fixes the problem.
Reported-by: Joe Stringer <joe@ovn.org> Fixes: a8cb456227b0 ("tests: Fix double-rebuild of testsuite for "check-valgrind" and similar.") Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
Alin Serdean [Tue, 20 Dec 2016 19:41:22 +0000 (19:41 +0000)]
Windows: Add internal switch port per OVS bridge
This patch updates the following commands in the vswitch:
ovs-vsctl add-br br-test
ovs-vsctl del-br br-test
ovs-vsctl add-br br-test:
This command will now create an internal port on the MSFT virtual switch
using the WMI interface from Msvm_VirtualEthernetSwitchManagementService
leveraging the method AddResourceSettings.
Before creating the actual port, the switch will be queried to see if there
is not a port already created (good for restarts when restarting the
vswitch daemon). If there is a port defined it will return success and log
a message.
After checking if the port already exists the command will also verify
if the forwarding extension (windows datapath) is enabled and on a single
switch. If it is not activated or if it is activated on multiple switches
it will return an error and a message will be logged.
After the port was created on the switch, we will disable the adapter on
the host and rename to the corresponding OVS bridge name for consistency.
The user will enable and set the values he wants after creation.
ovs-vsctl del-br br-test
This command will remove an internal port on the MSFT virtual switch
using the Msvm_VirtualEthernetSwitchManagementService class and executing
the method RemoveResourceSettings.
Both commands will be blocking until the WMI job is finished, this allows us
to guarantee that the ports are created and their name are set before issuing
a netlink message to the windows datapath.
This patch also includes helpers for normal WMI retrievals and initializations.
Appveyor and documentation has been modified to include the libraries needed
for COM objects.
This patch was tested individually using IMallocSpy and CRT heap checks
to ensure no new memory leaks are introduced.
Tested on the following OS's:
Windows 2012, Windows 2012r2, Windows 2016
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Paul Boca <pboca@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Sairam Venugopal [Fri, 16 Dec 2016 22:28:12 +0000 (14:28 -0800)]
datapath-windows: Conntrack - Enable FTP support
Enable the support for tracking FTP connections in the Connection tracker.
This checks an incoming ftp control connection to extract the related data
connection. When a matching data connection arrives, it would then update
the connection entry to point to the original control connection.