Russell Bryant [Mon, 16 Mar 2015 16:01:55 +0000 (12:01 -0400)]
command-line: add ovs_cmdl_ prefix
The coding style guidelines include the following:
- Pick a unique name prefix (ending with an underscore) for each
module, and apply that prefix to all of that module's externally
visible names. Names of macro parameters, struct and union members,
and parameters in function prototypes are not considered externally
visible for this purpose.
This patch adds the new prefix to the externally visible names. This
makes it a bit more obvious what code is coming from common command
line handling code.
Signed-off-by: Russell Bryant <rbryant@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Alex Wang [Fri, 13 Mar 2015 17:28:07 +0000 (10:28 -0700)]
ovs-vsctl-bashcomp: Fix build failure when bash version < 4.0.
The ovs-vsctl-bashcomp script does not work properly on bash (version
< 4.0). This commit adds test for the bash version and avoids running
the script/test when the bash version is not supported.
Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Alex Wang [Wed, 11 Feb 2015 19:08:57 +0000 (11:08 -0800)]
ovs-vsctl-bashcomp: Documentation and unit tests.
This commit includes the unit tests for ovs-vsctl-bashcomp
and refines the ovs-command-bashcomp.INSTALL.md to introduce
the bash completion for ovs-vsctl.
Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Peter Amidon [Wed, 4 Feb 2015 17:52:12 +0000 (09:52 -0800)]
ovs-vsctl-bashcomp: Add bash command-line completion for ovs-vsctl.
This patch adds bash command-line completion script for ovs-vsctl.
Therein, codes are added to ovs-vsctl to allow it to print the
options and command arguments. The ovs-vsctl-bashcomp.bash will
parse the vsctl command and complete on the user input.
The completion script can do the following::
- display available completions and complete on user input for
global/local options, sub-commands, and arguments.
- query database and expand keywords like 'table/record/column/key'
to available completions.
- deal with argument relations like 'one and more', 'zero or one'.
- complete multiple ovs-vsctl commands cascaded via '--'.
To use the script, either copy it inside /etc/bash_completion.d/
or manually run it via . ovs-vsctl-bashcomp.bash.
Signed-off-by: Peter Amidon <peter@picnicpark.org> Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Alex Wang [Tue, 10 Feb 2015 19:06:11 +0000 (11:06 -0800)]
ovs-appctl-bashcomp: Keep naming consistency.
Before adding the completion script ovs-vsctl-bashcomp.bash for
ovs-vsctl command, this commit renames the ovs-command-compgen.bash
to ovs-appctl-bashcomp.bash to keep the script naming consistent.
Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Commit 032c09ddd10 (XenServer: Don't reset on xe-toolstack-restart)
introduced a bug which causes the setting of 'ssl::6632' at xenserver
boot. Subsequently, at each bridge configuration, ovs will report
'|socket_util|ERR|:6632: bad IPv4 address ""' due to the empty address.
The exact calltrace is:
0 parse_sockaddr_components (ss=0xbf8dd87c, host_s=0x94c99f0 "",
port_s=0x94c99f1 "6632", default_port=6632, s=0x948b9dc ":6632")
at lib/socket-util.c:350
1 0x081163b5 in inet_parse_active (target_=0x948b9dc ":6632", default_port=
6632, ss=0xbf8dd87c) at lib/socket-util.c:412
2 0x08119dcf in stream_parse_target_with_default_port (target=0x948b9d8
"ssl::6632", default_port=6632, ss=0xbf8dd87c) at lib/stream.c:734
3 0x0804c946 in collect_in_band_managers (ovs_cfg=0x94433b0,
managersp=0xbf8dd9a8, n_managersp=0xbf8dd9a0) at vswitchd/bridge.c:516
4 0x08054b87 in bridge_reconfigure (ovs_cfg=0x94433b0) at vswitchd/bridge.c:
614
5 0x080557cf in bridge_run () at vswitchd/bridge.c:2897
6 0x080564aa in main (argc=155674720, argv=0x0) at vswitchd/ovs-vswitchd.c:
116
This commit fixes the issue.
Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Edwin Chiu [Tue, 10 Mar 2015 18:36:43 +0000 (11:36 -0700)]
xenserver: Fix build spec for XenServer 6.5.
The latest XenServer 6.5 uses a new way for kernel version naming.
Therein, the kernel flavor could not be found anymore. Also, the
directory name in 'lib/modules/' becomes a shortened version of
kernel version. e.g.:
[root@localhost ~]# ls /lib/modules/
3.10.0+2
As a workaround, this commit modifies the spec file to make
%{kernel_flavor} optional and %{xen_version} definable by users.
In the long run, I'd like to spend time refining the spec file.
Signed-off-by: Edwin Chiu <echiu@vmware.com> Signed-off-by: Alex Wang <alexw@nicira.com>
Ben Pfaff [Thu, 5 Mar 2015 19:12:21 +0000 (11:12 -0800)]
bridge: Enable RSTP if both STP and RSTP are enabled.
Until now, if both STP and RSTP were enabled, ovs-vswitchd would actually
enable only the one it first noticed to be enabled, and actually turn off
the setting for the other one in the database (!). This doesn't match
ovs-vswitchd behavior for other contradictory configurations, so this
commit changes its behavior so that, if both are enabled, RSTP takes
precedence.
Mark Kavanagh [Tue, 17 Feb 2015 21:20:04 +0000 (13:20 -0800)]
lib: upgrade to DPDK v1.8.0
DPDK v1.8.0 makes significant changes to struct rte_mbuf, including
removal of the 'pkt' and 'data' fields. The latter, formally a
pointer, is now calculated via an offset from the start of the
segment buffer. So now dp_packet data is also stored as offset
from base pointer.
Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com> Signed-off-by: Rory Sexton <rory.sexton@intel.com> Signed-off-by: Kevin Traynor <kevin.traynor@intel.com> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Pravin B Shelar [Tue, 3 Mar 2015 22:08:58 +0000 (14:08 -0800)]
lldp: Fix DPDK build.
Fixes following dp-packet access. Removes netinet/if_ether.h
include due to duplicate definition of ether_addr.
------
In file included from /usr/include/netinet/if_ether.h:60:0,
from lib/lldp/lldpd.h:23,
from lib/ovs-lldp.h:26,
from lib/ovs-lldp.c:30:
/usr/include/net/ethernet.h: At top level:
/usr/include/net/ethernet.h:32:8: error: redefinition of 'struct
ether_addr'
struct ether_addr
^
In file included from
../dpdk/dpdk/x86_64-native-linuxapp-gcc/include/rte_ethdev.h:179:0,
from lib/netdev-dpdk.h:18,
from lib/dp-packet.h:25,
from lib/ovs-lldp.h:23,
from lib/ovs-lldp.c:30:
../dpdk/dpdk/x86_64-native-linuxapp-gcc/include/rte_ether.h:83:8: note:
originally defined here
struct ether_addr {
^
lib/ovs-lldp.c: In function 'lldp_process_packet':
lib/ovs-lldp.c:676:30: error: 'const struct dp_packet' has no member
named 'data_'
(char *) p->data_, p->size_);
^
lib/ovs-lldp.c:676:40: error: 'const struct dp_packet' has no member
named 'size_'
(char *) p->data_, p->size_);
------
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@nicira.com>
Alex Wang [Fri, 27 Feb 2015 05:16:14 +0000 (21:16 -0800)]
test-hash: Do not exit check_word_hash() when there is a failure.
This commit makes check_word_hash() run to finish even when there
is a failure during the run. The test will still fail due to the
output check in AT_CHECK. And developers can benefit from having
all failed hashes instead of only the first one.
Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Alex Wang [Thu, 26 Feb 2015 17:54:00 +0000 (09:54 -0800)]
test-hash: Test hash_bytes128() with single 128-bit word.
This commit adds a new test for hash_bytes128() using single 128-bit
word. The test shows that there is no collision in all 19 consecutive
bits checks, which indicates the hash function is good.
Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Joe Stringer <joestringer@nicira.com>
Ben Pfaff [Tue, 3 Mar 2015 23:36:28 +0000 (15:36 -0800)]
ovs-lldp: Use better types for ISID and VLANs.
An ISID is 24 bits, so it fits in a uint32_t. A VLAN is 12 bits, so it
fits in a uint16_t. Use these types consistently, instead of int64_t.
This removes a check in aa_mapping_unregister() that seems a little
mysterious to me: it previously checked for ISID and VLAN values >= 0. I
don't see a way that they could be < 0 in this situation though.
Ben Pfaff [Tue, 3 Mar 2015 23:26:54 +0000 (15:26 -0800)]
lldp: Get rid of POKE macros in favor of inline functions.
The POKE macros previously used here don't match the style usually used in
OVS and they require the user to know exactly how many bytes to reserve.
This commit replaces them by easier-to-use inline functions that take
advantage of the ofpbuf interface.
Also removes a few PEEK macros that weren't used anywhere.
Dennis Flynn [Fri, 20 Feb 2015 19:17:11 +0000 (14:17 -0500)]
auto-attach: Add auto-attach support to bridge layer and command set
This is the final commit in the series of commits that deliver initial support
for Auto-Attach. Specifically this commit delivers auto-attach support to the
OVS bridge layer as well as the new auto-attach commands. The OVSDB schema is
modified to define the new auto-attach entries. The man pages, unit tests, and
news and license notice files are also updated. A unit test is provided to
validate the construction of auto-attach packets.
Signed-off-by: Ludovic Beliveau <ludovic.beliveau@windriver.com> Signed-off-by: Dennis Flynn <drflynn@avaya.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Dennis Flynn [Fri, 20 Feb 2015 19:17:09 +0000 (14:17 -0500)]
auto-attach: Initial support for Auto-Attach standard
This commit provides the initial delivery of support for the Auto-Attach
standard to Open vSwitch. This standard describes a compact method of using
IEEE 802.1AB Link Layer Discovery Protocol (LLDP) with a IEEE 802.1aq Shortest
Path Bridging (SPB) network to automatically attach network devices not
supporting IEEE 802.1ah to individual services in a SPB network. Specifically
this commit adds base LLDP support to OVS along with the LLDP extension
required to support Auto-Attach.
The base LLDP code within this commit is adapted from the open source LLDPD
project headed by Vincent Bernat. This base code is augmented with OVS specific
logic which integrates LLDP into OVS and which extends LLDP to support
Auto-Attach. The required build system changes are provided to include this new
Auto-Attach feature.
This is the first of a series of commits. Subsequent commits will be provided
to complete the task of adding Auto-Attach to OVS.
Signed-off-by: Ludovic Beliveau <ludovic.beliveau@windriver.com> Signed-off-by: Dennis Flynn <drflynn@avaya.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Pravin B Shelar [Tue, 3 Mar 2015 01:29:44 +0000 (17:29 -0800)]
ofpbuf: Simplify ofpbuf API.
ofpbuf was complicated due to its wide usage across all
layers of OVS, Now we have introduced independent dp_packet
which can be used for datapath packet, we can simplify ofpbuf.
Following patch removes DPDK mbuf and access API of ofpbuf
members.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Pravin B Shelar [Sun, 22 Feb 2015 11:21:09 +0000 (03:21 -0800)]
dp-packet: Remove ofpbuf dependency.
Currently dp-packet make use of ofpbuf for managing packet
buffers. That complicates ofpbuf, by making dp-packet
independent of ofpbuf both libraries can be optimized for
their own use case.
This avoids mapping operation between ofpbuf and dp_packet
in datapath upcalls.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Mark Maglana [Mon, 2 Mar 2015 21:41:35 +0000 (13:41 -0800)]
vtep: Limit the split elements to 2 (maxsplit + 1)
This change ensures that we always end up with two elements even
if the name of the physical port contains dashes. For example, a
binding of "0100-br0-eth1" will be split to ["0100", "br0-eth1"]
instead of ["0100", "br0", "eth1"].
Signed-off-by: Mark Maglana <mmaglana@gmail.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Pravin B Shelar [Sun, 15 Feb 2015 22:58:51 +0000 (14:58 -0800)]
datapath: Fix masked key serialization.
Fix typo where mask is used rather than key.
Fixes: 74ed7ab9264("openvswitch: Add support for unique flow IDs.") Reported-by: Joe Stringer <joestringer@nicira.com> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Joe Stringer [Thu, 22 Jan 2015 00:42:52 +0000 (16:42 -0800)]
datapath: Add support for unique flow IDs.
Previously, flows were manipulated by userspace specifying a full,
unmasked flow key. This adds significant burden onto flow
serialization/deserialization, particularly when dumping flows.
This patch adds an alternative way to refer to flows using a
variable-length "unique flow identifier" (UFID). At flow setup time,
userspace may specify a UFID for a flow, which is stored with the flow
and inserted into a separate table for lookup, in addition to the
standard flow table. Flows created using a UFID must be fetched or
deleted using the UFID.
All flow dump operations may now be made more terse with OVS_UFID_F_*
flags. For example, the OVS_UFID_F_OMIT_KEY flag allows responses to
omit the flow key from a datapath operation if the flow has a
corresponding UFID. This significantly reduces the time spent assembling
and transacting netlink messages. With all OVS_UFID_F_OMIT_* flags
enabled, the datapath only returns the UFID and statistics for each flow
during flow dump, increasing ovs-vswitchd revalidator performance by 40%
or more.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Joe Stringer [Thu, 22 Jan 2015 00:42:51 +0000 (16:42 -0800)]
compat: Add genlmsg_parse() helper function.
The first user will be the next patch.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Joe Stringer [Thu, 22 Jan 2015 00:42:50 +0000 (16:42 -0800)]
datapath: Use sw_flow_key_range for key ranges.
These minor tidyups make a future patch a little tidier.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Joe Stringer [Thu, 22 Jan 2015 00:42:49 +0000 (16:42 -0800)]
datapath: Refactor ovs_flow_tbl_insert().
Rework so that ovs_flow_tbl_insert() calls flow_{key,mask}_insert().
This tidies up a future patch.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Joe Stringer [Thu, 22 Jan 2015 00:42:48 +0000 (16:42 -0800)]
datapath: Refactor ovs_nla_fill_match().
Refactor the ovs_nla_fill_match() function into separate netlink
serialization functions ovs_nla_put_{unmasked_key,mask}(). Modify
ovs_nla_put_flow() to handle attribute nesting and expose the 'is_mask'
parameter - all callers need to nest the flow, and callers have better
knowledge about whether it is serializing a mask or not.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Alex Wang [Fri, 27 Feb 2015 17:07:18 +0000 (09:07 -0800)]
test-hash: Remove the check_word_hash() for hash_bytes128_cb.
The original test fails on big-endian system due to the hash function
performing not as well when input is uint32_t. In reality, users should
only use hash_bytes128() to hash words larger than 128 bits (e.g. struct
flow). Besides, we do check the 1-bit set case for 16 128-bit words in
following test case. Therefore, the cleanest way to fix the failure
in big-endian system seems to be just removing the check_word_hash()
test for hash_bytes128_cb.
Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Andy Zhou [Tue, 24 Feb 2015 07:20:17 +0000 (23:20 -0800)]
ovsdb: Raise the jsonrpc server session limit
Raise the connection limit to allow larger number of concurrent
ovsdb-server connections. Note, ovsdb-server may not perform well
at the new limit. It is rather a prelude to further scaling tests and
optimizations.
Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Andy Zhou [Tue, 24 Feb 2015 07:15:23 +0000 (23:15 -0800)]
ovsdb: Warn about reaching max session limit
Without the log message, it was not obvious why ovsdb-server no longer
accepts new connections when the session limit was reached. This patch
adds a log message to make it obvious.
Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Russell Bryant <rbryant@redhat.com> Acked-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Sun, 22 Feb 2015 19:29:54 +0000 (11:29 -0800)]
FAQ.md: Mention Linux version that first could handle IPFIX flow monitoring.
I think that the critical commit is commit 4490108b4a5ada (openvswitch:
Allow OVS_USERSPACE_ATTR_USERDATA to be variable length.), which first
appeared in Linux 3.10.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Romain Lenglet <romain.lenglet@oracle.com>
ovs-docker: Use a different mechanism to check for commands.
Currently, the script uses '--version' option from different commands
to check for their availability. uuidgen on Centos6 has been reported
not to have the '--version' option causing failure in script invocation.
This commit looks for the utilities in $PATH instead. The code is
copied from build-aux/dist-docs.
Reported-by: Michael J. Smalley <michaeljsmalley@gmail.com> Suggested-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Andy Zhou [Fri, 20 Feb 2015 20:55:25 +0000 (12:55 -0800)]
ovs-sandbox: Show the running program on xterm's title
When debugging multiple programs under GDB, it will be easier to
identify xterms with the program name displayed as title. Without
this patch, xterms will have the title of "gdb", which is the first
program the xterm executes. This change is useful for the next patch.
Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jesse Gross [Wed, 18 Feb 2015 01:46:09 +0000 (17:46 -0800)]
datapath: Account for "openvswitch: Add support for checksums on UDP tunnels."
Upstream commit:
openvswitch: Add support for checksums on UDP tunnels.
Currently, it isn't possible to request checksums on the outer UDP
header of tunnels - the TUNNEL_CSUM flag is ignored. This adds
support for requesting that UDP checksums be computed on transmit
and properly reported if they are present on receive.
Signed-off-by: Jesse Gross <jesse@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: b8693877 ("openvswitch: Add support for checksums on UDP tunnels.") Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>