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

10798 Commits

Author SHA1 Message Date
Ben Pfaff
761fd08f83 ovn-controller: Explicitly pass the flow table from function to function.
As I was working in ovn-controller, I found it hard to tell what code
produced and what code consumed the OpenFlow flow table, because it was
all implicit.  This commit makes the data structure an explicit variable
in the main loop, which makes it easier to see.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
2015-07-28 11:06:51 -07:00
Ben Pfaff
f1fd765733 ovn-controller: Avoid blocking to commit OVSDB transactions.
Until now, ovn-controller has been full of loops that commit a transaction
to the OVS or OVN Southbound database.  These blocking loops delay other
work within ovn-controller.  They also make it unsafe to keep pointers to
database records within a single ovn-controller main loop, since calls
to ovsdb_idl_run() can cause IDL records to be destroyed.  This commit
drops all of the blocking calls, instead doing a single commit to the
databases at the end of each main loop.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
2015-07-28 11:06:47 -07:00
Ben Pfaff
acd55f58a5 ovn-controller: Drop unnecessary checks for ovsdb_idl_is_alive().
The IDLs as created by ovn-controller always retry failed connections,
which means that ovsdb_idl_is_alive() will always report that they are
alive.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
2015-07-28 11:02:35 -07:00
Ben Pfaff
9326534c9c ovn-controller: Fix potential use-after-free in get_core_config().
It's unsafe to hold a pointer to a row in the IDL across calls to
ovsdb_idl_run() for that IDL.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
2015-07-28 11:02:28 -07:00
Alex Wang
49af9a3d44 netdev-linux: Cache the result of previous reading of in4 address.
This commit makes netdev_linux_set_in4() cache the result of previous
reading of in4 address (successful or not).

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-28 09:29:14 -07:00
Alex Wang
7df6932e0f netdev-linux: Make netdev_linux_get_in6() conform to API definition.
The get_in6() API defined in netdev-provider.h requires the return
of error values when the 'netdev' has no assigned IPv6 address or
the 'netdev' does not support IPv6.  However, the netdev_linux_get_in6()
implementation does not follow this (always return 0).  And this
causes the a bug in deleting vlan interfaces created for vlan
splinter.

This commit makes netdev_linux_get_in6() conform to the API definition
and returns the specified error value when failing to get IPv6 address.

VMware-BZ: #1485521
Reported-by: Ronald Lee <ronaldlee@vmware.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-28 09:27:42 -07:00
Alex Wang
d6384a3a20 netdev-linux: Make netdev_linux_notify_sock join RTNLGRP_IPV4_IFADDR
and RTNLGRP_IPV6_IFADDR.

Currently the netdev_linux_notify_sock only joins multicast group
RTNLGRP_LINK for link status change notification.  Some ovs features
also require the detection of ip addresses changes and update of the
netdev-linux's cache.  To achieve this, we need to make
netdev_linux_notify_sock join the multicast group RTNLGRP_IPV4_IFADDR
and RTNLGRP_IPV6_IFADDR.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-28 09:27:09 -07:00
Alex Wang
7e9dcc0f99 rtnetlink: Extend rtnetlink to support RTNLGRP_IPV4_IFADDR and
RTNLGRP_IPV6_IFADDR.

This commit renames the rtnetlink-link.{c,h} to rtnetlink.{c,h}
and extends the module to support RTNLGRP_IPV4_IFADDR and
RTNLGRP_IPV4_IFADDR multicast groups.  A later patch will start
using this module to react to interface address changes.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-28 09:27:06 -07:00
Sorin Vinturis
1d3950e900 datapath-windows: Avoid BSOD when cleaning up a tunnel vport
If an error appears when creating a tunnel vport the cleanup is performed
twice, which causes the tunnel vport to be released also twice and
generate a BSOD.

