2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-22 01:51:26 +00:00

103 Commits

Author SHA1 Message Date
Aaron Conole
eeb7d7d995 checkpatch: Separate out the built-in spelling words.
Checkpatch contains a large list of spelling words, currently 326.  The
in-built list is quite cumbersome, and includes duplicate entries
('netdev' and 'revalidation').  Managing this list will continue to grow
difficult over time, and really shouldn't be so difficult.  To make the
maintenance of OVS specific spelling words easier, create a new file
that will contain the spelling words and move the list into that file
(sorted).  This patch adds 'FreeBSD' and 'gcloud' to the list as it
was tested against
80d723736b64 ("cirrus: Update to FreeBSD 14.3 and 13.5.").  It also
adds "apis", "enablement", "ifdef", and "tnl" after the patch proposed
by Eelco at the referenced link.

Link: d6fecfc949.1750328980.git.echaudro@redhat.com/
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Ilya Maximets <i.maximets@ovn.org>
Signed-off-by: Aaron Conole <aconole@redhat.com>
2025-07-16 08:39:25 -04:00
Adrián Moreno
93ccf58a91 utilities: upcall_cost: Refactor port mapping cache.
The upcall_cost.py script has a useful port mapping cache that can be
very useful for other scripts.

Move it into a library file (usdt_lib.py). While we're at it, refactor
it into a class since setting attributes to functions and having it
return different types depending on input is not very clean.

This patch should not introduce any functional change.

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
2025-04-09 10:47:47 +02:00
Eelco Chaudron
638433bb92 utilities: Add upcall statistics to the kernel_delay.py script.
This patch installs a kernel return probe on ovs_dp_upcall() to record
all successful and failed calls per CPU. The statistics are reported
when the script exits, providing insights into the upcall behavior.

This is an example output:

  # UPCALL STATISTICS (TOTAL [CPU_ID: N_UPCALLS_PER_CPU, ...]):
    Total upcalls       : 183247 [0: 8937, 2: 14464, 4: 10372, 6: 4254, ...]
    Successfull upcalls : 120195 [0: 5945, 2: 6379, 4: 5966, 6: 4254, ...]
    Failed upcalls      : 63052 [0: 2992, 2: 8085, 4: 4406, 8: 2275, ...]
       11, EAGAIN       : 63052 [0: 2992, 2: 8085, 4: 4406, 8: 2275, ...]

Tested-by: Adrian Moreno <amoreno@redhat.com>
Reviewed-by: Adrian Moreno <amoreno@redhat.com>
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
2024-12-20 11:03:03 +01:00
Eelco Chaudron
70fd13e25f utilities: Updated dpif_nl_exec_monitor.py to debug all operations.
Updated the dpif_nl_exec_monitor.py utility to also optionally monitor
the other DPIF netlink operations, i.e., DPIF_OP_FLOW_PUT,
DPIF_OP_FLOW_DEL and DPIF_OP_FLOW_GET

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Aaron Conole <aconole@redhat.com>
2024-08-30 07:58:47 -04:00
Kevin Sprague
86b9e653ef revalidator: Add a USDT probe during flow deletion with purge reason.
During normal operations, it is useful to understand when a particular flow
gets removed from the system. This can be useful when debugging performance
issues tied to ofproto flow changes, trying to determine deployed traffic
patterns, or while debugging dynamic systems where ports come and go.

Prior to this change, there was a lack of visibility around flow expiration.
The existing debugging infrastructure could tell us when a flow was added to
the datapath, but not when it was removed or why.

This change introduces a USDT probe at the point where the revalidator
determines that the flow should be removed.  Additionally, we track the
reason for the flow eviction and provide that information as well.  With
this change, we can track the complete flow lifecycle for the netlink
datapath by hooking the upcall tracepoint in kernel, the flow put USDT, and
the revalidator USDT, letting us watch as flows are added and removed from
the kernel datapath.

This change only enables this information via USDT probe, so it won't be
possible to access this information any other way (see:
Documentation/topics/usdt-probes.rst).

