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,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 054DDC282D5 for ; Wed, 30 Jan 2019 08:58:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B6F042087F for ; Wed, 30 Jan 2019 08:58:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="wC3BBw3p" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730428AbfA3I65 (ORCPT ); Wed, 30 Jan 2019 03:58:57 -0500 Received: from mail-eopbgr130089.outbound.protection.outlook.com ([40.107.13.89]:52448 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726452AbfA3I6z (ORCPT ); Wed, 30 Jan 2019 03:58:55 -0500 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=bByp1Ow1M5Bz+VyavgBF4QIN4gXNaoGf7FiiyZ1NhWs=; b=wC3BBw3p4yg7KcFpQx8wE5mCnFWJf46fPvE6lGqiXTPxfw9VXn59PlYJTbr8KuU8AFxHHGadYWYshBWXbxSLfNnkrAimcmKU4jupcFjfViJKQNIGAzjoZGd9A5Tk+IPRSaHbTLlSSf66ZIygPris2JoBJ4kmgtp8ffV6zluWGgY= Received: from DB7PR05MB4940.eurprd05.prod.outlook.com (20.176.235.152) by DB7PR05MB5211.eurprd05.prod.outlook.com (20.178.41.223) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.19; Wed, 30 Jan 2019 08:58:37 +0000 Received: from DB7PR05MB4940.eurprd05.prod.outlook.com ([fe80::6161:97fd:d315:7b07]) by DB7PR05MB4940.eurprd05.prod.outlook.com ([fe80::6161:97fd:d315:7b07%6]) with mapi id 15.20.1558.023; Wed, 30 Jan 2019 08:58:37 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , Jiri Pirko , mlxsw , Ido Schimmel Subject: [PATCH net-next 4/5] selftests: spectrum-2: Fix multiple_masks_test Thread-Topic: [PATCH net-next 4/5] selftests: spectrum-2: Fix multiple_masks_test Thread-Index: AQHUuHn81duWz24hRkCCvnb2n5pr6w== Date: Wed, 30 Jan 2019 08:58:36 +0000 Message-ID: <20190130085813.32161-5-idosch@mellanox.com> References: <20190130085813.32161-1-idosch@mellanox.com> In-Reply-To: <20190130085813.32161-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P193CA0024.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:3e::37) To DB7PR05MB4940.eurprd05.prod.outlook.com (2603:10a6:10:1e::24) 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-microsoft-exchange-diagnostics: 1;DB7PR05MB5211;6:8Z3woqiYIRISi0eh8utA8UNNGCADLNkLPL190TGtupqpCVOYiyQOOpwR29dmhIna5z0oIdaqL2D+3Edh7y/13cvOaDlMewti0TIGPpN8MdUZ9eDii0Q0sNi7x3YgDC+8akQVgyzf+ljnKnsyFWRMHXX3wnmKWR44c2GzTHRyraO0WKniB0aQqAiSWNJFEuY6sSuZ+0cHmJoKGX2itXHINVQ5DzJH4FgMftm5GQv4i4kIGSmC+qt8M1D+zMhRxDR6YZQhUxb7SOFOQg4t0uKC9TkemXXSlc/VJZpWVX0fXv3QbZqDjVwsQ6EbTV5EQSsJuWnoaZ9AwhsGcxFU/RXfbvCdV2XUOL8uWVFJ1xRyiBRGKDCEvLbFAcH2pwpCU1AdO1g8RdNC9f+z2cPJH1LvWbVrTgmEcYXZ0Sk+xampdaa/hlIxetwUGcqVB8Y+25amNz/dqQyNP7LULcqlH1qs2Q==;5:ftxd806GtDnUN2k4vDcUIP8iLZQhOpVHNMaz/XnRyTgXDaXTzqwH4TCYvBpiDMZnjxI8Ki49dG1g1ppG+h5vwoVi3sKEq7jaa6gHeEBiO0+sC6x+/h1eOqqgpiN3qIjhdzG+X3Bhw8K/3ba1eUoOURhF9AT78QbeGJyr3JmyUgnibpQTMdQTvtQOGpdWp4xL7Xg4jA2Dy73vnDY2UzaiPw==;7:F/C73pANPzd7J0RJu0HzIHRqEQZTpfHsaT9x5JcEZtIirqjBLGhxF1uHylZQbuUlamJwBbh9pJlOQZoXjZW6/ns1hun+Du9X2Xg0vEwQ25GnU3u4/8EAmPF8ZoeVzE03qQlywlm0GHhQRFwDfbamhg== x-ms-office365-filtering-correlation-id: 88a1e4ba-9d9d-4f5e-1359-08d686911e8c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020);SRVR:DB7PR05MB5211; x-ms-traffictypediagnostic: DB7PR05MB5211: x-microsoft-antispam-prvs: x-forefront-prvs: 0933E9FD8D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(396003)(346002)(366004)(39860400002)(376002)(189003)(199004)(66066001)(4326008)(68736007)(8936002)(2351001)(478600001)(386003)(6506007)(2906002)(102836004)(8676002)(36756003)(186003)(1730700003)(81156014)(6512007)(81166006)(5640700003)(107886003)(6916009)(106356001)(25786009)(6486002)(105586002)(50226002)(26005)(52116002)(6436002)(486006)(76176011)(53936002)(3846002)(6116002)(99286004)(2501003)(11346002)(316002)(446003)(54906003)(305945005)(14454004)(256004)(1076003)(7736002)(476003)(2616005)(71190400001)(71200400001)(86362001)(97736004)(473944003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB7PR05MB5211;H:DB7PR05MB4940.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: GwN5B9VC6zmZ9GofTuVPCsWBegg4dEUrUDm94cWZg/pGaAiNSxkFop0c3eygzBqwEvqqJln2XM3YDG5uNWdPduTpCVj95NmN+92cQRXDrpJnqqtBOm/1VIfJuSS7FokOgpPx6Yn9uKZcnmp5aUvOiUW3EW5ntF+0//g0zOrPIKUyxNbfrwVcFIVI6n09I/tKxknNYyPMeInYAaF8JcQv22CmyEO4ax8WzKwME3S/EaSPh4QqFDAYpH2Gfhwcalta3F981dYP4gKG9WWlI4usl+/KRY7+7EPUzEef+AL2XEUMS9xD/gql845OU5Q4TQ7xDPTRD87Tc7/7PnIeA7h+XMErfJwDUJ5LfBXMh4fuPwfzn5QR/drvEy8QSALK7AvTVy1v0yycQQ3nEP7b60PerdBTRWJ8NLsHCe6aermo/aY= 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: 88a1e4ba-9d9d-4f5e-1359-08d686911e8c X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2019 08:58:35.4816 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB5211 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jiri Pirko With recent fix in C-TCAM spillage for delta masks, the test stops to be falsely positive. So fix it not to use delta by adding src_ip bits to the masks. Alongside with that, use C-TCAM spill trace to see when the spillage actually happens. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel --- .../drivers/net/mlxsw/spectrum-2/tc_flower.sh | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower= .sh b/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower.sh index ed1ae902f2af..73a35ca827ac 100755 --- a/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower.sh @@ -231,20 +231,38 @@ multiple_masks_test() # spillage is performed correctly and that the right filter is # matched =20 + if [[ "$tcflags" !=3D "skip_sw" ]]; then + return 0; + fi + local index =20 RET=3D0 =20 NUM_MASKS=3D32 + NUM_ERPS=3D16 BASE_INDEX=3D100 =20 for i in $(eval echo {1..$NUM_MASKS}); do index=3D$((BASE_INDEX - i)) =20 - tc filter add dev $h2 ingress protocol ip pref $index \ - handle $index \ - flower $tcflags dst_ip 192.0.2.2/${i} src_ip 192.0.2.1 \ - action drop + if ((i > NUM_ERPS)); then + exp_hits=3D1 + err_msg=3D"$i filters - C-TCAM spill did not happen when it was expecte= d" + else + exp_hits=3D0 + err_msg=3D"$i filters - C-TCAM spill happened when it should not" + fi + + tp_record "mlxsw:mlxsw_sp_acl_atcam_entry_add_ctcam_spill" \ + "tc filter add dev $h2 ingress protocol ip pref $index \ + handle $index \ + flower $tcflags \ + dst_ip 192.0.2.2/${i} src_ip 192.0.2.1/${i} \ + action drop" + tp_check_hits "mlxsw:mlxsw_sp_acl_atcam_entry_add_ctcam_spill" \ + $exp_hits + check_err $? "$err_msg" =20 $MZ $h1 -c 1 -p 64 -a $h1mac -b $h2mac -A 192.0.2.1 \ -B 192.0.2.2 -t ip -q --=20 2.20.1