From patchwork Thu Apr 28 14:56:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Phelan, Michael" X-Patchwork-Id: 1623718 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=QkZGMAhx; dkim-atps=neutral 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=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4KpzHF4Ggsz9s0r for ; Fri, 29 Apr 2022 00:57:13 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 288F760D63; Thu, 28 Apr 2022 14:57:12 +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 gwtWXdICQq-b; Thu, 28 Apr 2022 14:57:11 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 1615161066; Thu, 28 Apr 2022 14:57:10 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id DD27AC0032; Thu, 28 Apr 2022 14:57:09 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 43F1BC002D for ; Thu, 28 Apr 2022 14:57:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 2D22860B09 for ; Thu, 28 Apr 2022 14:57:08 +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 xFvyLOhcEPFl for ; Thu, 28 Apr 2022 14:57:06 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by smtp3.osuosl.org (Postfix) with ESMTPS id 6CDC86101C for ; Thu, 28 Apr 2022 14:57:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651157826; x=1682693826; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=okWozyfY7BHD95ndpbnkA35H/OJe1/10+bUBqstp8xA=; b=QkZGMAhxoD1qrM/Wk1QqbE50OPKb77iZ8BlTommwYGgYtbnVSfxgi7lk lXnsHz68chGCDdB2DOzfU1UzKoKXFV+97OMx1QWz1A7E0f6fSn6Me5pQ/ YRTcSMjD7Ru59CoxGkPruL0424yy5/tmPa43d/0OcY9N6Yu65IdKbRpO1 ifUxvyo03vdQo8Nn8QRI86ySgkY2oedy0GESDsZJnz7yP1MLz4BMsGiH7 jDsN5jCCo/sX2EKpdvpSHhiSbVbFLBpQnNSH9nsjTnzWut7l/0kfqcSDQ qV6wqUDH4z67vX5jGAHZft2HEgqoqA+AJiB4/r6A4RpzOdhlZJBToiZfn A==; X-IronPort-AV: E=McAfee;i="6400,9594,10330"; a="265162959" X-IronPort-AV: E=Sophos;i="5.91,295,1647327600"; d="scan'208";a="265162959" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2022 07:57:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,295,1647327600"; d="scan'208";a="581416337" Received: from silpixa00397517.ir.intel.com (HELO silpixa00397517.ger.corp.intel.com) ([10.237.223.109]) by orsmga008.jf.intel.com with ESMTP; 28 Apr 2022 07:57:03 -0700 From: Michael Phelan To: dev@openvswitch.org Date: Thu, 28 Apr 2022 14:56:28 +0000 Message-Id: <20220428145628.4171477-1-michael.phelan@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220404083203.2489400-1-michael.phelan@intel.com> References: <20220404083203.2489400-1-michael.phelan@intel.com> MIME-Version: 1.0 Cc: maxime.coquelin@redhat.com, david.marchand@redhat.com, Seamus Ryan Subject: [ovs-dev] [PATCH v2] tests: Add ovs-dpdk rate limiting unit 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" From: Seamus Ryan This adds 4 new unit tests to the 'check-dpdk' subsystem that will test rate limiting functionality. Signed-off-by: Seamus Ryan Signed-off-by: Michael Phelan Co-authored-by: Michael Phelan Acked-by: Aaron Conole --- v2: - Fixed dn1 typo & spacing issues. - Added check for removing burst and rate values. - Renamed tests to specify ingress policing. --- NEWS | 2 + tests/system-dpdk.at | 161 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 163 insertions(+) diff --git a/NEWS b/NEWS index 5bc8e6566..63c6a3009 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,8 @@ Post-v2.17.0 - OVSDB: * 'relay' service model now supports transaction history, i.e. honors the 'last-txn-id' field in 'monitor_cond_since' requests from clients. + - DPDK: + * Add rate limiting unit tests to DPDK testsuite. v2.17.0 - 17 Feb 2022 diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at index 7d2715c4a..74174f61e 100644 --- a/tests/system-dpdk.at +++ b/tests/system-dpdk.at @@ -222,6 +222,167 @@ OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [ AT_CLEANUP dnl -------------------------------------------------------------------------- + + +dnl -------------------------------------------------------------------------- +dnl Ingress policing create delete phy port +AT_SETUP([OVS-DPDK - Ingress policing create delete phy port]) +AT_KEYWORDS([dpdk]) + +OVS_DPDK_PRE_PHY_SKIP() +OVS_DPDK_START() + +dnl Add userspace bridge and attach it to OVS and add policer +AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev]) +AT_CHECK([ovs-vsctl add-port br10 phy0 -- set Interface phy0 type=dpdk options:dpdk-devargs=$(cat PCI_ADDR)], [], [stdout], [stderr]) +AT_CHECK([ovs-vsctl set interface phy0 ingress_policing_rate=10000 ingress_policing_burst=1000]) +AT_CHECK([ovs-vsctl show], [], [stdout]) +sleep 2 + +dnl check policer was created correctly +AT_CHECK([ovs-vsctl list interface phy0], [], [stdout]) +AT_CHECK([egrep 'ingress_policing_burst: 1000' stdout], [], [stdout]) + +AT_CHECK([ovs-vsctl list interface phy0], [], [stdout]) +AT_CHECK([egrep 'ingress_policing_rate: 10000' stdout], [], [stdout]) + +dnl remove policer +AT_CHECK([ovs-vsctl set interface phy0 ingress_policing_rate=0 ingress_policing_burst=0]) + +dnl check policer was removed correctly +AT_CHECK([ovs-vsctl list interface phy0], [], [stdout]) +AT_CHECK([egrep 'ingress_policing_burst: 0' stdout], [], [stdout]) + +AT_CHECK([ovs-vsctl list interface phy0], [], [stdout]) +AT_CHECK([egrep 'ingress_policing_rate: 0' stdout], [], [stdout]) + +dnl Clean up +AT_CHECK([ovs-vsctl del-port br10 phy0], [], [stdout], [stderr]) +OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [])") +AT_CLEANUP +dnl -------------------------------------------------------------------------- + + + +dnl -------------------------------------------------------------------------- +dnl Ingress policing create delete vport port +AT_SETUP([OVS-DPDK - Ingress policing create delete vport port]) +AT_KEYWORDS([dpdk]) + +OVS_DPDK_PRE_CHECK() +OVS_DPDK_START() + +dnl Add userspace bridge and attach it to OVS and add policer +AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev]) +AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set Interface dpdkvhostuserclient0 type=dpdkvhostuserclient options:vhost-server-path=$OVS_RUNDIR/dpdkvhostclient0], [], [stdout], [stderr]) +AT_CHECK([ovs-vsctl set interface dpdkvhostuserclient0 ingress_policing_rate=10000 ingress_policing_burst=1000]) +AT_CHECK([ovs-vsctl show], [], [stdout]) +sleep 2 + +dnl check policer was created correctly +AT_CHECK([ovs-vsctl list interface dpdkvhostuserclient0], [], [stdout]) +AT_CHECK([egrep 'ingress_policing_burst: 1000' stdout], [], [stdout]) + +AT_CHECK([ovs-vsctl list interface dpdkvhostuserclient0], [], [stdout]) +AT_CHECK([egrep 'ingress_policing_rate: 10000' stdout], [], [stdout]) + +dnl remove policer +AT_CHECK([ovs-vsctl set interface dpdkvhostuserclient0 ingress_policing_rate=0 ingress_policing_burst=0]) + +dnl check policer was removed correctly +AT_CHECK([ovs-vsctl list interface dpdkvhostuserclient0], [], [stdout]) +AT_CHECK([egrep 'ingress_policing_burst: 0' stdout], [], [stdout]) + +AT_CHECK([ovs-vsctl list interface dpdkvhostuserclient0], [], [stdout]) +AT_CHECK([egrep 'ingress_policing_rate: 0' stdout], [], [stdout]) + +dnl Parse log file +AT_CHECK([grep "VHOST_CONFIG: vhost-user client: socket created" ovs-vswitchd.log], [], [stdout]) +AT_CHECK([grep "vHost User device 'dpdkvhostuserclient0' created in 'client' mode, using client socket" ovs-vswitchd.log], [], [stdout]) +AT_CHECK([grep "VHOST_CONFIG: $OVS_RUNDIR/dpdkvhostclient0: reconnecting..." ovs-vswitchd.log], [], [stdout]) + +dnl Clean up +AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr]) +OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [ +\@VHOST_CONFIG: failed to connect to $OVS_RUNDIR/dpdkvhostclient0: No such file or directory@d +])") +AT_CLEANUP +dnl -------------------------------------------------------------------------- + + + +dnl -------------------------------------------------------------------------- +dnl Ingress policing no policing rate +AT_SETUP([OVS-DPDK - Ingress policing no policing rate]) +AT_KEYWORDS([dpdk]) + +OVS_DPDK_PRE_CHECK() +OVS_DPDK_START() + +dnl Add userspace bridge and attach it to OVS and add policer +AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev]) +AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set Interface dpdkvhostuserclient0 type=dpdkvhostuserclient options:vhost-server-path=$OVS_RUNDIR/dpdkvhostclient0], [], [stdout], [stderr]) +AT_CHECK([ovs-vsctl set interface dpdkvhostuserclient0 ingress_policing_burst=1000]) +AT_CHECK([ovs-vsctl show], [], [stdout]) +sleep 2 + +dnl check policer was created correctly +AT_CHECK([ovs-vsctl list interface dpdkvhostuserclient0], [], [stdout]) +AT_CHECK([egrep 'ingress_policing_burst: 1000' stdout], [], [stdout]) + +AT_CHECK([ovs-vsctl list interface dpdkvhostuserclient0], [], [stdout]) +AT_CHECK([egrep 'ingress_policing_rate: 0' stdout], [], [stdout]) + + +dnl Parse log file +AT_CHECK([grep "VHOST_CONFIG: vhost-user client: socket created" ovs-vswitchd.log], [], [stdout]) +AT_CHECK([grep "vHost User device 'dpdkvhostuserclient0' created in 'client' mode, using client socket" ovs-vswitchd.log], [], [stdout]) +AT_CHECK([grep "VHOST_CONFIG: $OVS_RUNDIR/dpdkvhostclient0: reconnecting..." ovs-vswitchd.log], [], [stdout]) + +dnl Clean up +AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr]) +OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [ +\@VHOST_CONFIG: failed to connect to $OVS_RUNDIR/dpdkvhostclient0: No such file or directory@d +])") +AT_CLEANUP +dnl -------------------------------------------------------------------------- + + + +dnl -------------------------------------------------------------------------- +dnl Ingress policing no policing burst +AT_SETUP([OVS-DPDK - Ingress policing no policing burst]) +AT_KEYWORDS([dpdk]) + +OVS_DPDK_PRE_CHECK() +OVS_DPDK_START() + +dnl Add userspace bridge and attach it to OVS and add policer +AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev]) +AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set Interface dpdkvhostuserclient0 type=dpdkvhostuserclient options:vhost-server-path=$OVS_RUNDIR/dpdkvhostclient0], [], [stdout], [stderr]) +AT_CHECK([ovs-vsctl set interface dpdkvhostuserclient0 ingress_policing_rate=10000]) +AT_CHECK([ovs-vsctl show], [], [stdout]) +sleep 2 + +dnl check policer was created correctly +AT_CHECK([ovs-vsctl list interface dpdkvhostuserclient0], [], [stdout]) +AT_CHECK([egrep 'ingress_policing_rate: 10000' stdout], [], [stdout]) + +dnl Parse log file +AT_CHECK([grep "VHOST_CONFIG: vhost-user client: socket created" ovs-vswitchd.log], [], [stdout]) +AT_CHECK([grep "vHost User device 'dpdkvhostuserclient0' created in 'client' mode, using client socket" ovs-vswitchd.log], [], [stdout]) +AT_CHECK([grep "VHOST_CONFIG: $OVS_RUNDIR/dpdkvhostclient0: reconnecting..." ovs-vswitchd.log], [], [stdout]) + +dnl Clean up +AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr]) +OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [ +\@VHOST_CONFIG: failed to connect to $OVS_RUNDIR/dpdkvhostclient0: No such file or directory@d +])") +AT_CLEANUP +dnl -------------------------------------------------------------------------- + + + dnl -------------------------------------------------------------------------- dnl Add standard DPDK PHY port AT_SETUP([OVS-DPDK - MFEX Autovalidator])