From patchwork Thu Jan 21 09:42:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tonghao Zhang X-Patchwork-Id: 1429699 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=vXalfy87; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DLyD20KwWz9sTD for ; Thu, 21 Jan 2021 20:44:50 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 9D58A871AF; Thu, 21 Jan 2021 09:44:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gNQKlFM82c0B; Thu, 21 Jan 2021 09:44:47 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id B6539871C4; Thu, 21 Jan 2021 09:44:47 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9E239C088B; Thu, 21 Jan 2021 09:44:47 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id A1FCAC088B for ; Thu, 21 Jan 2021 09:44:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 9E19A86BE9 for ; Thu, 21 Jan 2021 09:44:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7cLYx3KvQpL5 for ; Thu, 21 Jan 2021 09:44:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-vs1-f51.google.com (mail-vs1-f51.google.com [209.85.217.51]) by whitealder.osuosl.org (Postfix) with ESMTPS id 8347986CEB for ; Thu, 21 Jan 2021 09:44:38 +0000 (UTC) Received: by mail-vs1-f51.google.com with SMTP id o186so719527vso.1 for ; Thu, 21 Jan 2021 01:44:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oNNWJGqXWSRH3sBYqTCDhdZPPWEMNqogBaoI461WgLI=; b=vXalfy87P7ngTGl5t8rKd7ezxcdIkEZQ3/xkwCnz9SqRg2loNkY3prwF+NuFCdtFiS /yd8r0WcSB90h8U/lsMxjasGE3cw3mj0MudiAj/htaM9qnBLTNzDlnr4VllUoAI6BmXt z4mHsRDpMOFgP21n99IYAr4ogMqHmWGTnMuB6e+AYCwd41YS7+vic2UiEa/lHhECKxnA y+wy/qSYdAneHc7KGmfmDE01CtJggLmjgDExNkkLjnNZmVUrqLfrS6fvED8h+g/ZUhpK wepZr3jktbl2POArAv01IRIq6COMTxUayBkP5AHAxabqk02B9gECKD1a9sWA9JqOthjc fD7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=oNNWJGqXWSRH3sBYqTCDhdZPPWEMNqogBaoI461WgLI=; b=l81tda/2NJV6h6RWVolj7umbr45qyNlQB5Rzm0cJYvbhmHVKtxbD5pE2Ot+PX0F7Gn 1gEW4pTlQzQaDiOM4eZJCFzG0mezNLLFozc8FE/zjcFKvzpPP1GE9p946e6jkaY1dTJK jRg9ok2V61+Eyt+RzelPKAcKgfJA+PTRT+WXDsETH1Md4nYoEw17sasx/V/qFeU7AG3K 4b9ovHkGL3EIqYUCwVMEdQvUe/oqEWvktpyHPFtgMdrpxL11pq4mz3KD9qugd4qoGYtK p5820hkIVHNcP5lJkOIPKns1VxYx6MdTZKe4k84W0SOnUhdMjJCRhiwqA/v6afy+ppHQ k/6g== X-Gm-Message-State: AOAM533WDdo6r6X9Nnlbw3gLmXALaAVfdABt0RffKZbPxFr3wwXJ1VlB f9A8WrMYjGwecUpcGaVX7kw= X-Google-Smtp-Source: ABdhPJy844cAz9eOt54NTw+ow6E7t5WNLFb1CAzwY4oK9M1ZBsoFuIX3orWSwtHLQL8KxhKCsj30hA== X-Received: by 2002:a05:6102:93:: with SMTP id t19mr9211234vsp.57.1611222277546; Thu, 21 Jan 2021 01:44:37 -0800 (PST) Received: from localhost.localdomain ([50.236.19.102]) by smtp.gmail.com with ESMTPSA id 84sm688230vkz.34.2021.01.21.01.44.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jan 2021 01:44:37 -0800 (PST) From: xiangxia.m.yue@gmail.com To: i.maximets@ovn.org, blp@ovn.org, pshelar@ovn.org Date: Thu, 21 Jan 2021 17:42:10 +0800 Message-Id: <20210121094210.55038-3-xiangxia.m.yue@gmail.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20210121094210.55038-1-xiangxia.m.yue@gmail.com> References: <20210121094210.55038-1-xiangxia.m.yue@gmail.com> Cc: dev@openvswitch.org Subject: [ovs-dev] [PATCH ovs v2 3/3] tests/dpif-netdev: Update dpif-netdev meter testcase. 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: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Tonghao Zhang The buckets used was changed, and now dpif-netdev support burst_size, change the testcase. Signed-off-by: Tonghao Zhang --- tests/dpif-netdev.at | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/dpif-netdev.at b/tests/dpif-netdev.at index 2862a3c9b..3aa9c0cba 100644 --- a/tests/dpif-netdev.at +++ b/tests/dpif-netdev.at @@ -282,7 +282,7 @@ OVS_VSWITCHD_START( AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) AT_CHECK([ovs-ofctl -O OpenFlow13 add-meter br0 'meter=1 pktps burst stats bands=type=drop rate=1 burst_size=1']) -AT_CHECK([ovs-ofctl -O OpenFlow13 add-meter br0 'meter=2 kbps burst stats bands=type=drop rate=1 burst_size=2']) +AT_CHECK([ovs-ofctl -O OpenFlow13 add-meter br0 'meter=2 kbps burst stats bands=type=drop rate=1 burst_size=1']) AT_CHECK([ovs-ofctl -O OpenFlow13 add-flow br0 'in_port=1 action=meter:1,7']) AT_CHECK([ovs-ofctl -O OpenFlow13 add-flow br0 'in_port=7 action=meter:2,1']) AT_CHECK([ovs-ofctl add-flow br1 'in_port=2 action=8']) @@ -295,7 +295,7 @@ meter=1 pktps burst stats bands= type=drop rate=1 burst_size=1 meter=2 kbps burst stats bands= -type=drop rate=1 burst_size=2 +type=drop rate=1 burst_size=1 ]) ovs-appctl time/warp 5000 @@ -312,14 +312,14 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),packet_type(ns=0,id=0), sleep 1 # wait for forwarders process packets # Meter 1 is measuring packets, allowing one packet per second with -# bursts of one packet, so 4 out of 5 packets should hit the drop +# bursts of one packet, so 3 out of 5 packets should hit the drop # band. -# Meter 2 is measuring kbps, with burst size 2 (== 2000 bits). 4 packets +# Meter 2 is measuring kbps, with burst size 1 ( = 2000bits). 4 packets # (240 bytes == 1920 bits) pass, but the last packet should hit the drop band. AT_CHECK([ovs-ofctl -O OpenFlow13 meter-stats br0 | strip_timers], [0], [dnl OFPST_METER reply (OF1.3) (xid=0x2): meter:1 flow_count:1 packet_in_count:5 byte_in_count:300 duration:0.0s bands: -0: packet_count:4 byte_count:240 +0: packet_count:3 byte_count:180 meter:2 flow_count:1 packet_in_count:5 byte_in_count:300 duration:0.0s bands: 0: packet_count:1 byte_count:60 @@ -343,13 +343,13 @@ sleep 1 # wait for forwarders process packets # Meter 1 is measuring packets, allowing one packet per second with # bursts of one packet, so all 5 of the new packets should hit the drop # band. -# Meter 2 is measuring kbps, with burst size 2 (== 2000 bits). After 500ms +# Meter 2 is measuring kbps, with burst size 1 (== 2000 bits). After 500ms # there should be space for 80 + 500 bits, so one new 60 byte (480 bit) packet # should pass, remaining 4 should hit the drop band. AT_CHECK([ovs-ofctl -O OpenFlow13 meter-stats br0 | strip_timers], [0], [dnl OFPST_METER reply (OF1.3) (xid=0x2): meter:1 flow_count:1 packet_in_count:10 byte_in_count:600 duration:0.0s bands: -0: packet_count:9 byte_count:540 +0: packet_count:8 byte_count:480 meter:2 flow_count:1 packet_in_count:10 byte_in_count:600 duration:0.0s bands: 0: packet_count:5 byte_count:300 @@ -360,7 +360,7 @@ ovs-appctl time/warp 5000 AT_CHECK([ ovs-appctl coverage/read-counter datapath_drop_meter ], [0], [dnl -14 +13 ]) AT_CHECK([cat ovs-vswitchd.log | filter_flow_install | strip_xout_keep_actions], [0], [dnl