Also included is a script (utilities/usdt-scripts/flow_reval_monitor.py)
which serves as a demonstration of how the new USDT probe might be used
going forward.

Co-authored-by: Aaron Conole <aconole@redhat.com>
Acked-by: Han Zhou <hzhou@ovn.org>
Signed-off-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Kevin Sprague <ksprague0711@gmail.com>
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
2024-03-19 15:34:53 +01:00
Eelco Chaudron
13dde11310 utilities: Add kernel_delay.py script to debug a busy Linux kernel.
This patch adds an utility that can be used to determine if
an issue is related to a lack of Linux kernel resources.

This tool is also featured in a Red Hat developers blog article:

  https://developers.redhat.com/articles/2023/07/24/troubleshooting-open-vswitch-kernel-blame

Reviewed-by: Adrian Moreno <amorenoz@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
2023-09-27 11:21:16 +02:00
Eelco Chaudron
6ad35dd80e utilities: Add revalidator measurement script and needed USDT probes.
This patch adds a Python script that can be used to analyze the
revalidator runs by providing statistics (including some real time
graphs).

The USDT events can also be captured to a file and used for
later offline analysis.

The following blog explains the Open vSwitch revalidator
implementation and how this tool can help you understand what is
happening in your system.

https://developers.redhat.com/articles/2022/10/19/open-vswitch-revalidator-process-explained

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Adrian Moreno <amorenoz@redhat.com>
Acked-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2023-01-27 16:57:27 +01:00
Eelco Chaudron
62e85106b4 utilities: Add USDT script to monitor dpif netlink execute message queuing.
This patch adds the dpif_nl_exec_monitor.py script that will used the
existing dpif_netlink_operate__:op_flow_execute USDT probe to show
all DPIF_OP_EXECUTE operations being queued for transmission over
the netlink interface.

Here is an example, truncated output:

Display DPIF_OP_EXECUTE operations being queued for transmission...
TIME               CPU  COMM             PID        NL_SIZE
3124.516679897     1    ovs-vswitchd     8219       180
    nlmsghdr  : len = 0, type = 36, flags = 1, seq = 0, pid = 0
    genlmsghdr: cmd = 3, version = 1, reserver = 0
    ovs_header: dp_ifindex = 21
      > Decode OVS_PACKET_ATTR_* TLVs:
      nla_len 46, nla_type OVS_PACKET_ATTR_PACKET[1], data: 00 00 00...
      nla_len 20, nla_type OVS_PACKET_ATTR_KEY[2], data: 08 00 02 00...
          > Decode OVS_KEY_ATTR_* TLVs:
          nla_len 8, nla_type OVS_KEY_ATTR_PRIORITY[2], data: 00 00...
          nla_len 8, nla_type OVS_KEY_ATTR_SKB_MARK[15], data: 00 00...
      nla_len 88, nla_type OVS_PACKET_ATTR_ACTIONS[3], data: 4c 00 03...
          > Decode OVS_ACTION_ATTR_* TLVs:
          nla_len 76, nla_type OVS_ACTION_ATTR_SET[3], data: 48 00...
                  > Decode OVS_TUNNEL_KEY_ATTR_* TLVs:
                  nla_len 12, nla_type OVS_TUNNEL_KEY_ATTR_ID[0], data:...
                  nla_len 20, nla_type OVS_TUNNEL_KEY_ATTR_IPV6_DST[13], ...
                  nla_len 5, nla_type OVS_TUNNEL_KEY_ATTR_TTL[4], data: 40
                  nla_len 4, nla_type OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT[5]...
                  nla_len 4, nla_type OVS_TUNNEL_KEY_ATTR_CSUM[6], data:
                  nla_len 6, nla_type OVS_TUNNEL_KEY_ATTR_TP_DST[10],...
                  nla_len 12, nla_type OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS[8],...
          nla_len 8, nla_type OVS_ACTION_ATTR_OUTPUT[1], data: 02 00 00 00
      - Dumping OVS_PACKET_ATR_PACKET data:
      ###[ Ethernet ]###
        dst       = 00:00:00:00:ec:01
        src       = 04:f4:bc:28:57:00
        type      = IPv4
      ###[ IP ]###
           version   = 4
           ihl       = 5
           tos       = 0x0
           len       = 50
           id        = 0
           flags     =
           frag      = 0
           ttl       = 127
           proto     = icmp
           chksum    = 0x2767
           src       = 10.0.0.1
           dst       = 10.0.0.100
           \options   \
      ###[ ICMP ]###
              type      = echo-request
              code      = 0
              chksum    = 0xf7f3
              id        = 0x0
              seq       = 0xc

