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

1150 Commits

Author SHA1 Message Date
Ethan Jackson
c875bb948d 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>
2015-05-08 15:26:26 -07:00
Billy O'Mahony
77c180cea6 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>
2015-05-07 10:49:27 -07:00
Gurucharan Shetty
a1dbf3d890 ovs-ctl.8: Add a missing synopsis.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-04-22 08:19:18 -07:00
Thomas Graf
2791b00ce1 ovs-dev: Load all available vport modules on modinst
Automatically load all vport modules upon 'modinst' in case
they are not properly installed and thus not autoloaded.

Suggested-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
2015-04-22 09:49:55 +02:00
Thomas Graf
e8ee793b8c ovs-dev: Hint that vport modules may need to be loaded manually
In case the openvswitch.ko is loaded manually without dependencies
built, the vport modules need to be loaded manually as well.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
2015-04-22 09:49:55 +02:00
Thomas Graf
a6df8ea0be 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.

Reported-by: Pravin Shelar <pshelar@nicira.com>
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
2015-04-22 09:49:55 +02:00
Ben Pfaff
96660ed1fc ovs-ofctl: Fix documentation of burst_size.
Reported-by: Kentaro Ebisawa <ebiken.g@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
2015-04-20 10:40:04 -07:00
Ben Pfaff
19c12401d6 ovs-dev.py: Remove vport-*.ko at same time as openvswitch.ko.
My guess is that this is the intent.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
2015-04-05 15:02:48 -07:00
Simon Horman
b879391e0f Support NTR selection method in ovs-ofctl group commands
NTR selection method
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-24 09:22:56 -07:00
Alex Wang
2c9907cde3 bashcomp: Install and package completion scripts.
This commit makes the bash completion scripts be installed to
$(sysconfdir)/bash_completion.d/ through 'make install' and to
/etc/bash_completion.d/ through package installation.  This will
make the scripts available for each bash session.

An alternative is to put scripts to /usr/share/bash_completion/
directory.  However, this is not supported by earlier version of
bash completion.

Signed-off-by: Alex Wang <alexw@nicira.com>
2015-03-20 16:42:47 -07:00
Alex Wang
bb5dbe7859 ovs-vsctl-bashcomp: Avoid setting the COMP_WORDBREAKS.
Modifying $COMP_WORDBREAKS in completion script is not the recommended
as it is a global variable and the modification could affect the behavior
of other completion scripts.  As a workaround, this commit uses the
_get_comp_words_by_ref which allows user to exclude characters out of
$COMP_WORDBREAKS and reassemble input command line.  However, as a side
effect, the bash completion module cannot handle characters defined in
$COMP_WORDBREAKS (e.g. ':' and '=') correctly in the resulting completions.
Thusly, we need to trim the colon-word and equal-word prefixes from reply.

Signed-off-by: Alex Wang <alexw@nicira.com>
2015-03-20 16:42:42 -07:00
Ben Pfaff
d6f115f56a ovs-vsctl: Only monitor AutoAttach columns when useful.
Otherwise this creates a gratuitous incompatibility with older databases,
which can be a problem in upgrade situations.

VMware-BZ: #1413562
Reported-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
2015-03-20 00:25:13 -07:00
Ben Pfaff
c557ca0416 ovs-vsctl: Create AutoAttach records on demand, for backward compatibility.
The AutoAttach table is new in OVS 2.3.90, but ovs-vsctl was creating a
record in the table unconditionally whenever it created a new bridge.
This caused a gratuitous incompatibility with older databases, which can
be a problem during upgrade.  This commit switches to creating the
AutoAttaach record for a bridge lazily, only when the first mapping is
created for the bridge.

VMware-BZ: #1413562
CC: Dennis Flynn <drflynn@avaya.com>
Reported-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
2015-03-20 00:25:13 -07:00
Kevin Traynor
58397e6c1e netdev-dpdk: add dpdk vhost-cuse ports
This patch adds support for a new port type to userspace datapath
called dpdkvhost. This allows KVM (QEMU) to offload the servicing
of virtio-net devices to its associated dpdkvhost port. Instructions
for use are in INSTALL.DPDK.

This has been tested on Intel multi-core platforms and with clients
that have virtio-net interfaces.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Signed-off-by: Kevin Traynor <kevin.traynor@intel.com>
Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
2015-03-19 20:26:03 -07:00
Alex Wang
b6b0e049fd ovs-appctl-bashcomp: Use better function to complete file.
This commit uses the _filedir function defined in bash_completion
module for file completion.  It will take care of the '/' suffix
for directory.

Signed-off-by: Alex Wang <alexw@nicira.com>
2015-03-18 12:30:47 -07:00
Russell Bryant
1636c76112 command-line: add ovs_cmdl_context
I started working on a new command line utility that used this shared
code.  I wanted the ability to pass some data from common
initialization code to all of the commands.  You can find a similar
pattern in ovs-vsctl.

