summaryrefslogtreecommitdiff
path: root/vtep
Commit message (Collapse)AuthorAgeFilesLines
* DNS: Add basic support for asynchronous DNS resolvingYifeng Sun2018-07-061-16/+18
| | | | | | | | | | | | | | | | | | | | | | This patch is a simple implementation for the proposal discussed in https://mail.openvswitch.org/pipermail/ovs-dev/2017-August/337038.html and https://mail.openvswitch.org/pipermail/ovs-dev/2017-October/340013.html. It enables ovs-vswitchd and other utilities to use DNS names when specifying OpenFlow and OVSDB remotes. Below are some of the features and limitations of this patch: - Resolving is asynchornous in daemon context, avoiding blocking main loop; - Resolving is synchronous in general utility context; - Both IPv4 and IPv6 are supported; - The resolving API is thread-safe; - Depends on the unbound library; - When multiple ip addresses are returned, only the first one is used; - /etc/nsswitch.conf isn't respected as unbound library doesn't look at it; - For async-resolving, caller need to retry later; there is no callback. Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* db-ctl-base: Extend ctl_context with an error message.Jakub Sitnicki2018-07-031-0/+9
| | | | | | | | Prepare for the command handlers (pre_cmd_*() cmd_*() functions) to report errors by storing them in the context. Signed-off-by: Jakub Sitnicki <jkbs@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovs-vsctl, ovn-nbctl, ovn-sbctl, vtep-ctl: Parse options before logging.Ben Pfaff2018-05-251-5/+3
| | | | | | | | | | These utilities logged the command very early, before parsing the options or the command. This meant that logging options (like --log-file or -vsyslog:off) weren't considered for the purpose of logging the command. This fixes the problem. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* ctl-option: add --inactivity-probe= option in set targets commandsGuoshuai Li2018-03-311-4/+13
| | | | | | | | | | | | This patch can set inactivity probe for connection by command: ovs-vsctl --inactivity-probe=30000 set-manager tcp:<CONTROLLER IP>:6640 ovs-vsctl --inactivity-probe=30000 set-controller tcp:<CONTROLLER IP>:6641 vtep-ctl --inactivity-probe=30000 set-manager tcp:<CONTROLLER IP>:6640 ovn-nbctl --inactivity-probe=30000 set-connection ptcp:6641:0.0.0.0 ovn-sbctl --inactivity-probe=30000 set-connection ptcp:6642:0.0.0.0 Signed-off-by: Guoshuai Li <ligs@dtdream.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Refer to database manpages in *ctl manpagesMark Michelson2018-02-261-2/+5
| | | | | | | | | | | | | | The ovn-nbctl, ovn-sbctl, and ovs-vsctl manpages are inconsistent in their "Database Commands" section when it comes to referring to what database tables exist. This commit amends this by making each *ctl manpage reference the corresponding database manpage instead. To aid in having a more handy list, the --help text of ovn-nbctl, ovn-sbctl, and ovs-vsctl have been modified to list the available tables. This is also referenced in the manpages for those applications. Signed-off-by: Mark Michelson <mmichels@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovs-vsctl, vtep-ctl: Free 'args' string on exit.Ben Pfaff2018-01-261-4/+8
| | | | | | | | | This avoids a memory leak warning from valgrind. ovn-sbctl and ovn-nbctl already followed this pattern. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: William Tu <u9012063@gmail.com>
* ovsdb: Improve documentation.Ben Pfaff2017-12-141-16/+7
| | | | | Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* tests: Convert dot2pic build tool from Perl to Python.Ben Pfaff2017-11-261-1/+1
| | | | | | | | Perl is unfashionable and Python is more widely available and understood, so this commit converts one of the OVS uses of Perl into Python. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com>
* lib: Move lib/poll-loop.h to include/openvswitchXiao Liang2017-11-031-1/+1
| | | | | | | | Poll-loop is the core to implement main loop. It should be available in libopenvswitch. Signed-off-by: Xiao Liang <shaw.leon@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Eliminate most shadowing for local variable names.Ben Pfaff2017-08-021-1/+0
| | | | | | | | | | | | | | Shadowing is when a variable with a given name in an inner scope hides a different variable with the same name in a surrounding scope. This is generally undesirable because it can confuse programmers. This commit eliminates most of it. Found with -Wshadow=local in GCC 7. The repo is not really ready to enable this option by default because of a few cases that are harder to fix, and harmless, such as nested use of CMAP_FOR_EACH. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* Free port bindings when deleting cached ports.Mark Michelson2017-07-141-0/+1
| | | | | | | | | | | | Running test "ovn-controller-vtep binding 2" with address sanitizer enabled resulted in a failure due to a memory leak. The cached switch port's bindings were not being freed when the port was freed. The fix is to destroy the bindings hash table when the switch port is freed. Signed-off-by: Mark Michelson <mmichels@redhat.com> Reported-by: Lance Richardson <lrichard@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* treewide: .gitignore updatesLance Richardson2017-07-101-0/+1
| | | | | Signed-off-by: Lance Richardson <lrichard@redhat.com> Signed-off-by: Justin Pettit <jpettit@ovn.org>
* distclean: Fix ovs-vtep and docker drivers.Joe Stringer2017-06-211-0/+1
| | | | | | | | | | Commit b49a959bac47 ("Use @PYTHON@ directly instead of "#! /usr/bin/env"") broke distclean, as it doesn't clean up the generated python scripts after building. Fix by adding the new script files to CLEANFILES. Fixes: b49a959bac47 ("Use @PYTHON@ directly instead of "#! /usr/bin/env"") Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* Use @PYTHON@ directly instead of "#! /usr/bin/env"Timothy Redaelli2017-06-212-2/+2
| | | | | | | | | | | In some installed python scripts /usr/bin/env is unnecessarily used in shebang, replace it directly with @PYTHON@. This will also avoid implicit dependency to /usr/bin/env in RPM distributions and it will correctly add implicit dependency to /usr/bin/python instead. Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> Signed-off-by: Joe Stringer <joe@ovn.org>
* db-ctl-base: Add support for identifying a row based on a value in a map.Ben Pfaff2017-05-031-5/+6
| | | | | | | | | This will be used in an upcoming commit to allow Datapath_Binding records in the OVN southbound database to be identified based on external-ids:name and other map values. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* db-ctl-base: Drop redundant 'table' field from struct ctl_row_id.Ben Pfaff2017-05-031-7/+5
| | | | | | | | | | The 'table' field is redundant because the required 'column' field implies the table that the column is a part of. This simplifies the users and makes it harder to get these things wrong. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* db-ctl-base: Allow record UUIDs to be abbreviated.Ben Pfaff2017-04-301-4/+6
| | | | | | | | This makes it easier to type ovs-vsctl, ovn-sbctl, ovn-nbctl, and vtep-ctl commands without cut-and-paste. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* table: provide table formatting option help at runtimeLance Richardson2017-04-061-0/+1
| | | | | | | | | Show table formatting options with help output from ovn-nbctl, obn-sbctl, ovs-vsctl, and vtep-ctl commands. Include "--data" option in ovsdb-client help output. Signed-off-by: Lance Richardson <lrichard@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Adapt to flake8-import-orderxurong000379972017-03-081-3/+4
| | | | | | | | | | https://review.openstack.org/#/c/432906/ flake8-import-order adds 3 new flake8 warnings: I100: Your import statements are in the wrong order. I101: The names in your from import are in the wrong order. I201: Missing newline between sections or imports. Signed-off-by: Ben Pfaff <blp@ovn.org>
* Remove build-time generated files when "make clean" is run.Justin Pettit2017-02-131-3/+3
| | | | | | | | | | | | "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>
* libX: add new release / version info tagsAaron Conole2017-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit uses the $PACKAGE_VERSION automake variable to construct a release and version info combination which sets the library name to be: libfoo-$(OVS_MAJOR_VERSION).so.$(OVS_MINOR_VERSION).0.$(OVS_MICRO_VERSION) where formerly, it was always: libfoo.so.1.0.0 This allows releases of Open vSwitch libraries to reflect which specific versions they came with, and sets up a psuedo ABI-versioning scheme. In this fashion, future releases of Open vSwitch could be installed alongside older releases, allowing 3rd party utilities linked against previous versions to continue to function. ex: $ ldd /path/to/utility linux-vdso.so.1 (0x00007ffe92cf6000) libopenvswitch-2.so.6 => /lib64/libopenvswitch-2.so.6 (0x00007f733b7a3000) libssl.so.10 => /lib64/libssl.so.10 (0x00007f733b530000) ... Note the library name and version information. Signed-off-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* db-ctl-base: Always support all tables in schema.Ben Pfaff2017-01-131-64/+14
| | | | | | | | | | | | | | | | | When one adds a new table to a database schema, it's easy to forget to add the table to the list of tables in the *ctl.c program. When this happens, the database commands for that program don't work on that table at all, even for commands like "list" and "create" that don't need any special help. This patch fixes that problem, by making sure that db-ctl-base always has the complete list of tables. Previously, each ctl_table_class pointed directly to the corresponding ovsdb_idl_table_class. With this patch, there are instead two parallel arrays, one of ovsdb_idl_table_classes and the other of ctl_table_classes. This change accounts for the bulk of the change to the db-ctl-base code. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Lance Richardson <lrichard@redhat.com>
* Python tests: Set CREATE_NO_WINDOW flag for PopenAlin Balutoiu2017-01-031-1/+5
| | | | | | | | | | | | | | | | On Windows if the flag CREATE_NO_WINDOW is not specified when using subprocess.Popen, a new window will appear with the new process. The window is not necessary for the tests. This patch addresses this issue by adding the flag CREATE_NO_WINDOW for all subprocess.Popen calls if the machine is running Windows. Signed-off-by: Alin Balutoiu <abalutoiu@cloudbasesolutions.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions> Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* table: correct documented default format in man pagesLance Richardson2016-12-221-1/+0
| | | | | | | | | | | | | | | | | There are currently five users of the table formatting library, all of which default to "list" except for ovsdb-client which defaults to "table". The library current default is "table", and the table.man man page fragment only considers ovs-vsctl to use something other than "table" as a default.As a result, the man pages for ovn-sbctl and vtep-ctl are currently incorrect (these options aren't documented in the ovn-nbctl man page, which will need to be addressed in a future patch). Fix by making the library default format "list" and handling ovsdb-client as the exception. Signed-off-by: Lance Richardson <lrichard@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* doc: Further populate the 'howto' sectionStephen Finucane2016-12-122-231/+0
| | | | | | | | | There are a couple of references to these for various build systems. The website is going to be our "one true resource" for all docs, so simply remove these references. Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Ben Pfaff <blp@ovn.org>
* doc: Populate 'install', 'howto' sectionsStephen Finucane2016-12-122-11/+10
| | | | | | | | | 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>
* treewide: Fix recent flake8-check.Joe Stringer2016-12-081-0/+1
| | | | | | | | | Without this patch, I see errors like this on master: ../ofproto/ipfix-gen-entities:115:1: E305 expected 2 blank lines after class or function definition, found 1 Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
* Add support for specifying SSL connection parameters to ovsdbEthan Rahn2016-11-101-1/+2
| | | | | Signed-off-by: Ethan Rahn <erahn@arista.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* doc: Convert datapath/README to rSTStephen Finucane2016-11-031-1/+1
| | | | | Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Russell Bryant <russell@ovn.org>
* doc: Convert README.ovs-vtep to rSTStephen Finucane2016-11-033-206/+232
| | | | | | | Expand on the definition of VTEP (it took me a bit of Googling). Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Russell Bryant <russell@ovn.org>
* ovsdb-idlc: Eliminate <prefix>_init() function from generated code.Ben Pfaff2016-10-191-1/+0
| | | | | Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* doc: Convert INSTALL.Debian to rSTStephen Finucane2016-10-181-1/+1
| | | | | Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Russell Bryant <russell@ovn.org>
* json: Move from lib to include/openvswitch.Terry Wilson2016-07-221-1/+1
| | | | | | | | | | | | | | | To easily allow both in- and out-of-tree building of the Python wrapper for the OVS JSON parser (e.g. w/ pip), move json.h to include/openvswitch. This also requires moving lib/{hmap,shash}.h. Both hmap.h and shash.h were #include-ing "util.h" even though the headers themselves did not use anything from there, but rather from include/openvswitch/util.h. Fixing that required including util.h in several C files mostly due to OVS_NOT_REACHED and things like xmalloc. Signed-off-by: Terry Wilson <twilson@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovs-vtep: Handle tunnel key configuration in any order.Darrell Ball2016-07-151-14/+14
| | | | | | | | | | | Presently, ovs-vtep expects the datapath tunnel key to be available in the VTEP DB at startup. This may not be the case which is also observed as interrmittent unit test failures. This patch allows for the tunnel key to later appear in the VTEP database. Signed-off-by: Darrell Ball <dlu998@gmail.com> Acked-by: Russell Bryant <russell@ovn.org> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
* util: New function nullable_xstrdup().Ben Pfaff2016-06-261-1/+1
| | | | | | It's a pretty common pattern so create a function for it. Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovs-vtep: Make compatible with python2.7 and 3.Joe Stringer2016-05-311-13/+12
| | | | | | | | | Translate commandline calls to UTF-8, appease flake8 and use six's integer types. This allows the testsuite to pass when using python3 as your default system python version. Signed-off-by: Joe Stringer <joe@ovn.org> Tested-by: Darrell Ball <dlu998@gmail.com>
* ovs-vtep: Support running multiple ovs-vtep processesnickcooper-zhangtonghao2016-05-181-3/+3
| | | | | | | | | | Include ovs-vtep physical switch name as part of logical switch name to support running multiple ovs-vtep processes sharing the same ovsdb and vswitchd. Signed-off-by: nickcooper-zhangtonghao <nickcooper-zhangtonghao@opencloud.tech> Tested-by: Darrell Ball <dlu998@gmail.com> Acked-by: Justin Pettit <jpettit@ovn.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
* vtep: Add other_config to Global table.Dennis Sam2016-05-172-2/+13
| | | | | | | | Extend the Global table to allow for additional configurations by re-using the idea of an other_config column. Signed-off-by: Dennis Sam <dsam@arista.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* vtep: Add source node replication support.Darrell Ball2016-05-096-13/+194
| | | | | | | | | | | | | | | This patch updates the vtep schema, vtep-ctl commands and vtep simulator to support source node replication in addition to service node replication per logical switch. The default replication mode is service node as that was the only mode previously supported. Source node replication mode is optionally configurable and clearing the replication mode implicitly sets the replication mode back to a default of service node. Signed-off-by: Darrell Ball <dlu998@gmail.com> Acked-by: Bruce Davie <bdavie@vmware.com> Acked-by: Anupam Chanda <achanda@vmware.com> Signed-off-by: Justin Pettit <jpettit@ovn.org>
* list: Rename all functions in list.h with ovs_ prefix.Ben Warren2016-03-301-9/+9
| | | | | | | This attempts to prevent namespace collisions with other list libraries Signed-off-by: Ben Warren <ben@skyportsystems.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Move lib/dynamic-string.h to include/openvswitch directoryBen Warren2016-03-191-1/+1
| | | | | Signed-off-by: Ben Warren <ben@skyportsystems.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* vtep: Introduce other_config column in some vtep schema tables.Saurabh Shrivastava2016-03-182-3/+65
| | | | | | | | Having an other_config column is a simple way to pass more information than the schema allows. Signed-off-by: Saurabh Shrivastava <saurabh.shrivastava@nuagenetworks.net> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovs-vtep: Delete flows with untagged vlan carefully.Gurucharan Shetty2016-03-171-2/+2
| | | | | | | | | | | | A (physical port + vlan) or (physical port + no tag) can be bound to a logical switch. When one unbinds (physical port + no tag) from a logical switch, the emulator inadvertantly deletes flows for (physical port + vlan) too. This commit fixes it. VMware-BZ: #1609938 Reported-by: Mike Qing <mqing@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org> Acked-by: Ryan Moats <rmoats@us.ibm.com>
* vtep: Add error messages for logical router supportDennis Sam2016-02-231-0/+22
| | | | | | | | | Documents error codes that a Hardware Switch Controller can publish to the NVC to indicate errors related to the provisioning of logical routers. Signed-off-by: Dennis Sam <dsam@arista.com> Acked-by: Anupam Chanda <achandra@vmware.com> Signed-off-by: Justin Pettit <jpettit@ovn.org>
* vlog: Make the most common module reference more direct.Ben Pfaff2016-02-101-2/+2
| | | | | | | | | | | | | Most vlog calls are for the log module owned by the translation unit being compiled, but this module was referenced indirectly through a pointer variable. That seems silly, so this commit changes the code so that the local vlog module is referred to directly, as &this_module. We could get rid of the global variables for vlog modules entirely, but I like getting linker errors when there's a duplicate module name. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Russell Bryant <russell@ovn.org>
* vtep: Support per-tunnel tunnel key in schema.Ofer Ben Yacov2016-02-082-25/+35
| | | | | | | | | | | | | | | | | | | | | | | | Currently the scenario of single logical bridge that use multiple locators with different tunnel key on each of the locators is not supported. In order to support much more flexibility in the tunnel settings, we need to add tunnel key column to the Physical_Locator table. This patch is needed to support the usage of neutron L2GW as an inter-cloud gateway. The tunnel key that is set in the logical bridge will be used 'internally' to connect the L2GW to the compute hosts and the key that is set in the physical locator will be used to connect the L2GW to a remote L2GW to form a tunnel between 2 clouds. In this case, the 'external' connection will use single 'dst_ip' on all the locators with different tunnel key for each L2 domain. The Neutron spec is available here: https://review.openstack.org/#/c/270786/ The new code depend on the ability to use different keys in multiple tunnels in the same logical switch. Signed-off-by: Ofer Ben-Yacov <ofer.benyacov@gmail.com> [blp@ovn.org added and clarified documentation] Signed-off-by: Ben Pfaff <blp@ovn.org>
* vlog: Stop using explicit references to external log modules.Ben Pfaff2016-02-031-2/+1
| | | | | | | | | | | | | | | | | It's always risky to write "extern" declarations outside a header file, since there's no way to ensure the type of what's being referenced is correct. In these cases, we can easily avoid the extern reference, so do so. There is a little tradeoff here, in that referring to the log modules through strings means that we catch an incorrect module name at runtime instead of at link time, but I think that the risk here is minimal because the mistake will be found by every test in "make check" that runs any of the utilities, since they make these calls as one of their first tasks during initialization. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Russell Bryant <russell@ovn.org>
* vtep: add logical router related commands.Wenyu Zhang2016-02-032-0/+180
| | | | | | | | | | | Add logical router related vtep-ctl commands: vtep-ctl add-lr LR vtep-ctl del-lr LR vtep-ctl list-lr vtep-ctl lr-exists LR Signed-off-by: Wenyu Zhang <wenyuz@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* vtep: make vtep-ctl support L3 tables.Wenyu Zhang2016-01-281-0/+12
| | | | | | | | | | | Add supporting for tables necessary for L3 usage: Logical_Router Arp_Sources_Local Arp_Sources_Remote Signed-off-by: Wenyu Zhang <wenyuz@vmware.com> Acked-by: Shuangmin Zhang <tsingzsm@gmail.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* README.ovs-vtep.md: Fix incorrect spacing.Kyle Mestery2016-01-271-0/+1
| | | | | | | | This fixes a simple formatting issue with this file I noticed while reviewing the example of experimenting with the OVS HW-VTEP simulator. Signed-off-by: Kyle Mestery <mestery@mestery.com> Signed-off-by: Ben Pfaff <blp@ovn.org>