Acked-by: Adrian Moreno <amorenoz@redhat.com>
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2023-01-06 14:42:14 +01:00
Eelco Chaudron
d5469cb743 Makefile: Add USDT scripts to make install and fedora/debian test rpm.
This change will install all the USDT scripts to the
{_datadir}/openvswitch/scripts/usdt directory with the
make install command.

In addition it will also add them to the Fedora
and Debian openvswitch-test rpm.

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2022-12-21 20:10:58 +01:00
Eelco Chaudron
85d3785e6a utilities: Add netlink flow operation USDT probes and upcall_cost script.
This patch adds a series of NetLink flow operation USDT probes.
These probes are in turn used in the upcall_cost Python script,
which in addition of some kernel tracepoints, give an insight into
the time spent on processing upcall.

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Paolo Valerio <pvalerio@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2022-01-18 00:46:30 +01:00
Eelco Chaudron
51ec98635e utilities: Add upcall USDT probe and associated script.
Added the dpif_recv:recv_upcall USDT probe, which is used by the
included upcall_monitor.py script. This script receives all upcall
packets sent by the kernel to ovs-vswitchd. By default, it will
show all  upcall events, which looks something like this:

 TIME               CPU  COMM      PID      DPIF_NAME          TYPE PKT_LEN FLOW_KEY_LEN
 5952147.003848809  2    handler4  1381158  system@ovs-system  0    98      132
 5952147.003879643  2    handler4  1381158  system@ovs-system  0    70      160
 5952147.003914924  2    handler4  1381158  system@ovs-system  0    98      152

It can also dump the packet and NetLink content, and if required,
the packets can also be written to a pcap file.

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Paolo Valerio <pvalerio@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2022-01-18 00:46:30 +01:00
Eelco Chaudron
ff4c712d45 Documentation: Add USDT documentation and bpftrace example.
Add the USDT documentation and a bpftrace example using the
bridge run USDT probes.

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Paolo Valerio <pvalerio@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2022-01-18 00:46:30 +01:00
Mike Pattrick
428b11caa7 utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.

Example usage:
(gdb) break fast_path_processing
(gdb) commands
 ovs_dump_packets packets_
 continue
 end
(gdb) continue

Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
    10.1.1.1 tell 10.1.1.2, length 28

Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
    is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28

Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2022-01-04 19:14:11 +01:00
Ben Pfaff
39b5e46312 Documentation: Convert multiple manpages to ReST.
Tested-by: Numan Siddique <numans@ovn.org>
Acked-by: Numan Siddique <numans@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2019-12-02 12:35:42 -08:00
Ben Pfaff
36e5d97f9b ovs-vlan-bug-workaround: Remove.
This workaround only applied to kernels earlier than 2.6.37, but OVS
only supports 3.10 and later.

As the original author of this code, I won't miss it.

Tested-by: Greg Rose <gvrose8192@gmail.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2019-10-14 15:34:53 -07:00
Ben Pfaff
1ca0323e7c Require Python 3 and remove support for Python 2.
Python 2 reaches end-of-life on January 1, 2020, which is only
a few months away.  This means that OVS needs to stop depending
on in the next release that should occur roughly that same time.
Therefore, this commit removes all support for Python 2.  It
also makes Python 3 a mandatory build dependency.

Some of the interesting consequences:

- HAVE_PYTHON, HAVE_PYTHON2, and HAVE_PYTHON3 conditionals have
  been removed, since we now know that Python3 is available.

