Alex Wang [Thu, 28 May 2015 23:19:15 +0000 (16:19 -0700)]
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>
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>
Sorin Vinturis [Fri, 19 Jun 2015 16:33:56 +0000 (16:33 +0000)]
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.
Nithin Raju [Fri, 19 Jun 2015 16:13:08 +0000 (09:13 -0700)]
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.
Jesse Gross [Tue, 16 Jun 2015 18:15:28 +0000 (11:15 -0700)]
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>
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>
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>
With this commit, the VTEP emulator detects the datapath_type of the
bridge used as a "physical" switch, and creates subsequent bridges
with the same type. This allows ovs-vtep to work with the userspace
datapath.
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Gurucharan Shetty <gshetty@nicira.com>
Ben Pfaff [Tue, 16 Jun 2015 15:22:46 +0000 (08:22 -0700)]
xml2nroff: Add support for variable substitutions.
This allows XML-generated manpages in the source tree to include correct
directory names for the local configuration, instead of just the plain
nroff ones.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
Ben Pfaff [Sat, 13 Jun 2015 23:58:49 +0000 (16:58 -0700)]
dummy: Introduce new --enable-dummy=system option.
Until now there have been two variants for --enable-dummy:
* --enable-dummy: This adds support for "dummy" dpif and netdev.
* --enable-dummy=override: In addition, this replaces *every* existing
dpif and netdev by the dummy type.
The latter is useful for testing but it defeats the possibility of using
the userspace native tunneling implementation (because all the tunnel
netdevs get replaced by dummy netdevs). Thus, this commit adds a third
variant:
* --enable-dummy=system: This replaces the "system" dpif and netdev
by dummies but leaves the others untouched.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
Ben Pfaff [Sat, 13 Jun 2015 23:59:49 +0000 (16:59 -0700)]
netdev: Initialize at the beginning of netdev_unregister_provider().
Otherwise, if netdev_unregister_provider() is called before any other
netdev function, netdev_class_mutex is not initialized and the attempt to
lock it aborts.
This doesn't fix an existing bug but with the following commit
--enable-dummy=system will make netdev_unregister_provider() the first
netdev function to be called.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
Ben Pfaff [Sun, 14 Jun 2015 18:03:23 +0000 (11:03 -0700)]
packets: Generalize compose_arp().
Until now, compose_arp() has only been able to compose ARP requests. This
extends it to composing general ARP packets, in particular replies.
An upcoming commit will make use of this capability.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
Sorin Vinturis [Thu, 28 May 2015 20:30:57 +0000 (20:30 +0000)]
datapath-windows: BSOD when disabling the extension
When the filter detach routine is called while there are packets
still in processing, the OvsUninitSwitchContext function call will
decrement the switch context reference count without releasing the
switch context structure. This behaviour is correct and expected,
but the BSOD is caused in this case because the gOvsSwitchContext
variable is set to NULL, which is wrong.
The gOvsSwitchContext global variable must be set to NULL only when
the switch context structure is actually released.
Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/80 Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Mon, 15 Jun 2015 22:28:43 +0000 (15:28 -0700)]
ovn-sb: Remove redundant "attached_port" column from Gateway table.
The keys in the Chassis table's "gateway_ports" column report the same
information as the Gateway table's "attached_port" column, so this commit
removes the latter.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
dpif-netdev: Prefetch next packet before miniflow_extract().
It appears that miniflow_extract() in emc_processing() spends a lot of
cycles waiting for the packet's data to be read.
Prefetching the next packet's data while parsing removes this delay.
For a single flow pipeline the throughput improves by ~10%. With a
more realistic pipeline the change has a much smaller effect (~0.5%
improvement)
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
ovs-ctl: let openvswitch startup to NOT hold up system boot upon error
Abort openvswitch startup script if ovsdb startup fails for
some reason. This helps in getting the system startup to NOT hang
indefinitely, as was seen in a recent report when ovsdb failed with
"I/O error: /etc/openvswitch/conf.db: failed to lock lockfile
(Resource temporarily unavailable)" and system remained in hung state
forever, unless manually rebooted from console.
Signed-off-by: Sabyasachi Sengupta <sabyasachi.sengupta@alcatel-lucent.com>
[blp@nicira.com changed an 'if' statement to '||'] Signed-off-by: Ben Pfaff <blp@nicira.com>
Russell Bryant [Sat, 13 Jun 2015 01:08:33 +0000 (21:08 -0400)]
Update location for Neutron plugin.
The git repository for the neutron plugin has been renamed to reflect
that it is now officially part of the OpenStack Neutron project. The
repo now lives in the "openstack" namespace.
Also remove the link to the todo file as those are now just tracked in
the networking-ovn bug tracker (launchpad bugs).
Signed-off-by: Russell Bryant <rbryant@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Russell Bryant [Fri, 12 Jun 2015 16:51:24 +0000 (12:51 -0400)]
fedora.spec: Create openvswitch-ovn package.
This patch creates a new subpackage for OVN, openvswitch-ovn. It also
installs systemd unit files for ovn-controller and ovn-northd.
If you want to run ovn-controller:
# systemctl start ovn-controller
If you want to run ovn-northd:
# systemctl start ovn-northd
Both systemd units are currently set to depend on openvswitch. If
further ovsdb initialization is required for the OVN databases before
ovn-northd can start, that will be handled automatically by ovn-ctl
when you start the ovn-northd service.
This currently assumes that ovn-northd runs on the same host as
ovsdb-server that is hosting the OVN databases. That seems like a
reasonable assumption in the current architecture and can be evolved
later when needed.
Signed-off-by: Russell Bryant <rbryant@redhat.com> CC: Flavio Leitner <fbl@redhat.com> CC: Ben Pfaff <blp@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Russell Bryant [Fri, 12 Jun 2015 16:51:23 +0000 (12:51 -0400)]
ovn: Add ovn-ctl to assist with OVN daemon lifecycle.
This patch introduces ovn-ctl, which is similar to ovs-ctl. I opted
for a new script as everything in OVN so far is nicely isolated, so a
new script seemed to make the most sense.
If you'd like to run ovn-controller on a host already running ovs:
# ovn-ctl start_controller
If you'd like to run ovn-northd:
# ovn-ctl start_northd
Note that ovn-ctl assumes that ovn-northd is running on the same
server as ovsdb-server hosting the OVN databases. Based on the
current architecture this seems like a completely reasonable
assumption. This can be improved later when needed.
There's some additional stuff happening in start_northd to make the
experience nicer and not require additional steps by the
administrator. It creates the OVN dbs if they don't exist. If
ovsdb-server hasn't loaded them, it tells it to load them, as well.
ovn-ctl also supports running everything on the same host. This would
be common in a test environment with a single host or small set of
hosts. That would simply be:
Ciara Loftus [Thu, 4 Jun 2015 13:51:40 +0000 (06:51 -0700)]
netdev-dpdk: add dpdk vhost-user ports
This patch adds support for a new port type to the userspace
datapath called dpdkvhostuser.
A new dpdkvhostuser port will create a unix domain socket which
when provided to QEMU is used to facilitate communication between
the virtio-net device on the VM and the OVS port on the host.
vhost-cuse ('dpdkvhost') ports are still available as 'dpdkvhostcuse'
ports and will be enabled if vhost-cuse support is detected in the
DPDK build specified during compilation of the switch. Otherwise,
vhost-user ports are enabled.
Ben Pfaff [Sun, 14 Jun 2015 01:46:34 +0000 (18:46 -0700)]
ovn-controller: Verify bridge ports before changing.
OVSDB is transactional but it does not have built-in protection from dirty
reads. To avoid those, it's necessary to manually add verification to
transactions to ensure that any data reads whose values were essential to
later writes have not changed. ovn-controller didn't do that for
the "ports" column in the Bridge table, which means that if the set of
ports changed when it didn't expect it, it could revert changes made by
other database clients.
In particular this showed up in a scale test, where ovn-controller would
delete "vif" ports added via ovs-vsctl.
(It's easy to see exactly what happened by looking in the database log
with "ovsdb-tool -mm show-log".)
Reported-by: Russell Bryant <rbryant@redhat.com>
Reported-at: http://openvswitch.org/pipermail/dev/2015-June/056326.html Signed-off-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Fri, 12 Jun 2015 23:12:56 +0000 (16:12 -0700)]
ofproto: Support port mods in bundles.
Add support for port mods in an OpenFlow 1.4 bundle, as required for
the minimum support level by the OpenFlow 1.4 specification. If the
bundle includes port mods, it may not specify the OFPBF_ATOMIC flag.
Port mods and flow mods in a bundle are always applied in order and
the consecutive flow mods between port mods are made available to
lookups atomically.
Note that ovs-ofctl does not support creating bundles with port mods.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Fri, 12 Jun 2015 23:12:56 +0000 (16:12 -0700)]
ofproto: Postpone sending flow removed messages.
The final flow stats are available only after there are no references
to the rule. Postpone sending the flow removed message until the
final stats are available.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Fri, 12 Jun 2015 23:12:56 +0000 (16:12 -0700)]
classifier: Simplify versioning.
After all, there are some cases in which both the insertion version
and removal version of a rule need to be considered. This makes the
cls_match a bit bigger, but makes classifier versioning much simpler
to understand.
Also, avoid using type larger than int in an enum, as it is not
portable C.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Fri, 12 Jun 2015 00:28:37 +0000 (17:28 -0700)]
rculist: Remove postponed poisoning.
Postponed 'next' member poisoning was based on the faulty assumption
that postponed functions would be called in the order they were
postponed. This assumption holds only for the functions postponed by
any single thread. When functions are postponed by different
threads, there are no guarantees of the order in which the functions
may be called, or timing between those calls after the next grace
period has passed.
Given this, the postponed poisoning could have executed after
postponed destruction of the object containing the rculist element.
This bug was revealed after the memory leaks on rule deletion were
recently fixed.
This patch removes the postponed 'next' member poisoning and adds
documentation describing the ordering limitations in OVS RCU.
Alex Wang dug out the root cause of the resulting crashes, thanks!
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
Alex Wang [Tue, 9 Jun 2015 05:57:09 +0000 (22:57 -0700)]
vtep-ctl: Fix a bug.
add_port_to_cache() uses 'cache_name' as the shash node name for
shash_add(). So, the del_cached_port() must also pass 'cache_name'
as argument for shash_find_and_delete().
This bug does not cause any issue currently but should be fixed.
Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
Jarno Rajahalme [Thu, 11 Jun 2015 22:53:43 +0000 (15:53 -0700)]
ofproto: Revertible eviction.
Handling evictions was broken in the previous patches. Eviction took
place early in the commit, and actually inappropriately bumped the
version number too early. Now eviction is treated much like a flow
modification, where a new rule replaces the old one, but just without
any 'inheritance' from the evicted rule to the new rule. This makes
evictions to be executed only when commit is successful, as evictions
are reverted like any other changes when the commit fails.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Thu, 11 Jun 2015 22:53:43 +0000 (15:53 -0700)]
ofproto: Accurate flow counts.
Classifier's rule count now contains temporary duplicates and rules
whose deletion has been deferred. Maintain a new 'n_flows' count in
struct oftable to as the count of rules in the latest version.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Thu, 11 Jun 2015 22:53:43 +0000 (15:53 -0700)]
Use classifier versioning.
Each rule is now added or deleted in a specific tables version. Flow
tables are versioned with a monotonically increasing 64-bit integer,
where positive values are valid version numbers.
Rule modifications are implemented as an insertion of a new rule and a
deletion of the old rule, both taking place in the same tables
version. Since concurrent lookups may use different versions, both
the old and new rule must be available for lookups at the same time.
The ofproto provider interface is changed to accomodate the above. As
rule's actions need not be modified any more, we no longer need
'rule_premodify_actions', nor 'rule_modify_actions'. 'rule_insert'
now takes a pointer to the old rule and adds a flag that tells whether
the old stats should be forwarded to the new rule or not (this
replaces the 'reset_counters' flag of the now removed
'rule_modify_actions').
Versioning all flow table changes has the side effect of making
learned flows visible for future lookups only. I.e., the upcall that
executes the learn action, will not see the newly learned action in
it's classifier lookups. Only upcalls that start executing after the
new flow was added will match on it.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Thu, 11 Jun 2015 22:53:42 +0000 (15:53 -0700)]
classifier: Make traversing identical rules robust.
The traversal of the list of identical rules from the lookup threads
is fragile if the list head is removed during the list traversal.
This patch simplifies the implementation of that list by making the
list NULL terminated, singly linked RCU-protected list. By having the
NULL at the end there is no longer a possiblity of missing the point
when the list wraps around. This is significant when there can be
multiple elements with the same priority in the list.
This change also decreases the size of the struct cls_match back
pre-'visibility' attribute size.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jesse Gross [Tue, 9 Jun 2015 17:29:43 +0000 (10:29 -0700)]
odp-util: Remove last use of odp_tun_key_from_attr for formatting.
We formerly converted tunnel attributes to their flow representation
before formatting but now perform all operations directly on the
netlink attributes.
There is one remaining use of odp_tun_key_from_attr() that is not
used for the purposes of generating a flow. This is to check the
mask but this no longer makes sense given the way that we format
the flow itself. In fact, the code is not actually invoked any
more, so we can simply remove it.
This retains the special case for tunnels as a safety measure but it
should not matter in practice.
Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Sat, 6 Jun 2015 05:09:50 +0000 (22:09 -0700)]
netdev-vport: Mark netdev_vport_get_dpif_port() as OVS_WARN_UNUSED_RESULT.
Ignoring the result of this function means that the caller is quite likely
blindly using the character array passed in, instead of the return value,
which leads to latent bugs.
This would have prevented one of the bugs fixed by commit "tunneling: Fix a
tunnel name display bug".
CC: Andy Zhou <azhou@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
Jarno Rajahalme [Wed, 10 Jun 2015 00:00:00 +0000 (17:00 -0700)]
classifier: Support table versioning
This patch allows classifier rules to become visible and invisible in
specific versions. A 'version' is defined as a positive monotonically
increasing integer, which never wraps around.
The new 'visibility' attribute replaces the prior 'to_be_removed' and
'visible' attributes.
When versioning is not used, the 'version' parameter should be passed
as 'CLS_MIN_VERSION' when creating rules, and 'CLS_MAX_VERSION' when
looking up flows.
This feature enables the support for atomic OpenFlow bundles without
significant performance penalty on 64-bit systems. There is a
performance decrease in 32-bit systems due to 64-bit atomics used.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Fri, 5 Jun 2015 21:03:12 +0000 (14:03 -0700)]
ovs-ofctl: Add bundle support and unit testing.
All existing ovs-ofctl flow mod commands now take an optional
'--bundle' argument, which executes the flow mods as a single
transaction. OpenFlow 1.4+ is implicitly assumed when '--bundle' is
specified.
ovs-ofctl 'add-flow' and 'add-flows' commands now accept flow
specifications that start with an optional 'add', 'modify', 'delete',
'modify_strict', or 'delete_strict' keyword, so that arbitrary flow
table modifications may be specified. For backwards compatibility, a
missing keyword is treated as an 'add'. With the new '--bundle'
option all the modifications are executed as a single transaction
using an OpenFlow 1.4 bundle.
OpenFlow 1.4 requires bundles to support at least flow and port mods.
This implementation does not yet support port mods in bundles.
Another restriction is that the atomic transactions are not yet
supported.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Fri, 5 Jun 2015 21:03:11 +0000 (14:03 -0700)]
ofproto: Rename *_begin functions as *_start.
Weirdest things can bother you at night when you try to sleep ;-)
Now we have function triples such as add_flow_begin(),
add_flow_finish(), and add_flow_revert(), where a modification is
started in *_begin(), which can fail, and when successful can be
either made permanent with *_finish(), or cancelled with *_revert().
Linguistically it should be either "begin/end" or "start/finish", not
"begin/finish". "begin/end" has some C++ STL baggage, so let's go
with "start/finish". IMO "revert" rhymes with it, too.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Sun, 7 Jun 2015 16:48:14 +0000 (09:48 -0700)]
configure: Stop avoiding -Wformat-zero-length.
Debian likes to enable -Wformat-zero-length, even over our code trying to
disable it. It isn't too hard to make our code warning-free against this
option, so this commit both stops disabling it and fixes the warnings.
The first fix is to change set_subprogram_name() to take a plain string
instead of a format string, and to adjust its few callers. This fixes one
warning since one of those callers passed in an empty string.
The second fix is to remove a test for ovs_scan() against an empty string.
I couldn't find a way to avoid a warning for this test, and it isn't too
valuable in any case.
This allows us to drop filtering for -Wformat from the Debian rules file,
so this commit removes it.
Joe Stringer [Tue, 9 Jun 2015 20:35:29 +0000 (13:35 -0700)]
dpif: Always generate RFC4122 UUIDs for UFID.
This patch sacrifices a few bits of hash quality from the 128-bit unique
flow identifiers to make the UFIDs RFC4122-conformant as per the version 4
(random) UUID spec. Given that the 128-bit space is already quite large,
this should not affect the spread of UFIDs in any meaningful way for
hashing.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Tue, 9 Jun 2015 22:24:33 +0000 (15:24 -0700)]
odp-util: Simplify parsing function for GCC.
GCC 4.7.2 -O3 flagged potential use before initialization for the 'id'
and 'id_mask' being scanned in scan_vxlan_gbp(). For the 'id' this
was a real possiblity, but for the 'id_mask' it seems to be a false
positive in gcc analysis. Simplify scan_vxlan_gbp() to fix this.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Tue, 9 Jun 2015 22:24:33 +0000 (15:24 -0700)]
ofproto: Fix memory leak in ofproto_rule_delete().
Commit 401aa90e33be (ofproto: Fix memory leak in flow deletion.) fixed
the memory leak when a rule is deleted, but failed to do the same when
all rules in a bridge are deleted just before the bridge itself is
deleted.
This patch adds the necessary unref to ofproto_rule_delete().
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Andy Zhou [Mon, 16 Mar 2015 22:45:27 +0000 (15:45 -0700)]
ovsdb-monitor: add json cache
Although multiple jsonrpc monitors can share the same ovsdb monitor,
each change still needs to translated into json object from scratch.
This can be wasteful if multiple jsonrpc monitors are interested in the
same changes.
Json cache improves this by keeping an copy of json object generated
for transaction X to current transaction. When jsonrpc is interested
in a change, the cache is searched first, if an json object is found,
a copy of it is handed back, skipping the regeneration process.
Any commit to the monitor will empty the cache. This can be further
optimized to not throw away the cache if the updated tables and columns
are not being monitored.
Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Andy Zhou [Mon, 16 Mar 2015 10:03:20 +0000 (03:03 -0700)]
ovsdb-monitor: allow multiple jsonrpc monitors to share a single ovsdb
monitor
Store ovsdb monitor in a global hmap. If a newly created ovsdb monitor
object monitors the same tables and columns as an existing one, the
existing monitor will be reused.
With this patch, jsonrpc monitor and ovsdb monitor now have N:1 mapping.
The goals are to:
1) Reduce the cost of maintaining duplicated monitors.
2) Allow for create Json cache for the same updates. Json cache will be
introduced in the following patch.
Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Andy Zhou [Thu, 4 Jun 2015 20:45:55 +0000 (13:45 -0700)]
tunneling: Fix a tunnel name display bug
Currently, 'ovs-appctl tnl/ports/show' command won't display gre port
name correctly. Since netdev_vport_get_dpif_port() will not always
set the 'namebuf' it receives. Should use the name by its return
value instead. Found by inspection.
Also extend the test case to cover this command.
Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jesse Gross [Sat, 16 May 2015 00:03:17 +0000 (17:03 -0700)]
ofp-util: Convert flow_metadata to match structure.
We have a special flow_metadata structure to represent the parts
of a packet that aren't carried in the payload itself. This is
used in the case where we need to send the packet as a Packet In
to an OpenFlow controller. This is a subset of the more general
struct flow.
In practice, almost all operations we do on this structure involve
converting it to or from a match or have code that is the same as
a match. Serialization to NXM and back is done as a match. There
is special flow_metadata formatting code that is almost identical
to match formatting.
The uses for struct flow_metadata aren't performance critical
when it comes to memory, so we can save quite a bit of code by
just using a match structure directly instead. In addition, as
metadata increases and becomes more complex (Geneve options require
some special handling beyond just additional fields), using the
match structure means we only have to do this work in one place.
Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
This commit adds the windows installer to the OVS tree.
Requirements are the following:
Visual Studio Community 2013
WiX Toolset 3.9
Microsoft_VC120_CRT_x86.msm
More detailed information on the requirements and build instructions
can be found under:
https://github.com/cloudbase/ovs-windows-installer/blob/master/README.rst
To run and make the installer issue the following:
To uninstall one could use the following Powershell commandlets:
$app = Get-WmiObject -Class Win32_Product | Where-Object `
{ $_.Name -match "Open Vswitch" }
Alex Wang [Sun, 7 Jun 2015 18:38:52 +0000 (11:38 -0700)]
odp-util: Make sure vlan tci mask has exact match for VLAN_CFI.
OVS datapath has check which prevents the installation of flow
that matches VLAN TCI but does not have exact match for VLAN_CFI
bit. To follow this rule, ovs userspace must make sure the
flow key for datapath flow matching VLAN TCI has exact match for
VLAN_CFI bit.
Before this commit, this is not enforced, so OpenFlow flow like
"vlan_tci=0x000a/0x0fff,action=output:local" can generate datapath
flow like "vlan(vid=10/0xfff,pcp=0/0x0,cfi=1/0)".
With the OVS datapath check, the installation of such datapath
flow will be rejected with:
"|WARN|system@ovs-system: failed to put[create][modify] (Invalid argument)"
This commit makes ovs userspace always exact match the VLAN_CFI
bit if the flow matches VLAN TCI.
Reported-by: Ronald Lee <ronaldlee@vmware.com> Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Use xzalloc instead of xmalloc for some key structure allocations in
ofproto-dpif (viz. ofproto_dpif, ofport_dpif and rule_dpif) so as to
prevent uninitialized values in these structures.
Signed-off-by: Sabyasachi Sengupta <sabyasachi.sengupta@alcatel-lucent.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 5 Jun 2015 15:13:28 +0000 (08:13 -0700)]
ofproto-dpif: Avoid creating OpenFlow ports for duplicate tunnels.
Until now, when two tunnels had an identical configuration, both of them
were assigned OpenFlow ports, but only one of those OpenFlow ports was
functional. With this commit, only one of the two (or more) identically
configured tunnels will be assigned an OpenFlow port number.
Reported-by: Keith Holleman <hollemanietf@gmail.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Co-authored-by: Andy Zhou <azhou@nicira.com> Signed-off-by: Andy Zhou <azhou@nicira.com>
Non pmd threads have a core_id == UINT32_MAX, while queue ids used by
netdevs range from 0 to the number of CPUs. Therefore core ids cannot
be used directly to select a queue.
This commit introduces a simple mapping to fix the problem: pmd threads
continue using queues 0 to N (where N is the number of CPUs in the
system), while non pmd threads use queue N+1.
Fixes: d5c199ea7ff7 ("netdev-dpdk: Properly support non pmd threads.") Reported-by: 차은호 <eunho.cha@atto-research.com Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Signed-off-by: Mark D. Gray <mark.d.gray@intel.com> Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Flavio Leitner <fbl@redhat.com> Acked-by: Ethan Jackson <ethan@nicira.com>
Jesse Gross [Tue, 19 May 2015 00:17:41 +0000 (17:17 -0700)]
metaflow: Convert hex parsing to use new utility functions.
We now have functions that can do parsing and printing of long hex
strings, so we should use them for meta flow fields to ensure
consistent behavior.
Since these functions can handle infinitely long strings, we can
also increase the maximum field size for MFS_HEXADECIMAL types to
the limit allowed by NXM/OXM. This is useful for future large fields,
such as Geneve options.
Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>