From patchwork Sun Aug 23 08:06:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 262054 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E310EC433E1 for ; Sun, 23 Aug 2020 08:08:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF28C2075B for ; Sun, 23 Aug 2020 08:08:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="GTIJphto" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728563AbgHWIIH (ORCPT ); Sun, 23 Aug 2020 04:08:07 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:54473 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728121AbgHWIH6 (ORCPT ); Sun, 23 Aug 2020 04:07:58 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4578C5C0080; Sun, 23 Aug 2020 04:07:57 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 23 Aug 2020 04:07:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=1Ql38g1X/we1gQvRTy/kxvSnf59XZFWlpTE8Aj+T48E=; b=GTIJphto Tlkh91y8FiCSUhlEymi5U6fTXUICqSDfePpJIw5Reg5iFTppTWgMyFXGa+/PpF7Q ClY2DgPtd87o5fSmiPOCnyk5Ncz2sfriRFvn8/xDegoRw85WHGv+AuP3v+Kgwfgq tT6QVR6Puu5B7J03Ueo1xgAxUPCfnk6jx095DzNa/ECIRDwER6Qlom5lUZLYXKSf mGjh7+k9U93H0Vd5SNHUgjZFxT4rtGjDpFIZidt0NMVFR7HRBquxjUPg5Mrogr2t cyBeNFTVeUwHNtwoUZ39fXyGFaQKfbR3rYRTXggDx04NxaKq+K3pp0gebqXN5YtX R43Da2sVWe1nuQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudduiecutefuodetggdotefrodftvfcurf hrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertd dtnecuhfhrohhmpefkughoucfutghhihhmmhgvlhcuoehiughoshgthhesihguohhstghh rdhorhhgqeenucggtffrrghtthgvrhhnpeduteeiveffffevleekleejffekhfekhefgtd fftefhledvjefggfehgfevjeekhfenucfkphepjeelrddujeekrddufedurdefheenucev lhhushhtvghrufhiiigvpeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpehiughoshgthh esihguohhstghhrdhorhhg X-ME-Proxy: Received: from shredder.mtl.com (bzq-79-178-131-35.red.bezeqint.net [79.178.131.35]) by mail.messagingengine.com (Postfix) with ESMTPA id 5DEBD3280059; Sun, 23 Aug 2020 04:07:54 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, jiri@nvidia.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH net-next 6/7] selftests: mlxsw: Reduce runtime of tc-police scale test Date: Sun, 23 Aug 2020 11:06:27 +0300 Message-Id: <20200823080628.407637-7-idosch@idosch.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200823080628.407637-1-idosch@idosch.org> References: <20200823080628.407637-1-idosch@idosch.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Ido Schimmel Currently, the test takes about 626 seconds to complete because of an inefficient use of the device's TCAM. Reduce the runtime to 202 seconds by inserting all the flower filters with the same preference and mask, but with a different key. In particular, this reduces the deletion of the qdisc (which triggers the deletion of all the filters) from 66 seconds to 0.2 seconds. This prevents various netlink requests from user space applications (e.g., systemd-networkd) from timing-out because RTNL is not held for too long anymore. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko --- .../selftests/drivers/net/mlxsw/tc_police_scale.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw/tc_police_scale.sh b/tools/testing/selftests/drivers/net/mlxsw/tc_police_scale.sh index 4b96561c462f..3e3e06ea5703 100644 --- a/tools/testing/selftests/drivers/net/mlxsw/tc_police_scale.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/tc_police_scale.sh @@ -24,6 +24,13 @@ tc_police_switch_destroy() simple_if_fini $swp1 } +tc_police_addr() +{ + local num=$1; shift + + printf "2001:db8:1::%x" $num +} + tc_police_rules_create() { local count=$1; shift @@ -34,8 +41,9 @@ tc_police_rules_create() for ((i = 0; i < count; ++i)); do cat >> $TC_POLICE_BATCH_FILE <<-EOF filter add dev $swp1 ingress \ - prot ip \ - flower skip_sw \ + prot ipv6 \ + pref 1000 \ + flower skip_sw dst_ip $(tc_police_addr $i) \ action police rate 10mbit burst 100k \ conform-exceed drop/ok EOF