- $PYTHON and $PYTHON2 are removed, and $PYTHON3 is always
  available.

- Many tests for Python 2 support have been removed, and the ones
  that depended on Python 3 now run unconditionally.  This allowed
  several macros in the testsuite to be removed, making the code
  clearer.  This does make some of the changes to the testsuite
  files large due to indentation level changes.

- #! lines for Python now use /usr/bin/python3 instead of
  /usr/bin/python.

- Packaging depends on Python 3 packages.

Acked-by: Numan Siddique <nusiddiq@redhat.com>
Tested-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2019-09-27 09:23:50 -07:00
Aaron Conole
bc6f73c951 flake8: also check the ovs-check-dead-ifs script
Acked-by: William Tu <u9012063@gmail.com>
Signed-off-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2019-09-25 09:58:21 -07:00
Aliasgar Ginwala
6b4dc055d6 OVS: Containerize components
1. Start OVS components in containers so that building and shipping
    of OVS components is easy.
 2. Load OVS kernel modules on host from container to avoid installing ovs
    on host.
 3. Update documentation about how to build/run ovs in docker.

Acked-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: aginwala <aginwala@ebay.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2019-08-22 13:19:46 -07:00
Timothy Redaelli
1ea9742269 utilities: Install ovs-tcp{dump, undump} also when only Python3 is enabled
Since commit 793bdb6c0500 ("ovs-tcpdump: Fix incompatibilities with python3")
and commit 227abb77d3d1 ("ovs-tcpundump: Fix incompatibilities with python3")
ovs-tcpdump and ovs-tcpdump works with Python3 as well.

This commit allows ovs-tcpdump and ovs-tcpundump to be installed also when
only Python3 is enabled.

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-04 19:19:00 -07:00
Timothy Redaelli
9ec533122f Permit to build OVS with only Python3 installed
This commit renames HAVE_PYTHON to HAVE_PYTHON2 and PYTHON to PYTHON2
and adds HAVE_PYTHON and PYTHON with a different semantics:
- If PYTHON environment variable is set, use it as PYTHON
- If a python2 interpreter is available, PYTHON became the python2 interpreter
- If a python3 interpreter is available, PYTHON became the python3 interpreter

PYTHON is only used to run the python scripts needed by the build system

NOTE:
Since currently most of the utilities and bugtool doesn't support Python3,
they're installed only if python2 is available. This will be fixed in later
commits.

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-24 16:02:48 -07:00
Aaron Conole
15117123c5 ovs-kmod-ctl: introduce a kernel module load script
Currently, Open vSwitch on linux embeds the logic of loading and unloading
kernel modules into the ovs-ctl and ovs-lib script files.  This works, but
it means that there is no way to leverage extended filesystem attributes
to grant fine grain permissions relating to module loading.

The split out utility 'ovs-kmod-ctl' will be used in an upcoming commit
for RHEL-based distributions to have a separate transition domain that
will allow module loading to be given to a separate selinux domain from
the openvswitch_t domain.

Acked-by: Ansis Atteka <aatteka@ovn.org>
Acked-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Aaron Conole <aconole@redhat.com>
2018-06-17 19:32:06 -07:00
Ben Pfaff
ea38b8931a ovs-sim: Convert documentation to RST format.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
2018-05-25 14:25:43 -07:00
Eelco Chaudron
0a3348d1a9 utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
  - ovs_dump_bridge [ports|wanted]
  - ovs_dump_bridge_ports <struct bridge *>
  - ovs_dump_dp_netdev [ports]
  - ovs_dump_dp_netdev_ports <struct dp_netdev *>
  - ovs_dump_netdev

These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:

