summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* ovsdb: Fix replication memory leak.Joe Stringer2016-09-121-1/+0
| | | | | | | | | | | | | | | | | | | | | | | Valgrind reports: ==18725== 32 bytes in 1 blocks are definitely lost in loss record 339 of 497 ==18725== at 0x4C29BBE: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==18725== by 0x450F1F: xmalloc (util.c:112) ==18725== by 0x41748E: replication_add_local_db (replication.c:137) ==18725== by 0x40803B: ovsdb_replication_init (ovsdb-server.c:146) ==18725== by 0x407C9E: ovsdb_server_connect_active_ovsdb_server (ovsdb-server.c:1165) ==18725== by 0x450AB3: process_command (unixctl.c:313) ==18725== by 0x4500DC: run_connection (unixctl.c:347) ==18725== by 0x44FFB6: unixctl_server_run (unixctl.c:400) ==18725== by 0x4081AC: main_loop (ovsdb-server.c:182) ==18725== by 0x406432: main (ovsdb-server.c:429) Fixes: 60e0cd041958 ("ovsdb: Replication usability improvements") Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Flavio Fernandes <flavio@flaviof.com> Acked-by: Ben Pfaff <blp@ovn.org>
* ovsdb-monitor: Fix valgrind 'possible loss' warnings.Joe Stringer2016-09-122-4/+4
| | | | | | | | | By placing these nodes at the start of their respective structures, several "possibly lost" warnings from valgrind are silenced. Fixes: 60e0cd041958 ("ovsdb: Replication usability improvements") Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: update CodingStyle.Nithin Raju2016-09-121-0/+2
| | | | | | Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* ofctrl: Fix logic for mff_ovn_geneve.Gurucharan Shetty2016-09-101-1/+1
| | | | | | | Fixes: 7fa39c6b9376e99 ("Fix memory leak in recv_S_TLV_TABLE_REQUESTED().") Signed-off-by: Gurucharan Shetty <guru@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org> Acked-by: Flavio Fernandes <flavio@flaviof.com>
* ovn-controller: Fix group_id allocation.Gurucharan Shetty2016-09-093-1/+10
| | | | | | | | | | | | | | | | | | A bitmap in 'struct group_table' is used to track all the allocated group_ids. For every run of logical flows action parsing, we add 'group_info' structure to a hmap called 'desired_groups'. The group_id assigned to this group_info either comes from an already installed 'existing groups' or a new reservation done in the bitmap. In ofctrl_put(), if there is a backlog, we call ovn_group_table_clear(). This could unreserve a group_id that comes from an already existing group. This could result in re-use of group_id in the future causing errors while installing new groups. This commit fixes the above scenario. Signed-off-by: Gurucharan Shetty <guru@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ovn-northd: Tag allocation for nested containers.Gurucharan Shetty2016-09-097-31/+279
| | | | | | | | | When there are hundreds of nodes controlled by OVN, the workflow to track and allocate unique tags across multiple hosts becomes complicated. It is much easier to let ovn-northd do the allocation. Signed-off-by: Gurucharan Shetty <guru@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ovn-northd: Add load-balancers to gateway routers.Gurucharan Shetty2016-09-095-39/+360
| | | | | | | | | | | | | | Load-balancers in gateway routers lets us load-balance north-south traffic. This commit adds a new table called "DEFRAG" in the logical router pipeline to defragment packets and to track them. Once the packet is tracked, new connections get a group id as an action. The group in turn chooses a DNAT action. Established connections go through the DNAT table for a regular DNAT. Signed-off-by: Gurucharan Shetty <guru@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ovn-controller: Datapath based conntrack zone for load-balancing.Gurucharan Shetty2016-09-095-4/+16
| | | | | | | | | | | | | | | | | Currently ct_lb() logical action is only added for a logical switch and we use the conntrack zone allocated for the logical port. A future commit will use ct_lb() for a logical router too. In that case, use the allocated DNAT zone. Rationale for not passing zone as an argument for ct_lb(): One way to look at it would be that a "zone" is an internal implementation detail and should not be seen in a action of logical flow. But we can then say that we could rename "zone" as "datapath" in the logical action. But, then we would be limiting it to 2 anyway (datapath=lswitch or datapath=lrouter) - in which case we are inferring it with the current patch. Signed-off-by: Gurucharan Shetty <guru@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* datapath: Use pre-routing hook for conntrack.Joe Stringer2016-09-091-1/+1
| | | | | | | | | | | | | | | | The upstream code uses NF_INET_PRE_ROUTING hook for the nf_conntrack_in() call, which does deeper (eg l4proto) validation. It was previously thought that using the NF_INET_ROUTING hook for this function on older kernels would trigger kernel panics due to a dependency on the unpopulated skb->dev, however during recent testing on a variety of platforms (Centos7.[12], Ubuntu 1[46].04, Fedora23) using the latest distribution kernels and the OVS kernel module testsuite, no such kernel panics were observed. Therefore it appears to be safe to bring this in line with upstream without any other workarounds. Reported-by: Jesse Gross <jesse@kernel.org> Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Jesse Gross <jesse@kernel.org>
* ovn-nbctl, tests: Clean up noisy memory leaksRyan Moats2016-09-092-0/+5
| | | | | | | | | | When run with valgrind, ovn-nbctl.c and tests/test-ovn.c reveal memory leaks of their own. This patch cleans these up so that they don't create noise when looking for leaks in the OVN daemon processes. Signed-off-by: Ryan Moats <rmoats@us.ibm.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* rhel: add option to run kernel datapath test when building rpmsLance Richardson2016-09-092-2/+38
| | | | | | | | | | | | | | Add ability to execute kernel datapath tests when building rpms. These tests are disabled by default, and can optionally be run by providing "--with check_datapath_kernel" on the rpmbuild command line. This is intended to facilitate automated testing, and should not be used in production environments (it is generally not recommended to run rpmbuild as root). Suggested-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Lance Richardson <lrichard@redhat.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Russell Bryant <russell@ovn.org>
* rhel: build source rpm packagesLance Richardson2016-09-091-2/+2
| | | | | | | | | Build source RPM packages for rpm-fedora and rpm-fedora-kmod targets. Signed-off-by: Lance Richardson <lrichard@redhat.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Russell Bryant <russell@ovn.org>
* ovsdb-server: Fix memory leak in ovsdb_server_get_sync_exclude_tables().Ben Pfaff2016-09-091-1/+3
| | | | | | Fixes: 3109b4e127fa ("ovsdb: Add blacklist_tables") Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* ovn-controller: Fix match crieria for dynamic mac binding flowsChandra S Vejendla2016-09-091-19/+11
| | | | | | | | | | | | match struct is not initialized before adding flows for each entry in mac_bindings table. The matches for IPv4 and IPv6 entries don't have exactly the same form (IPv4 uses reg0, IPv6 uses xxreg0), so reusing a match structure can cause problems. Signed-off-by: Chandra Sekhar Vejendla <csvejend@us.ibm.com> Signed-off-by: Ryan Moats <rmoats@us.ibm.com> Co-authored-by: Ryan Moats <rmoats@us.ibm.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovn-nbctl: Update man page for missing tables.Han Zhou2016-09-081-4/+29
| | | | | | | | There are tables added recently in ovn-nb, but not mentioned in man page of ovn-nbctl. Signed-off-by: Han Zhou <zhouhan@gmail.com> Signed-off-by: Russell Bryant <russell@ovn.org>
* datapath-windows: Fixed tcp flags byte order in conntrackPaul Boca2016-09-081-6/+8
| | | | | | | | | | In user mode the flags are interpreted as little endian. This fix makes the kernel mode compatible with user mode. Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* ovn: fix ovn-northd leaks in build_aclRamu Ramamurthy2016-09-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following leaks are due to missing ds_destroy in a few places in build_acl. 5,850 bytes in 50 blocks are definitely lost in loss record 93 of 93 at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x4C2BACB: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x449507: xrealloc (util.c:123) by 0x42CC73: ds_reserve (dynamic-string.c:63) by 0x42D08F: ds_put_format_valist (dynamic-string.c:161) by 0x42D176: ds_put_format (dynamic-string.c:142) by 0x40D380: build_acls (ovn-northd.c:2320) by 0x40D380: build_lswitch_flows.constprop.36 (ovn-northd.c:2472) by 0x4072D9: build_lflows (ovn-northd.c:3845) by 0x4072D9: ovnnb_db_run (ovn-northd.c:3971) by 0x4072D9: main (ovn-northd.c:4375) 9,360 bytes in 72 blocks are definitely lost in loss record 93 of 93 at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x4C2BACB: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x449507: xrealloc (util.c:123) by 0x42CC73: ds_reserve (dynamic-string.c:63) by 0x42D08F: ds_put_format_valist (dynamic-string.c:161) by 0x42D176: ds_put_format (dynamic-string.c:142) by 0x40D505: build_acls (ovn-northd.c:2346) by 0x40D505: build_lswitch_flows.constprop.36 (ovn-northd.c:2472) by 0x4072D9: build_lflows (ovn-northd.c:3845) by 0x4072D9: ovnnb_db_run (ovn-northd.c:3971) by 0x4072D9: main (ovn-northd.c:4375) Signed-off-by: Ramu Ramamurthy <ramu.ramamurthy@us.ibm.com> Acked-by: Ryan Moats <rmoats@us.ibm.com> Signed-off-by: Russell Bryant <russell@ovn.org>
* system-traffic: Add FTP NAT test without seqadj.Joe Stringer2016-09-071-2/+81
| | | | | | | | | | | | | The existing FTP with NAT tests all perform NATing from an IP like 10.1.1.1 -> 10.1.1.240, which requires adjusting the length of FTP control messages as they pass through the connection tracker. Occasionally this is a source of kernel bugs, so it is useful to have a regular FTP NAT test between IPs that do not change the message length in FTP control messages (eg, 10.1.1.1 -> 10.1.1.9) to more clearly identify failures in this area. Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* xlate: Clarify comment about mac learning table entry locking.Jarno Rajahalme2016-09-061-2/+7
| | | | | | | | | | The rationale for locking mac learning table entires wrt. gratuitous ARP packets and bond interfaces was too cryptic for me to understand. After reading vswitchd/INTERNALS the issue is understandable, but we can still improve the comment to prevent such confusion in future. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ovsdb: Replication usability improvementsAndy Zhou2016-09-039-116/+414
| | | | | | | | | | | | | | | | | | | | | | | Based on feedbacks from initial HA manager integration, added the '--active' command line option and appctl command "ovsdb-server/sync-status. See man page updates for details. Added the RPL_S_INIT state in the state machine. This state is not strictly necessary for the replication state machine, but is introduced to make sure the state is update immediately when the state machine is reset, via replication_init(). Without it ovsdb/sync-status may display "replicating" or crash, if the command is issued between after replication_init() is called, but before the state variable is updated from replication_run(). Added a test to simulate the integration of HA manager with OVSDB server using replication. Other documentation and API improvements. Tested-by: Numan Siddique <nusiddiq@redhat.com> Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* tests: Fix recently broken sFlow tests.Ben Pfaff2016-09-021-7/+7
| | | | | | | | | | | A recent improvement to the promptness of sFlow reporting caused some of the sFlow tests to fail (because the output was reported sooner). This fixes up sequence numbers in the expected output to match the new behavior. It also reduces the amount of (virtual) time that the test waits since it's no longer necessary to wait as long. Fixes: 784bf5d4eb3c ("sflow-agent: Flush freshly-polled sFlow counters promptly.") Signed-off-by: Ben Pfaff <blp@ovn.org>
* ofproto: Honor mtu_request even for internal ports.Daniele Di Proietto2016-09-029-36/+121
| | | | | | | | | | | | | | | | | | | | | | | | By default Open vSwitch tries to configure internal interfaces MTU to match the bridge minimum, overriding any attempt by the user to configure it through standard system tools, or the database. While this works in many simple cases (there are probably many users that rely on this) it may create problems for more advanced use cases (like any overlay networks). This commit allows the user to override the default behavior by providing an explict MTU in the mtu_request column in the Interface table. This means that Open vSwitch will now treat differently database MTU requests from standard system tools MTU requests (coming from `ip link` or `ifconfig`), but this seems the best way to remain compatible with old users while providing a more powerful interface. Suggested-by: Darrell Ball <dlu998@gmail.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org> Tested-by: Joe Stringer <joe@ovn.org>
* Revert "ofproto: Always set MTU for new internal ports."Daniele Di Proietto2016-09-022-14/+5
| | | | | | | | | | This reverts commit 47bf118665a3d0f3c153d1fe80e9af02ac9a4e9c. While the commit tries to make it more consistent, it breaks some system tests. The assumptions made on the tests are probably made by many users, so it's better to revert it. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org>
* learn: Fix iteration over learning specs.Ben Pfaff2016-09-023-22/+28
| | | | | | | | | | | | | | | | struct ofpact_learn_spec is variable-length. The 'n_specs' member of struct ofpact_learn counted the number of specs, but the iteration loops over struct ofpact_learn_spec only iterated as far as the *minimum* length of 'n_specs' specs. This fixes the problem, which exhibited as consistent failures for test 431 (learning action - TCPv6 port learning), seemingly only on i386 since it shows up for my personal development machine but appears to not happen for anyone else. Fixes: dfe191d5faa6 ("ofp-actions: Waste less memory in learn actions.") Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* sflow-agent: Flush freshly-polled sFlow counters promptly.Neil McKee2016-09-021-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the order of the steps that are followed every second in the sFlow agent. By moving the receiver_tick() step to the end, we ensure that any counters that were polled during the poller_tick() step are flushed immediately to the sFlow collector. This eliminates what was a variable time-delay between counters being polled and being flushed. The variable time-delay that this eliminates could be up to a second because counters lingering in the output buffer could be flushed at any time by the arrival of random packet-samples. Since the sFlow standard does not require that a poll-timestamp be sent along with the counters the collector must use his receive-time as the timestamp, so that extra second of variable delay was "stretching or shrinking" the time between successive counter readings. This affected any counter-rate calculation that was based only on the delta between sucessive samples. The effect was small with a polling interval of 60 seconds: just +/- 2%. But the effect grew larger when faster polling was configured. For example, if the counters were pushed every 5 seconds then the instantaneous rate calculations could wander by +/- 20%. For a thorough analysis of this problem, see Rick Jones' paper: "High Frequency sFlow v5 Counter Sampling" ftp://ftp.netperf.org/papers/high_freq_sflow/hf_sflow_counters.pdf So this patch makes it possible to obtain usable results even when high-frequency polling is configured. Signed-off-by: Neil McKee <neil.mckee@inmon.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ofproto-dpif-sflow: Tolerate unknown datapath input port for tunnel.Neil McKee2016-09-022-1/+2
| | | | | | | | | | | This patch avoids a segfault. Submitted-at: https://github.com/openvswitch/ovs/pull/152 Reported-at: http://openvswitch.org/pipermail/discuss/2016-August/022513.html Reported-by: 张东亚 <fortitude.zhang@gmail.com> Fixes: 7321bda384c3 ("Extend sFlow agent to report tunnel and MPLS structures") Signed-off-by: Neil McKee <neil.mckee@inmon.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* check-system-userspace: add recheck supportLance Richardson2016-09-021-1/+2
| | | | | | | | Add support for "make check-system-userspace RECHECK=yes", similar to existing support for "make check RECHECK=yes". Signed-off-by: Lance Richardson <lrichard@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovsdb-idlc: Fix logic error in IDL parse function.Mickey Spiegel2016-09-021-1/+1
| | | | | | | | | | | | | | This was found due to a build error when adding an ovsschema column with "type": {"key": "string", "value": "integer"} with no min or max, only a single instance. I am rather unfamiliar with IDL, so no tests have been added yet. I could use some pointers, or someone familiar with IDL tests could take over. Signed-off-by: Mickey Spiegel <mickeys.dev@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Encapsulate packet when src port is tunnel portSairam Venugopal2016-09-021-2/+3
| | | | | | | | | | | | | | | | | | | | If a packet arrives on a tunnel port and is again transmitted on a tunnel port, the packet needs to be encapsulated. Eg: Sample flow which arrives on a tunnel port and gets encapsulated again. eth(src=00:15:5d:ae:b7:b1,dst=ff:ff:ff:ff:ff:ff),in_port(5),eth_type(0x0806), arp(sip=192.168.1.12,tip=192.168.1.78,op=1,sha=00:15:5d:ae:b7:b1,tha=00:00:00:00:00:00), tunnel(tun_id=0x5b88,dst=192.165.226.191,src=192.166.255.253,tos=0,ttl=63, geneve({class=0x104,type=0x80,len=4,0x11680100}),flags(key)) actions:set(tunnel(tun_id=0x5b88,dst=192.165.226.190,ttl=64, geneve({class=0x104,type=0x80,len=4,0x1680100}),flags(df|csum|key))),5,4 Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* check-kernel: add recheck supportLance Richardson2016-09-011-1/+2
| | | | | | | | Support "make check-kernel RECHECK=yes", similar to existing support for "make check RECHECK=yes". Signed-off-by: Lance Richardson <lrichard@redhat.com> Signed-off-by: Joe Stringer <joe@ovn.org>
* AUTHORS: Add Anand to AUTHORS file.Gurucharan Shetty2016-09-011-0/+1
| | | | Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* INSTALL.Windows.md : Updated the kernel datapath project solution file nameAnand Kumar2016-09-011-1/+1
| | | | | | | Singed-off-by : Anand Kumar <kumaranand@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: add assert in OvsHashFlow()Nithin Raju2016-09-011-0/+1
| | | | | | Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* learn: Avoid nested zero-sized arrays to fix build with MSVC.Jarno Rajahalme2016-09-013-24/+36
| | | | | | | | | | | | Avoid using nested zero-sized arrays to allow compilation with MSVC. Also, make sure the immediate data is accessed only if it exists, and that the size is always calculated from struct learn_spec field 'n_bits'. Fixes: dfe191d5faa6 ("ofp-actions: Waste less memory in learn actions.") Reported-by: Alin Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* upcall: Replace ukeys for deleted flows.Joe Stringer2016-09-011-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | If a revalidator dumps/revalidates a flow during the 'dump' phase, resulting in the deletion of the flow, then the ukey state moves into UKEY_EVICTED, and the ukey is kept around until the 'sweep' phase. The ukey is kept around to ensure that cases like duplicated dumps from the datapaths do not result in multiple attribution of the same stats. However, if an upcall for this flow comes for a handler between the revalidator 'dump' and 'sweep' phases, the handler will lookup the ukey and find that the ukey exists, then skip installing a new flow entirely. As a result, for this period all traffic for the flow is slowpathed. If there is a lot of traffic hitting this flow, then it will all be handled in userspace until the 'sweep' phase. Eventually the revalidators will reach the sweep phase and delete the ukey, and subsequently the handlers should install a new flow. To reduce the slowpathing of this traffic during flow table transitions, allow the handler to identify this case during miss upcall handling and replace the existing ukey with a new ukey. The handler will then be able to install a flow for this traffic, allowing the traffic flow to return to the fastpath. Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* upcall: Track ukey states.Joe Stringer2016-09-011-46/+96
| | | | | | | | | | | | | | | | | | | Ukeys have a defined lifetime that starts from being created, inserted into the umaps, having the corresponding flow installed, then the flow deleted, the ukey removed from the umap, rcu-deferral of its deletion, and finally freedom. However, until now it's all been represented behind a simple boolean "flow_exists" with a bunch of implicit logic sprinkled around the accessors. This patch attempts to make the ukey lifetime a bit clearer by outlining the correct transitions and asserting that their lifetime proceeds as expected. This should improve the readability of the current code, and also make the following patch easier to reason about. Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* upcall: Only init flow_put if ukey is installed.Joe Stringer2016-09-011-12/+4
| | | | | | | | | | | | | | | | Currently when processing a batch of upcalls, all datapath operations are first initialized, then later the corresponding ukeys are installed. If the ukey_install fails at this later point, then the code needs to backtrack a bit to delete the ukey and skip using the initialized datapath op. It's a little simpler to only initialize the datapath operation if the ukey could actually be installed. The locks are held longer, but these locks aren't heavily contended and the extended holding of the lock will be removed in a subsequent patch anyway. Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* upcall: Reuse flow_put initializer.Joe Stringer2016-09-011-16/+8
| | | | | Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* ovn-controller: Fix memory leak in recv_S_TLV_TABLE_REQUESTED().Ben Pfaff2016-09-011-58/+66
| | | | | | | | | | | | | | Nothing freed 'reply'. This fixes the problem. Most of this patch is moving coding around. The essential change is that breaking the code that works with 'reply' out into a separate function makes it possible to catch all paths out of the function so that 'reply' can be freed in one place. Reported-by: Ryan Moats <rmoats@us.ibm.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Ryan Moats <rmoats@us.ibm.com> Acked-by: Flavio Fernandes <flavio@flaviof.com>
* ovn-controller: Fix leak in patched_datapaths processing.Ben Pfaff2016-09-016-12/+9
| | | | | | | | | | Nothing freed 'key', which was dynamically allocated. This commit changes 'key' so that it is no longer dynamically allocated. Reported-by: Ryan Moats <rmoats@us.ibm.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Flavio Fernandes <flavio@flaviof.com> Acked-by: Russell Bryant <russell@ovn.org>
* ovn-controller: Drop incremental processing from encapsulation code.Ben Pfaff2016-08-311-353/+90
| | | | | | | | | | | | | | | This commit reverts encaps.c to its content just before commit 1d45d5a9666d (ovn-controller: Change encaps_run to work incrementally.). I then reintroduced the UDP checksum support originallly added in commit 36283d7884f3 (ovn-controller: Use UDP checksums when creating Geneve tunnels.) I also read the other commits following the incremental processing commit to verify that this change didn't lose any bug fixes. This commit takes advantage of the "addvalue" and "delvalue" functions now available in the IDL to simplify some code. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Russell Bryant <russell@ovn.org>
* ovsdb-idlc: Make set and map update operations take const arguments.Ben Pfaff2016-08-312-20/+32
| | | | | | | | | | In a call like "ovsrec_bridge_update_ports_delvalue(bridge, port)", there's no reason for the port argument to be nonconst, because the call doesn't do anything to the port at all--it only searches the list of ports in the bridge for that particular port and, if it finds it, removes it. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Russell Bryant <russell@ovn.org>
* ovsdb: Reimplement replication. Using a state machine.Andy Zhou2016-08-313-302/+330
| | | | | | | | | Current replication uses blocking transactions, which are error prone in practice, especially in handling RPC connection flapping to the active server. Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* test: Improve replication unit testsAndy Zhou2016-08-312-70/+73
| | | | | | | | | | | | Replication test currently uses many sleeps that slowes the test down and may not be reliable. Remove those sleeps when possible. OVSDB servers needs to be killed on test failure. Use on_exit() to ensure cleanup happens, so they don't have to be handled for each testing step. Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ovsdb: (Re)hide struct db in ovsdb-server.cAndy Zhou2016-08-313-70/+104
| | | | | | | | | It seems odd that the currently replication implementation moves the struct db from ovsdb-server.c (file private) to replication.h (global). This patch moves the 'struct db' defintion back into ovsdb-server.c, Signed-off-by: Andy Zhou <azhou@ovn.org>
* ovsdb: Add request_idsAndy Zhou2016-08-311-4/+76
| | | | | | | | | | | | | When starting, the replication logic may issue multiple requests at a time, for example, one monitor request for each databases. The request_ids keeps track of all outsanding request IDs that are used for matching reply message with. It also provides the 'db' context for the reply. Future patches will make use of this facility. Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ovsdb: Add blacklist_tablesAndy Zhou2016-08-314-58/+159
| | | | | | | | | | | | | | Currently, 'sync-exclude-tables' command line options are simply stored in a string. Change the implementation to store it in an shash instead to improve modularity. One additional benefit of this change is that errors can be detected and reported to user earlier. Adde a 'dryrun' option to set_blacklist_tables() API to make this feature available to the command line option parsing and unixctl command parsing. Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ovsdb: Properly handle error returned from from reset_database()Andy Zhou2016-08-311-5/+9
| | | | | | | | | Fix a memory leak in case of error. The error object was not properly disposed. Since the error to reset DB is not expected, log it and exit. Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* expr: Fix memory leak in expr_macros_destroy().Ben Pfaff2016-08-311-0/+1
| | | | | | Signed-off-by: Ryan Moats <rmoats@us.ibm.com> [blp@ovn.org split this bug fix out of a larger patch] Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovn-controller: Unpersist lflow data structures for address sets.Ben Pfaff2016-08-311-152/+24
| | | | | | | | | | With the removal of incremental processing, it is no longer necessary to persist the data structures for storing address sets. Simplify things by removing this complexity. Signed-off-by: Ryan Moats <rmoats@us.ibm.com> [blp@ovn.org deleted more unnecessary code] Signed-off-by: Ben Pfaff <blp@ovn.org>