Thomas Graf [Fri, 29 Aug 2014 23:43:03 +0000 (01:43 +0200)]
travis: Run 'make distcheck' instead of 'make check'
make distcheck runs a superset of make check and will additionally
catch failures in adding new files to the Makefile. It will also test
installation and uninstallation of the package.
Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
These function are used to stored the packet hash. 'netdev-dpdk'
automatically set this value to the RSS hash returned by the
NIC. Other 'netdev's set it to 0 (which is an invalid hash
value), so that callers can compute the hash on their own.
If DPDK support is enabled, struct dpif_packet's member
'dp_hash' is removed and 'pkt.hash.rss' from DPDK mbuf is used
This commit also configure DPDK devices to compute RSS hash
for UDP and IPv6 packets
Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Jarno Rajahalme [Fri, 29 Aug 2014 23:15:44 +0000 (16:15 -0700)]
lib/ovs-thread: Use atomic_count.
barrier->count is used as a simple counter and is not expected the
synchronize the state of any other variable, so we can use atomic_count,
which uses relaxed atomics.
Ditto for the 'next_id' within ovsthread_wrapper().
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Fri, 29 Aug 2014 23:15:44 +0000 (16:15 -0700)]
lib/seq: Document acquire-release semantics.
Seq objects would be really hard to use if they did not provide
acquire-release semantics. Currently they do that via
ovs_mutex_lock()/ovs_mutex_unlock(), respectively. Document the
behavior so that it is safer to rely on that elsewhere.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
This commit introduces the BUILD_MESSAGE() macro. It uses _Pragma("message"),
with compilers that support that, to output a warning-like compile-time message
without blocking the compilation.
Used by next commit.
Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Andy Zhou [Fri, 29 Aug 2014 20:20:23 +0000 (13:20 -0700)]
datapath: simplify sample action implementation
The current sample() function implementation is more complicated
than necessary in handling single user space action optimization
and skb reference counting. There is no functional changes.
Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Jesse Gross [Fri, 15 Aug 2014 18:01:54 +0000 (11:01 -0700)]
datapath: Fix checksum calculation when modifying ICMPv6 packets.
The checksum of ICMPv6 packets uses the IP pseudoheader as part of
the calculation, unlike ICMP in IPv4. This was not implemented,
which means that modifying the IP addresses of an ICMPv6 packet
would cause the checksum to no longer be correct as the psuedoheader
did not match.
Thomas Graf [Fri, 29 Aug 2014 10:21:49 +0000 (12:21 +0200)]
thread: Use explicit wide type when shifting > 32 bits
Without the explicit wide type, the shift operation may be performed
on a int which will result in implementation defined behaviour on a
system with more than 32 CPUs.
Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Fri, 29 Aug 2014 17:34:53 +0000 (10:34 -0700)]
ofproto/ofproto: Use relaxed atomics.
Neither 'miss_config', 'n_missed', nor 'n_matched' is used to
synchronize the state of any other variable, so we can use relaxed
atomic operations on them.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Fri, 29 Aug 2014 17:34:53 +0000 (10:34 -0700)]
ofproto/ofproto-dpif-upcall: Use relaxed atomic operations.
Neither 'enable_megaflows', 'udpif->flow_limit', 'udpif->n_flows', nor
'udpif->n_flows_timestamp' are used to synchronize the state of any
other variables, so we can use relaxed atomic operations to access
them.
Move the atomic read operation of 'enable_megaflows' outside the loop
in handle_upcalls().
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Fri, 29 Aug 2014 17:34:53 +0000 (10:34 -0700)]
lib/netdev-dummy: Use relaxed atomics for a trivial counter.
Even though there is no need to optimize netdev-dummy, it might be
good to do this right, in case it serves as an inspiration for
something else later.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Fri, 29 Aug 2014 17:34:52 +0000 (10:34 -0700)]
lib/ovs-atomic: Add helpers for relaxed atomic access.
When an atomic variable is not serving to synchronize threads about
the state of other (atomic or non-atomic) variables, no memory barrier
is needed with the atomic operation. However, the default memory
order for an atomic operation is memory_order_seq_cst, which always
causes a system-wide locking of the memory bus and prevents both the
CPU and the compiler from reordering memory accesses accross the
atomic operation. This can add considerable stalls as each atomic
operation (regardless of memory order) always includes a memory
access.
In most cases we can let the compiler reorder memory accesses to
minimize the time we spend waiting for the completion of the atomic
memory accesses by using the relaxed memory order. This patch adds
helpers to make such accesses a little easier on the eye (and the
fingers :-), but does not try to hide them completely.
Following patches make use of these and remove all the (implied)
memory_order_seq_cst use from the OVS code base.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Pravin B Shelar [Wed, 27 Aug 2014 14:24:44 +0000 (07:24 -0700)]
datapath: Always initialize fix_segment for GSO packet.
OVS tunnel compat code depends on this function pointer to
handle GSO packet. Currently we do not initialize for all
GRE GSO packets. Following patch fixes that.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
Samuel Ghinet [Fri, 29 Aug 2014 04:06:48 +0000 (04:06 +0000)]
datapath-windows: Rename files.
This patch includes the file renaming and accommodations needed for the file
renaming to build the forwarding extension for Hyper-V.
This patch is also a follow-up for the thread:
http://openvswitch.org/pipermail/dev/2014-August/044005.html
Signed-off-by: Samuel Ghinet <sghinet@cloudbasesolutions.com> Co-authored-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Nithin Raju [Wed, 27 Aug 2014 15:36:19 +0000 (08:36 -0700)]
netlink-socket: Use read/write ioctl instead of ReadFile/WriteFile.
The Windows datapath supports a READ/WRITE ioctl instead of ReadFile/WriteFile.
In this change, we update the following:
- WriteFile() in nl_sock_send__() to use DeviceIoControl(OVS_IOCTL_WRITE)
- ReadFile() in nl_sock_recv__() to use DeviceIoControl(OVS_IOCTL_READ)
The WriteFile() call in nl_sock_transact_multiple__() has not been touched
since it is not needed yet.
Main motive for this change is to be able to unblock the DP Dump workflow.
Signed-off-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Eitan Eliahu <eliahue@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Ben Pfaff [Thu, 28 Aug 2014 15:50:13 +0000 (08:50 -0700)]
CodingStyle: Relax restrictions on types of bit-fields.
C99 only requires compilers to support four types for bit-fields: signed
int, unsigned int, int, and _Bool. "int" should not be used because it
is implementation-defined whether it is signed. In practice, we have found
that compilers (in particular, GCC, Clang, and MSVC 2013) support any
integer type.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Alin Serdean [Thu, 28 Aug 2014 13:49:24 +0000 (13:49 +0000)]
Add build of ovsext.sln using MSBuild
This commit adds to the automake build system the full build required
by the forwarding extension solution.
It will help a lot in the future CI to check the full build of the project.
To configure the forwarding extension to be built one could use the following:
./configure CC=./build-aux/cccl LD="`which link`" LIBS="-lws2_32" \
--prefix="C:/openvswitch/usr" --localstatedir="C:/openvswitch/var" \
--sysconfdir="C:/openvswitch/etc" --with-pthread="C:/pthread" \
--with-vstudioddk="Win8.1 Release"
Documentation will be updated in another patch.
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Saurabh Shah <ssaurabh@vmware.com>
Thomas Graf [Thu, 28 Aug 2014 12:40:50 +0000 (14:40 +0200)]
ovsdb: Fix error leak for negative timeout and invalid until case
Although the check for negative timeout is present, the error string
is overwritten if an invalid "until" is found right after. This leaks
an error string and results in not reporting the negative timeout back
to the user even though it is encountered first.
Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Nithin Raju [Wed, 27 Aug 2014 03:37:18 +0000 (20:37 -0700)]
datapath-windows: Update netlink family IDs
I didn't realize earlier while defining OvsDpInterfaceExt.h that
there are special values defined in netlink-protocol.h for nlmsg_type.
For Eg. NLMSG_ERROR is defined to be 2. In this patch, we update the
values of the family IDs to not clash with the special defines.
I'm using NLMSG_MIN_TYPE as a reference.
All this points to doing family ID lookup from the kernel rather than
returning values from netlink-socket.c. We should move to that model
after we get through the first round of netlink commands.
Signed-off-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Nithin Raju [Wed, 27 Aug 2014 03:20:51 +0000 (20:20 -0700)]
netlink-socket: fix typo to get_sock_pid_from_kernel()
A typo crept in while respinning get_sock_pid_from_kernel() in the previous
patch. Fixing it now. Also, get_sock_pid_from_kernel() doesn't need an OUT
argument. Fixing that too.
Signed-off-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Nithin Raju [Wed, 27 Aug 2014 03:17:03 +0000 (20:17 -0700)]
netlink-socket: add support for nl_lookup_genl_mcgroup()
While we work out whether nl_sock_join_mcgroup() will be the mechanism
to support VPORT events, it is easy to add support for
nl_lookup_genl_mcgroup() and make progress on the other commands.
In this patch, we implement support for nl_lookup_genl_mcgroup() only
for the VPORT family though, which is all what dpif-linux.c needs.
Validation:
- A ported dpif-linux.c with epoll code commented out went so far as
to call dp_enumerate! DP Dump commands can be implemented next.
Signed-off-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Nithin Raju [Wed, 27 Aug 2014 03:17:02 +0000 (20:17 -0700)]
datapath-windows: define mcgroup IDs for VPORT and other families
dpif-linux.c makes a nl_lookup_genl_mcgroup(OVS_VPORT_FAMILY) that is not
implemented yet on Windows yet. Multicast group is used currently to
subscribe to events related to VPORTs. Whether the exact same mechanism
would be used is unclear yet.
In the interim, we can implement code to support nl_lookup_genl_mcgroup().
and make progress with the other simpler commands.
In this patch, we define a ID for the VPORT MC group and use it. The IDs for
other families were also defined, but without usage, were seen as unclear.
Hence we define only the VPORT group.
Signed-off-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Thu, 31 Jul 2014 22:55:59 +0000 (10:55 +1200)]
tests: Fix race conditions.
These tests had the potential to fail due to statistics not updating
before the test script retrieves them. Fix them by waiting until the
next revalidation cycle.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Tue, 26 Aug 2014 22:11:39 +0000 (15:11 -0700)]
lib/flow.h: Improve struct miniflow comment and definition.
Miniflows can nowadays be dynamically allocated to different inline
sizes, as done by lib/classifier.c, but this had not been documented
at the struct miniflow definition.
Also, MINI_N_INLINE had a different value for 32-bit and 64-bit builds
due to a historical reason. Now we use 8 for both.
Finally, use change the storage type of 'values_inline' to uint8_t, as
uint64_t looks kind of wide for a boolean, even though we intend the
bit be carved out from the uint64_t where 'map' resides.
Suggested-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Ed Swierk [Sun, 24 Aug 2014 17:37:29 +0000 (10:37 -0700)]
debian: Fix cross build.
Cross-building openvswitch with debuild -aARCH (or equivalent) fails
because the target architecture is not getting passed to configure.
Thus binaries like ovs-appctl get built using the build host
architecture.
Signed-off-by: Ed Swierk <eswierk@skyportsystems.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Thomas Graf [Tue, 26 Aug 2014 10:01:34 +0000 (12:01 +0200)]
miniflow: Remove unused values_inline branch from miniflow_move()
The branch is unused as size < sizeof dst->inline_values must
always be true for inlined values. Hitting the branch would lead
to corruption as inline_values is accessed out of bounds.
Remove branch and add assertion.
Cc: Jarno Rajahalme <jrajahalme@nicira.com> Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Tue, 26 Aug 2014 15:56:09 +0000 (08:56 -0700)]
debian: Really fix packaging given new dot-files.
commit a5c1096abb1 (debian: Fix debian packaging build failures due to
dot-files in tree.) contained an error that I've made before and should
have noticed. This commit should really fix the problem.
Ben Pfaff [Tue, 26 Aug 2014 15:18:57 +0000 (08:18 -0700)]
debian: Fix debian packaging build failures due to dot-files in tree.
openvswitch/* no longer matches all the files since commit 826bc7b61345a5d
(build: Add travis continuous integration support) added files with names
beginning with ".".
VMware-BZ: #1298353 Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
Lorand Jakab [Thu, 21 Aug 2014 17:25:47 +0000 (20:25 +0300)]
datapath: Remove flow member from struct ovs_skb_cb
struct ovs_skb_cb is full on kernels < 3.11 due to compatibility code.
This patch removes the 'flow' member in order to make room for data
needed by layer 3 flow/port support that will be added in an upcoming
patch. The 'flow' memeber was chosen for removal because it's only used
in ovs_execute_actions().
Signed-off-by: Lorand Jakab <lojakab@cisco.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Ben Pfaff [Fri, 22 Aug 2014 22:32:19 +0000 (15:32 -0700)]
ofproto-dpif-xlate: Drop 'may_learn' parameter from xlate_push_stats().
Both existing callers calculated 'may_learn' as 'stats->n_packets > 0', so
it was redundant. Because xlate_push_stats() is now entirely a no-op if
'stats->n_packets' is 0, we can now delete the tests entirely from the
cases that previously only ran if 'may_learn'.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Joe Stringer <joestringer@nicira.com>
Ben Pfaff [Fri, 22 Aug 2014 22:18:33 +0000 (15:18 -0700)]
ofproto-dpif-xlate: Skip pushing stats if there are no packets to push.
xlate_push_stats() mostly does nothing if 'stats->n_packets' is 0. This
commit allows it to skip more complicated internal logic in that case.
The one case I see in which xlate_push_stats() does do something if
'stats->n_packets' is 0 is in the case of a cached fin_timeout translation.
That translation changes the idle and hard timeouts of a flow if tcp_flags
has FIN or RST set, even if n_packets is 0. But I don't think that can
happen anyway; how would FIN or RST be set without receiving a packet?
More broadly, the xlate_push_stats handles two functions - pushing stats
and implementing side-effects from actions. If there are no packets, the
stats shouldn't need updating. If there were no packets, then no packets
could have hit actions for things such as mac learning/openflow learning,
so xlate_push_stats() should be a no-op.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Joe Stringer <joestringer@nicira.com>
Thomas Graf [Mon, 25 Aug 2014 12:51:00 +0000 (14:51 +0200)]
build: Add travis continuous integration support
This enables the use of travis-ci via github. Linking any ovs
github repo to travis-ci [0] will automatically lead to a build
and testsuite run being triggered for each new commit or pull
requests against the repo.
The introduction of any warnings will cause the build to fail as
both gcc and clang are invoked with -Werror.
The build matrix currently includes:
* --disable-ssl
* --with-linux=linux-3.14.7
* --with-dpdk=1.7.0
Each of these builds is performed with gcc+sparse and clang. The
testsuite is only run for the --with-linux build to keep the total
build time on an acceptable level.
Build failures are reported to the author and commiter by email,
through the travis-ci web UI, and in the github pull request.
Jarno Rajahalme [Fri, 22 Aug 2014 16:01:36 +0000 (09:01 -0700)]
ofproto-dpif-xlate: Do not take references in xlate_receive().
xlate configuration (via xcfg) is already holding the references, so
the callers of xlate_receive() can safely use the returned pointers
upto the point when they quiesce. If the objects are needed for
longer term, the callers can take additional references themselves.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Fri, 22 Aug 2014 16:01:36 +0000 (09:01 -0700)]
ofproto/xlate: Add xlate_lookup_ofproto().
"xlate_receive" did not tell much about what it is used for. We have
two users of it that only want the ofproto and the OF port number, use the
new xlate_lookup_ofproto() for those.
Fix the comments of xlate_receive() as we no longer change the flow.
Also, the helper ofproto_dpif_contains_flow() seemed ill-named, so this
path removes it and uses xlate_lookup_ofproto() directly.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Ankur Sharma [Fri, 22 Aug 2014 17:00:29 +0000 (10:00 -0700)]
datapath-windows: remove reference to OvsNetlink.h
In this patch we remove reference to OvsNetlink.h.
Since we do not refer to lib/netlink-protocol.h anymore,
hence removed the WIN_DP based check as well.
In this change we introduce Netlink.c, Netlink.h and NetlinkProto.h
in datapath-windows. These files will provide netlink message
data structures and parsing APIs.
Changes are on similar lines to userspace netlink code.
We have mapped the userspace APIs and data structures to
kernel coding convention.
for example:
nlmsghdr ==> NL_MSG_HDR
nl_attr_get ==> NlAttrGet
Signed-off-by: Ankur Sharma <ankursharma@vmware.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/18 Acked-by: Nithin Raju <nithin@vmware.com> Acked-by: Samuel Ghinet <sghinet@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Nithin Raju [Fri, 22 Aug 2014 08:16:44 +0000 (01:16 -0700)]
netlink-socket.c: add support for do_lookup_genl_family on Windows
In this patch, we add support for querying the genl family id for any
family supported by the OVS kernel datapath. On platforms that support
netlink natively, the operating system assigns a family ID, and the
OS netlink infrastructure supports querying the family ID by name.
In case of Windows, since OVS datpath provides the netlink support,
it is not necessary to make a call into the kernel. Returning a
family ID that is consistent between the userspace and kernel
is sufficient. Once there is code to support netlink message parsing
as well as constructing netlink messages, we can make a call into
the kernel, but that in itself may not buy anything more than this
approach.
This patch is a precursor to make progress of the other commands.
The next hurdle is to support nl_lookup_genl_mcgroup().
Signed-off-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Terry Wilson [Tue, 19 Aug 2014 23:28:55 +0000 (17:28 -0600)]
ovsdb: Allow comparison on optional scalar types
This allows things like initiating a wait request on an interface
ofport being set.
When the optional field is empty and operation is != or excludes
then the result is true; otherwise it is false. If the field is
set then the field is compared normally for its type.
Signed-off-by: Terry Wilson <twilson@redhat.com>
[blp@nicira.com updated ovsdb-server(1) and NEWS.] Signed-off-by: Ben Pfaff <blp@nicira.com>
Nithin Raju [Tue, 19 Aug 2014 20:51:54 +0000 (13:51 -0700)]
netlink-socket.c: implement get pid support on Windows
To verify if the netlink support in the kernel works, I updated
the netlink-socket.c code to get the PID for a given device
descriptor.
In the existing code, userspace sets the PID, which will not be
unique across different processes. So, it is better for the
kernel to generate the PID and give it back to userspace.
dpif-linux.c was ported to Windows (similar to Alin's change in
the cloudbase repo) and was able to exercise the code changes
in netlink-socket.c to read the PID. dpif-linux.c changes are
not being checked in.
Nithin Raju [Tue, 19 Aug 2014 20:51:53 +0000 (13:51 -0700)]
datapath-windows: add infrastructure for supporting netlink
In this change, we define netlink families and commands supported
by the Windows datapath. Only the control family and one command
is supported today to get the PID.
We also implement the 3 ioctls: read, write and transact. This is
bare minimum and can be used to implement the equivalent of a
recv, send, and send-recv in userspace netlink. This interface
is subject to change as iron out the details of the user-kernel
interface for operations around packet receive, events, dump, etc.
We also turn on OVS_USE_NL_INTERFACE to 1 in the ovsext project.
Nithin Raju [Tue, 19 Aug 2014 20:51:52 +0000 (13:51 -0700)]
datapath-windows: Add Datapath.[ch] and OVS_USE_NL_INTERFACE CPP
In this change we create peer to OvsIoctl.[ch] that would interface
with userspace using the netlink interface. The new files are called
Datapath.[ch]. We are not deleting OvsIoctl.[ch] yet. Datapath.[ch]
provides bare minimum functionality to register a pseudo device for
communication with userspace.
We also define a CPP called OVS_USE_NL_INTERFACE in the ovsext project.
This defines if the old interface (pre-netlink based) or the new
interface (netlink- based) should be enabled in the kernel. By default,
the value is 0 since the Datapath.[ch] are minimal. In the next change,
we'll turn it to 1.
Since Datapath.[ch] containes code copied from OvsIoctl.[ch], acking
the original author as well.
Signed-off-by: Nithin Raju <nithin@vmware.com> Co-authored-by: Guolin Yang <gyang@vmware.com> Acked-by: Alin Serdean <aserdean@cloudbasesolutions.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Saurabh Shah <ssaurabh@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Nithin Raju [Tue, 19 Aug 2014 20:51:51 +0000 (13:51 -0700)]
Add extentions to the standard datapath interface
The datapath interface defined in odp-netlink.h needs some extensions
that are platform dependent. Some examples are the name of the communication
device on Windows and a set of commands that are specific to Windows.
In this change we define a datapath-windows/include/OvsDpInterfaceExt.h
to include any platform specific interface extensions.
OvsDpInterfaceExt.h is in turn included in odp-netlink.h ONLY for _WIN32.
This approach was chosen to avoid including OvsDpInterfaceExt.h directly
although the latter approach is as good as the former.
Also, we define three ioctls in OvsDpInterfaceExt.h:
read: provides an output buffer (mimics a recv)
write: provides an input buffer (mimics a send)
transact: provides an input and optionally an output buffer.
(mimics a send followed by recv)
Signed-off-by: Nithin Raju <nithin@vmware.com> Co-Authored-by: Ben Pfaff <blp@nicira.com> Acked-by: Alin Serdean <aserdean@cloudbasesolutions.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Saurabh Shah <ssaurabh@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
fat-rwlock: fat_rwlock_tryrdlock() should never block
fat_rwlock_tryrdlock() used to call fat_rwlock_get_slot__() which could block
in the "slow path" case. This commit adds fat_rwlock_try_get_slot__() which
does not block, even in the "slow path" case.
This fixes a minor issue in dpif-netdev: when the datapath has no registered
upcall handler (e.g. if it is created with dpctl commands), dp_netdev_input()
hangs if it does not find a packet's flow in the classifier. This is
because dpif-netdev uses its upcall_rwlock as a way to enable and disable
upcalls and thus holds the upcall_rwlock write lock as long as upcalls are
disabled. Both holding the write lock and creating a slot require the
fat_rwlock's mutex, causing the hang.
Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Commit b7ea2d480338(Extend OVS IPFIX exporter to export tunnel headers)
added a usage for IPROTO_GRE. But that does not look available in any
Visual Studio headers. So add it.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Mark Maglana [Fri, 15 Aug 2014 03:03:10 +0000 (03:03 +0000)]
ovs-vtep: Clarifications on the README.
The README was not clear on whether the steps are for attaching physical
or virtual machines to the emulated VTEP. This adds more detail to the
README so that readers will know what to do if they want to attach physical
machines or otherwise.
Signed-off-by: Mark Maglana <mmaglana@gmail.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Wenyu Zhang [Mon, 18 Aug 2014 03:19:36 +0000 (20:19 -0700)]
Extend OVS IPFIX exporter to export tunnel headers
Extend IPFIX exporter to export tunnel headers when both input and output
of the port.
Add three other_config options in IPFIX table: enable-input-sampling,
enable-output-sampling and enable-tunnel-sampling, to control whether
sampling tunnel info, on which direction (input or output).
Insert sampling action before output action and the output tunnel port
is sent to datapath in the sampling action.
Make datapath collect output tunnel info and send it back to userpace
in upcall message with a new additional optional attribute.
Add a tunnel ports map to make the tunnel port lookup faster in sampling
upcalls in IPFIX exporter. Make the IPFIX exporter generate IPFIX template
sets with enterprise elements for the tunnel info, save the tunnel info
in IPFIX cache entries, and send IPFIX DATA with tunnel info.
Add flowDirection element in IPFIX templates.
Signed-off-by: Wenyu Zhang <wenyuz@vmware.com> Acked-by: Romain Lenglet <rlenglet@vmware.com> Acked-by: Ben Pfaff <blp@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Jarno Rajahalme [Fri, 15 Aug 2014 22:09:38 +0000 (15:09 -0700)]
lib/dpif-netdev: Clean-up pmd thread signaling.
It could be possible that the thread misses a signal when it reads the
change_seq again after reload. Also, the counter has no dependent
data, so the memory model for the atomic read can be relaxed.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Alex Wang [Fri, 15 Aug 2014 07:59:36 +0000 (00:59 -0700)]
ofproto-dpif-upcall: Fix use of cleared stack memory.
Commit cc377352d (ofproto: Reorganize in preparation for direct
dpdk upcalls.) introduced the bug that uses variable defined on
the stack inside while loop for reading dpif upcalls and keeps
reference to attributes of the variable within the same function
after the stack is cleared. This bug can cause ovs abort.
This commit fixes the above issue by defining an array of the
variable on the function stack.
Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>