(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev     , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0    , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0          , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0         , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0          , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3            , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0         , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>

(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
  reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:14:34 -07:00
Russell Bryant
fa4058ab2a python: Enable flake8 checking of ovs-pipegen.py.
Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
2018-03-14 15:53:17 -04:00
Stephen Finucane
3591d8c7bb doc: Convert ovs-test to rST
Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-04-21 14:15:13 -07:00
Stephen Finucane
fd0837a76f doc: Convert ovs-vlan-test to rST
Let's start with a simple one that lets us focus on setting up most of
the required "infrastructure" for building man pages using Sphinx.

This changes the 'check-htmldocs' target to 'check-docs' as its now
responsible for building man page docs too.

Other than that, hurrah for (mostly) legible syntaxes.

[1] http://www.tldp.org/HOWTO/Man-Page/q2.html

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-04-21 14:15:13 -07:00
Justin Pettit
70969b092f Remove build-time generated files when "make clean" is run.
"make clean" should remove all files generated by building a program, while
"make distclean" should also remove files generated by configuring the
program.  Previously some generated files during the build process, such
as man pages, were left behind when "make clean" was run.  This commit
only leaves configuration files after "make clean" is run, and removes
all other generated files.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
2017-02-13 20:49:55 -08:00
Stephen Finucane
795752a3cf doc: Populate 'install', 'howto' sections
This is a dumb move of all 'INSTALL*' docs, with very little
refactoring (mostly updating links and making the titles a little more
consistent. Additional refactoring will be done in subsequent changes.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2016-12-12 08:55:32 -08:00
Stephen Finucane
4c5a41811c doc: Convert ovs-command-bashcomp.INSTALL to rST
Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
2016-11-03 15:31:58 -04:00
Ciara Loftus
4198764443 netdev-dpdk: Remove dpdkvhostcuse ports
This commit removes the 'dpdkvhostcuse' port type from the userspace
datapath. vhost-cuse ports are quickly becoming obsolete as the
vhost-user port type begins to support a greater feature-set thanks to
the addition of things like vhost-user multiqueue and potential
upcoming features like vhost-user client-mode and vhost-user reconnect.
The feature is also expected to be removed from DPDK soon.

One potential drawback of the removal of this support is that a
userspace vHost port type is not available in OVS for use with older
versions of QEMU (pre v2.2). Considering v2.2 is nearly two years old
this should however be a low impact change.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
2016-08-15 17:29:12 -07:00
Aaron Conole
314ce6479a ovs-tcpdump: Add a tcpdump wrapper utility
Currently, there is some documentation which describes setting up and
using port mirrors for bridges. This documentation is helpful to setup
a packet capture for specific ports.

However, a utility to do such packet capture would be valuable, both
as an exercise in documenting the steps an additional time, and as a way
of providing an out-of-the-box experience for running a capture.

This commit adds a tcpdump-wrapper utility for such purpose. It uses the
Open vSwitch python library to add/remove ports and mirrors to/from the
Open vSwitch database. It will create a tcpdump instance listening on
the mirror port (allowing the user to specify additional arguments), and
dump data to the screen (or otherwise).

Signed-off-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
2016-06-23 15:02:38 -07:00
Joe Stringer
c6b581b9c3 ovs-dev.py: PEP-8ify.
Signed-off-by: Joe Stringer <joe@ovn.org>
2016-05-18 11:24:39 -07:00
Aaron Conole
c599d5ccf3 checkpatch.py: A simple script for finding patch issues
Most projects have a checkpatch facility, which can be used as a pre-commit
sanity check. This introduces such a mechanism to the Open vSwitch project
to catch some of the more silly formatting mistakes which can occur. It is
not meant to replace good code review practices, but it can help eliminate
the silly code review issues which get added.

Suggested-by: Mauricio Vásquez <mauricio.vasquezbernal@studenti.polito.it>
Signed-off-by: Aaron Conole <aconole@redhat.com>
[blp@ovn.org adjusted long line threshold and treatment of terminal]
Signed-off-by: Ben Pfaff <blp@ovn.org>
2016-03-31 08:29:14 -07:00
Ben Pfaff
e752914179 ovs-benchmark: Remove.
This utility was completely broken and no one noticed for the time of a
full release, so I think that's a safe sign that we should remove it.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
2016-02-05 16:49:29 -08:00
Russell Bryant
115d8719db python: Run flake8 at build time.
If flake8 is installed, run it at build time.  Similar to most Makefile
targets, run it once and then only run again if the files change.

flake8 is set to ignore all error and warning types that currently occur.
Future patches will remove items from the ignore list as they are
resolved.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
2016-01-05 18:13:46 -05:00
Russell Bryant
73cd29796f ovs-sim: Don't install man page.
The build system was set up to install the ovs-sim manpage, but not
ovs-sim itself.  I noticed this because the fedora rpm build is
currently broken because the man page was installed but not packaged
yet.  Fix this up by not installing the manpage.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-21 11:31:43 -07:00
Gurucharan Shetty
2dd7d60c64 Add a few OVN files as part of DISTCLEANFILES.
Reported-by: Ian Stokes <ian.stokes@intel.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Tested-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
2015-06-23 09:37:26 -07:00
Ben Pfaff
6901639bc8 ovs-sim: New utility for multi-node OVS and OVN simulation.
Please see the examples in ovs-sim(1) for some examples of how this
can be useful.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-06-16 08:38:46 -07:00
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
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
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
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
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
4441a01cbd dist-docs: New utility to generate a documentation bundle for the website.
This utility isn't going to be as portable as most of the Open vSwitch
utilities, unfortunately.  I'm happy to take improvements to make it
able to work with, e.g., the "man" program from BSD.  (I haven't tested
with that program, but I suspect that it is somewhat different from the
GNU version.)

The output of this program can already be viewed at:
	http://openvswitch.org/support/dist-docs/

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
2014-12-02 11:04:16 -08:00
Alex Wang
423ede182b utilities: Add bash command-line completion script.
This patch adds bash command-line completion script for ovs-appctl,
ovs-dpctl, ovs-ofctl and ovsdb-tool command.  Right now, the script
can do the following:

- display available completion or complete on unfinished user input
  (long option, subcommand, and argument).

- once the subcommand (e.g. ofproto/trace) has been given, the
  script will print the subcommand format.

- the script can convert between keywords like 'bridge/port/interface/dp'
  and the available record in ovsdb.

The limitations are:

- only support small set of important keywords
  (dp, datapath, bridge, switch, port, interface, iface).

- does not support parsing of nested options
  (e.g. ovsdb-tool create [db [schema]]).

- does not support expansion on repeatitive argument
  (e.g. ovs-dpctl show [dp...]).

- only support matching on long options, and only in the format
  (--option [arg], i.e. should not use --option=[arg]).

To use the script, either copy it inside /etc/bash_completion.d/
or manually run it via . ovs-command-compgen.bash.

Also, a unit testsuite is provided as ovs-command-compgen-test.bash.
It is suggested that this test script be run only inside
tutorial/sandbox directory.

For more info please refer to utilities/ovs-command-compgen.INSTALL.md.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-10-30 11:22:26 -07:00
Gurucharan Shetty
ec8f0f0c24 docker: Integrate docker containers with Open vSwitch.
Open vSwitch does not have native integration with Docker.
INSTALL.Docker explains how Open vSwitch can be integrated
with docker non-natively.

ovs-docker is a helper script to add network interfaces to
docker containers and to attach them as ports to OVS bridge.
This script can be further enhanced as we understand different
use cases.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-10-16 14:48:54 -07:00
Ben Pfaff
0bc1b46a38 test-controller: Rename to ovs-testcontroller, again install.
mininet uses the Open vSwitch controller by default, for testing.

CC: 757761@bugs.debian.org
Reported-at: https://bugs.debian.org/757761
Requested-by: Tomasz Buchert <tomasz.buchert@inria.fr>
Requested-by: Dariusz Dwornikowski <dariusz.dwornikowski@cs.put.poznan.pl>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
2014-08-26 11:03:43 -07:00
Ben Pfaff
c260f4e2e0 ovs-ctl: Install manpage.
It seems that it is useful to admins after all.

Reported-by: Brian Candler <b.candler@pobox.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-05-01 08:11:21 -07:00