dpif-netdev: Share emc and fast path output batches.
Until now the exact match cache processing was able to handle only four
megaflows. The rest of the packets was passed to the megaflow
classifier.
The limit was arbitraly set to four also because the algorithm used to
group packets in output batches didn't perform well with a lot of
megaflows.
After changing the algorithm and after some performance testing it seems
much better just to share the same output batches between the exact
match cache and the megaflow classifier.
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
dpif-netdev: Store batch pointer in dp_netdev_flow.
The userspace datapath
1. receives a batch of packets.
2. finds a 'netdev_flow' (megaflow) for each packet.
3. groups the packets in output batches based on the 'netdev_flow'.
Until now the grouping (2) was done using a simple algorithm with a
O(N^2) runtime, where N is the number of distinct megaflows of the packets
in the incoming batch. This could quickly become a bottleneck, even with
a small number of megaflows.
With this commit the datapath simply stores in the 'netdev_flow' (the
megaflow) a pointer to the output batch, if one has been created for the
current input batch. The pointer will be cleared when the output batch
is sent.
In a simple phy2phy test with 128 megaflows the throughput is more than
doubled.
The reason that stopped us from doing this change was that the
'netdev_flow' memory was shared between multiple threads: this is no
longer the case with the per-thread classifier.
Also, this commit reorders struct dp_netdev_flow to group toghether the
members used in the fastpath.
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
dpif-netdev: Store pkt_metadata structure in dp_netdev_port.
Initializing a struct pkt_metadata for every packet can be surprisingly
expensive. It's much faster to keep a copy for each port and copying it
on each packet.
Suggested-by: Pravin Shelar <pshelar@nicira.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
In 'struct ofpbuf' the 'frame' pointer was used to parse different kinds of
data (Ethernet, OpenFlow, Netlink attributes). For Ethernet packets the
'frame' pointer was supposed to have the same value as the 'data'
pointer.
Since 'struct dp_packet' is only used for Ethernet packets, there's no
need for a separate 'frame' pointer: we can use the 'data' pointer
instead.
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Jarno Rajahalme [Mon, 18 May 2015 17:24:02 +0000 (10:24 -0700)]
ofproto: Fix memory leak in flow deletion.
Fix a memory leak that was introduced in commit 834fe5cb997b (ofproto:
Additional simplifications.). We used to unref the flow
asynchronously, but forgot to do it when the support for asynchronous
operations was removed.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Pravin B Shelar [Fri, 15 May 2015 13:32:32 +0000 (06:32 -0700)]
datapath: Fix Sparse warning.
CHECK /home/pravin/ovs/w8/datapath/linux/flow_table.c
/home/pravin/ovs/w8/datapath/linux/flow_table.c:536:6: warning: symbol
'ovs_flow_cmp_unmasked_key' was not declared. Should it be static?
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
Oleg Strikov [Fri, 8 May 2015 19:05:13 +0000 (12:05 -0700)]
INSTALL.DPDK: Notes on running ovs-vswitchd/dpdk inside a VM
Additional configuration is required if you want to run ovs-vswitchd
with DPDK backend inside a QEMU virtual machine. This happens because,
by default, virtio NIC provided to the guest doesn't support multiple
TX queues which are required by ovs-vswitchd/dpdk. This commit updates
INSTALL.DPDK.md to provide guidelines on how to enable support for
multiple TX queues using QEMU command line and Libvirt config file.
Signed-off-by: Oleg Strikov <oleg.strikov@canonical.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Kevin Traynor [Tue, 12 May 2015 04:58:14 +0000 (21:58 -0700)]
netdev-dpdk: Add vhost enqueue retries.
The max allowed burst size for a single vhost enqueue is 32.
This code facilitates trying to send greater than the burst
size of packets to the vhost interface by adding a retry loop
and calling vhost enqueue multiple times. As this could
potentially block, a timeout is added.
Signed-off-by: Kevin Traynor <kevin.traynor@intel.com> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Kevin Traynor [Tue, 12 May 2015 04:58:12 +0000 (21:58 -0700)]
netdev-dpdk: Change phy rx burst size.
Change phy rx burst size from 192 to 32. This aligns the
burst size with the other dpdk interfaces and significantly
improves performance when forwarding to dpdk vhost ports.
Signed-off-by: Kevin Traynor <kevin.traynor@intel.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Ethan Jackson [Thu, 26 Mar 2015 19:52:42 +0000 (12:52 -0700)]
utilities: Add new pipeline generator script.
When doing OVS performance testing, it's important to have both
realistic traffic traces and OpenFlow pipelines on which to evaluate
prospective changes. As a first step in this direction, this patch
adds a python script which generates an OpenFlow pipeline intended to
simulate typical network virtualization workloads.
Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
Ben Pfaff [Fri, 8 May 2015 16:15:43 +0000 (09:15 -0700)]
ofp-util: Use OFPGMFC_OUT_OF_BUCKETS for indirect groups with !=1 buckets.
OpenFlow 1.3 says:
If a switch cannot add the incoming group entry due to restrictions
(hardware or otherwise) limiting the number of group buckets, it must
refuse to add the group entry and must send an ofp_error_msg with
OFPET_GROUP_MOD_FAILED type and OFPGMFC_OUT_OF_BUCKETS code.
This indicates that OFPGMFC_OUT_OF_BUCKETS is appropriate for an indirect
group with the wrong number of buckets, but OVS was using a different
error. This fixes the problem.
ONF-JIRA: EXT-546 Reported-by: Mrinmoy Das <mrdas@ixiacom.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
Pravin B Shelar [Thu, 7 May 2015 17:17:26 +0000 (10:17 -0700)]
datapath: define compat __skb_gso_segment()
OVS correctly define skb_gso_segment() to handle MPLS and VLAN
segmentation correctly. But OVS also uses __skb_gso_segment() in
some cases. Following patch defines compat __skb_gso_segment()
to handle all segmentation cases.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
dpctl: Ignore enumeration errors if there is at least one datapath.
When dpctl commands are used to inspect a userspace datapath, but OVS
has also built-in support for the kernel datapath, an error message is
reported if the kernel module is not loaded. This commit suppresses the
message.
Suggested-by: Ethan Jackson <ethan@nicira.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Wed, 6 May 2015 21:31:55 +0000 (14:31 -0700)]
lldp: Fix clang warning.
Clang-3.7 generates warnings such as the following:
../lib/ovs-lldp.c:394:19: error: address of array 'hardware->h_ifname'
will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
This value is fetched from a netdev, which as far as I can tell must
always have a non-NULL name. Simplify this code.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Dennis Flynn <drflynn@avaya.com> Acked-by: Ben Pfaff <blp@nicira.com>
Billy O'Mahony [Tue, 5 May 2015 16:37:31 +0000 (17:37 +0100)]
docs: Clarify creation & bonding of DPDK enabled interfaces.
Unlike system interfaces, DPDK enabled interfaces must have their interface
type explicitly set when used to create ports. Mention this in relevant parts
of the documentation and add references to INTALL.DPDK.md, where there are many
examples.
Signed-off-by: Billy O'Mahony <billy.o.mahony@intel.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
xenserver: Use kernel uname version for XenServer 6.5
In XenServer 6.5, multiple kernel packages with different
rpm versions can have the same uname. So, it is not
necessary for openvswitch kernel module to require the
exact rpm version. Instead, the kernel module package
should check the uname version.
This commit will add a new variable %{kernel_uname} to
specify whether to use kernel uname version or kernel
rpm version as requirement.
When %{kernel_name} is used, openvswitch-module will have
"Requires: kernel-uname-r = <uname version>" set instead of
"Requires: kernel = <version>".
Reported-by: Gosen Chien <astgosen@ccu.edu.tw> Signed-off-by: Edwin Chiu <echiu@vmware.com> Signed-off-by: Alex Wang <alexw@nicira.com>
Pravin B Shelar [Sat, 2 May 2015 00:30:44 +0000 (17:30 -0700)]
datapath: gre: Reset fix_segment pointer.
For kernel version 3.12 to 3.18, GRE uses compat code to
transmit packets which used fix_segment to segment packets.
but ovs_gso_cb->fix_segment is not initialized for GRE tunnels.
Following patches fixes it by resetting fix_segment.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
Pravin B Shelar [Fri, 1 May 2015 18:02:02 +0000 (11:02 -0700)]
dpctl: cleaner dpctl output for tunnel ports.
Currently dont-fragment and TTL are initialized to zero, but
those are not default config for tunnel ports. dpctl
does not show default config of a port. So by setting these
values to default we can get cleaner `dpctl show` output.
% ovs-dpctl show
system@ovs-system:
port 0: ovs-system (internal)
port 1: br0 (internal)
port 4: gre_sys (gre: df_default=false, ttl=0)
% ovs-dpctl show # After initializing default values.
system@ovs-system:
port 0: ovs-system (internal)
port 1: br0 (internal)
port 4: gre_sys (gre)
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
Mark Kavanagh [Mon, 20 Apr 2015 19:37:14 +0000 (12:37 -0700)]
DPDK: add support for v2.0.0
Update relevant artifacts to add support for DPDK v2.0.0
- INSTALL.DPDK.md
- travis build script
- acinclude.m4: add 'mssse3' flag to OVS_CFLAGS
- netdev-dpdk: fix build with unified offload types in DPDK v2.0.0
Note that this breaks compatibility with DPDK v1.8.0
Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com> Signed-off-by: Panu Matilainen <pmatilai@redhat.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
The Stateless TCP Tunnel (STT) protocol encapsulates traffic in
IPv4/TCP packets.
STT uses TCP segmentation offload available in most of NIC. On
packet xmit STT driver appends STT header along with TCP header
to the packet. For GSO packet GSO parameters are set according
to tunnel configuration and packet is handed over to networking
stack. This allows use of segmentation offload available in NICs
The protocol is documented at
http://www.ietf.org/archive/id/draft-davie-stt-06.txt
ovs-hyperv: make kernel return values netlink socket like
In this patch, we make changes to usersapce as well as
kernel datapath on hyperv to make it more netlink socket
like. Previously, the kernel datapath did not distinguish
between "transport errors" and other errors. Netlink
semantics dictate that netlink functions should only
return an error only in the case of a "transport error"
which is generally something fatal. Eg. failure to
communicate with the OVS module, or an invalid command
altogether. Other errors such as an unsupported action,
or an invalid flow key is not considered a "transport
error", and in such cases, netlink functions are to return
success with a 'struct nlmsgerr' populated in the output
buffer.
The extension failed to be activated during booting due to the
failure to initialize tunnel filter. This happened because the Base
Filtering Engine (BFE) is not started and no session to the engine
could be acquired.
The solution for this was to registered a BFE notification callback
that is called whenever the BFE's state changes. Only if the BFE's
state is running the tunnel filter is initialized.
datapath: Fix check-export-symbol for non-bash shells
Avoid using a bash construct (=~) in the target.
An alternative would be to make the configure script require
bash explicitly. (Currently it doesn't and on NetBSD /bin/ksh
is likely used.)
The code in question was introduced by
commit b296b82a87326e68773b970284b8e012def0e3ba .
("datapath: Check the export of public functions in linux/compat/linux/.")
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Acked-by: Alex Wang <alexw@nicira.com>
datapath: Stop using __DATE__ and __TIME__ in startup string.
An increasing number of distributions ship with GCC 4.9 (including
Fedora and Ubuntu) that has -Werror=date-time. This causes kernel
compilation to fail because the builds are not exactly reproducible.
This simply removes the use of those constants, which was already
done for the upstream Linux version of the module. It retains the
version string, however, which should provide the same information
in most cases.
Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Terry Wilson [Sat, 25 Apr 2015 19:57:44 +0000 (14:57 -0500)]
Allow subclasses of Idl to define a notification hook
It is useful to make the notification events that Idl processes
accessible to users of the library. This will make it possible to
keep external systems in sync, but does not impose any particular
notification pattern.
The Row.from_json() call is added to be able to convert the 'old'
JSON response on an update to a Row object to make it easy for
users of notify() to see what changed, though this usage of Row
is quite different than Idl's typical use.
Signed-off-by: Terry Wilson <twilson@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Reported-by: Kevin Lo <kevlo@FreeBSD.org> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Simon Horman <simon.horman@netronome.com> Acked-by: Kevin Lo <kevlo@FreeBSD.org>
datapath: Use kernel Geneve implementation on 4.0 and above.
When Geneve was originally backported, it wasn't available as part
of a released kernel version but it is now, so we can take advantage
of the native implementation.
Note that Geneve was actually first available as part of the 3.18
kernel release but some drivers erroreously try to offload it as
if it were VXLAN, which was fixed in the 4.0 release. Since our
UDP tunnel compat layer already takes care of this, we continue
using the OVS Geneve implementation until 4.0.
Reported-by: Alex Wang <alexw@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com> Reviewed-by: Simon Horman <simon.horman@netronome.com>
When the UDP tunnel compat code was written, it backported some
functions that were slated to be in the next kernel release, then
called 3.20. However, this was ultimately released as 4.0 instead.
Signed-off-by: Jesse Gross <jesse@nicira.com> Reviewed-by: Simon Horman <simon.horman@netronome.com>
Alex Wang [Mon, 20 Apr 2015 03:54:50 +0000 (20:54 -0700)]
datapath: Check the export of public functions in linux/compat/linux/.
This commit adds check in datapath/Makefile to make sure that all public
functions and exported symbols in linux/compat/ are either rpl_ or ovs_
prefixed, except those defined in compat/build-aux/export-check-whitelist.
Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
Alex Wang [Tue, 21 Apr 2015 01:19:53 +0000 (18:19 -0700)]
datapath: Prevent linker error of unknown symbol.
With the latest change of separating vports into their own modules,
it is necessary to export all public functions in linux/compat/
directory. Also, we should prefix functions which replace the
upstream ones with 'rpl_' and others with 'ovs_'. This will prevent
the linker error when vport modules use those functions in the future.
e.g., the to be merged vport-stt module will use the flex_array_*
functions which are not currently exported.
Co-authored-by: Tuan Nguyen <tuan.nguyen@veriksystems.com> Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
When linking executables on windows the following argument is passed
to the linker -Qunused-arguments.
This results in the following warning:
Command line warning D9002 : ignoring unknown option '-Qunused-arguments'
This patch removes that warning.
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
datapath-windows: don't free switch cxt until ref == 0
This is a hard to hit corner case, because currently we recommend that
all handles to the kernel datapath be closed before trying to unload the
OVS extension.
Mark D. Gray [Mon, 13 Apr 2015 13:36:56 +0000 (06:36 -0700)]
netdev-dpdk: Reset RSS hash on transmit
When using DPDK rings (dpdkr port type), packet buffers get shared
to consumers of the rings (e.g. Virtual Machines). The packet buffers
also include the RSS hash. This is a hash of a number of fields
in the packet and is used in order to do a fast lookup in the EMC.
However, if a consumer of the packet modifies the packet without
regenerating the RSS hash, the EMC will use the same hash for lookup
even though the packet may belong to a different flow. This would
cause unnecessary collisions in the EMC reducing performance in the
presence of multiple flows.
To avoid receiving an incorrect RSS hash on reception from a DPDK
ring, the RSS hash needs to be reset on transmission. This will reduce
performance of the forwarding path as the RSS hash will need to
calculated for every packet received from an dpdkr but will behave
correctly in the presence of a large number of flows that get
modified by the consumer of a DPDK ring
Signed-off-by: Mark D. Gray <mark.d.gray@intel.com> Acked-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
It has been observed that sometimes Windows unit tests hang.
This happens when a daemon is started but does not get terminated
when the test ends.
In one particular case, OVS_VSWITCHD_STOP is called which inturn
calls 'ovs-appctl exit'. This causes ovs-vswitchd's atexit handler
to cleanup the pidfiles. After this, the pthread destructurs get
called and a deadlock happens in there. This results in the
daemons not getting force killed resulting in the tests hanging
because the cleanup file tries to run the command
"kill `cat ovs-vswitchd.pid`" and ovs-vswitchd.pid no longer exists.
With this commit, we write the pid value of the daemons in the
cleanup file (instead of asking it to 'cat' the value later from
the pidfile). This way, even if the pidfiles get deleted, we can
still kill the daemons.
This commit also changes the way daemons are force killed in
Windows. It was observed that 'taskkill //F ' failed to kill
a deadlocked daemon running its pthread destructor. But
tskill succeeds.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
(ON_EXIT_UNQUOTED macro provided by Ben.) Co-authored-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Thomas Graf [Wed, 22 Apr 2015 07:49:43 +0000 (09:49 +0200)]
ovs-ctl: Unload & reload vport modules on force-reload-kmod
We manually rmmod the loaded vports as using modprobe -r
only works if the modules are available through modules.dep
We do not treat failures to load vports as a fatal error in case
the vport module has been renamed. Bringing the bridge back up is
considered more important. The error is still reported though.
Ben Pfaff [Thu, 16 Apr 2015 21:38:36 +0000 (14:38 -0700)]
netdev-dummy: Fix null pointer deref in dummy_packet_conn_set_config().
This would trigger if someone tried to switch a dummy device between
active and passive connections. It's not very important because dummy
devices are only enabled during testing.
Found by LLVM scan-build.
Reported-by: Kevin Lo <kevlo@FreeBSD.org> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
Ben Pfaff [Mon, 20 Apr 2015 19:11:23 +0000 (12:11 -0700)]
dpctl.at: Ignore string representation of error messages in output.
Different C libraries represent the same error code (particularly ENODEV)
differently. This caused spurious test failures on BSD. This commit
avoids the problem by ignoring the error string representations entirely.
Alex Wang [Mon, 20 Apr 2015 22:01:40 +0000 (15:01 -0700)]
in-band: Do not use manager with loopback address for in-band control.
If the manager resides on the same host as ovs, the manager target will
be the loopback address. Then, if in-band is enabled on a bridge, the
in-band module will constantly checks the connection to the manager to
make sure the manager is reachable. However, the connection checking
implementation cannot identify the route for the loopback address and
will keep issuing the following warning:
|in_band|WARN|cannot find route for controller (127.0.0.1): No such
device or address.
To fix this, this commit makes ovs not consider manager with loopback
for in-band control at all, since the manager is always reachable
on the same host.
Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
datapath-windows: Removed assert from FilterNetPnPEvent handler
I have removed an inappropriate assert from the FilterNetPnPEvent
routine, OvsExtNetPnPEvent. When NDIS calls the FilterNetPnPEvent
routine, the extension is in paused state and, obviously, the
switch is not active. The switch becomes active after FilterRestart
routine is called and the restart is successfully complete.
We already have the 'dp_hash' embedded in the metadata. This caused
confusion in the code. With this commit it should be clear that
'rss_hash' is the packet hash used for internal purposes, while
'md.dp_hash' is part of the flow, computed during the execution of
certain actions.
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ethan Jackson <ethan@nicira.com>
dpif-netdev: Cache time_msec() calls for each received batch.
Calling time_msec() (which calls clock_gettime()) too often might be
expensive. With this commit OVS makes only one call per received
batch and caches the result.
Suggested-by: Ethan Jackson <ethan@nicira.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ethan Jackson <ethan@nicira.com>
dpif-netdev: Store actions data and size contiguously.
As stated by the comment above the structure, the 'action' pointer does not
change during the 'dp_netdev_actions' lifetime: we might as well embed
the pointed memory into the structure.
The commit also updates the description of dp_netdev_actions_create().
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ethan Jackson <ethan@nicira.com>
Ben Pfaff [Mon, 20 Apr 2015 19:43:37 +0000 (12:43 -0700)]
netlink-socket: Exit NL transaction loop when EINVAL is returned
The nl_sock_transact_multiple function enters in an infinite loop,
when invalid error, EINVAL, is returned by nl_sock_transact_multiple__.
EINVAL is the error returned by the latter function when a driver
request fails.
Dennis Flynn [Wed, 15 Apr 2015 15:53:56 +0000 (11:53 -0400)]
auto-attach: Implement interface lldp disable and re-enable
This commit completes the implementation of the lldp enable
option. Specifically after enabling lldp on a particular interface, lldp can
now be disabled and subsequently re-enabled. OVS will not transmit or receive
lldp packets if lldp is disabled on the interface.
Signed-off-by: Dennis Flynn <drflynn@avaya.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Kevin Lo [Sat, 18 Apr 2015 17:48:06 +0000 (01:48 +0800)]
configure.ac: Fix pthread linking on FreeBSD.
The configure script checks for the existence of pthread_sigmask.
However, on FreeBSD, libc contains no-op stubs for many of the
pthread_* functions. As a result, the AC_SEARCH_LIBS macro returns
"none required".
As an alternative to checking pthread_sigmask, a solution is to check
pthread_create.
Signed-off-by: Kevin Lo <kevlo@FreeBSD.org> Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: Ben Pfaff <blp@nicira.com>
Alex Wang [Fri, 17 Apr 2015 18:30:18 +0000 (11:30 -0700)]
dkms.conf.in: Install all kernel modules.
With the latest change of separating vports into their own modules,
we need to update the dkms.conf.in and make dkms install all vport
modules. So, this commit modifies the debian/rules to read all
kernel module names and sets the dkms.conf correctly.
When netdev_bsd_get_mtu() failed, it didn't report the error to the caller,
so the caller couldn't work around not knowing the MTU, and ended up using
an uninitialized 'mtu' value.
Found by LLVM scan-build.
Reported-by: Kevin Lo <kevlo@FreeBSD.org> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Kevin Lo <kevlo@FreeBSD.org> Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Ben Pfaff [Thu, 16 Apr 2015 20:44:53 +0000 (13:44 -0700)]
ovs-lldp: Remove unused variable 'lldp_size'.
Doesn't seem to be good for anything.
Found by LLVM scan-build.
Reported-by: Kevin Lo <kevlo@FreeBSD.org> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Kevin Lo <kevlo@FreeBSD.org> Acked-by: Dennis Flynn <drflynn@avaya.com>
Andy Zhou [Thu, 16 Apr 2015 19:52:09 +0000 (12:52 -0700)]
autoconf: check for linux/perf_event.h
Older Linux prior to version 2.6.32 do not support user mode
performance events, They also don't have 'linux/perf_event.h' header
file. Add check for those older Linux to conditionally compile
perf-counter.c
Reported-by: Alex Wang <alexw@nicira.com> Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
Ben Pfaff [Thu, 16 Apr 2015 15:52:29 +0000 (08:52 -0700)]
ovs-lldp: Avoid free() of static data in aa_print_element_status_port().
In some cases 'id' could point to the static string "<None>", which was
then passed to free() even though it must not be. This commit fixes the
problem.
Found by LLVM scan-build.
Reported-by: Kevin Lo <kevlo@FreeBSD.org> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Russell Bryant <rbryant@redhat.com> Acked-by: Dennis Flynn <drflynn@avaya.com>
Ben Pfaff [Wed, 15 Apr 2015 18:13:04 +0000 (11:13 -0700)]
dpctl: Fix error handling and reporting regressions.
Fixes multiple weaknesses in dpctl error reporting:
* dpctl_set_if() didn't stop processing or report to the caller
attempts to change a port type or number.
* dpctl_set_if() didn't report the specifics when netdev_set_config()
reported an error setting port configuration (which can happen even
it returns 0).
* The unixctl handler didn't report errors encountered during command
processing through the JSON-RPC error mechanism, which meant that
ovs-appctl's return code wasn't useful (as ovs-dpctl's return code
is useful) for detecting errors in command execution.
At least the first of these is a regression from OVS 2.3.x.
A followup commit will add tests.
Reported-by: Kevin Lo <kevlo@FreeBSD.org> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>