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=-3.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 BFC74C282D5 for ; Wed, 30 Jan 2019 08:58:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8DE4121473 for ; Wed, 30 Jan 2019 08:58:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="YWM7IuqS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728272AbfA3I6k (ORCPT ); Wed, 30 Jan 2019 03:58:40 -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 S1726452AbfA3I6k (ORCPT ); Wed, 30 Jan 2019 03:58:40 -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=MWjMud25HvptlCEZPSjeHFedj8p5mP17vGY8qo+YJhA=; b=YWM7IuqSHwLYsAWBsMHAMglx2DwWH2eP4jlcZcDTg3JFfkpsutWMeERsXnfJVa8GlTEUNbWeNbR0B/2+5O0aR+wWP8VduSUZUhLhRwxTX8b3Wa5iUsWkYHKr3riybiq4311ueVuml8jsXvyB6iPDrjMlUjgjEo7MiSZWS0Itbkw= 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:30 +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:30 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , Jiri Pirko , mlxsw , Ido Schimmel Subject: [PATCH net-next 0/5] mlxsw: spectrum_acl: Include delta bits into hashtable key Thread-Topic: [PATCH net-next 0/5] mlxsw: spectrum_acl: Include delta bits into hashtable key Thread-Index: AQHUuHn45u9Iyr+MjESJnWAxf/oDbg== Date: Wed, 30 Jan 2019 08:58:29 +0000 Message-ID: <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:S6xxFrDdB65mi152c5Szv/j7fks4suE2ZZ70DhvkL/eHQ/2TyH/hrLwWn1DTX8pw3MyQP3G9s14uPXWeH4wWy/5tV6RXrqZJlcDbF3remNEanitBlP/iOhK1F24dXMr0qHNm7h2gd7ZSQc97yEvxJqXpUjg2qvj2MSMpOcXG+PTvetLnwfmpD6rJGQIX1L17uJEgFinp63niXfYPptzZ81DWJZDvS/C1ELoHnW7zMveVMX65MBh2xba+oMf6X3lKKyM+xnW/6JENy8wlsW5YLmCo+DWGoQjbmJhLurh/h5n9yt6B4FGJO0pzo9J4lgniSodfyG+RyovLWgvRlWkmXFSxzjGMJzG46vvXZnX+7fVsPFjqu/Hy8us/yuKILL5fJgzbUScuuIcxGSWrj89rzTBz5UvYT+MP5bbLKLuYAmhwn1F2pnDFCvKaO1VDIwAogbkNYaVn+7mheiQqqUSeMw==;5:S4EZW2GO7wL6Ztr/3/fzDFe6ixmrUDiy/0k3EpnE74v4tayD+KCohohiuX4CHjM/PHQgqADF2QyE3nLPXrt6vyWsom/OjVT1AVIQe4fgJDO1zGFsMsdW0K6hbO6yxUo9wtIrIHoYTELomD5WjXLdUVbXvSHPFBdFlK+N7LY5YSYWw1D9OWmlZfWIc4EOYtBilfm5vLho55Celq2RyOHf7g==;7:6s7bhMSfoS0ffbIVXs4wwvZBYjs9rvowZUrd6tnUAdf9/6cz1TerqvQYsZa4GbIbvorzbNNDksho7pZSftlCU6KaJIKIlKEKW/f1sPfVTdaEe3eAyVMDjcNOKjJNyYY9ZJDndfHJsQI+l0NwTFSuPg== x-ms-office365-filtering-correlation-id: 415a5fb4-db65-446f-6751-08d686911abf 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)(53936002)(3846002)(6116002)(99286004)(2501003)(316002)(54906003)(305945005)(14454004)(14444005)(256004)(1076003)(7736002)(476003)(2616005)(71190400001)(71200400001)(86362001)(97736004);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: +3cxSusaCVHihUJkq+BG+rPC89effWqyWtlUJF/atC0jb1hpr4pyaVgf1qJnqfgFGOgTs33howQ0SOU0v2OkXUlOlY/DnC1wwQAfwcuG8eINsiQK8zF5oS40x0mgrBKYREcqbM44vpLJTD4UNSRGzWPRy/XLfu4FdNExr+pWW7PiSmnjRI/Q2zEYSElZsgCplCYb6UJ/RkhU/qUqyNrfzC0H+Iod1PHGHbt8WK3OTGGp3Q3A8d2Z8oLOIerv6nhUFE08jOJ41Z40e/XuyqJ6bDxPQZr/qAxNRZ+pFHiTM+8QgIWXrlnBu8t/Sw7lioSavpflLlbAzov2AlbidKOPiv37781n7Cm4UC0eJGycKuDkYgo2PC2c2sV2ZBa6cwLgygtea59pRgwUBQOKA9KY2dxoz6jry5MjLnZcL2iNMek= 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: 415a5fb4-db65-446f-6751-08d686911abf X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2019 08:58:29.1041 (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 The Spectrum-2 ASIC allows multiple rules to use the same mask provided that the difference between their masks is small enough (up to 8 consecutive delta bits). A more detailed explanation is provided in merge commit 756cd36626f7 ("Merge branch 'mlxsw-Introduce-algorithmic-TCAM-support'"). These delta bits are part of the rule's key and therefore rules that only differ in their delta bits can be inserted with the same A-TCAM mask. In case two rules share the same key and only differ in their priority, then the second will spill to the C-TCAM. Current code does not take the delta bits into account when checking for duplicate rules, which leads to unnecessary spillage to the C-TCAM. This may result in reduced scale and performance. Patch #1 includes the delta bits in the rule's key to avoid the above mentioned problem. Patch #2 adds a tracepoint when a rule is inserted into the C-TCAM. Patches #3-#5 add test cases to make sure unnecessary spillage into the C-TCAM does not occur. Jiri Pirko (5): mlxsw: spectrum_acl: Include delta bits into hashtable key mlxsw: spectrum_acl: Add C-TCAM spill tracepoint selftests: spectrum-2: Extend and move trace helpers selftests: spectrum-2: Fix multiple_masks_test selftests: spectrum-2: Add delta two masks one key test .../mellanox/mlxsw/spectrum_acl_atcam.c | 24 +-- .../mlxsw/spectrum_acl_bloom_filter.c | 2 +- .../mellanox/mlxsw/spectrum_acl_tcam.h | 10 +- include/trace/events/mlxsw.h | 38 +++++ .../drivers/net/mlxsw/spectrum-2/tc_flower.sh | 143 ++++++++++++++---- 5 files changed, 174 insertions(+), 43 deletions(-) create mode 100644 include/trace/events/mlxsw.h --=20 2.20.1