summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* checkpatch: Fix regexp for if, while, etc inside macros.Ilya Maximets2019-08-121-0/+5
| | | | | | | | | | | | | | | | This allows to use a one-character expression inside the 'if' statement and multiple spaces before the line continuation character. Fixes false positive in case like this: #define MACRO(ARG) \ if (a) { \ do_work(ARG); \ } Fixes: 16770c6d9179 ("checkpatch: support macro continuation") Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Aaron Conole <aconole@redhat.com>
* ovsdb-data: Don't put strings with digits in quotes.Ilya Maximets2019-07-256-38/+38
| | | | | | | | | | No need to use quotes for strings like "br0". Keeping UUIDs always in quotes to avoid different treatment of those that starts with digits and those that starts with letters. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Ben Pfaff <blp@ovn.org>
* test: Fix fragment-related tests that fail on 4.19+ due to small-sized packetsYifeng Sun2019-07-221-15/+15
| | | | | | | | | | | | These fragment-related tests are failing on later kernels (4.19.x) because kernel quietly drops any packet fragment that is not the last but has a size smaller than IPV6_MIN_MTU. This patch fixes them by increasing their sizes to IPV6_MIN_MTU. Reviewed-by: Darrell Ball <dlu998@gmail.com> Reivewed-at: https://github.com/openvswitch/ovs/pull/278 Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* tnl-neigh-cache: Purge learnt neighbors when port/bridge is deletedVasu Dasari2019-07-221-0/+47
| | | | | | | | | | | | | | | | | Say an ARP entry is learnt on a OVS port and when such a port is deleted, learnt entry should be removed from the port. It would have be aged out after ARP ageout time. This code will clean up immediately. Added test case(tunnel - neighbor entry add and deletion) in tunnel.at, to verify neighbors are added and removed on deletion of a ports and bridges. Discussion for this addition is at: https://mail.openvswitch.org/pipermail/ovs-discuss/2019-June/048754.html Signed-off-by: Vasu Dasari <vdasari@gmail.com> Reviewed-by: Flavio Fernandes <flavio@flaviof.com> Reviewed-by: Ben Pfaff <blp@ovn.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
* system-traffic: Make nsh test more robust.William Tu2019-07-221-56/+37
| | | | | | | | | | | The patch adds '-n' to tcpdump to avoid address coverting. Add '-l' for rhel8 to avoid buffering. Since '-U' is used to output to stdout, simply use 'cat' to search result. Use OVS_WAIT_UNTIL instead of sleep, and also remove/add some newlines. Finally, move tcpdump captured interface into the namespace, (capture p1 instead of ovs-p1), and tested using af_xdp. Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
* netdev-afxdp: add new netdev type for AF_XDP.William Tu2019-07-195-0/+86
| | | | | | | | | | | | | | | | The patch introduces experimental AF_XDP support for OVS netdev. AF_XDP, the Address Family of the eXpress Data Path, is a new Linux socket type built upon the eBPF and XDP technology. It is aims to have comparable performance to DPDK but cooperate better with existing kernel's networking stack. An AF_XDP socket receives and sends packets from an eBPF/XDP program attached to the netdev, by-passing a couple of Linux kernel's subsystems As a result, AF_XDP socket shows much better performance than AF_PACKET For more details about AF_XDP, please see linux kernel's Documentation/networking/af_xdp.rst. Note that by default, this feature is not compiled in. Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
* OVN: Add ovn-northd IGMP supportDumitru Ceara2019-07-162-0/+389
| | | | | | | | | | | | | | | | | | | | New IP Multicast Snooping Options are added to the Northbound DB Logical_Switch:other_config column. These allow enabling IGMP snooping and querier on the logical switch and get translated by ovn-northd to rows in the IP_Multicast Southbound DB table. ovn-northd monitors for changes done by ovn-controllers in the Southbound DB IGMP_Group table. Based on the entries in IGMP_Group ovn-northd creates Multicast_Group entries in the Southbound DB, one per IGMP_Group address X, containing the list of logical switch ports (aggregated from all controllers) that have IGMP_Group entries for that datapath and address X. ovn-northd also creates a logical flow that matches on IP multicast traffic destined to address X and outputs it on the tunnel key of the corresponding Multicast_Group entry. Signed-off-by: Dumitru Ceara <dceara@redhat.com> Acked-by: Mark Michelson <mmichels@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* OVN: Add IGMP SB definitions and ovn-controller supportDumitru Ceara2019-07-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A new IP_Multicast table is added to Southbound DB. This table stores the multicast related configuration for each datapath. Each row will be populated by ovn-northd and will control: - if IGMP Snooping is enabled or not, the snooping table size and multicast group idle timeout. - if IGMP Querier is enabled or not (only if snooping is enabled too), query interval, query source addresses (Ethernet and IP) and the max-response field to be stored in outgoing queries. - an additional "seq_no" column is added such that ovn-sbctl or if needed a CMS can flush currently learned groups. This can be achieved by incrementing the "seq_no" value. A new IGMP_Group table is added to Southbound DB. This table stores all the multicast groups learned by ovn-controllers. The table is indexed by datapath, group address and chassis. For a learned multicast group on a specific datapath each ovn-controller will store its own row in this table. Each row contains the list of chassis-local ports on which the group was learned. Rows in the IGMP_Group table are updated or deleted only by the ovn-controllers that created them. A new action ("igmp") is added to punt IGMP packets on a specific logical switch datapath to ovn-controller if IGMP snooping is enabled. Per datapath IGMP multicast snooping support is added to pinctrl: - incoming IGMP reports are processed and multicast groups are maintained (using the OVS mcast-snooping library). - each OVN controller syncs its in-memory IGMP groups to the Southbound DB in the IGMP_Group table. - pinctrl also sends periodic IGMPv3 general queries for all datapaths where querier is enabled. Signed-off-by: Mark Michelson <mmichels@redhat.com> Co-authored-by: Mark Michelson <mmichels@redhat.com> Signed-off-by: Dumitru Ceara <dceara@redhat.com> Acked-by: Mark Michelson <mmichels@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovs-macros: An option to suspend test execution on errorVasu Dasari2019-07-161-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Origins for this patch are captured at https://mail.openvswitch.org/pipermail/ovs-discuss/2019-June/048923.html. Summarizing here, when a test fails, it would be good to pause test execution and let the developer poke around the system to see current status of system. As part of this patch, made a small tweaks to ovs-macros.at, so that when test suite fails, ovs_on_exit() function will be called. And in this function, a check is made to see if an environment variable to OVS_PAUSE_TEST is set. If it is set, then test suite is paused and will continue to wait for user input Ctrl-D. Meanwhile user can poke around the system to see why test case has failed. Once done with investigation, user can press ctrl-d to cleanup the test suite. For example, to re-run test case 139: export OVS_PAUSE_TEST=1 cd tests/system-userspace-testsuite.dir/139 sudo -E ./run When error occurs, above command would display something like this: ===================================================== Set environment variable to use various ovs utilities export OVS_RUNDIR=/opt/vdasari/Developer/ovs/_build-gcc/tests/system-userspace-testsuite.dir/139 Press ENTER to continue: ===================================================== And from another window, one can execute ovs-xxx commands like: export OVS_RUNDIR=/opt/vdasari/Developer/ovs/_build-gcc/tests/system-userspace-testsuite.dir/139 $ ovs-ofctl dump-ports br0 . . To be able to pause while performing `make check`, one can do: $ OVS_PAUSE_TEST=1 make check TESTSUITEFLAGS='-v' Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Vasu Dasari <vdasari@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* OVN: use trigger_event action to report 'empty_lb_rule' eventsLorenzo Bianconi2019-07-121-0/+65
| | | | | | | | | | | Add northd logical flows in order to reports that the controller received an IP packet for LB rule witn no backends. This configuration is used by OpenShift to spin up a idle POD Signed-off-by: Mark Michelson <mmichels@redhat.com> Co-authored-by: Mark Michelson <mmichels@redhat.com> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* OVN: introduce trigger_event() actionLorenzo Bianconi2019-07-122-2/+19
| | | | | | | | | | | | | | | | | | Add trigger_event() ovn action in order to allow ovs-vswitchd to report CMS related events. This commit introduces a new event, empty_lb_backends. This event is raised if a received packet is destined for a load balancer VIP that has no configured backend destinations. For this event, the event info includes the load balancer VIP, the load balancer UUID, and the transport protocol. The use case for this particular event is for the CMS to supply backend resources to handle this traffic. For example, in Openshift, this event can be used to spin up new containers to handle the incoming traffic. Signed-off-by: Mark Michelson <mmichels@redhat.com> Co-authored-by: Mark Michelson <mmichels@redhat.com> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* tests: Add ovsdb-cluster-testsuite to gitignore.Ilya Maximets2019-07-121-0/+3
| | | | | | | | CC: Han Zhou <hzhou8@ebay.com> Fixes: 2bcb3b7052c8 ("ovsdb raft: Move ovsdb cluster tests to separate testsuite.") Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Ben Pfaff <blp@ovn.org> Acked-by: Han Zhou <hzhou8@ebay.com>
* checkpatch: Check FOR_EACH loops with numbers.Ilya Maximets2019-07-121-1/+1
| | | | | | | | | | | | | OVS has defines for loops like 'BITMAP_FOR_EACH_1' or 'ULLONG_FOR_EACH_1', but the regexp in checkpatch doesn't match with numbers and skips these loops while checking. This patch adds numbers into regexp and adds some FER_EACH loops to the unit tests. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com>
* ovn: Fix the test failures in travis CI.Numan Siddique2019-07-121-18/+35
| | | | | | | | | | | | | | | | | | | | After the commit [1], below test cases are failing repeatedly in travis CI. 2663: ovn -- 4 HV, 1 LS, 1 LR, packet test with HA distributed router gateway port FAILED (ovn.at:8597) 2664: ovn -- 4 HV, 3 LS, 2 LR, packet test with HA distributed router gateway port FAILED (ovn.at:8844) 2667: ovn -- vlan traffic for external network with distributed router gateway port FAILED (ovn.at:9580) 2691: ovn -- router - check packet length - icmp defrag FAILED (ovn.at:13624) With the commit [1], ovn-controller sends GARPs for the IPs of the distributed router ports. The failing tests did not handle the situation if multiple GARPs are sent. The failures are mostly timing related. This patch fixes these issues. [1] - d65586b6fa97 ("ovn: Send GARP for router port IPs of a router port connected to bridged logical switch") Fixes: d65586b6fa97 ("ovn: Send GARP for router port IPs of a router port connected to bridged logical switch") CC: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Numan Siddique <nusiddiq@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovn-performance.at: Fix syntax error in ACL.Han Zhou2019-07-101-2/+2
| | | | | | | | | This doesn't impact the effectiveness of the test but just fix an obvious error in ACL syntax which was noticed when looking at test logs. Signed-off-by: Han Zhou <hzhou8@ebay.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovn-performance.at: Missing steps for connecting LS to LR.Han Zhou2019-07-101-0/+4
| | | | | | | | | | | | | | | | The test creates 2 logical switches and connect them with a logical router. However, it didn't set the option "router-port", so the 2 LS datapaths were not connected. This results in missing test coverage for port-binding incremental processing: assume I-P has a bug and port-binding change always trigger recompute, since each HV monitors only its own datapath (i.e. HV1 -> ls1, HV2 -> ls2) then it never got notification of the other port-binding change, thus recompute is never triggered when port-binding is updated on the other datapath. With this fix, each HV's local datapaths will include both ls1 and ls2, so port-binding change notification will be received properly and unexpected recompute would be captured. Signed-off-by: Han Zhou <hzhou8@ebay.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovsdb-server: drop all connections on read/write status changeDaniel Alvarez2019-07-101-0/+21
| | | | | | | | | | | | | | | | Prior to this patch, only db change aware connections were dropped on a read/write status change. However, current schema in OVN does not allow clients to monitor whether a particular DB changes this status. In order to accomplish this, we'd need to change the schema and adapting ovsdb-server and existing clients. Before tackling that, this patch is changing ovsdb-server to drop *all* the existing connections upon a read/write status change. This will force clients to reconnect and honor the change. Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2019-July/048981.html Signed-off-by: Daniel Alvarez <dalvarez@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovn-controller: Fix chassis ovn-sbdb record initDumitru Ceara2019-07-081-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | The chassis_run code didn't take into account the scenario when the system-id was changed in the Open_vSwitch table. Due to this the code was trying to insert a new Chassis record in the OVN_Southbound DB with the same Encaps as the previous Chassis record. The transaction used to insert the new records was aborting due to the ["type", "ip"] index constraint violation as we were creating new Encap entries with the same "type" and "ip" as the old ones. In order to fix this issue the flow is now: 1. the first time ovn-controller initializes the Chassis (shortly after start up) we store the chassis-id. 2. for subsequent chassis_run calls we use last configured chassis-id stored at the previous step to lookup the old Chassis record. 3. when ovn-controller shuts down gracefully we lookup the Chassis record based on the chassis-id stored in memory at steps 1 and 2 above. This is to avoid failing to cleanup the Chassis record in OVN_Southbound DB if the OVS system-id changes between the last call to chassis_run and chassis_cleanup. Reported-at: https://bugzilla.redhat.com/1708146 Reported-by: Haidong Li <haili@redhat.com> Signed-off-by: Dumitru Ceara <dceara@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* sat-math: Add functions for saturating arithmetic on "long long int".Ben Pfaff2019-07-052-1/+46
| | | | | | | | | The first users will be added in an upcoming commit. Also add tests. Acked-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* OVN: Enable E-W Traffic, Vlan backed DVRAnkur Sharma2019-07-051-0/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Background: [1] https://mail.openvswitch.org/pipermail/ovs-dev/2018-October/353066.html [2] https://docs.google.com/document/d/1uoQH478wM1OZ16HrxzbOUvk5LvFnfNEWbkPT6Zmm9OU/edit?usp=sharing Key difference between an overlay logical switch and vlan backed logical switch is that for vlan logical switches packets are not encapsulated. Hence, if a distributed router port is connected to vlan backed logical switch, then router port mac as source mac could be seen from multiple hypervisors. Same <mac,vlan> pairs coming from multiple ports from a top of the rack switch (TOR) perspective could be seen as a security threat and it could send alarms, drop the packets or block the ports etc. This patch addresses the same by introducing the concept of chassis mac. A chassis mac is CMS provisioned unique mac per chassis. For any routed packet (i.e source mac is router port mac) going on the wire on a vlan type logical switch, we will replace its source mac with chassis mac. This replacing of source mac with chassis mac will happen in table=65 of the logical switch datapath. A flow is added at priority 150, which matches the source mac and replaces it with chassis mac if the value is a router port mac. Example flow: cookie=0x0, duration=67765.830s, table=65, n_packets=0, n_bytes=0, idle_age=65534, hard_age=65534, priority=150,reg15=0x1,metadata=0x4, dl_src=00:00:01:01:02:03 actions=mod_dl_src:aa:bb:cc:dd:ee:ff, mod_vlan_vid:1000,output:16 Here, 00:00:01:01:02:03 is router port mac and aa:bb:cc:dd:ee:ff is chassis mac. Acked-by: Numan Siddique <nusiddiq@redhat.com> Signed-off-by: Ankur Sharma <ankur.sharma@nutanix.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovn: Send GARP for router port IPs of a router port connected to bridged ↵Numan Siddique2019-07-031-21/+68
| | | | | | | | | | | | | | | logical switch This patch handles sending GARPs for - router port IPs of a distributed router port - router port IPs of a router port which belongs to gateway router (with the option - redirect-chassis set in Logical_Router.options) Acked-by: Dumitru Ceara <dceara@redhat.com> Signed-off-by: Numan Siddique <nusiddiq@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovn: Send GARP for the router ports with reside-on-redirect-chassis options setNuman Siddique2019-07-031-2/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | With the commit [1], the routing for the provider logical switches connected to a router is centralized on the master gateway chassis (if the option - reside-on-redirect-chassis) is set. When the failover happens and a standby gateway chassis becomes master, it should send GARPs for the router port macs. Without this, the physical switch doesn't learn the new location of the router port macs immediately and this could result in traffic disruption. This patch addresses this issue so that the ovn-controller which claims the distributed gatweway router port sends out the GARPs. ovn-controller sends the GARPs if the Port_Binding.nat_addresses column is set. This patch makes use of this column, instead of adding a new column even though the name - nat_addresses seems a bit misnomer. The documentation is updated to highlight the usage of this column. This patch doesn't handle sending the GARPs for the gateway router port IPs. This will be handled in a separate patch. [1] - 85706c34d53d ("ovn: Avoid tunneling for VLAN packets redirected to a gateway chassis") Acked-by: Dumitru Ceara <dceara@redhat.com> Signed-off-by: Numan Siddique <nusiddiq@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* tunnel: Add layer 2 IPv6 GRE encapsulation support.William Tu2019-07-032-0/+109
| | | | | | | | | | | | | | | | | The patch adds ip6gre support. Tunnel type 'ip6gre' with packet_type= legacy_l2 is a layer 2 GRE tunnel over IPv6, carrying inner ethernet packets and encap with GRE header with outer IPv6 header. Encapsulation of layer 3 packet over IPv6 GRE, ip6gre, is not supported yet. I tested it by running: # make check-kernel TESTSUITEFLAGS='-k ip6gre' under kernel 5.2 and for userspace: # make check TESTSUITEFLAGS='-k ip6gre' Tested-by: Greg Rose <gvrose8192@gmail.com> Tested-at: https://travis-ci.org/gvrose8192/ovs-experimental/builds/552977116 Reviewed-by: Greg Rose <gvrose8192@gmail.com> Reviewed-by: Eli Britstein <elibr@mellanox.com> Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ossfuzz: Remove duplicate tcp flags parsing in flow extract targetBhargava Shastry2019-07-031-6/+0
| | | | | | | | | | | | | | | During a code audit, the flow extraction fuzzer target was seen to be parsing tcp flags from the fuzzer supplied input twice. This is probably a typo since the second call to `parse_tcp_flags()` is identical to the first. Since a call to `parse_tcp_flags()` parses the Ethernet and IP headers contained in the packet, the second (buggy) call to `parse_tcp_flags()` creates an expectation that there is a second set of Ethernet and IP headers beyond the first which is incorrect. This patch fixes this problem by removing the duplicate code in question. Signed-off-by: Bhargava Shastry <bshas3@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* vswitchd: Separate disable system and route.William Tu2019-06-262-2/+4
| | | | | | | | | | | | | | | | | Previously, '--disable-system' disables both system dp and the system routing table. The patch makes '--disable-system' only disable system dp and adds '--disable-system-route' for disabling the route table. This fixes failures when 'make check-system-userspace' for tunnel cases. As a consequence, hitting errors due to OVS userspace parses the IGMP packet but its datapaths do not, so odp_flow_key_to_flow() return ODP_FIT_TOO_LITTLE. commit c645550bb249 ("odp-util: Always report ODP_FIT_TOO_LITTLE for IGMP.") Fix it by filtering out the IGMP-related error message. Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Co-authored-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* dpif-netdev: Only poll enabled vhost queues.David Marchand2019-06-261-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently poll all available queues based on the max queue count exchanged with the vhost peer and rely on the vhost library in DPDK to check the vring status beneath. This can lead to some overhead when we have a lot of unused queues. To enhance the situation, we can skip the disabled queues. On rxq notifications, we make use of the netdev's change_seq number so that the pmd thread main loop can cache the queue state periodically. $ ovs-appctl dpif-netdev/pmd-rxq-show pmd thread numa_id 0 core_id 1: isolated : true port: dpdk0 queue-id: 0 (enabled) pmd usage: 0 % pmd thread numa_id 0 core_id 2: isolated : true port: vhost1 queue-id: 0 (enabled) pmd usage: 0 % port: vhost3 queue-id: 0 (enabled) pmd usage: 0 % pmd thread numa_id 0 core_id 15: isolated : true port: dpdk1 queue-id: 0 (enabled) pmd usage: 0 % pmd thread numa_id 0 core_id 16: isolated : true port: vhost0 queue-id: 0 (enabled) pmd usage: 0 % port: vhost2 queue-id: 0 (enabled) pmd usage: 0 % $ while true; do ovs-appctl dpif-netdev/pmd-rxq-show |awk ' /port: / { tot++; if ($5 == "(enabled)") { en++; } } END { print "total: " tot ", enabled: " en }' sleep 1 done total: 6, enabled: 2 total: 6, enabled: 2 ... # Started vm, virtio devices are bound to kernel driver which enables # F_MQ + all queue pairs total: 6, enabled: 2 total: 66, enabled: 66 ... # Unbound vhost0 and vhost1 from the kernel driver total: 66, enabled: 66 total: 66, enabled: 34 ... # Configured kernel bound devices to use only 1 queue pair total: 66, enabled: 34 total: 66, enabled: 19 total: 66, enabled: 4 ... # While rebooting the vm total: 66, enabled: 4 total: 66, enabled: 2 ... total: 66, enabled: 66 ... # After shutting down the vm total: 66, enabled: 66 total: 66, enabled: 2 Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
* ofproto-dpif: Fix continuation with patch portYi-Hung Wei2019-06-211-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the ofp_port to odp_port translation issue on patch port with nxt_resume. When OVS resumes processing a packet from nxt_resume, OVS does not translate the ofp in_port to odp in_port correctly if the packet is originally received from a patch port. Currently,OVS sets the odp in_port for this resume pakcet as ODPP_NONE and push the resume packet back to the datapath. Later on, if the packet goes through a recirc, OVS will generate the following message since it can not translate odp in_port (ODPP_NONE) back to ofp in_port during upcall, and push down a datapath rule to drop the packet. ofproto_dpif_upcall(handler16)|INFO|received packet on unassociated datapath port 4294967295 When OVS revalidates the drop datapath flow with ODPP_NONE in_port, we will see the following warning. ofproto_dpif_upcall(revalidator18)|WARN|Failed to acquire udpif_key corresponding to unexpected flow (Invalid argument): ufid:.... This patch resolves this issue by storing the odp in_port in the continuation messages, and restores the odp in_port before push the packet back to the datapath. VMWare-BZ: 2364696 Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* OpenFlow: Enable OpenFlow 1.5 by default.Ben Pfaff2019-06-201-7/+7
| | | | | | | | Open vSwitch now supports all OpenFlow 1.5 required features, so enable it by default. Acked-by: Numan Siddique <nusiddiq@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ofp-actions: Support OF1.5 meter action.Ben Pfaff2019-06-201-0/+3
| | | | | | | | OpenFlow 1.5 changed "meter" from an instruction to an action. This commit supports it properly. Acked-by: Numan Siddique <nusiddiq@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* netdev: Dynamic per-port Flow API.Ilya Maximets2019-06-112-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Current issues with Flow API: * OVS calls offloading functions regardless of successful flow API initialization. (ex. on init_flow_api failure) * Static initilaization of Flow API for a netdev_class forbids having different offloading types for different instances of netdev with the same netdev_class. (ex. different vports in 'system' and 'netdev' datapaths at the same time) Solution: * Move Flow API from the netdev_class to netdev instance. * Make Flow API dynamic, i.e. probe the APIs and choose the suitable one. Side effects: * Flow API providers localized as possible in their modules. * Now we have an ability to make runtime checks. For example, we could check if particular device supports features we need, like if dpdk device supports RSS+MARK action. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Roi Dayan <roid@mellanox.com>
* tests: Add negative tests for action and instruction parsing.Ben Pfaff2019-06-092-30/+209
| | | | | | | | | | This adds a negative test for almost all of the error messages that parsing an action or instruction can produce. This commit removes now-redundant tests from multipath.at. Acked-by: Numan Siddique <nusiddiq@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ofp-actions: Improve error messages for verification failures in parsing.Ben Pfaff2019-06-091-4/+2
| | | | | | | | Verification can fail for a variety of reasons but the code here always reported "Incorrect instruction ordering". Acked-by: Numan Siddique <nusiddiq@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* conntrack: ignore port for ICMP/ICMPv6 NAT.solomon2019-06-071-0/+48
| | | | | | | | | | | | | ICMP/ICMPv6 fails, if the src/dst port is set in a common NAT rule. For example: actions=ct(nat(dst=172.16.1.100:5000),commit,table=40) Fixes: 4cd0481c9e8b ("conntrack: Fix wasted work for ICMP NAT.") CC: Darrell Ball <dlu998@gmail.com> Signed-off-by: solomon <liwei.solomon@gmail.com> Signed-off-by: Darrell Ball <dlu998@gmail.com> Co-authored-by: Darrell Ball <dlu998@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovn: Add support for DHCP option 15 - domain nameMaciej Józefczyk2019-06-073-6/+6
| | | | | | | | | | | | | | | | | For Openstack Internal DNS functionality we need to provide support for domain_name option. DHCP option 15 was previously used only in parser tests and according to RFC it should be renamed to domain_name [1]. This patch modifies its name in the tests from 'domain' to 'domain_name' and adds its support to the code. [1] https://tools.ietf.org/html/rfc2132#section-3.17 Signed-off-by: Maciej Józefczyk <mjozefcz@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* tests: Include ovn-macros for system testsuites.Darrell Ball2019-06-032-0/+2
| | | | | | | | | ovn-macros are needed to run the OVN system tests. Tested-by: Greg Rose <gvrose8192@gmail.com> Reviewed-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Darrell Ball <dlu998@gmail.com> Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
* ossfuzz: Fix expr target build failureBhargava Shastry2019-05-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | Google oss-fuzz reported a build failure for the OVN expression parser. Upon investigation, it turned out that the expr_parse_target fuzzer was not being run by Google due to the said failure. The root cause of the build failure turned out to be a change in the definition of the expr_parse_string() API. Now, this API accepts an additional parameter of type struct sset * that points to the set of address set referenced which may be NULL if unused. This patch adds this additional parameter to expr_parse_string() setting the pointer to the set of address set referenced to NULL. Once this patch is applied, ossfuzz's expr_parse_target should build and subsequently be fuzzed. CC: Han Zhou <hzhou8@ebay.com> Fixes: 43e6900a7991 ("ovn-controller: Maintain resource references for logical flows.") Signed-off-by: Bhargava Shastry <bshastry@sect.tu-berlin.de> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovn-performance.at: Test port group incremental processing.Han Zhou2019-05-241-6/+37
| | | | | | | Add tests to make sure port group change doesn't trigger recomputing. Signed-off-by: Han Zhou <hzhou8@ebay.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovn: Test for full logical flow processing in ovn-controller.Jakub Sitnicki2019-05-243-1/+392
| | | | | | | | | | | | | | | | | | | From: Jakub Sitnicki <jkbs@redhat.com> Add a test that performs typical operations of creating & destroying logical routers, switches, ports, address sets and ACLs while checking if they trigger full logical flow processing in the ovn-controller. This way confirm that incremental processing is taking effect when we expect it to. Place the new test in a separate module - tests/ovn-performance.at, instead of the usual tests/ovn.at as it doesn't test OVN's functionality but rather a performance aspect of ovn-controller. Signed-off-by: Jakub Sitnicki <jkbs@redhat.com> Acked-by: Han Zhou <hzhou8@ebay.com> Signed-off-by: Han Zhou <hzhou8@ebay.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovn-controller: Incremental processing for address-set changes.Han Zhou2019-05-241-0/+75
| | | | | | | | | | | | When the content of an address set changes, ovn-controller will not recompute all flows but only the ones related to the changed address-set. The performance test result is discussed at [1]. [1] https://mail.openvswitch.org/pipermail/ovs-discuss/2018-June/046880.html Tested-by: Mark Michelson <mmichels@redhat.com> Signed-off-by: Han Zhou <hzhou8@ebay.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovn-controller: Maintain resource references for logical flows.Han Zhou2019-05-241-3/+4
| | | | | | | | | | This patch maintains the cross reference between logical flows and the resources such as address sets and port groups that are used by logical flows. This data will be needed in address set and port group incremental processing. Signed-off-by: Han Zhou <hzhou8@ebay.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ofproto-dpif-xlate: Change priority tags from boolean to enumEli Britstein2019-05-241-3/+3
| | | | | | | | | | | | | Priority tags is a port configuration to determine how the port treats priority tags, e.g. zero VLAN ID. Change the type from boolean to enum as a pre-step towards introducing additional modes. The new options are "never", equivalent to previously "false", and "if-nonzero", equivalent to previously "true". "true" is still supported for backwards compatibility. Signed-off-by: Eli Britstein <elibr@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovn-macros: Break the OVN macros into their own file.Justin Pettit2019-05-234-178/+183
| | | | | Signed-off-by: Justin Pettit <jpettit@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ovn.at: Use ovn cleanup macros.Justin Pettit2019-05-231-87/+5
| | | | | Signed-off-by: Justin Pettit <jpettit@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ovn.at: Clean up northd-backup in "ovn -- ipam" test.Justin Pettit2019-05-231-0/+3
| | | | | Signed-off-by: Justin Pettit <jpettit@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* OVN: fix pinctrl ip buffering for gw router portLorenzo Bianconi2019-05-071-5/+6
| | | | | | | | | | Use sb mac binding table to trigger ip buffer dequeueing instead of the APR/ND packet reception since the ARP reply can be managed on a different chassis if a gw router port is scheduled on a different node Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* tests: Fix IPv4 checksums in zone limit test.Darrell Ball2019-05-071-5/+5
| | | | | | | | | | Userspace conntrack cares about IPv4 checksums, so this is a prerequisite for adding zone limit support to userspace conntrack. Fixes: 3f1087c70cf9 ("system-traffic: Add conntrack per zone limit test case.") Acked-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Darrell Ball <dlu998@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* conntrack: Stop exporting internal datastructures.Darrell Ball2019-05-031-7/+7
| | | | | | | Stop the exporting of the main internal conntrack datastructure. Signed-off-by: Darrell Ball <dlu998@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovn: Added missing --wait in ovn testsLeonid Ryzhyk2019-05-022-10/+10
| | | | | | | | | | | Several of the ovn tests did not use the `--wait` flag to to wait for a configuration change to propagate through the system. As a result, these tests fail when `ovn-northd` is slow. Fixed by adding `--wait=hv` or `--wait=sb` as appropriate. Signed-off-by: Leonid Ryzhyk <ryzhyk@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* oss-fuzz: fixed wrong lib pathToms Atteka2019-04-301-1/+1
| | | | | | | | | | the logical-fields.h file was moved. Path has been updated accordingly. This broke oss-fuzz buils. CC: Numan Siddique <nusiddiq@redhat.com> Fixes: 086470cdbe66 ("ovn: Add a new OVN field icmp4.frag_mtu") Signed-off-by: Toms Atteka <cpp.code.lv@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* system-offloads-traffic.at: Fix requesting HW offloaded flows from veth.Ilya Maximets2019-04-291-6/+6
| | | | | | | | | | | | | | | | | | veth pair doesn't offload anything to HW. i.e. we should use 'tc' type while requesting flows. 'offloaded' kept just in case to not update the test if veths will be HW offloaded someday. Additionally fixed missed for unknown reason 'ipv4' fields. Also dropped stripping of the errors from log. Fixes test: 2: offloads - ping between two ports - offloads enabled ok CC: Gavi Teitz <gavi@mellanox.com> Fixes: d63ca5329ff9 ("dpctl: Properly reflect a rule's offloaded to HW state") Acked-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Ilya Maximets <i.maximets@samsung.com>