summaryrefslogtreecommitdiff
path: root/vtep
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* python: Convert dict iterators.Russell Bryant2016-01-211-10/+11
| | | | | | | | | | | | | | | | In Python 2, dict.items(), dict.keys(), and dict.values() returned a list. dict.iteritems(), dict.iterkeys(), and dict.itervalues() returned an iterator. As of Python 3, dict.iteritems(), dict.itervalues(), and dict.iterkeys() are gone. items(), keys(), and values() now return an iterator. In the case where we want an iterator, we now use the six.iter*() helpers. If we want a list, we explicitly create a list from the iterator. Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* python: Stop using xrange().Russell Bryant2016-01-201-0/+1
| | | | | | | | | | | | Python 2 had range() and xrange(). xrange() is more efficient, but behaves differently so range() was retained for compatibility. Python 3 only has range() and it behaves like Python 2's xrange(). Remove explicit use of xrange() and use six.moves.range() to make sure we're using xrange() from Python 2 or range() from Python 3. Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* python: Remove unnecessary semicolons and slashes.Russell Bryant2016-01-051-4/+4
| | | | | | | | | | | | Resolve the following flake8 errors: E703 statement ends with a semicolon E502 the backslash is redundant between brackets Also document the reamining flake8 errors that are still ignored. Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* python: Resolve a deprecation warning.Russell Bryant2016-01-051-2/+2
| | | | | | | | | | | | | | | Resolve the following deprecation warning. This deprecation warning advises to use an alternative syntax which is also compatible with Python 3, where has_key() was removed. W601 .has_key() is deprecated, use 'in' Also fix this related error: E713 test for membership should be 'not in' Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* python: Fix several pep8 whitespace errors.Russell Bryant2016-01-051-21/+21
| | | | | | | | | | | | | | | | | | | | Fix the following pep8 errors: E201 whitespace after '(' E203 whitespace before ',' E222 multiple spaces after operator E225 missing whitespace around operator E226 missing whitespace around arithmetic operator E231 missing whitespace after ':' E241 multiple spaces after ':' E251 unexpected spaces around keyword / parameter equals E261 at least two spaces before inline comment E262 inline comment should start with '# ' E265 block comment should start with '# ' E271 multiple spaces after keyword Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* python: Resolve pep8 comparison errors.Russell Bryant2016-01-051-2/+2
| | | | | | | | | | | | | | | | | | | | | Resolve pep8 errors: E711 comparison to None should be 'if cond is None:' The reason comparing against None with "is None" is preferred over "== None" is because a class can define its own equality operator and produce bizarre unexpected behavior. Using "is None" has a very explicit meaning that can not be overridden. E721 do not compare types, use 'isinstance()' This one is actually a mistake by the tool in most cases. 'from ovs.db import types' looks just like types from the Python stdlib. In those cases, use the full ovs.db.types name. Fix one case where it actually was types from the stdlib. Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* python: Resolve pep8 blank line errors.Russell Bryant2016-01-051-1/+14
| | | | | | | | | | Resolve pep8 errors E302 and E303: E302 expected 2 blank lines, found 1 E303 too many blank lines (3) Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* python: Remove unused imports and variables.Russell Bryant2016-01-051-1/+1
| | | | | | | | | | This resolves the following flake8 error types: F841 local variable 'e' is assigned to but never used F401 'exceptions' imported but unused Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* python: Run flake8 at build time.Russell Bryant2016-01-051-0/+2
| | | | | | | | | | | | 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>
* ovs-vtep: Clean up local mac entries on startup.Anupam Chanda2015-12-211-0/+7
| | | | | | | | | | This change handles a corner case where local mac entries are not cleared if a vlan binding is deleted while the emulator is not running. The fix is to clean up the local mac entries once on restart. Reported-by: Hsin-Yi Shen <shenh@vmware.com> Signed-off-by: Anupam Chanda <achanda@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* vtep/vtep.xml: Improve XML source formatting.Ariel Tubaltsev2015-11-291-11/+11
| | | | | | | | This patch contains only cosmetic changes. Signed-off-by: Ariel Tubaltsev <tubaltzev@gmail.com> Acked-by: Bruce Davie <bdavie@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* use "/usr/bin/env python" for shebangs for python scriptsYAMAMOTO Takashi2015-11-261-1/+1
| | | | | | | On NetBSD, a typical path of python interpreter is /usr/pkg/bin/python. Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com> Acked-by: Ben Pfaff <blp@ovn.org>
* HW VTEP Schema: update Tunnel table definitionAriel Tubaltsev2015-11-191-59/+61
| | | | | | | | | | | vtep/vtep.xml : Tunnel table definitions were reviewed against latest OVS schema. Relevant changes taken into HW VTEP schema. XML formatting of Tunnel table corrected Signed-off-by: Ariel Tubaltsev <tubaltzev@gmail.com> Acked-by: Bruce Davie <bdavie@vmware.com> Signed-off-by: Russell Bryant <russell@ovn.org>
* vtep-ctl: Exit if database connection fails.Daniele Di Proietto2015-10-221-0/+5
| | | | | | | | | | | | | | Before this commit vtep-ctl hung forever if it didn't manage to reach the database. This caused the testcase "ovn -- 3 HVs, 1 VIFs/HV, 1 GW, 1 LS" to hang occasionally, because ovsdb-server could be killed before ovs-vtep called vtep-ctl. This mimics the behaviour of ovs-vsctl, ovn-nbctl and ovn-sbctl. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Justin Pettit <jpettit@nicira.com>
* vtep: Make stats and status columns ephemeral.Justin Pettit2015-10-141-10/+12
| | | | | | | | | | | These fields don't need to be stored, and it causes a lot of unnecessary writes to the database log. This commit also fixes a couple of trivial indentation issues with previous ephemeral declarations. Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* automake: Consolidate schema checksum check.Gurucharan Shetty2015-10-021-9/+1
| | | | | Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* vtep: add ACLs to VTEP schemaBruce Davie2015-10-012-4/+352
| | | | | | | | | | Two new tables are added to the VTEP schema, for ACL entries and ACLs (which are groups of entries). The physical port table is modified to allow ACLs to be associated with ports, and the logical router table is modified to allow ACLs to be attached to logical router ports. Signed-off-by: Bruce Davie <bdavie@vmware.com> Signed-off-by: Justin Pettit <jpettit@nicira.com>
* vtep: Document the meaning of VLAN zero for vlan_bindingsBruce Davie2015-10-011-2/+5
| | | | | | | | | | | The meaning of a value of zero in the VLAN field when mapping <VLAN, port> pairs to logical switches had not previously been specified in the VTEP schema. It is now clarified that a value of zero refers to untagged traffic. Signed-off-by: Bruce Davie <bdavie@vmware.com> Acked-by: Russell Bryant <rbryant@redhat.com> Signed-off-by: Justin Pettit <jpettit@nicira.com>
* vtep: fix typosBruce Davie2015-10-011-4/+4
| | | | | | | | Correct a number of typos in vtep.xml Signed-off-by: Bruce Davie <bdavie@vmware.com> Acked-by: Russell Bryant <rbryant@redhat.com> Signed-off-by: Justin Pettit <jpettit@nicira.com>
* Fix typos in comments.Ben Pfaff2015-09-141-1/+1
| | | | | Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Alex Wang <ee07b291@gmail.com>
* db-ctl-base: Allow print rows that weak reference to table inAlex Wang2015-08-131-6/+11
| | | | | | | | | | | | | | | | | | | | 'cmd_show_table'. Sometimes, it is desirable to print the table with weak reference to the table specified in 'struct cmd_show_table'. For example the Port_Binding table rows in OVN_Southbound database that refer to the same Chassis table row can be printed under the same chassis entry in 'ovn-sbctl show' output. To achieve it, this commit adds a new struct in 'struct cmd_show_table' that allows users to print a table with weak reference to 'table' specified in 'struct cmd_show_table'. The 'ovn-sbctl' which now prints the Port_Binding entries with Chassis table, is the first user of this new feature. Requested-by: Justin Pettit <jpettit@nicira.com> Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
* db-ctl-base: make cmd_show_table privateAndy Zhou2015-07-231-2/+2
| | | | | | | | Instead of requiring user to declare a global variable, pass the value via ctl_init(). Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* db-ctl-base: remove the recurse member from struct cmd_show_tableAndy Zhou2015-07-231-11/+11
| | | | | | | | | | | | The 'recurse' is used during run time to suppress duplicated prints. It is not essential to describe how show command should work. This patch remove the 'recurse' member. Duplicated prints is now suppressed by maintaining an 'sset' of tables that have been printed at run time. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* Makefiles: Clean and do not distribute IDL-generated files.Ben Pfaff2015-07-221-2/+1
| | | | | | | | | | | | | | | | | | IDL-generated files don't need to be distributed, and distributing them puts them in the source directory rather than the build directory, which causes "make distcheck" to fail if any of them need to be remade. To prevent this, this commit this removes them from ..._SOURCES, moving them into nodist_..._SOURCES. IDL-generated files all need to be cleaned, so this commit adds all of them to CLEANFILES wholesale via a single CLEANFILES += $(OVSIDL_BUILT) line in ovsdb/automake.mk, removing the individual additions from various makefiles. With this commit, "make distcheck" passes for me. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Aaron Conole <aaron@bytheb.org>
* vtep/automake.mk: Changes to support make distcheck.Aaron Conole2015-07-211-1/+1
| | | | | | | | Add autogenerated files to the CLEANFILES so that they are not kept around after clean/distclean. Signed-off-by: Aaron Conole <aaron@bytheb.org> Signed-off-by: Ben Pfaff <blp@nicira.com>
* db-ctl-base: make use of user supplied exit functionAndy Zhou2015-07-171-4/+28
| | | | | | | | | The user is required to expose the_idl and the_idl_txn global variables, so that memory can be cleaned up on fatal errors. This patch changes to ask user to supply an exit function via ctl_init(). What user needs to do on exit can now remain private. Signed-off-by: Andy Zhou <azhou@nicira.com>
* vtep-ctl: Remove extraneous NULL pointer check.Joe Stringer2015-07-171-7/+2
| | | | | | | | | | OVS will exit if the allocations in this function fail, so this check is pointless. Found by MIT STACK undefined behaviour checker. Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* db-ctl-base: do not require client to expose the "tables" variableAndy Zhou2015-07-131-2/+2
| | | | | | | Instead, client now pass it via the modified ctl_init() API. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
* db-ctl-base: Improve show command.Alex Wang2015-06-231-3/+10
| | | | | | | | | | This commit adds improvement to 'show' command logic and allows it to print key->table_ref maps. The direct effect can be observed from the tests/vtep-ctl.at change. The improvement will also be used in the ovn-sbctl implementation. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* vtep-ctl: Use db-ctl-base.Alex Wang2015-06-232-2203/+373
| | | | | | | | This commit makes vtep-ctl use db-ctl-base to avoid duplicate code. As an addition, a 'show' command is added to vtep-ctl. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovs-vtep: Support userspace datapaths.Daniele Di Proietto2015-06-161-2/+15
| | | | | | | | | | With this commit, the VTEP emulator detects the datapath_type of the bridge used as a "physical" switch, and creates subsequent bridges with the same type. This allows ovs-vtep to work with the userspace datapath. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Gurucharan Shetty <gshetty@nicira.com>
* vtep-ctl: Fix a bug.Alex Wang2015-06-111-1/+1
| | | | | | | | | | | add_port_to_cache() uses 'cache_name' as the shash node name for shash_add(). So, the del_cached_port() must also pass 'cache_name' as argument for shash_find_and_delete(). This bug does not cause any issue currently but should be fixed. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
* automake.mk: Improve schema checksum error message.Mark D. Gray2015-03-191-1/+1
| | | | | | Signed-off-by: Mark D. Gray <mark.d.gray@intel.com> Signed-off-by: Billy O'Mahony <billy.o.mahony@intel.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* command-line: add ovs_cmdl_ prefixRussell Bryant2015-03-161-1/+1
| | | | | | | | | | | | | | | | | 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>