This patch modifies the tunnel filter cleanup logic to avoid this issue.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/97
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-28 08:08:04 -07:00
Gurucharan Shetty
7ad705c65f ofproto-dpif.at: Skip a sflow test.
sflow is not supported on Windows. So skip the
test.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-27 15:56:25 -07:00
Thadeu Lima de Souza Cascardo
75f697bdcc rtbsd: Include necessary headers on rtbsd.h.
rtbsd.h requires net/if.h for IF_NAMESIZE. This was not caught because rtbsd.c
did not include rtbsd.h as its first header.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-27 15:44:38 -07:00
Gurucharan Shetty
6767b5ec75 collectors: Use closesocket() to close sockets.
We should use closesocket() while closing sockets so that
closing sockets work fine on both POSIX and Windows.
(In POSIX, we #define closesocket close)

Without this change, sflow unit tests would cause ovs-vswitchd
to crash in Windows.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-27 15:34:50 -07:00
Ben Pfaff
a45475400a ofproto-dpif-mirror: Fix insane waste of memory and time in checking VLANs.
When a mirror was restricted to particular VLANs, this code was allocating,
copying, and freeing a 512-byte block of memory just to check the value of
a single bit in the block.  This fixes the problem.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
2015-07-27 15:13:45 -07:00
Niti Rohilla
9809048233 ofproto: Implement OF1.4 Set/Get asynchronous configuration messages.
This patch adds support for Openflow1.4 set/get asynchronous configuration
messages. OpenVSwitch already supports set/get asynchronous configuration
messages for Openflow1.3. In this patch OFPT_SET_ASYNC_CONFIG message
allows the controllers to set the configuration for OFPT_ROLE_STATUS,
OFPT_TABLE_STATUS and OFPT_REQUESTFORWARD in addition to the Openflow1.3
messages. In a OFPT_SET_ASYNC, only the properties that shall be changed
need to be included, properties that are omitted from the message are
unchanged.

The OFPT_GET_ASYNC_CONFIG is used to query the asynchronous configuration
of switch. In a OFPT_GET_ASYNC_REPLY message, all properties must be
included.

According to Openflow1.4 the initial configuration shall be:

   - In the “master” or “equal” role, enable all OFPT_PACKET_IN messages,
     except those with reason OFPR_INVALID_TTL, enable all OFPT_PORT_STATUS
     and OFPT_FLOW_REMOVED messages, and disable all OFPT_ROLE_STATUS,
     OFPT_TABLE_STATUS and OFPT_REQUESTFORWARD messages.

   - In the “slave” role, enable all OFPT_PORT_STATUS messages and disable
     all OFPT_PACKET_IN, OFPT_FLOW_REMOVED, OFPT_ROLE_STATUS,
     OFPT_TABLE_STATUS and OFPT_REQUESTFORWARD messages.

Signed-off-by: Niti Rohilla <niti.rohilla@tcs.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-27 10:15:28 -07:00
Ben Pfaff
ad2e649834 tunnel: Drop 'base_flow' parameter from tnl_xlate_init().
At the point when tnl_xlate_init() is called, all of the members that
tnl_xlate_init() examines in 'base_flow' have the same values in 'flow',
so there's no point in passing both.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
2015-07-24 13:49:19 -07:00
Ben Pfaff
9055ca9a21 ofproto-dpif-xlate: Fix handling of write_actions(group(5),output(10)).
This keeps actset_output as OFPP_UNSET in the special case where a single
write_actions() contains a group action followed by an output action.  The
presumably more common case where instructions in separate action lists
contained output and group actions was already properly handled.

Without the fix added by this commit, the test case as updated by this
commit fails.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
2015-07-24 13:04:21 -07:00
Ben Pfaff
2338727d30 ofproto-dpif-upcall: Fix typo in comment.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
2015-07-24 09:28:03 -07:00
Ben Pfaff
0a1017cb23 ofproto-dpif-upcall: Indentation fix.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
2015-07-24 09:27:58 -07:00
Ben Pfaff
7033c5ab54 ofproto-dpif-xlate: Remove unused function xlate_out_copy().
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
2015-07-24 09:26:33 -07:00
Thadeu Lima de Souza Cascardo
e81541398a perf-counter: Fix segfaults on non-Linux platforms.
Commit 0eee08dbddea520536197657da7a0b (perf-counter: simplify the
performance macro) introduces the PERF macro, which is empty for non-linux
platforms.

Added to commit bc487aeff2d6823c088d6e4499e0f53e6651523b (ovsdb: Add per
transaction commit instruction counter), that uses such macro, it causes
segfaults, since it makes ovsdb_txn_commit return an uninitialized pointer as
error.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
[blp@nicira.com added {} around the macro expansion]
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-24 09:20:05 -07:00
Ben Pfaff
44dbb3e4bd netflow: Mark some function parameters 'const'.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
2015-07-23 15:48:51 -07:00
Andy Zhou
d33340a56b db-ctl-base: make cmd_show_table private
Instead of requiring user to declare a global variable, pass the value
via ctl_init().

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-23 13:31:55 -07:00
Andy Zhou
6530be3ba0 db-ctl-base: remove the recurse member from struct cmd_show_table
The 'recurse' is used during run time to suppress duplicated prints.
It is not essential to describe how show command should work.

This patch remove the 'recurse' member. Duplicated prints is now
suppressed by maintaining an 'sset' of tables that have been printed
at run time.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-23 13:18:01 -07:00
Gurucharan Shetty
ecbc260f00 INSTALL.Windows.md: Update the minimum required compiler.
MSVC 2013 update 4 was released in Nov 2014. Its release notes
says that it has fixed the problem wherein using designated
initializers to initialize unions within structs would
fail to compile.

Using designated initializers is useful in OVS and so this commit
updates the minimum required compiler for Windows.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-23 11:02:09 -07:00
Chris J Arges
33b2ad88ef datapath: allocate nr_node_ids flow_stats instead of num_possible_nodes
Some architectures like POWER can have a NUMA node_possible_map that
contains sparse entries. This causes memory corruption with openvswitch
since it allocates flow_cache with a multiple of num_possible_nodes()
and
assumes the node variable returned by for_each_node will index into
flow->stats[node].

Use nr_node_ids to allocate a maximal sparse array instead of
num_possible_nodes().

The crash was noticed after 3af229f2 was applied as it changed the
node_possible_map to match node_online_map on boot.
Fixes: 3af229f2071f5b5cb31664be6109561fbe19c861

Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
2015-07-22 12:54:00 -07:00
Ben Pfaff
90ffd53419 Makefiles: Clean and do not distribute IDL-generated files.
IDL-generated files don't need to be distributed, and distributing them
puts them in the source directory rather than the build directory, which
causes "make distcheck" to fail if any of them need to be remade.  To
prevent this, this commit this removes them from ..._SOURCES, moving them
into nodist_..._SOURCES.

IDL-generated files all need to be cleaned, so this commit adds all of
them to CLEANFILES wholesale via a single CLEANFILES += $(OVSIDL_BUILT)
line in ovsdb/automake.mk, removing the individual additions from various
makefiles.

With this commit, "make distcheck" passes for me.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Aaron Conole <aaron@bytheb.org>
2015-07-22 09:56:32 -07:00
Ben Pfaff
ea53e3a86d treewide: Change doubled ";;" to single ";" in C code.
Except in "for (;;)".

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
2015-07-22 09:54:11 -07:00
Ben Pfaff
9b0b57ca15 tnl-arp-cache: Remove spurious OVS_UNUSED from tnl_arp_cache_flush().
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
2015-07-22 08:25:45 -07:00
Ben Pfaff
08a9564368 tnl-arp-cache: Indentation fixes.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
2015-07-22 08:25:36 -07:00
Gal Sagie
eae3484956 Add 'name' field to logical router port NB schema
Signed-off-by: Gal Sagie <gal.sagie@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-21 15:52:53 -07:00
Neil McKee
7321bda384 Extend sFlow agent to report tunnel and MPLS structures
Packets are still sampled at ingress only, so the egress
tunnel and/or MPLS structures are only included when there is just 1 output
port.  The actions are either provided by the datapath in the sample upcall
or looked up in the userspace cache.  The former is preferred because it is
more reliable and does not present any new demands or constraints on the
userspace cache, however the code falls back on the userspace lookup so that
this solution can work with existing kernel datapath modules. If the lookup
fails it is not critical: the compiled user-action-cookie is still available
and provides the essential output port and output VLAN forwarding information
just as before.

The openvswitch actions can express almost any tunneling/mangling so the only
totally faithful representation would be to somehow encode the whole list of
flow actions in the sFlow output.  However the standard sFlow tunnel structures
can express most common real-world scenarios, so in parsing the actions we
look for those and skip the encoding if we see anything unusual. For example,
a single set(tunnel()) or tnl_push() is interpreted,  but if a second such
action is encountered then the egress tunnel reporting is suppressed.

The sFlow standard allows "best effort" encoding so that if a field is not
knowable or too onerous to look up then it can be left out. This is often
the case for the layer-4 source port or even the src ip address of a tunnel.
The assumption is that monitoring is enabled everywhere so a missing field
can typically be seen at ingress to the next switch in the path.

This patch also adds unit tests to check the sFlow encoding of set(tunnel()),
tnl_push() and push_mpls() actions.

The netlink attribute to request that actions be included in the upcall
from the datapath is inserted for sFlow sampling only.  To make that option
be explicit would require further changes to the printing and parsing of
actions in lib/odp-util.c, and to scripts in the test suite.

Further enhancements to report on 802.1AD QinQ, 64-bit tunnel IDs, and NAT
transformations can follow in future patches that make only incremental
changes.

Signed-off-by: Neil McKee <neil.mckee@inmon.com>
[blp@nicira.com made stylistic and semantic changes]
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-21 14:19:04 -07:00
Daniele Di Proietto
4b8df03787 netdev-dpdk: Restore txq/rxq number if initialization fails.
netdev_dpdk_set_multiq() should not set the number of configured rxq
and txq if the driver initialization fails (meaning that the driver
failed to setup the queues).  Otherwise, on a subsequent call to
netdev_dpdk_set_multiq(), the code may believe that the queues have
already been setup and there's no work to be done.

This commit fixes the problem by restoring the old values if
dpdk_eth_dev_init() fails.

Reported-by: Ian Stokes <ian.stokes@intel.com>
Tested-by: Ian Stokes <ian.stokes@intel.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
2015-07-21 12:01:37 -07:00
Flavio Leitner
24496b4ac2 rhel: Fix ifup-ovs to delete ports first.
When ifdown isn't executed (system didn't shut down properly),
the interfaces remain in the openvswitch's database.  For the
internal ports or devices that are available when openvswitch
service starts that's not an issue.

