From patchwork Fri Mar 12 11:59:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 1451944 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.136; helo=smtp3.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=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=jpJQ0SO+; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Dxkrm336kz9sS8 for ; Fri, 12 Mar 2021 22:59:52 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 60E0B6FA78; Fri, 12 Mar 2021 11:59:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WbEnGIvQ-AWX; Fri, 12 Mar 2021 11:59:43 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTP id 32CB96FACA; Fri, 12 Mar 2021 11:59:42 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2C4ABC0019; Fri, 12 Mar 2021 11:59:40 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id CA232C0012 for ; Fri, 12 Mar 2021 11:59:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 8F57960679 for ; Fri, 12 Mar 2021 11:59:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SoZJrOA_QMB6 for ; Fri, 12 Mar 2021 11:59:37 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by smtp3.osuosl.org (Postfix) with ESMTPS id A3C7B60676 for ; Fri, 12 Mar 2021 11:59:37 +0000 (UTC) Received: by mail-ej1-x62d.google.com with SMTP id ox4so37228465ejb.11 for ; Fri, 12 Mar 2021 03:59:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cwsW6uWJ7889KuZrdkmcMKeVLeX6X/g6EjgZMNy+y90=; b=jpJQ0SO+kBSP9QHdOobQNJXFkZdf5kshAvYn9WGitM91SqLAjgs8lYexgdFCT10fgw j9HwiXSgBCl2krHNPaF1vmMg73EMErNnbuhILeBA+nQFjd6KhjK43f+SlsJ8fNw9EYRJ tyMLl8qkB+cLMjDfKZ2CMsrW+qND4BCOJXmVPawuCt/7PIt2jnUksnIyG/b6JpRecXXQ ozNEpdBzvNY9g4oIFwIqqlqCz0VBmcPge8w5Wzi9nxPj8pkXDlgGkgj9TuhFJlsRYP1k LCGhbYpIXke/LsD9OmUbWrbNML0i9epSqBbWa5i3wO66T7tLhseBJmZKqw9DIwpw1Y4e vIdQ== 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:mime-version:content-transfer-encoding; bh=cwsW6uWJ7889KuZrdkmcMKeVLeX6X/g6EjgZMNy+y90=; b=qt49yaHbYk34G0ugnmww4Z1jD7GEGSFXZr/2dghyVrqSvpldIFr5Brg1UxKx3dvBix cpNMmgJaiE/KvzP9xAO8HQjBCAadEqft9KfYESy11hbxPje5xC1O+pMhi9B5bKvd4C+8 0r8IblDWFxfjDAuq5aLkCiJuTct6VpYVJFAXYX79MDkz3LUGN1CnA5C+KJjRiEUVGFoA kn39BR4LRf+Je7f/dfGeOGngRyfuw+TTQ9uwZLU2l7DZ6cYN9TTSuQ7N6Rpq91gOCYmU zu9xP+FiRPkUqTNab06o1HUYiRaZELW2t+UdIW5Di8E8ZZ+OLFugdwzY/3sT+wEJPijD kkkw== X-Gm-Message-State: AOAM530e2aE/WVPa3i0EtYFsapUyx8+JdgF0fVVZ1pMvHVwbTSJ2xIzT 8E1edAwGqL/tm4U7+5Cz1xISDkhE2b27WxUundjd/Jmft1Qf6WKnqHZUMHju+im0A34b2NAW0TU vUa7JOtbEXTdcwN+kxGTbjM/lACsfITeW0PR7Eq3XLOi0ndqCr0B+++CTtWfK2f4rwXwdlmDqRg == X-Google-Smtp-Source: ABdhPJx0so/hHcmix1e6nraZ58z0kLNxX5AfGJg0YNiyifuFUVXXSzZdsknFrtk0i8mWcur4QhBbkA== X-Received: by 2002:a17:906:a0d3:: with SMTP id bh19mr8340573ejb.199.1615550375503; Fri, 12 Mar 2021 03:59:35 -0800 (PST) Received: from madeliefje.horms.nl ([2001:982:7ed1:403:9eeb:e8ff:fe0d:5b6a]) by smtp.gmail.com with ESMTPSA id r17sm2857401edx.1.2021.03.12.03.59.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 03:59:35 -0800 (PST) From: Simon Horman To: dev@openvswitch.org Date: Fri, 12 Mar 2021 12:59:17 +0100 Message-Id: <20210312115917.6838-3-simon.horman@netronome.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210312115917.6838-1-simon.horman@netronome.com> References: <20210312115917.6838-1-simon.horman@netronome.com> MIME-Version: 1.0 Cc: oss-drivers@netronome.com, Simon Horman , Tianyu Yuan , "Yong . Xu" Subject: [ovs-dev] [PATCH v2 2/2] testsuite: add test cases for ingress_policing parameters 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" From: Tianyu Yuan * Exercise OVS setting of ingress_policing parameters using ovs-vsctl and verify that the correct values are stored on OVSDB. * Verify the ingress_policing parameters with tc command. Also check offload and non-offload in tc software datapath based on tc filter type (matchall and basic). Example invocation: make check TESTSUITEFLAGS='-k ingress_policing' make check-offloads TESTSUITEFLAGS='-k ingress_policing' Signed-off-by: Tianyu Yuan Signed-off-by: Simon Horman Signed-off-by: Louis Peens --- tests/ovs-vsctl.at | 58 ++++++++++++++++++++++++++++++++ tests/system-offloads-traffic.at | 47 ++++++++++++++++++++++++++ 2 files changed, 105 insertions(+) diff --git a/tests/ovs-vsctl.at b/tests/ovs-vsctl.at index d2cb41403..790d46f18 100644 --- a/tests/ovs-vsctl.at +++ b/tests/ovs-vsctl.at @@ -1659,3 +1659,61 @@ AT_CHECK([grep "server name" ovsdb-server.log], [0], OVS_VSCTL_CLEANUP AT_CLEANUP + +dnl ---------------------------------------------------------------------- +AT_BANNER([set ingress policing test]) + +AT_SETUP([set ingress_policing_rate and ingress_policing_burst]) +AT_KEYWORDS([ingress_policing]) +OVS_VSCTL_SETUP +AT_CHECK([RUN_OVS_VSCTL_TOGETHER( + [add-br a], + [add-port a a1], + [set interface a1 ingress_policing_rate=100], + [set interface a1 ingress_policing_burst=10], + [list interface a1 > configured_interface_a1.txt])], + [0], []) +AT_CHECK( + [uuidfilt configured_interface_a1.txt], + [0], + [[ + + + +_uuid : <0> +admin_state : [] +bfd : {} +bfd_status : {} +cfm_fault : [] +cfm_fault_status : [] +cfm_flap_count : [] +cfm_health : [] +cfm_mpid : [] +cfm_remote_mpids : [] +cfm_remote_opstate : [] +duplex : [] +error : [] +external_ids : {} +ifindex : [] +ingress_policing_burst: 10 +ingress_policing_rate: 100 +lacp_current : [] +link_resets : [] +link_speed : [] +link_state : [] +lldp : {} +mac : [] +mac_in_use : [] +mtu : [] +mtu_request : [] +name : a1 +ofport : [] +ofport_request : [] +options : {} +other_config : {} +statistics : {} +status : {} +type : "" +]]) +OVS_VSCTL_CLEANUP +AT_CLEANUP diff --git a/tests/system-offloads-traffic.at b/tests/system-offloads-traffic.at index 4f601ef93..b9cd29c95 100644 --- a/tests/system-offloads-traffic.at +++ b/tests/system-offloads-traffic.at @@ -70,3 +70,50 @@ AT_CHECK([ovs-appctl upcall/show | grep -E "offloaded flows : [[1-9]]"], [0], [i OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP + +AT_SETUP([offloads - set ingress_policing_rate and ingress_policing_burst - offloads disabled]) +AT_KEYWORDS([ingress_policing]) +OVS_TRAFFIC_VSWITCHD_START() +AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:hw-offload=false]) +AT_CHECK([ovs-ofctl add-flow br0 "actions=normal"]) +ADD_NAMESPACES(at_ns0) +ADD_VETH(p0, at_ns0, br0, "10.1.1.1/24") +AT_CHECK([ovs-vsctl set interface ovs-p0 ingress_policing_rate=100]) +AT_CHECK([ovs-vsctl set interface ovs-p0 ingress_policing_burst=10]) +AT_CHECK([ovs-vsctl list open | grep other_config > other_config.txt]) +AT_CHECK([cat other_config.txt],[0], + [other_config : {hw-offload="false"} +]) +AT_CHECK([tc -s -d filter show dev ovs-p0 ingress |grep rate| awk '{a=index($0,"rate");b=index($0,"mtu");print substr($0,a,b-a-1)}' > tc_ovs-p0.txt ],[0],[]) +AT_CHECK([cat tc_ovs-p0.txt],[0], + [rate 100Kbit burst 1280b +]) +AT_CHECK([tc -s -d filter show dev ovs-p0 ingress | grep basic | head -n 1 | awk '{a=index($0,"basic");print substr($0,a,5)}'| head -n 1],[0], + [basic +]) +OVS_TRAFFIC_VSWITCHD_STOP +AT_CLEANUP + + +AT_SETUP([offloads - set ingress_policing_rate and ingress_policing_burst - offloads enabled]) +AT_KEYWORDS([ingress_policing]) +OVS_TRAFFIC_VSWITCHD_START() +AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:hw-offload=true]) +AT_CHECK([ovs-ofctl add-flow br0 "actions=normal"]) +ADD_NAMESPACES(at_ns0) +ADD_VETH(p0, at_ns0, br0, "10.1.1.1/24") +AT_CHECK([ovs-vsctl set interface ovs-p0 ingress_policing_rate=100]) +AT_CHECK([ovs-vsctl set interface ovs-p0 ingress_policing_burst=10]) +AT_CHECK([ovs-vsctl list open | grep other_config > other_config.txt]) +AT_CHECK([cat other_config.txt],[0], + [other_config : {hw-offload="true"} +]) +AT_CHECK([tc -s -d filter show dev ovs-p0 ingress | grep rate| awk '{a=index($0,"rate");b=index($0,"mtu");print substr($0,a,b-a-1)}' > tc_ovs-p0.txt ],[0],[]) +AT_CHECK([cat tc_ovs-p0.txt],[0], + [rate 100Kbit burst 1280b +]) +AT_CHECK([tc -s -d filter show dev ovs-p0 ingress | grep matchall | head -n 1 | awk '{a=index($0,"matchall");print substr($0,a,8)}'| head -n 1],[0], + [matchall +]) +OVS_TRAFFIC_VSWITCHD_STOP +AT_CLEANUP