From patchwork Fri Nov 6 02:06:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell Bryant X-Patchwork-Id: 540785 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (li376-54.members.linode.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 7BF911409C2 for ; Fri, 6 Nov 2015 13:06:54 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 37F3422C382; Thu, 5 Nov 2015 18:06:53 -0800 (PST) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v3.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id C187A108AF for ; Thu, 5 Nov 2015 18:06:51 -0800 (PST) Received: from bar3.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id 002EC162DEA for ; Thu, 5 Nov 2015 19:06:51 -0700 (MST) X-ASG-Debug-ID: 1446775610-03dd7b5776175a0001-byXFYA Received: from mx3-pf3.cudamail.com ([192.168.14.3]) by bar3.cudamail.com with ESMTP id S3ziYtAT7549oi7M (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 05 Nov 2015 19:06:50 -0700 (MST) X-Barracuda-Envelope-From: rbryant@redhat.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.3 Received: from unknown (HELO mx1.redhat.com) (209.132.183.28) by mx3-pf3.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 6 Nov 2015 02:18:17 -0000 Received-SPF: pass (mx3-pf3.cudamail.com: SPF record at _spf1.redhat.com designates 209.132.183.28 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-Barracuda-RBL-IP: 209.132.183.28 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 1854D6F; Fri, 6 Nov 2015 02:06:39 +0000 (UTC) Received: from x1c.redhat.com ([10.3.112.15]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tA626aJd005446; Thu, 5 Nov 2015 21:06:37 -0500 X-CudaMail-Envelope-Sender: rbryant@redhat.com From: Russell Bryant To: dev@openvswitch.org X-CudaMail-MID: CM-V3-1104069949 X-CudaMail-DTE: 110515 X-CudaMail-Originating-IP: 209.132.183.28 Date: Thu, 5 Nov 2015 21:06:32 -0500 X-ASG-Orig-Subj: [##CM-V3-1104069949##][RFC] Extremely crude conntrack resubmit test case Message-Id: <1446775592-6973-1-git-send-email-rbryant@redhat.com> In-Reply-To: <563BA1D6.7000206@redhat.com> References: <563BA1D6.7000206@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-GBUdb-Analysis: 0, 209.132.183.28, Ugly c=0.264319 p=-0.0769231 Source Normal X-MessageSniffer-Rules: 0-0-0-8382-c X-Barracuda-Connect: UNKNOWN[192.168.14.3] X-Barracuda-Start-Time: 1446775610 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using per-user scores of TAG_LEVEL=3.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=BSF_SC5_MJ1963, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.24151 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Cc: jpettit@gmail.com Subject: [ovs-dev] [RFC] Extremely crude conntrack resubmit test case X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" This patch includes a really crude test case demonstrating the problem I'm seeing with resubmitting to a table that does ct() multiple times. It only seems to work on the first resubmit. The test case is REALLY crude, but I think it shows the issue. The test case will always fail as written so I can look at the flows. I run this with: $ sudo make check-kmod TESTSUITEFLAGS="-k resubmit -v" The interesting part is the flows output at the end. Here's what I see: > cookie=0x0, duration=1.037s, table=0, n_packets=2, n_bytes=84, priority=150,arp actions=NORMAL > cookie=0x0, duration=1.037s, table=0, n_packets=3, n_bytes=266, priority=100,in_port=1 actions=drop > cookie=0x0, duration=1.037s, table=0, n_packets=2, n_bytes=168, priority=100,in_port=2 actions=drop > cookie=0x0, duration=1.036s, table=0, n_packets=1, n_bytes=98, priority=100,ip,in_port=LOCAL actions=load:0x1->NXM_NX_REG0[0..15],resubmit(,1),load:0x2->NXM_NX_REG0[0..15],resubmit(,1) > cookie=0x0, duration=1.036s, table=0, n_packets=1, n_bytes=78, priority=1 actions=drop > cookie=0x0, duration=1.035s, table=1, n_packets=1, n_bytes=98, priority=100,ip actions=ct(table=2,zone=NXM_NX_REG0[0..15]) > cookie=0x0, duration=1.035s, table=2, n_packets=1, n_bytes=98, priority=100,ip,reg0=0x1 actions=output:1 > cookie=0x0, duration=1.034s, table=2, n_packets=0, n_bytes=0, priority=100,ip,reg0=0x2 actions=output:2 There is a flow in table 0 that resubmits to table 1 twice. It should result in the packet being output to ports 1 and 2 in table 2. It only hits tables 1 and 2 once, which is the first resubmit from the flow in table 0. I'm running this in a new VM and the following message seen in my OpenStack test environment does *not* show up at all in this environment: "openvswitch: ovs-system: deferred action limit reached, drop recirc action". --- tests/system-traffic.at | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/system-traffic.at b/tests/system-traffic.at index 3b2de83..80b96c0 100644 --- a/tests/system-traffic.at +++ b/tests/system-traffic.at @@ -1266,3 +1266,43 @@ NS_CHECK_EXEC([at_ns0], [ping -s 3200 -q -c 3 -i 0.3 -w 2 10.1.1.100 | FORMAT_PI OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP + +AT_SETUP([conntrack - resubmit to ct multiple times]) +CHECK_CONNTRACK() + +OVS_TRAFFIC_VSWITCHD_START( + [set-fail-mode br0 secure -- ]) + +ADD_NAMESPACES(at_ns0, at_ns1) + +AT_CHECK([ip addr add dev br0 "10.1.1.1/24"]) +AT_CHECK([ip link set dev br0 up]) +on_exit 'ip addr del dev br0 "10.1.1.1/24"' +ADD_VETH(p0, at_ns0, br0, "10.1.1.2/24") +ADD_VETH(p1, at_ns1, br0, "10.1.1.3/24") + +AT_DATA([flows.txt], [dnl +table=0,priority=150,arp,action=normal +table=0,priority=100,in_port=1,action=drop +table=0,priority=100,in_port=2,action=drop +table=0,priority=100,ip,in_port=LOCAL,action=load:1->NXM_NX_REG0[[0..15]],resubmit(,1),load:2->NXM_NX_REG0[[0..15]],resubmit(,1) +table=0,priority=1,action=drop + +table=1,priority=100,ip,action=ct(table=2,zone=NXM_NX_REG0[[0..15]]) + +table=2,priority=100,ip,reg0=1,action=output:1 +table=2,priority=100,ip,reg0=2,action=output:2 +]) + +AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) + +AT_CHECK([ping -q -c 1 -w 1 -I 10.1.1.1 10.1.1.2 | FORMAT_PING], [0], [dnl +1 packets transmitted, 0 received, 100% packet loss, time 0ms +]) + +AT_CHECK([ovs-ofctl -O OpenFlow13 show br0 ; ovs-ofctl -O OpenFlow13 dump-flows br0 | cut -f3- -d','], [0], [dnl +always fail and show me the output +]) + +OVS_TRAFFIC_VSWITCHD_STOP +AT_CLEANUP