However, ovs-vsctl won't do anything for devices created later
(Linux vlan devices for instance) since they are already in the
database. That leaves a inconsistency behind because they will
be left out of the kernel's datapath.

The ifup/ifdown will operate only on configured interfaces, so
this patch fixes the issue by deleting the interface from the
database before attempt to configure it.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Acked-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-21 11:37:13 -07:00
Russell Bryant
73cd29796f ovs-sim: Don't install man page.
The build system was set up to install the ovs-sim manpage, but not
ovs-sim itself.  I noticed this because the fedora rpm build is
currently broken because the man page was installed but not packaged
yet.  Fix this up by not installing the manpage.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-21 11:31:43 -07:00
Aaron Conole
1a16d008e6 vtep/automake.mk: Changes to support make distcheck.
Add autogenerated files to the CLEANFILES so that they are not kept around
after clean/distclean.

Signed-off-by: Aaron Conole <aaron@bytheb.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-21 10:39:23 -07:00
Aaron Conole
51d41d39d2 tests/automake.mk: Changes to support make distcheck.
Add autogenerated files to the CLEANFILES so that they are not kept around
after clean/distclean.

Signed-off-by: Aaron Conole <aaron@bytheb.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-21 10:38:43 -07:00
Aaron Conole
1f7d1459a6 lib/automake.mk: Changes to support make distcheck.
Eliminate the $(srcdir) requirement on vswitch-idl.ovsidl.  Also, add
autogenerated files to the CLEANFILES so that they are not kept around
after clean/distclean.

