From patchwork Wed Jan 10 12:40:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ales Musil X-Patchwork-Id: 1884970 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=DW8rxC1U; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4T96q00hHYz1yP3 for ; Wed, 10 Jan 2024 23:40:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 28EA44215A; Wed, 10 Jan 2024 12:40:57 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 28EA44215A Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=DW8rxC1U X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HbRSgactSE_i; Wed, 10 Jan 2024 12:40:56 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id A9E284218D; Wed, 10 Jan 2024 12:40:54 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org A9E284218D Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 83E8FC0DD2; Wed, 10 Jan 2024 12:40:53 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0E620C0DD2 for ; Wed, 10 Jan 2024 12:40:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id C518642117 for ; Wed, 10 Jan 2024 12:40:51 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org C518642117 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BHpYaPBOP39F for ; Wed, 10 Jan 2024 12:40:51 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id 0F85542101 for ; Wed, 10 Jan 2024 12:40:50 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 0F85542101 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704890449; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hry6K5FJIHi089AiJ4C7V9wgMaeDBe8jRKTr9wAUImo=; b=DW8rxC1UvmxjxZ9nej+1lR83NbG+okH1x0djmopf7qZWk1OqYTMfC4c9K04giLsF+tSbq3 ITh6DFJQAoCDYRRM71nx+BpAsPYbV1Ujz9hcYoQBRCzTHfzlrngU4K6NOJs7LYjrVeaEYA ADO3ePT/bh0jGQpM/GqRsdrPp/ybWPc= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-282-515t57skOAiJBN3VPoWp2w-1; Wed, 10 Jan 2024 07:40:48 -0500 X-MC-Unique: 515t57skOAiJBN3VPoWp2w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 82E2D380628D for ; Wed, 10 Jan 2024 12:40:48 +0000 (UTC) Received: from amusil.redhat.com (unknown [10.45.225.132]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B6CA40C6EB9; Wed, 10 Jan 2024 12:40:47 +0000 (UTC) From: Ales Musil To: dev@openvswitch.org Date: Wed, 10 Jan 2024 13:40:45 +0100 Message-ID: <20240110124045.778257-2-amusil@redhat.com> In-Reply-To: <20240110124045.778257-1-amusil@redhat.com> References: <20240110124045.778257-1-amusil@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: dceara@redhat.com Subject: [ovs-dev] [PATCH ovn 2/2] system-tests: Wait for the meter in CoPP tests X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" The CoPP test modifies a meter from drop=1 to drop=10, there are two issues with this change: 1) It takes some time for this change to propagate into OvS. 2) Depending on the timing the 10 packet limit might not fit into single pktps bucket. To address those issues lower the pktps to 5, this has lower chance for the bucket to overflow into the next second. Also wait for OvS to receive the meter update and the meter stats reset. One thing to note is that even with this change the test can still fail with more packets being allowed through than expected, however the chance is highly reduced. For comparison, the test was failing on ARM in ~1/5 of runs. After this change there wasn't single failure in a loop with 100 runs. Signed-off-by: Ales Musil Acked-by: Mark Michelson --- tests/system-ovn.at | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/system-ovn.at b/tests/system-ovn.at index 3a692e341..7f240fef0 100644 --- a/tests/system-ovn.at +++ b/tests/system-ovn.at @@ -7355,7 +7355,8 @@ rm -f reject.pcap # Let's update the meter NS_EXEC([sw01], [tcpdump -l -n -i sw01 icmp -Q in > reject.pcap &]) -check ovn-nbctl --may-exist --wait=hv meter-add acl-meter drop 10 pktps 0 +check ovn-nbctl --may-exist --wait=hv meter-add acl-meter drop 5 pktps 0 +OVS_WAIT_UNTIL([ovs-ofctl -O OpenFlow15 meter-stats br-int | grep -q packet_count:0]) ip netns exec sw01 scapy -H <<-EOF p = IP(src="192.168.1.2", dst="192.168.1.1") / UDP(dport = 12345) / Raw(b"X"*64) send (p, iface='sw01', loop = 0, verbose = 0, count = 40) @@ -7364,7 +7365,7 @@ EOF # 10pps OVS_WAIT_UNTIL([ n_reject=$(grep unreachable reject.pcap | wc -l) - test "${n_reject}" = "10" + test "${n_reject}" = "5" ]) kill $(pidof tcpdump)