This patch updates the command handler to take a new struct,
ovs_cmdl_context, instead of argc and argv directly.  It includes argc
and argv, but also includes an opaque type (void *), where the user of
this API can attach its custom data it wants passed along to command
handlers.

This patch affected the ovstest sub-programs, as well.  The patch
includes a bit of an odd hack to OVSTEST_REGISTER() to avoid making
the main() function of the sub-programs take a ovs_cmdl_context.
The test main() functions still receive argc and argv directly, as
that seems more natural.  The test-subprograms themselves are able to
make use of a context internally, though.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-17 08:15:57 -07:00
Russell Bryant
5f38375100 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>
2015-03-16 13:42:52 -07:00
Alex Wang
ce34e37ffe 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>
2015-03-13 10:44:29 -07:00
Justin Pettit
d4763d1d4e Use the IANA-assigned ports for OpenFlow and OVSDB.
We've been warning about the change since 2.1, which was released a year
ago.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-03-12 17:01:10 -07:00
Alex Wang
557570fa09 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>
2015-03-12 14:20:40 -07:00
Peter Amidon
95e4a97a6f 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>
2015-03-12 14:17:13 -07:00
Alex Wang
94ace6ffe4 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>
2015-03-12 14:03:44 -07:00
Ben Pfaff
90bcf7a507 ovs-bugtool: Improve manpage.
The manpage was poorly organized and failed to mention some options.

Example provided by Gurucharan Shetty <gshetty@nicira.com>.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Gurucharan Shetty <gshetty@nicira.com>
2015-03-04 14:20:05 -08:00
Ben Pfaff
501b80538d ovs-vsctl: Fix misused casts.
Without the casts, the argument types match the format specifiers.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:19:26 -08:00
Dennis Flynn
99eef98b53 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>
2015-03-03 16:19:26 -08:00
Pravin B Shelar
6fd6ed71cb 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>
2015-03-03 13:37:39 -08:00
Pravin B Shelar
cf62fa4c70 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>
2015-03-03 13:37:37 -08:00
Gianluca Merlo
709344386f ovs-docker: check if port is already attached for container/interface
Reuse code for determining attached port to prevent ovs-docker to proceed if a
port for the given container and interface is already attached.

Signed-off-by: Gianluca Merlo <gianluca.merlo@gmail.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2015-03-03 08:52:07 -08:00
Alexey I. Froloff
b3a92948c9 ovs-save: Preserve IPv6 link-local address on interface save.
If IPv6 link-local address is removed from interface, it is unable to
receive any IPv6 packets, including Route Advertisements.

In save_interface only skip IPv4 "scope link" addresses.

Signed-off-by: Alexey I. Froloff <raorn@raorn.name>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 08:07:35 -08:00
Ben Pfaff
d3cb080e54 OpenFlow 1.5 is final, so change OF1.5 draft references to just say OF1.5.
Reported-by: Jean Tourrilhes <jt@hpl.hp.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jean Tourrilhes <jt@hpl.hp.com>
2015-02-25 11:43:25 -08:00
Gurucharan Shetty
a8353802a4 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>
2015-02-23 09:18:00 -08:00
Madhu Challa
ac6073e3cd ofproto: Add NXM_NX_TUN_GBP_ID and NXM_NX_TUN_GBP_FLAGS
Introduces two new NXMs to represent VXLAN-GBP [0] fields.

  actions=load:0x10->NXM_NX_TUN_GBP_ID[],NORMAL
  tun_gbp_id=0x10,actions=drop

This enables existing VXLAN tunnels to carry security label
information such as a SELinux context to other network peers.

The values are carried to/from the datapath using the attribute
OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS.

[0] https://tools.ietf.org/html/draft-smith-vxlan-group-policy-00

