From patchwork Mon Mar 29 10:09:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 411208 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=-11.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, 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 DF355C433DB for ; Mon, 29 Mar 2021 10:11:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BBDE361981 for ; Mon, 29 Mar 2021 10:11:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232469AbhC2KKj (ORCPT ); Mon, 29 Mar 2021 06:10:39 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:38349 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232573AbhC2KKX (ORCPT ); Mon, 29 Mar 2021 06:10:23 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 747F05C0093; Mon, 29 Mar 2021 06:10:23 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 29 Mar 2021 06:10:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=QMdcON+77YuNwW32B 1jQJlsQfIwGub5hN+3xLcX7rfw=; b=bldbcj51zVDj9i44vIubJUd8dvh2jQj71 qWSS26BtjDd8sepEOv4W5k0cKctp1wkyu2qEyYbAoJ3WzD98kOht76BQVYYJ69N5 zAdLeKTsuCF8YW2nBT0JYPv6aeIRklDDnpyMlJjJ7zMr/H6tfoIXYDHWGxdXzY90 9muVk79x9bTbzPsc5i2wyFYSmQ9NJ3566vTjvZOW+0Q0G+NO/K47IjyqUKDBQRqz xwpqN0tPbdikRLmrY3v4KhM3sya0jmnLmceDG1yzzTfEaZdVV42ByUKs1xZ+03b5 6YMnGFn5PljQv6vsU7jcVgYfSiVdcllq/WuwHeeH6hq/jXXt1SB7A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudehkedgvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomhepkfguohcuufgthhhimhhmvghluceoihguohhstghhsehiughoshgt hhdrohhrgheqnecuggftrfgrthhtvghrnhepteevgefhvefggfffkeeuffeuvdfhueehhe etffeikeegheevfedvgeelvdffudfhnecukfhppeekgedrvddvledrudehfedrgeegnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihguohhstg hhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: from shredder.mellanox.com (igld-84-229-153-44.inter.net.il [84.229.153.44]) by mail.messagingengine.com (Postfix) with ESMTPA id 6E4A5240054; Mon, 29 Mar 2021 06:10:21 -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 0/6] mlxsw: Two sampling fixes Date: Mon, 29 Mar 2021 13:09:42 +0300 Message-Id: <20210329100948.355486-1-idosch@idosch.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Ido Schimmel This patchset fixes two bugs in recent sampling submissions. The first fix, in patch #3, prevents matchall rules with sample action to be added in front of flower rules on egress. Patches #1-#2 are preparations meant at avoiding similar bugs in the future. Patch #4 is a selftest. The second fix, in patch #5, prevents sampling from being enabled on a port if already enabled. Patch #6 is a selftest. Ido Schimmel (6): mlxsw: spectrum_matchall: Perform protocol check earlier mlxsw: spectrum_matchall: Convert if statements to a switch statement mlxsw: spectrum_matchall: Perform priority checks earlier selftests: mlxsw: Test matchall failure with protocol match mlxsw: spectrum: Veto sampling if already enabled on port selftests: mlxsw: Test vetoing of double sampling .../net/ethernet/mellanox/mlxsw/spectrum.c | 5 ++ .../mellanox/mlxsw/spectrum_matchall.c | 46 ++++++++++--------- .../drivers/net/mlxsw/tc_restrictions.sh | 17 +++++++ .../selftests/drivers/net/mlxsw/tc_sample.sh | 30 ++++++++++++ 4 files changed, 76 insertions(+), 22 deletions(-)