Signed-off-by: Aaron Conole <aaron@bytheb.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-21 10:37:33 -07:00
Aaron Conole
283430e6e4 datapath-windows/include/automake.mk: Only build for WIN32 builds
Signed-off-by: Aaron Conole <aaron@bytheb.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-21 10:15:19 -07:00
Aaron Conole
0f89f1a735 .travis.yml: Tell travis-ci that sudo support is required
.travis/prepare.sh calls sudo.

Signed-off-by: Aaron Conole <aaron@bytheb.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-21 10:14:16 -07:00
Ben Pfaff
43e5a5b27d ofproto-macros: Remove stray garbage from file.
Due to the way that Autotest works, this text was ignored, but it's still
useless and looks weird and we might as well remove it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
2015-07-21 09:48:32 -07:00
Joe Stringer
83a278847d acinclude: Silence OVS_FIND_FIELD_IFELSE.
Fields found using OVS_FIND_FIELD_IFELSE would previously be printed in
the console during configure. Clean up the output.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-20 11:29:49 -07:00
Ben Pfaff
bccd843bb1 db-ctl-base: Add "static" to definition of ctl_exit().
The prototype said "static" but the definition did not.

Reported by sparse.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
2015-07-20 11:25:17 -07:00
Ben Pfaff
0ad9ae8834 ofproto-dpif: Remove prototype for unimplemented function.
The function was removed some time ago, but not the prototype.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
2015-07-20 11:24:44 -07:00
Alex Wang
38876d31f2 ofpbuf: Update msg when resizing ofpbuf.
Commit 6fd6ed7 (ofpbuf: Simplify ofpbuf API.) introduced the
'header' and 'msg' pointers to 'struct ofpbuf'.  However, we
forget to update the 'msg' pointer when resizing ofpbuf.

