From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,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 320C3C43381 for ; Thu, 28 Mar 2019 12:12:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0194A2075E for ; Thu, 28 Mar 2019 12:12:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="X1fnYF7+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726443AbfC1MMc (ORCPT ); Thu, 28 Mar 2019 08:12:32 -0400 Received: from mail-eopbgr80057.outbound.protection.outlook.com ([40.107.8.57]:55059 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726311AbfC1MMa (ORCPT ); Thu, 28 Mar 2019 08:12:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LBgpGHJc2uYsQaT5ZiL1S+qypNYypAps4+4Ombs3b7o=; b=X1fnYF7+V/qLdsloHf2NEly2Nu+ZLoNEteJ9QWEuz7J4sz37qomIIRcTjlhZLnmR9iBS+00gxxI3aKkHTiqhZ7v7n4RR6MQiUVE9vK6Ync0fWf9uyPaj33+aKzQK1LAb+wHqAXr3ko84HPL27f26N+tz/UoUlinMLQkh7haIWSo= Received: from AM0PR05MB6100.eurprd05.prod.outlook.com (20.178.119.209) by AM0PR05MB4307.eurprd05.prod.outlook.com (52.134.91.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.17; Thu, 28 Mar 2019 12:12:25 +0000 Received: from AM0PR05MB6100.eurprd05.prod.outlook.com ([fe80::85ee:723:721e:51f9]) by AM0PR05MB6100.eurprd05.prod.outlook.com ([fe80::85ee:723:721e:51f9%4]) with mapi id 15.20.1730.019; Thu, 28 Mar 2019 12:12:25 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , mlxsw , Petr Machata , Ido Schimmel Subject: [PATCH net-next 7/9] selftests: mlxsw: qos_mc_aware: Configure shared buffers Thread-Topic: [PATCH net-next 7/9] selftests: mlxsw: qos_mc_aware: Configure shared buffers Thread-Index: AQHU5V+Bw4flIO7HuE+VdoFkagejTw== Date: Thu, 28 Mar 2019 12:12:25 +0000 Message-ID: <20190328121144.22911-8-idosch@mellanox.com> References: <20190328121144.22911-1-idosch@mellanox.com> In-Reply-To: <20190328121144.22911-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P265CA0425.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a0::29) To AM0PR05MB6100.eurprd05.prod.outlook.com (2603:10a6:208:12e::17) authentication-results: spf=none (sender IP is ) smtp.mailfrom=idosch@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 61fa28be-1820-45d2-8cb3-08d6b376a3c9 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM0PR05MB4307; x-ms-traffictypediagnostic: AM0PR05MB4307: x-microsoft-antispam-prvs: x-forefront-prvs: 0990C54589 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(346002)(376002)(136003)(39860400002)(396003)(189003)(199004)(26005)(6506007)(11346002)(386003)(2616005)(446003)(186003)(68736007)(4326008)(52116002)(102836004)(6436002)(66066001)(99286004)(14454004)(2906002)(86362001)(107886003)(53936002)(6916009)(1076003)(71200400001)(71190400001)(76176011)(476003)(486006)(5660300002)(14444005)(256004)(25786009)(8676002)(2501003)(81166006)(1730700003)(36756003)(81156014)(3846002)(6512007)(316002)(50226002)(106356001)(5640700003)(105586002)(54906003)(2351001)(8936002)(305945005)(97736004)(6116002)(478600001)(7736002)(6486002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR05MB4307;H:AM0PR05MB6100.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: hwD1UqRP99lZrMV4K5Q9psdsEremNpiNr7yBKrMpTts3wViqr+cVTKENGw01pnsjuM67O+9dTE4EtYPit1N1kuGsyF7x0z0yU4p7tomikm9e4KfsJQzEnpQEcGGbO7Iwy2KVneklEtaLu+NMV6s5dzN1DTXBiqWUSsxhaMZNsiJKv63k7/h4jnSFMubqir4Rd3iX9ycckL30Lb+XuVR+ZEnoc5k2EmJcCMNdt1JGH8Z+gCnEvEhXiQ188mVzFGSzGY6K3Pa01yYmW89clIgBe3n/QN3SIaBIBnWMBRULE+aaebpY3wfmw2cK5W96oyDZmqBrOeO5JTGDad84dhGUYQj2t/mPkQL4B9yR9HX8deWy6AW66VP+LLMCspVwW84LNfdrptBSKptvI8O7UaspEnVL9zO/SNqWxOT5NMyISNU= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 61fa28be-1820-45d2-8cb3-08d6b376a3c9 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Mar 2019 12:12:25.7633 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4307 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Petr Machata This test runs two streams of traffic from two independent ports to create congestion on one egress port. It is necessary to configure the shared buffer thresholds correctly, to make sure that there is traffic from both streams in the shared buffer. Only then can the test actually test prioritization among these streams. Without this configuration, it is possible, that one of the streams takes all of port-pool quota, and the other stream is not even admitted, thus invalidating the result. On Spectrum-1, this is not a problem, because MC traffic uses a separate pool. But for Spectrum-2, MC and UC share the same pool, and the correct configuration is important. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel --- .../drivers/net/mlxsw/qos_mc_aware.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh b/to= ols/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh index 117f6f35d72f..2e17fe3b4872 100755 --- a/tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh @@ -67,6 +67,7 @@ lib_dir=3D$(dirname $0)/../../../net/forwarding =20 NUM_NETIFS=3D6 source $lib_dir/lib.sh +source $lib_dir/devlink_lib.sh =20 h1_create() { @@ -140,10 +141,28 @@ switch_create() ip link set dev br111 up ip link set dev $swp2.111 master br111 ip link set dev $swp3.111 master br111 + + # Make sure that ingress quotas are smaller than egress so that there is + # room for both streams of traffic to be admitted to shared buffer. + devlink_port_pool_th_set $swp1 0 5 + devlink_tc_bind_pool_th_set $swp1 0 ingress 0 5 + + devlink_port_pool_th_set $swp2 0 5 + devlink_tc_bind_pool_th_set $swp2 1 ingress 0 5 + + devlink_port_pool_th_set $swp3 4 12 } =20 switch_destroy() { + devlink_port_pool_th_restore $swp3 4 + + devlink_tc_bind_pool_th_restore $swp2 1 ingress + devlink_port_pool_th_restore $swp2 0 + + devlink_tc_bind_pool_th_restore $swp1 0 ingress + devlink_port_pool_th_restore $swp1 0 + ip link del dev br111 ip link del dev br1 =20 --=20 2.20.1