Ilya Maximets [Tue, 26 Jan 2016 06:12:33 +0000 (09:12 +0300)]
dpif-netdev: Rework of rx queue management.
Current rx queue management model is buggy and will not work properly
without additional barriers and other syncronization between PMD
threads and main thread.
Known BUGS of current model:
* While reloading, two PMD threads, one already reloaded and
one not yet reloaded, can poll same queue of the same port.
This behavior may lead to dpdk driver failure, because they
are not thread-safe.
* Same bug as fixed in commit e4e74c3a2b
("dpif-netdev: Purge all ukeys when reconfigure pmd.") but
reproduced while only reconfiguring of pmd threads without
restarting, because addition may change the sequence of
other ports, which is important in time of reconfiguration.
Introducing the new model, where distribution of queues made by main
thread with minimal synchronizations and without data races between
pmd threads. Also, this model should work faster, because only
needed threads will be interrupted for reconfiguraition and total
computational complexity of reconfiguration is less.
Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Lance Richardson [Fri, 22 Jan 2016 15:12:29 +0000 (10:12 -0500)]
system-traffic: use appropriate nc options for installed version
Test cases using netcat ("ICMP related" and "ICMP related with NAT")
currently fail on systems using the nmap version of nc because this
version does not support the -q command-line option.
Fix this by detecting which version of netcat is is in use and
using the "--send-only" command-line option when the nmap flavor
is detected, and using "-q 1" otherwise (openbsd and traditional
versions).
Tested via "make check-kernel" on RHEL7 (nmap version of nc),
Debian 8.2 (openbsd version of nc), and Ubuntu 14.04 ("traditional" nc).
Signed-off-by: Lance Richardson <lrichard@redhat.com> Signed-off-by: Joe Stringer <joe@ovn.org>
Ben Pfaff [Fri, 22 Jan 2016 23:58:55 +0000 (15:58 -0800)]
ofproto-dpif-xlate: Fix recirculation for resubmit to current table.
When recirculation defers actions for processing later, it decides
based on the actions being saved whether it needs to record the table
and cookie from which they originated. Until now, it was thought that
this was only important for actions that send packets to the controller
(because those actions send the table ID and cookie). This overlooked
a special case of the "resubmit" action which also depends on the
current table ID, which meant that this special case malfunctioned if
it came after recirculation. This commit fixes the problem, and adds
a test.
Found while testing another feature under development.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Russell Bryant [Mon, 14 Dec 2015 20:13:20 +0000 (15:13 -0500)]
python: Convert dict iterators.
In Python 2, dict.items(), dict.keys(), and dict.values() returned a
list. dict.iteritems(), dict.iterkeys(), and dict.itervalues() returned
an iterator.
As of Python 3, dict.iteritems(), dict.itervalues(), and dict.iterkeys()
are gone. items(), keys(), and values() now return an iterator.
In the case where we want an iterator, we now use the six.iter*()
helpers. If we want a list, we explicitly create a list from the
iterator.
Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
Ben Pfaff [Thu, 21 Jan 2016 00:53:01 +0000 (16:53 -0800)]
ofproto-dpif-xlate: Put recirc_state, not recirc_id_node, in xlate_in.
This will make it possible, in an upcoming commit, to construct a
recirc_state locally on the stack to pass to xlate_actions(). It would
also be possible to construct and pass a recirc_id_node on the stack, but
the translation process only uses the recirc_state anyway. The alternative
here of having upcall_xlate() know that it can recover the recirc_id_node
from the recirc_state isn't great either; it's debatable which is the
better approach.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Russell Bryant [Wed, 20 Jan 2016 16:17:58 +0000 (11:17 -0500)]
ovn-controller: Update check for parent port.
There were a couple of checks that checked for a parent port as the
field being non-NULL. We should treat an empty string the same as NULL
for this field.
Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
Russell Bryant [Thu, 14 Jan 2016 15:47:18 +0000 (10:47 -0500)]
ovn-nbctl: Help catch lport-set-addresses mistakes.
While debugging a broken OVN environment yesterday, the problem turned
out to be invalid entries in the logical port addresses column. In
particular, the following command had been used:
$ ovn-nbctl lport-set-addresses lp0 MAC IP
instead of:
$ ovn-nbctl lport-set-addresses lp0 "MAC IP"
This is really easy to mess up, so add some simple validation to the
lport-set-addresses command. If the beginning of an argument is ever
an IP address, it's wrong.
In passing, also add a note to the ovn-nb db documentation to note that
the order of "MAC IP" is required, as "IP MAC" is not valid.
Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
Ben Pfaff [Thu, 21 Jan 2016 00:33:13 +0000 (16:33 -0800)]
ofp-util: Make decoding switch features harder to misuse (and fix leak).
Until now, ofputil_decode_switch_features() has put the ports from the
switch features message into a separate ofpbuf supplied as an argument.
The natural desire for a caller is to just reuse an ofpbuf that it already
has, and that's what one of the callers did. This however has the
nonobvious effect of leaking the memory that the ofpbuf previously owned,
since it gets replaced by an OFPBUF_CONST-type ofpbuf.
This commit avoids the problem by changing the interface to pull the
header from an ofpbuf that the caller already has.
This fixes a leak in testcase 909 "ofproto-dpif - patch ports".
Found by valgrind.
Reported-by: William Tu <u9012063@gmail.com>
Reported-at: http://openvswitch.org/pipermail/dev/2016-January/064771.html Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
Ben Pfaff [Thu, 21 Jan 2016 01:15:16 +0000 (17:15 -0800)]
appveyor.yml: Install python "six" module.
It is now required for the build.
Thanks to Alin Gabriel Serdean for helping figure out the correct
solution here.
This adds --diable-pip-version-check because upgrading pip (as
suggested by the error that this option suppresses) causes pip
to fail, which is in turn a bug in pip that manifests only on
Windows: https://github.com/pypa/pip/issues/3383.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Ben Pfaff [Mon, 18 Jan 2016 22:55:30 +0000 (14:55 -0800)]
nx-match: Add functions for raw decoding and encoding of OXM.
The existing functions either assumed that we were working with NXM
(instead of OXM), or they added or parsed a header before OXM headers.
These aren't needed when OXM is encapsulated inside a property, as will be
the case in an upcoming commit.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Ben Pfaff [Mon, 18 Jan 2016 22:47:40 +0000 (14:47 -0800)]
ofproto-dpif-rid: Use UUID, not pointer, to identify ofprotos for recirc.
An upcoming commit will make it possible to essentially serialize the
recirculation state into an OpenFlow message. For that purpose, we can't
sensibly pass a "struct ofproto *", but a randomly generated UUID works
just as well.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Ben Pfaff [Fri, 15 Jan 2016 22:00:50 +0000 (14:00 -0800)]
ofproto-dpif-rid: Fix names of recirc_metadata_{hash,equal}().
These functions actually hash or compare recirc_state structs, so they
should be named that way; recirc_metadata is only a small subset of
recirc_state.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Ben Pfaff [Mon, 18 Jan 2016 22:43:01 +0000 (14:43 -0800)]
ofproto-dpif-rid: Use separate pointers for actions and action set.
During translation it makes some sense to concatenate these in a single
array, but in my opinion it's conceptually better to separate them for
the recirc_state; they are not naturally the same thing.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Ben Pfaff [Thu, 21 Jan 2016 00:47:14 +0000 (16:47 -0800)]
ofproto-dpif-rid: Use array instead of ofpbuf for recirc_state stack.
In my opinion, this makes better sense for the stack, because it's not
a packet or a collection of bytes, it's an array of struct mf_subvalue.
(I left it as an ofpbuf for accumulating stack entries during
translation, because the automatic reallocation and especially the stub
support there is helpful.)
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Joe Stringer [Wed, 20 Jan 2016 23:26:49 +0000 (15:26 -0800)]
datapath: Fix panic sending IP frags over tunnels.
The entire OVS_GSO_CB was not preserved when handling IP fragments,
leading to the following NULL pointer dereference in ovs_stt_xmit(). Fix
this in the fragmentation handling code by preserving the whole CB.
William Tu [Tue, 12 Jan 2016 22:24:53 +0000 (14:24 -0800)]
ovs-vsctl: Add parent process name and ID.
This patch forces appending "parent_process_name(PID)" when invoking
ovs-vsctl, in order to assist debugging. The patch is for Linux only.
For example:
User adds br0 by "ovs-vsctl add-br0", the log shows:
"ovs-vsctl (invoked by base(1528)): ovs-vsctl add-br br0"
Signed-off-by: William Tu <u9012063@gmail.com>
[blp@ovn.org made stylistic changes] Signed-off-by: Ben Pfaff <blp@ovn.org>
Russell Bryant [Thu, 14 Jan 2016 20:07:59 +0000 (15:07 -0500)]
tests: Set enable-dummy=system for ovn-controller-vtep tests.
All of the ovn-controller-vtep tests were failing on my laptop due to an
unexpected message in the ovs-vswitchd log related to my VPN. This
setting resolves it and makes all tests pass.
Fixes: 0c1e8a7d637e ("ovn-controller-vtep: Add gateway module.") Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
Russell Bryant [Mon, 14 Dec 2015 19:33:52 +0000 (14:33 -0500)]
python: Stop using xrange().
Python 2 had range() and xrange(). xrange() is more efficient, but
behaves differently so range() was retained for compatibility. Python 3
only has range() and it behaves like Python 2's xrange().
Remove explicit use of xrange() and use six.moves.range() to
make sure we're using xrange() from Python 2 or range() from Python 3.
Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
Russell Bryant [Mon, 14 Dec 2015 19:03:14 +0000 (14:03 -0500)]
python: Fix xmlrpclib imports.
Fix imports of xmlrpclib to be compatible with Python 3. Python 2 had
xmlrpclib (client) and SimpleXMLRPCServer (server). In Python 3, these
have been renamed to xmlrpc.client and xmlrpc.server.
The solution implemented here is to use the six library. It may seem
excessive for this particular issue, but the six library provides
helpers for Python 2 and 3 compatibility for many different issues.
This is just the first of many uses of the six library.
Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
Ben Pfaff [Tue, 19 Jan 2016 06:52:48 +0000 (22:52 -0800)]
hash: New helper functions hash_bytes32() and hash_bytes64().
All of the callers of hash_words() and hash_words64() actually find it
easier to pass in the number of bytes instead of the number of 32-bit
or 64-bit words. These new functions allow the callers to be a little
simpler.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Ben Pfaff [Wed, 20 Jan 2016 17:57:16 +0000 (09:57 -0800)]
openflow: Better abstract handling of packet-in messages.
Packet-in messages have been a bit of a mess. First, their abstraction
in the form of struct ofputil_packet_in has some fields that are used
in a clear way for incoming and outgoing packet-ins, and others
(packet_len, total_len, buffer_id) have have confusing meanings or
usage pattern depending on their direction.
Second, it's very confusing how a packet-in has both a reason (OFPR_*)
and a miss type (OFPROTO_PACKET_IN_*) and how those add up to the
actual reason that is used "on the wire" for each OpenFlow version (and
even whether the packet-in is sent at all!).
Finally, there's all kind of low-level detail randomly scattered between
connmgr, ofproto-dpif-xlate, and ofp-util.
This commit attempts to clear up some of the confusion. It simplifies
the struct ofputil_packet_in abstraction by removing the members that
didn't have a clear and consistent meaning between incoming and outgoing
packet-ins. It gets rid of OFPROTO_PACKET_IN_*, instead adding a couple
of nonstandard OFPR_* reasons that add up to what OFPROTO_PACKET_IN_*
was meant to say (in what I hope is a clearer way). And it consolidates
the tricky parts into ofp-util, where I hope it will be easier to
understand all in one place.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Ben Pfaff [Fri, 15 Jan 2016 04:10:43 +0000 (20:10 -0800)]
fail-open: Drop some of the weirder special cases.
I don't have any real evidence that these special cases make a difference
in real-world cases. The messages for the commits that add them are not
clear about the reasons for them. I seem to recall that they were only
tested with the dummy controller inside OVS, which isn't very good evidence
for real controllers. Finally, they cut across layers in nasty ways and
make it hard to better abstract packet-ins and packet buffering.
If these solve real problems then we can reconsider after some reports
come in.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Ben Pfaff [Fri, 15 Jan 2016 01:00:57 +0000 (17:00 -0800)]
openflow: Get rid of struct ofp13_packet_in.
It's actually harder to parse OF1.2/OF1.3 "packet-in" messages when
ofp13_packet_in is involved than when the code just realizes that
ofp13_packet_in = ofp12_packet_in + cookie.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Ben Pfaff [Tue, 19 Jan 2016 00:00:34 +0000 (16:00 -0800)]
ofp-util: Fix OF1.4+ version of ofputil_decode_set_async_config().
The OF1.0 through OF1.3 "set async config" set the whole configuration,
OF1.4+ only update parts of it piecemeal, but the decoding function always
set the whole configuration. This commit fixes the problem by changing the
interface to require the caller to provide an initial state. (It would
be possible to simply make it mutate existing state in-place, but that
interface seems a little more error-prone.)
Found by inspection.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Ben Pfaff [Wed, 20 Jan 2016 17:46:09 +0000 (09:46 -0800)]
ofp-util: Rewrite async config encoding and decoding to be table-driven.
The encoding and decoding of the OpenFlow and Open vSwitch async config
messages was, until now, a collection of disjoint code that had a lot of
redundancy. This commit changes it all to be driven using a single central
table.
This rewrite fixes a bug in the OF1.4+ version of the code, which until
now assumed that every TLV in an OF1.4+ asynchronous configuration message
was exactly 8 bytes long, and reported an error if any was a different
length. This invariant is true of all the standard TLVs already defined,
but it won't be true of any experimenter TLVs (and won't necessarily be
true of any new standard TLVs), so this commit changes it to be more
tolerant.
The OFPACPT_* constants are no longer useful (they are encoded directly
in the table and do not need to be anywhere else), so this removes them.
This commit also adds support for experimenter async config messages.
We don't have any yet but an upcoming commit will add one.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
OpenFlow 1.0 through 1.3 have a message OFPT_QUEUE_GET_CONFIG_REQUEST and
its corresponding reply, for fetching a description of the queues
configured on a given port. OpenFlow 1.4 changes this message to a
multipart message OFPMP_QUEUE_DESC, which Open vSwitch has not until now
implemented. This commit adds an implemntation of that message. Because
the message is a replacement for the former one, this commit implements it
using the same ofp-util functions as the former message, so that the client
code doesn't have to distinguish a difference between versions.
The ovs-ofctl command queue-get-config was previously undocumented (due
only to an oversight). This commit corrects that and documents the new
feature available with OpenFlow 1.4.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Ben Pfaff [Tue, 29 Dec 2015 14:44:16 +0000 (06:44 -0800)]
ofp-prop: New module for working with OpenFlow 1.3+ properties.
Several OpenFlow 1.3+ messages use TLV-based properties that take a
common form. Until now, ofp-util has had some static functions for
dealing with properties. Because properties will start to be needed
outside of ofp-util, this commit breaks them out into a new library,
renaming them to begin with ofpprop_.
The following commit will add a few new interfaces that add new
functionality.
Ben Pfaff [Mon, 18 Jan 2016 23:06:54 +0000 (15:06 -0800)]
ofp-errors: Add extension error codes for OF1.3+ property errors.
Upcoming commits will introduce uses of the "property" message formats,
which are used in OF1.3 and especially in OF1.4+, in Nicira extension
messages for earlier versions of OpenFlow. Thus, it's best to also
support the appropriate error codes in those versions of OpenFlow, so that
errors can be reported in a useful way.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Ben Pfaff [Thu, 24 Dec 2015 23:44:31 +0000 (15:44 -0800)]
ovs-ofctl: Merge dump_stats_transaction() into dump_transaction().
The callers call dump_stats_transaction() for OFPST_* messages and
dump_transaction() for other messages, but the callee can easily
distinguish the two types, so this commit eliminates the difference for the
callers to simplify use.
This will be more valuable in an upcoming commit in which a single
ofputil_encode_*() function can produce an OFPT_* request for some
OpenFlow versions and an OFPST_* request for others. (Specifically, OF1.4
changes OFPT_QUEUE_GET_CONFIG_REQUEST into OFPST_QUEUE_DESC.)
Also merges dump_trivial_stats_transaction() into
dump_trivial_transaction() for the same reason.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Ben Pfaff [Wed, 20 Jan 2016 16:16:09 +0000 (08:16 -0800)]
netdev-dummy: Add a dummy queue.
Until now it's been pretty hard to properly test any of the queue support,
because the dummy network device doesn't have any queues. By adding one
queue to the dummy network device (queue 0), we can get slightly higher
confidence that OVS queue support works correctly. I suppose we could do
even better if we made the dummy network device support modifying the
queues, but that's a job for another day.
At first glance, OF1.4 queue properties look a lot like those for OF1.0
to OF1.3, but in fact their different padding makes them incompatible. In
addition, OF1.4 switches from using regular OpenFlow messages to request
queue properties, to using multipart messages. Thus, we really need to
use separate code to deal with OF1.4 queues.
OF1.0, OF1.1, and OF1.2 all have slightly different queue config reply
messages, but only OF1.0 and OF1.2 had tests, so this adds tests. (There
is no test for OF1.3 because it's the same as OF1.2.)
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Ben Pfaff [Thu, 24 Dec 2015 23:29:26 +0000 (15:29 -0800)]
ofp-print: Improve formatting of queue stat requests and port_mods.
Without this, OFPST_QUEUE requests are formatted as:
OFPST_QUEUE request:port=LOCAL queue=5
With this commit, OFPST_QUEUE requests are formatted as:
OFPST_QUEUE request: port=LOCAL queue=5
which looks better.
Similarly for OFPT_PORT_MOD.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Ben Pfaff [Tue, 5 Jan 2016 19:42:51 +0000 (11:42 -0800)]
pinsched: Remove obsolete ofpbuf_trim().
This call to ofpbuf_trim() comes from a time when the packets passed to
pinsched came directly from a dpif. For some time now that's no longer
true--now they are messages generated by ofputil_encode_packet_in(), which
generally are well sized and do not benefit from trimming.
This is not a bug fix--the code is equally correct either way, it's only
the rationale for trimming that's obsolete.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Ben Pfaff [Wed, 6 Jan 2016 21:38:20 +0000 (13:38 -0800)]
ofp-msgs: Fix definitions of OF1.4 OFPT_GET_ASYNC_REPLY and OFPT_SET_ASYNC.
The structures declared in ofp-msgs.h for messages definitions should not
include an OpenFlow header (its presence is implied), but the definition of
these messages did. This commit fixes the definitions.
The visible bug was really minor here: messages of these kinds without any
TLVs would be rejected by the OpenFlow parser. But OVS never sends these
messages without TLVs, so probably no one ever noticed this. (Also, the
OVS support for OF1.4 is still incomplete and experimental.)
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Ben Pfaff [Mon, 18 Jan 2016 22:49:47 +0000 (14:49 -0800)]
learning-switch: Use "if"s instead of "switch" to reduce maintenance.
This code only cares about a very few kinds of OpenFlow messages, and it's
unlikely that it will care about new ones, so replace the "switch" by "if"
statements so that GCC won't complain about every new message.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Ben Pfaff [Thu, 14 Jan 2016 06:15:09 +0000 (22:15 -0800)]
ofproto: Fix memory leak and memory exhaustion bugs in group_mod.
In handle_group_mod() cases where adding a group failed, nothing freed the
list of buckets, causing a leak. The same was true in every case of
modifying a group. This commit fixes the problem by changing add_group()
to never steal or free the buckets (modify_group() already acted this way)
and then making handle_group_mod() always free the buckets when it's done.
This approach might at first raise objections, because it makes add_group()
copy the buckets instead of just take the existing ones. But it actually
fixes a worse problem too: when OF1.4+ REQUESTFORWARD is enabled, the
group_mod is reused for the request forwarding. Until now, for a group_mod
that adds a new group and that has some buckets, the previous stealing of
buckets in add_group() meant that the group_mod's buckets were no longer
valid; in practice, the list of buckets became linked in a way that
iteration never terminated, which caused memory to be exhausted while
composing the requestforward message. By making add_group() no longer
modify the group_mod, we also fix this problem.
The requestforward test in the testsuite did not find the latter problem
because it only added a group without any buckets. This commit also
updates the testsuite to include a bucket in its group_mod, which would
have found the problem.
Found by pain and suffering.
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Haggai Eran [Thu, 14 Jan 2016 11:29:08 +0000 (13:29 +0200)]
ofproto: Wildcard TTL on IP tunnels
There is no need to set the mask on the outer header IP TTL [1]. The only requirement
is that the TTL will be non-zero. Clear the mask in tnl_wc_init().
[1] OVS VXLAN decap rule has full match on TTL for the outer headers?
http://www.spinics.net/lists/netdev/msg351961.html
Cc: Jesse Gross <jesse@kernel.org> Cc: Joe Stringer <joe@ovn.org> Signed-off-by: Haggai Eran <haggaie@mellanox.com> Signed-off-by: Jesse Gross <jesse@kernel.org>
Haggai Eran [Thu, 14 Jan 2016 11:29:07 +0000 (13:29 +0200)]
odp-util: Accept fields with zero mask
It is possible to pass some fields to the kernel with a zero mask, but
ovs-dpctl doesn't currently allow it. Change the code to allow it to
mimic what vswitchd is allowed to do.
Signed-off-by: Haggai Eran <haggaie@mellanox.com> Signed-off-by: Jesse Gross <jesse@kernel.org>
Russell Bryant [Thu, 14 Jan 2016 20:36:17 +0000 (15:36 -0500)]
tests: Update ovn localnet test case.
The OVN localnet port test case did not cover having 2 ports on the same
network and on the same hypervisor. It also turns out that this case is
broken. Update the test case to demonstrate the problem. A solution
should be able to uncomment these additional test_packet lines and have
the test case still pass.
Reported-at: http://openvswitch.org/pipermail/dev/2016-January/064413.html Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Han Zhou <zhouhan@gmail.com>
Pravin B Shelar [Thu, 14 Jan 2016 00:42:10 +0000 (16:42 -0800)]
datapath: STT: Fix nf-hook softlockup.
nf-hook is not unregistered on STT device delete, But when
second time it was created it nf-hook is again registered.
which causes following softlockup.
Following patch fixes it by registering nf-hook only on very
first stt device.
Joe Stringer [Tue, 12 Jan 2016 19:32:41 +0000 (11:32 -0800)]
netdev-dpdk: Fix thread_is_pmd() symbol conflict.
DPDK build was broken after commit 2f8932e8403a ("poll: Suppress logging
for pmd threads.") due to the following error:
lib/netdev-dpdk.c:245:13: error: static declaration of ‘thread_is_pmd’
follows non-static declaration
lib/ovs-thread.h:526:6: note: previous declaration of ‘thread_is_pmd’
was here
The version used in this file operates in the fastpath, so it cannot
switch to using the newly introduced version; the new version lives
outside of the dpdk portions of OVS so its implementation cannot be
shared with this function. Rename it to resolve the conflict.
Fixes: 2f8932e8403a ("poll: Suppress logging for pmd threads.") Suggested-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Flavio Leitner <fbl@sysclose.org>
Pravin B Shelar [Tue, 12 Jan 2016 19:45:18 +0000 (11:45 -0800)]
datapath: Fix deadlock on STT device destroy.
STT unregisters nf-hook when there are no other STT devices
left in the namespace. On some kernel versions the nf-unreg API
take RTNL lock, but it is already taken in the tunnel device
destroy code path which results in deadlock. To fix the issue
I moved the unreg call into net-exit.
VMware-BZ: #1582410 Reported-by: Joe Stringer <joe@ovn.org> Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Joe Stringer <joe@ovn.org>
Shad Ansari [Thu, 10 Dec 2015 09:12:31 +0000 (01:12 -0800)]
ovsdb-idl: Add support for column tracking in IDL.
Recent IDL change tracking patches allow quick traversal of changed
rows. This patch adds additional support to track changed columns.
It allows an IDL client to efficiently check if a specific column
of a row was updated by IDL.
Signed-off-by: Shad Ansari <shad.ansar@hpe.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Ben Pfaff [Tue, 12 Jan 2016 18:37:48 +0000 (10:37 -0800)]
xml2nroff: Fix build breakage when srcdir differs from builddir.
When the source directory and build directory differ, xml2nroff needs
to pull include files from the source directory, but it was blindly
using the current working directory (the build directory) instead.
Signed-off-by: Ben Pfaff <blp@ovn.org> Fixes: 7ba0c32f610 ("ovn-nbctl: add db commands help and manpage") Tested-by: Joe Stringer <joe@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
Russell Bryant [Mon, 14 Dec 2015 15:21:53 +0000 (10:21 -0500)]
python: Fix print function compatibility.
The print statement from Python 2 is a function in Python 3. Enable
print function support for Python 2 and convert print statements to
function calls.
Enable the H233 flake8 warning. If the hacking plugin is installed,
this will generate warnings for print statement usage not compatible
with Python 3.
H233 Python 3.x incompatible use of print operator
Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
Terry Wilson [Thu, 30 Jul 2015 02:12:45 +0000 (21:12 -0500)]
python: Start fixing some Python 3 issues.
This patch fixes just the Python 3 problems found by running:
python3 setup.py install
There are still many other issues to be fixed, but this is a start.
Signed-off-by: Terry Wilson <twilson@redhat.com>
[russell@ovn.org resolved conflicts with current master] Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
Simon Horman [Mon, 11 Jan 2016 05:00:25 +0000 (14:00 +0900)]
flow: fix compilation of MINIFLOW_ASSERT
Often MINIFLOW_ASSERT is a no-op and compilation of code that uses
it is optimised out. This patch fixes compilation errors that occur
when that is not the case:
* FLOWMAP_MAX does not exist. Use MAP_MAP instead.
* FLOWMAP_IS_SET does not exist. Use flowmap_is_set instead.
Signed-off-by: Simon Horman <simon.horman@netronome.com> Acked-by: Jarno Rajahalme <jarno@ovn.org>
William Tu [Tue, 5 Jan 2016 21:38:43 +0000 (13:38 -0800)]
ofproto: Fix memory leak reported by valgrind.
Test case 757: ofproto - table description (OpenFlow 1.4)
Call stacks:
parse_ofp_table_vacancy (ofp-parse.c:896)
parse_ofp_table_mod (ofp-parse.c:978)
ofctl_mod_table (ovs-ofctl.c:2011)
ovs_cmdl_run_command (command-line.c:121)
main (ovs-ofctl.c:135)
Reason: return without freeing memory
Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Co-authored-by: Daniele Di Proietto <diproiettod@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
William Tu [Tue, 5 Jan 2016 21:38:42 +0000 (13:38 -0800)]
rstp: Fix memory leak reported by valgrind.
test case: 1650 RSTP Single bridge, call stacks
hmap_insert_at (hmap.h:235)
rstp_port_set_port_number__ (rstp.c:744)
rstp_add_port (rstp.c:1164)
new_bridge (test-rstp.c:123)
test_rstp_main (test-rstp.c:514)
ovstest_wrapper_test_rstp_main__ (test-rstp.c:714)
ovs_cmdl_run_command (command-line.c:121)
main (ovstest.c:132)
fix it by adding hmap_destroy() at rstp_unref()
Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Co-authored-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Daniele Venturino <daniele.venturino@m3s.it> Signed-off-by: Ben Pfaff <blp@ovn.org>
William Tu [Tue, 5 Jan 2016 21:38:41 +0000 (13:38 -0800)]
ovs-ofctl: Fix memory leak reported by valgrind.
Reported by 348: ovs-ofctl parse-flows (skb_priority)
Reason: return without freeing memory
Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Co-authored-by: Daniele Di Proietto <diproiettod@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
William Tu [Thu, 7 Jan 2016 23:59:34 +0000 (15:59 -0800)]
stream-ssl: Fix memory leak reported by valgrind.
test case 1628: peer ca cert
ASN1_item_dup
do_ca_cert_bootstrap (stream-ssl.c:413)
ssl_connect (stream-ssl.c:468)
scs_connecting (stream.c:297)
stream_connect (stream.c:320)
Fix by removing the X509_dup().
Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
William Tu [Thu, 7 Jan 2016 23:53:08 +0000 (15:53 -0800)]
ovsdb-client: Fix memory leak reported by valgrind.
test case 1427: ovsdb-server combines updates on backlogged connections.
ovsdb_column_set_add (column.c:233)
add_column (ovsdb-client.c:730)
parse_monitor_columns (ovsdb-client.c:787)
add_monitored_table (ovsdb-client.c:872)
do_monitor__ (ovsdb-client.c:945)
Reported-by: William Tu <u9012063@gmail.com>
Reported-at: http://openvswitch.org/pipermail/dev/2016-January/064161.html Signed-off-by: Andy Zhou <azhou@ovn.org> Signed-off-by: Ben Pfaff <blp@ovn.org>