This bug could cause serious issue.  For example, in the function
ofputil_encode_nx_packet_in(), the 'msg' pointer is populated in
ofpraw_alloc_xid() when creating the ofpbuf .  Later, the ofpbuf
memory can be reallocated due to the writing to the ofpbuf.
However, since the 'msg' pointer is not updated, the later use of
the 'ofpbuf->msg' will end up writing to either free'ed memory or
memory allocated for other struct.

This commit fixes the bug by always updating the 'header' and
'msg' pointers when the ofpbuf is resized.  Also, a simple test
is added.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-20 10:19:12 -07:00
Ben Pfaff
dfe5044cef ofp-util: Allow out-of-range indexes in ofputil_decode_geneve_table_reply().
Otherwise, if some future version of OVS supports more Geneve options than
the current version, and any of these extras are in use, then one would be
unable to dump them with "ovs-ofctl dump-geneve-map", and any other
OVS-based software that wants to dump the Geneve map to work with the
existing options (i.e. ovn-controller) would fail entirely, instead of
being able to work with at least a subset.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2015-07-19 21:55:47 -07:00
Jarno Rajahalme
361d808dd9 flow: Split miniflow's map.
Use two maps in miniflow to allow for expansion of struct flow past
512 bytes.  We now have one map for tunnel related fields, and another
for the rest of the packet metadata and actual packet header fields.
This split has the benefit that for non-tunneled packets the overhead
should be minimal.

Some miniflow utilities now exist in two variants, new ones operating
over all the data, and the old ones operating only on a single 64-bit
map at a time.  The old ones require doubling of code but should
execute faster, so those are used in the datapath and classifier's
lookup path.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-17 15:18:43 -07:00
Jarno Rajahalme
8cd27cfd1e dpif-netdev: Skip also xregs when building a mask.
When no mask is passed in, dpif_netdev_mask_from_nlattrs() builds a
mask from all possible fields whose prerequisites are met.  OpenFlow
metadata is not relevant for a datapath flow, so we skip registers and
metadata.  Do this for XREGs as well.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-17 15:18:43 -07:00
Neil McKee
0e469d3b38 datapath: Include datapath actions with sampled-packet upcall to userspace.
If new optional attribute OVS_USERSPACE_ATTR_ACTIONS is added to an
OVS_ACTION_ATTR_USERSPACE action, then include the datapath actions
in the upcall.

This Directly associates the sampled packet with the path it takes
through the virtual switch. Path information currently includes mangling,
encapsulation and decapsulation actions for tunneling protocols GRE,
VXLAN, Geneve, MPLS and QinQ, but this extension requires no further
changes to accommodate datapath actions that may be added in the
future.

Adding path information enhances visibility into complex virtual
networks.

Signed-off-by: Neil McKee <neil.mckee@inmon.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
2015-07-17 13:23:39 -07:00
Gurucharan Shetty
c002791a30 type-props: Avoid a MSVC warning.
Currently, MSVC complains when you have a macro of the
form TYPE_MAXIMUM(uint64_t) because a part of macro becomes
~(uint64_t)0 << 64 with a warning:

C4293: '<<' : shift count negative or too big, undefined behavior.

This commit makes changes to the macro to prevent that warning.

Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-07-17 13:21:46 -07:00
Andy Zhou
ce6f1d1fc5 db-ctl-base: make use of user supplied exit function
The user is required to expose the_idl and the_idl_txn global variables,
so that memory can be cleaned up on fatal errors. This patch changes to
ask user to supply an exit function via ctl_init(). What user needs to
do on exit can now remain private.

Signed-off-by: Andy Zhou <azhou@nicira.com>
2015-07-17 13:01:49 -07:00