Signed-off-by: Madhu Challa <challa@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
2015-02-14 15:31:04 +01:00
Flavio Leitner
8e04a33ffc mcast-snoop: Add support to control Reports forwarding
The RFC4541 section 2.1.1 item 1 allows the snooping switch
to provide an administrative control to allow Report messages
to be flooded to ports not connected to multicast routers.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-02-04 10:49:07 -08:00
Alex Wang
b8905bfa9d ovs-command-completion: Complete on file path by default.
This commit makes the bash completion script complete on file
path when there is no completion available.  The unit tests
are also adjusted accordingly.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-02-03 17:57:55 -08:00
Alex Wang
1b8c7b961c ovs-command-completion: Avoid using negative subscript.
Negative subscript causes error in bash version 4.1.2(1)-release
(x86_64-redhat-linux-gnu).  This commit fixes it.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-02-01 21:21:38 -08:00
Alex Wang
08d425488a ovs-command-completion: Autotest integration.
This commit integrates the unit tests defined in
utilities/ovs-command-compgen-test.bash into 'make check'.
The tests will be skipped if the current shell is not bash.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-01-30 15:28:22 -08:00
Ben Pfaff
5989a51c88 ovs-dpctl: Mention use of ovs-appctl instead for netdev datapath.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Gurucharan Shetty <gshetty@nicira.com>
2015-01-30 13:38:45 -08:00
Ben Pfaff
7be0b8a0b0 ovs-bugtool: Add --help message.
Seemed a little embarrassing when I realized that ovs-bugtool has no usage
message on a customer call this morning.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
2015-01-30 13:22:33 -08:00
Gurucharan Shetty
d69d61c7c1 vlog: Ability to override the default log facility.
When Open vSwitch is run in hundreds of hypervisors, it is
useful to collect log messages through log collectors. To
collect log messages like this, it is useful to log them
in a particular RFC5424 facility in the local system. The
log collectors can then be used to collect logs anytime
desired.

This commit provides a sysadmin the ability to specify the
facility through which the log messages are logged.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-01-28 08:32:37 -08:00
Ben Pfaff
18080541d2 classifier: Add support for conjunctive matches.
A "conjunctive match" allows higher-level matches in the flow table, such
as set membership matches, without causing a cross-product explosion for
multidimensional matches.  Please refer to the documentation that this
commit adds to ovs-ofctl(8) for a better explanation, including an example.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
2015-01-11 13:25:24 -08:00
Gurucharan Shetty
d5460484c3 vlog: Rename the currently used term 'facility' as 'destination'.
In OVS, we currently use the term 'facility' to mean the place
where we log (syslog, console or file). In Linux's syslog() and
rfc5424, the term 'facility' is used to specify what type of program
is logging the message (e.g: LOG_DAEMON). This causes confusion
while reading vlog's code. This commit changes the term 'facility'
to 'destination'.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-01-08 07:21:03 -08:00
Alex Wang
1fdbfd4e98 ovs-command-compgen: Avoid using GNU sed extensions.
This commit changes '\?' to '\{0,1\}' to avoid using GNU
sed extension.

Found by using the script in FreeBSD.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-01-05 10:14:49 -08:00
Joe Stringer
818650e6b1 dpctl: Add 'get-flow' command.
This allows users to fetch a flow by giving a particular UFID.

Usage: 'ovs-dpctl get-flow ufid:<ufid>'
Usage: 'ovs-appctl dpctl/get-flow ufid:<ufid>'

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
2014-12-19 13:11:47 -08:00
Paul-Emmanuel Raoul
8a856a63b3 ovs-docker : Handle pre-existing fake bridges.
Signed-off-by: Paul-Emmanuel Raoul <skyper@skyplabs.net>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2014-12-17 17:27:37 -08:00
Gurucharan Shetty
348efd0434 ovs-docker: Add the ability to set VLANs.
For containers containing multiple ports and spawned by
orchestrators without openflow flows configured, it can be quite
useful to distinguish their traffic with vlans. This can be useful
when containers are spawned inside VMs instead of hypervisors.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
2014-12-15 14:54:21 -08:00
Gurucharan Shetty
a14bf25a24 ovs-docker: Ability to set the default gateway.
ovs-docker currently lets one add the ability to set the
IP address on an OVS interface. Ability to set the default
gateway too can be an useful addition. (orchestrators
who plan to use OVS interfaces can do this from a single
utility instead of multiple utilities)

Requested-by: Marvin Pascual <marvin@pascual.com.ph>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
2014-12-15 09:49:10 -08:00
Thomas Graf
4a1f523f2d lib: Move vconn.h to <openvswitch/vconn.h>
Also moves definitions for struct vconn and pvconn to the public
header. The provider interface is kept private.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-15 14:15:22 +01:00
Thomas Graf
e6211adce4 lib: Move vlog.h to <openvswitch/vlog.h>
A new function vlog_insert_module() is introduced to avoid using
list_insert() from the vlog.h header.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-15 14:15:19 +01:00
Thomas Graf
ca6ba70092 list: Rename struct list to struct ovs_list
struct list is a common name and can't be used in public headers.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-15 14:15:12 +01:00
Thomas Graf
cab5044987 lib: Move compiler.h to <openvswitch/compiler.h>
The following macros are renamed to avoid conflicts with other headers:
 * WARN_UNUSED_RESULT to OVS_WARN_UNUSED_RESULT
 * PRINTF_FORMAT to OVS_PRINTF_FORMAT
 * NO_RETURN to OVS_NO_RETURN

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-15 14:14:47 +01:00