Nithin Raju [Mon, 6 Oct 2014 20:07:20 +0000 (13:07 -0700)]
netdev-windows: add code to query netdev information
Primary goals of netdev-windows.c are:
1) To query the 'network device' information of a vport such as MTU, etc.
2) Monitor changes to the 'network device' information such as link
status.
In this change, we implement only #1. #2 can also be implemented, but it
does not seem to be required for the purposes of implement
'ovs-dpctl.exe show'.
Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Nithin Raju [Mon, 6 Oct 2014 20:07:19 +0000 (13:07 -0700)]
netdev-windows: New module.
In this patch, we add a lib/netdev-windows.c which mostly contains stub
code and in subsequent patches, would use the netlink interface to query
netdev information for a vport.
The code implements netdev functionality for "internal" and "system"
types of vports.
Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Nithin Raju [Mon, 6 Oct 2014 20:07:17 +0000 (13:07 -0700)]
OvsDpInterfaceExt.h: add support for netlink family for netdev
In this patch, we define netlink family, attributes and commands
for query the 'network device' information of VPORTs, such as
MTU, Link status, etc.
I considered adding the netdev command to the OVS_WIN_CONTROL_FAMILY
itself, but the netdev attributes are not compatible with the existing
attributes for the events. I also considered adding new attributes to
the VPORT family, but we'll have to extend the standard datapath
interface for that.
In this patch, we fix the definition of 'OVS_WIN_CONTROL_ATTR_MAX' as
well.
Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Sorin Vinturis [Mon, 6 Oct 2014 15:19:23 +0000 (15:19 +0000)]
datapath-windows: Incorrect assumption of the IRQL
Acquiring a spin lock raises the IRQL to DISPATCH_LEVEL. But
in many places of the code, while holding a spin lock, there
are useless checks for the current IRQL against DISPATCH_LEVEL.
Also, the dispatch flag is not correctly set when calling
NdisAcquireRWLockXXX() functions, which causes an extra check
of the current IRQL.
Batching the cmap find improves the memory behavior with large cmaps
and can make searches twice as fast:
$ tests/ovstest test-cmap benchmark 2000000 8 0.1 16
Benchmarking with n=2000000, 8 threads, 0.10% mutations, batch size 16:
cmap insert: 533 ms
cmap iterate: 57 ms
batch search: 146 ms
cmap destroy: 233 ms
cmap insert: 552 ms
cmap iterate: 56 ms
cmap search: 299 ms
cmap destroy: 229 ms
hmap insert: 222 ms
hmap iterate: 198 ms
hmap search: 2061 ms
hmap destroy: 209 ms
Batch size 1 has small performance penalty, but all other batch sizes
are faster than non-batched cmap_find(). The batch size 16 was
experimentally found better than 8 or 32, so now
classifier_lookup_miniflow_batch() performs the cmap find operations
in batches of 16.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
We use the 'counter' as a "lock" providing acquire-release
semantics. Therefore we can use normal, non-atomic access to the
memory accesses between the atomic accesses to 'counter'. The
cmap_node.next needs to be RCU, so that can not be changed.
For the writer this is straightforward, as we first acquire-read the
counter and after all the changes we release-store the counter. For
the reader this is a bit more complex, as we need to make sure the
last counter read is not reordered with the preceding read operations
on the bucket contents.
Also rearrange code to benefit from the fact that hash values are
unique in any bucket.
This patch seems to make cmap_insert() a bit faster.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
tests/test-cmap: Balance benchmarks between cmap and hmap.
The test cases have been carefully crafted so that we do the same
amount of "overhead" operations in each case. Earlier, with no
mutations, the number of random number generations was different for
hmap and cmap test cases. hmap test was also missing an ignore() call.
Now the numbers look like this:
$ tests/ovstest test-cmap benchmark 2000000 8 0
Benchmarking with n=2000000, 8 threads, 0.00% mutations:
cmap insert: 597 ms
cmap iterate: 65 ms
cmap search: 299 ms
cmap destroy: 251 ms
hmap insert: 243 ms
hmap iterate: 201 ms
hmap search: 299 ms
hmap destroy: 202 ms
So it seems search on cmap can be as fast as on hmap in the
single-threaded case.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
lib/cmap: Return number of nodes from functions modifying the cmap.
We already update the count field as the last step of these functions,
so returning the current count is very cheap. Callers that care about
the count become a bit more efficient, as they avoid extra
non-inlineable function call.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Wed, 1 Oct 2014 22:35:45 +0000 (15:35 -0700)]
lib/match: Do not format undefined fields.
Add function flow_wildcards_init_for_packet() that can be used to set
sensible wildcards when megaflows are disabled. Before this, we set
all the mask bits to ones, which caused printing tunnel, mpls, and/or
transport port fields even for packets for which it makes no sense.
This has the side effect of generating different megaflow masks for
different packet types, so there will be more than one kind of mask in
the datapath classifier. This should not make practical difference,
as megaflows should not be disabled when performance is important.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
openvswitch.spec: Remove dependency with openvswitch-kmod.
Upstream Linux has OVS kernel module that includes most (not all) of
the features that comes with the kernel module from openvswitch.org.
So, it is okay to relax the requirement for OVS userspace package
to depend on openvswitch-kmod package.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Andy Zhou [Sun, 5 Oct 2014 06:35:30 +0000 (23:35 -0700)]
bridge: Keep bond active slave selection across OVS restart
Whenever OVS restarts, it pseudo-randomly picks an interface
of a bond port to be the active slave. This can cause traffic
disruption in case the upstream switch does not support LACP, or
in case of multi-chassis switches that do not support mLACP.
This patch helps the situation by always record the last active
slave into ovsdb. When OVS restarts, the stored last active slave
has the highest priority to be selected again. In case this interface
is available, due to configuration changes or being offline, OVS then
consider other interfaces with the bond as it does today.
In a nutshell, this patch makes the active slave selection stickier
across OVS restart.
datapath: Add support for RHEL-7 / CentOS-7 kernel.
This patch mostly is related to tunnel API where RHEL 7
kernel API are not in-sync with newer linux kernel API. So
extra checks are required to check for parameters of API.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jiri Benc <jbenc@redhat.com>
Eitan Eliahu [Wed, 1 Oct 2014 03:37:56 +0000 (20:37 -0700)]
netlink-socket: User mode event read for Windows.
User mode sends down three distinct Read ioctl commands for Events, Packet
Reads and Dumps. In case the Packet Read socket can not be distinguished a
Set function will be provided.
Firstly, with this change, the 'more_actions' parameter is removed and
is integrated into 'steal'. Then, every function that receives a batch
of packets with 'steal' set to true is responsible for freeing the
packets. Finally, odp_execute_actions() and odp_execute_actions__()
can be be merged.
This also fixes a memory leak in odp_execute_sample(), when the
subactions are not executed
Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
If odp_execute_actions() has been called with 'steal' set to true and
OVS_ACTION_ATTR_RECIRC as last action, it should allow dp_execute_cb()
to steal the packet.
Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
dp_netdev_free() must free 'dp->upcall_rwlock', but when upcalls are
disabled (if the datapath is being freed upcalls should be disabled)
'dp->upcall_rwlock' is taken and freeing it causes an assertion to
fail.
This commit takes makes sure that the upcalls are disabled and
releases 'dp->upcall_rwlock' before freeing it. A simple testcase is
added to detect the failure.
Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Use the new OVS_FLOW_ATTR_PROBE flag when probing for datapath feature
support. Suppress also dpif error logging when requested, as probe
failures are already logged at ofproto-dpif.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
This new flag is useful for suppressing error logging while probing
for datapath features using flow commands. For backwards
compatibility reasons the commands are executed normally, but error
logging is suppressed.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Alex Wang [Thu, 2 Oct 2014 04:59:16 +0000 (21:59 -0700)]
bfd.at: Fix intermittent failure of test - flap_count.
ovs-vsctl commands like 'ovs-vsctl list Interface p1' use the
'monitor' RPC method, which causes ovsdb sending updates to
the command session when changes are committed to the monitored
table. Since ovs-vsctl commands are short-lived, there is chance
that ovs-vsctl terminates the connection to ovsdb right before
ovsdb sends the update. This race will cause the following
warning entries in ovsdb-server log:
The bfd:flap_count test is particularly prone to this race,
since the test aligns the statistics updates (every 5 seconds)
with the invocation of ovs-vsctl commands.
In the short term, this commit fixes the intermittent failure
by disabling the ovs-vswitchd statistics updates using a huge
update interval.
In the long run, we will research on making ovsdb not send
further updates to sessions like ovs-vsctl.
stream-tcp: Change the connection name for pwindows.
As of now, when someone passes a punix:foo/bar as a connection type
in Windows, we create a TCP server using 127.0.0.1 and save the kernel
assigned port number in the file foo/bar. The connection name
as obtained through pstream_get_name() would be ptcp:127.0.0.1:$PORT.
This was okay if pstream_get_name() was only used for logging
purposes. But netdev-dummy uses it to close active connections when the
passed name and created name are different. This causes transient
connection teardowns while using patch ports in Windows unit tests
causing occasional packet loss.
This commit sets the connection name to be punix:foo/bar instead
of ptcp:127.0.0.1:$PORT for pwindows.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Thu, 2 Oct 2014 16:12:11 +0000 (09:12 -0700)]
lib/ovs-atomic-i586: Faster 64-bit atomics on 32-bit builds with SSE.
Aligned 64-bit memory accesses in i586 are atomic. By using an SSE
register we can make such memory accesses in one instruction without
bus-locking. Need to compile with -msse (or higher) to enable this
feature.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Andy Zhou [Wed, 1 Oct 2014 07:29:19 +0000 (00:29 -0700)]
datapath: avoid hard coding OVS_VPORT_TYPE_GENEVE
OVS_VPORT_TYPE_GENEVE is currently hard coded to 6. This is not
necessary since slot 5 has not been taken yet. Drop the hard
coded value to before upstreaming GENEVE support to Linux kernel.
Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Alex Wang [Wed, 1 Oct 2014 18:49:10 +0000 (11:49 -0700)]
cmap: ovsrcu postpone the cmap destroy.
Currently, the cmap_destroy() directly frees the cmap memory.
Some callers of cmap_destroy() (e.g. destroy_subtable()) still
allows other threads (e.g. pmd threads) accessing the cmap at
the same time (e.g. via classifier_lookup_miniflow_batch()),
which could cause segfault.
To fix the above issue, this commit use ovsrcu to postpone
the free of cmap memory.
Reported-by: Ethan Jackson <ethan@nicira.com> Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
When the bridge datapath_type is changed, ofproto is destroyed and immediately
recreated. This involves closing and reopening the mgmt socket. If the
destruction of the 'connmgr' is postponed, a race condition might happen, where
we first recreate the socket and then try to destroy it.
Reported-by: Daniel Badea <daniel.badea@windriver.com> Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Wed, 1 Oct 2014 00:03:07 +0000 (17:03 -0700)]
configure: Disable strict aliasing.
The C standard allows compilers to do type-based alias analysis, which
means that the compiler is allowed to assume that pointers to objects of
different types are pointers to different objects. For example, a compiler
may assume that "uint16_t *a" and "uint32_t *b" point to different and
nonoverlapping locations because the pointed-to types are different. This
can lead to surprising "optimizations" with compilers that by default do
this kind of analysis, which includes GCC and Clang.
The one escape clause that the C standard gives us is that character types
must be assumed to alias any other object. We've always tried to use this
escape clause to avoid problems with type-based alias analysis in the past.
I think that we should continue to try to do this in the future. It's hard
to tell what compiler we might want to use in the future, and one never
knows what kind of control that compiler allows over alias analysis.
However, recently I helped another developer debug a nasty and confusing
issue, which turned out to be the result of a surprising compiler
optimization due to alias analysis. I've seen enough of these that I don't
think it's worthwhile to risk more problems than we have to. Thus, this
commit turns off type-based alias analysis in GCC and Clang.
Linus Torvalds thinks that type-base alias analysis is not sane, at least
as GCC implements it: https://lkml.org/lkml/2003/2/26/158
The GCC manual says that -Wstrict-aliasing is only effective without
-fno-strict-aliasing, otherwise I'd keep -Wstrict-aliasing also.
Indications are that MSVC doesn't do type-based alias analysis by default.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Alex Wang [Tue, 30 Sep 2014 20:46:22 +0000 (13:46 -0700)]
bridge: Fix high cpu utilization.
When there are more than one ovs-vswitchd processes started,
only one process is enabled. The disabled processes should
just sleep. However, a bug in ovs makes the disabled processes
keep waking up on global connectivity sequence number which is
never sync'ed. Consequently, those processes use 100% cpu.
This commit fixes the bug by always sync up the connectivity
sequence number for disabled processes.
Reported-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Joe Stringer <joestringer@nicira.com>
Ben Pfaff [Tue, 30 Sep 2014 16:57:08 +0000 (09:57 -0700)]
ovs-vswitchd: Better diagnose errors in DPDK command-line options.
With DPDK compiled in, when the --dpdk option was given other than as the
first command-line argument, ovs-vswitchd silently ignored it. Without
DPDK compiled in, when the --dpdk option was given anywhere, ovs-vswitchd
silently ignored it. However, in each case any options following --dpdk
were not ignored, and since --dpdk is normally followed by additional
DPDK-specific options, this caused even more confusing trouble.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Daniele Di Proietto <ddiproietto@vmware.com> Tested-by: Daniele Di Proietto <ddiproietto@vmware.com>
pstream-unix: Increase listen count to 64 in punix_open().
In my test with openstack setup, ovs-ofctl executes failed when there are
many flow rules to be added by multiple threads.
The error like this:
ovs-ofctl: /var/run/openvswitch/br1.mgmt: failed to open socket (Protocol
error)
In the function listen(fd, 10) in punix_open(), the number 10 should be
modified to more bigger, such as 64 maybe a proper value.
Signed-off-by: Lilijun <jerry.lilijun@huawei.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Fri, 26 Sep 2014 17:28:05 +0000 (17:28 +0000)]
revalidator: Distinguish new and duplicate flows.
We previously counted flows that have been installed during the current
dump as duplicates, rather than recognising them as new flows. This
patch separates the counters out for these two cases.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 12 Sep 2014 21:42:47 +0000 (14:42 -0700)]
nx-match: Encode dp_hash and recirc_id in OXM also.
dp_hash and recirc_id are specific to OVS, but that doesn't mean that we
shouldn't encode them into flow matches when OXM is used in OpenFlow 1.2
and later.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Ben Pfaff [Tue, 2 Sep 2014 23:47:01 +0000 (16:47 -0700)]
ofp-actions, nx-match: Use mf_oxm_header() instead of explicit constants.
Following this change, only meta-flow.c uses any explicit NXM_* or OXM_*
constants. An upcoming commit will actually remove the definitions of
these constants, hiding them behind a functional interface, for better
abstraction.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Joe Stringer [Mon, 29 Sep 2014 18:09:57 +0000 (18:09 +0000)]
bridge: Fix bug where IDL wakeup causes 100% CPU.
Commit 9c537baf613a16e (bridge: Refactor the stats and status update.)
inadvertently changed the way that the status transaction is destroyed,
which could cause the main thread to constantly wake up.
The bug occurs when ovsdb_idl_txn_commit() returns TXN_INCOMPLETE and
there are no further changes to connectivity or 'status_txn_try_again'.
- ovsdb_idl_run() receives the transaction reply and updates the
transaction status to TXN_SUCCESS.
- status_update_wait() detects that the transaction is in progress, and
the status is TXN_SUCCESS so wakes up the main thread immediately.
- run_status_update() is meant to destroy the transaction now that it is
finished, however the logic is never run because there were no changes.
- Repeat the wakeup every time the main loop runs.
This patch fixes the behaviour by ensuring that ovsdb_idl_txn_commit()
gets a chance to run whenever there is an ongoing status transaction.
Bug was found by unloading and reloading the kernel module, then
immediately restarting ovs-vswitchd.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
Currently, whenever there's a missed packet, the ovs driver allocates
memory and copies the packet even if there's no packet queue setup from
userspace. Then if there's no queue created, the packet is released and
dropped.
The solution was to check for the existence of the userspace queue before
trying to allocate and add a new missed packet to the queue. If there is
no userspace queue created, the original packet is dropped without creating
a new missed packet.
Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-by: Nithin Raju <nithin@vmware.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/32 Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Registered FLOW_DEL command handler. The same command
handler as FLOW_ADD is good enough to handle FLOW_DEL
case as well with minor changes for checking to action
attribute.
Signed-off-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Eitan Eliahu <eliahue@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Acked-by: Samuel Ghinet <sghinet@cloudbasesolutions.com> Tested-by: Ankur Sharma <ankursharma@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
This patch covers the changes needed to support FLOW_NEW command.
API _OvsFlowMapNlToFlowPutFlags has a bug, which will be fixed
with the patches for FLOW_DEL.
Signed-off-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Eitan Eliahu <eliahue@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Acked-by: Samuel Ghinet <sghinet@cloudbasesolutions.com> Tested-by: Ankur Sharma <ankursharma@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
NlAttrParseNested was using the whole netlink payload for iteration.
This is not correct, as it would lead to exceeding the
nested attribute boundries. Fixed the same in this patch.
Signed-off-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Eitan Eliahu <eliahue@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Acked-by: Samuel Ghinet <sghinet@cloudbasesolutions.com> Tested-by: Ankur Sharma <ankursharma@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Moved the structure OVS_MESSAGE to Netlink.h.
This change is done for following reasons.
a. Patch 2 in this series provides a generic API in Netlink.c
for creating netlink message. That API needs OVS_MESSAGE.
Including Datapath.h in Netlink.c/h gives compilation error.
b. OVS_MESSAGE defines netlink messages hence moving it to
Netlink.h looked fine to me.
Signed-off-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Eitan Eliahu <eliahue@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Acked-by: Samuel Ghinet <sghinet@cloudbasesolutions.com> Tested-by: Ankur Sharma <ankursharma@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows: Add WMI Script that updates Hyper-V friendly port names.
The following script leverage's the advantages of WMI infrastructure
offered in Hyper-V.
This scripts allows the user to change the
Msvm_EthernetPortAllocationSettingData property of a VM network adapter
connected to a Hyper-V Virtual Switch.
The Read event handler is executed when user mode issues a socket
receive on an MC socket associated with the event queue. A new IOCTL
READ command is used to differentiate between transaction based and packet
miss sockets.
An entry for the handler will be added once the Control family (logically
should have been added to the Vport family)
implementation checked in.
User mode code for setting the socket type will follow
Samuel Ghinet [Thu, 25 Sep 2014 21:22:22 +0000 (21:22 +0000)]
datapath-windows: Add file NetlinkError.h.
Contains error codes for netlink transactional errors.
These errors are passed to the "error" field (INT) of the NL_MSG_ERR struct.
The userspace requires them to be negative values: the nl_msg_nlmsgerr userspace
function transforms them from negative to positive values.
These error codes correspond to the userspace error codes defined in:
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\errno.h"
Signed-off-by: Samuel Ghinet <sghinet@cloudbasesolutions.com> Acked-by: Eitan Eliahu <eliahue@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Functionality for vport dump.
Later, when we will add more netlink dump commands, some common code will need
to be split to functions.
Notes:
a) the current implementation of vport assumes the datapath feature
"multiple upcall pids" is not used. A single upcall pid is used now.
c) the vxlan destination udp port is currently a constant. When it will become
configurable, the vport options netlink attribute will become relevant.
Signed-off-by: Samuel Ghinet <sghinet@cloudbasesolutions.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Samuel Ghinet [Thu, 25 Sep 2014 21:20:25 +0000 (21:20 +0000)]
datapath-windows: fix OVS_VPORT_TYPE
The windows ovs kernel uses an OVS_VPORT_TYPE enum that is incompatible with
the userspace counterpart (enum ovs_vport_type from openvswitch.h). We must use
the same enum type for the netlink communication to work properly.
This patch makes the fix: "typedef enum ovs_vport_type OVS_VPORT_TYPE" and
changes the afferent kernel driver code:
o) vport types synthetic and emulated turn to: netdev
o) vport type internal turns to: internal
o) vport type external truns to: netdev (plus, we hold a field in vport,
"isExternal"
Signed-off-by: Samuel Ghinet <sghinet@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
string.split() function splits a quoted string if there is a whitespace
inside the quote.
ex: The following code snippet will output ['printing', '"No', 'Diagnostic"']
args = 'printing "No Diagnostic"'
print args.split()
The above is a problem if we run the following command through vtep_ctl().
vtep-ctl set tunnel $uuid bfd_status:diagnostic="No Diagnostic"
The workaround is to use the split() function from shlex module.
ovs-vtep is an emulator and it works only on one
physical switch. This switch name is stored in the variable
'ps_name' and then passed around. An upcoming commit requires
access to this variable at more places and it is easier if this
variable is global.
Before destroying a logical switch, cleanup any left over local
mac information in Ucast_Macs_Local or Mcast_Macs_Local table.
We need to do this to atleast cleanup the 'unknown-dst' information
added in the Mcast_Macs_Local table while creating the Logical_Switch
class in setup_ls().
vtep-ctl: Add Tunnel table to vtep_ctl_table_class.
This is needed to create, get, set records in the Tunnel table.
(We need to add the Tunnel table's 'local' and 'remote' columns
that point to the Physical_Locator record to cache because vtep-ctl
commands like 'add-ucast-local' will try to add an entry in
Physical_Locator table based on the contents of the cache.)
Alex Wang [Thu, 25 Sep 2014 20:10:55 +0000 (13:10 -0700)]
netdev-dpdk: Fix crash when there is no pci numa info.
When kernel cannot obtain the pci numa info, the numa_node file
in corresponding pci directory in sysfs will show -1. Then the
rte_eth_dev_socket_id() function will return it to ovs. On
current master, ovs assumes rte_eth_dev_socket_id() always
returns non-negative value. So using this -1 in pmd thread
creation will cause ovs crash.
To fix the above issue, this commit makes ovs always check the
return value of rte_eth_dev_socket_id() and use numa node 0 if
the return value is negative.
Reported-by: Daniel Badea <daniel.badea@windriver.com> Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Daniele Di Proietto <ddiproietto@vmware.com>