From patchwork Sun Jan 17 08:02:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12025229 X-Patchwork-Delegate: kuba@kernel.org 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,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 D86A5C433E0 for ; Sun, 17 Jan 2021 08:08:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 801E3225AC for ; Sun, 17 Jan 2021 08:08:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726412AbhAQIHd (ORCPT ); Sun, 17 Jan 2021 03:07:33 -0500 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:39291 "EHLO wout1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726906AbhAQIEA (ORCPT ); Sun, 17 Jan 2021 03:04:00 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id E4A2F180B; Sun, 17 Jan 2021 03:02:54 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 17 Jan 2021 03:02:55 -0500 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= fm1; bh=LHYPHz1XxlpyIaQ+mIz1GPadM/4v/UJewmr3IARsO0I=; b=qA/fLYg+ rrhey6tOQG2NTy4Ef9X6Q6Py/1htiFWQ+tvZMiNe3O/JUQxlKR27j8DaLuNDMp56 7XyoS2K4pyqG87vec5cY8Ub55HSeHaFgcj6cC7ptL+gj0Hj9DlALDsu5PNI6M99J wRbzgX2noOExaFUWSrVBYeep6K1ysPeiINZVBogLNU/zNyjNmro+I/dzqIcYPEbA oJ0hld++JU68ySeobgQqa3SRqG3TyFD4Ro3vIIF8sg2gJ0PzvvqITx6OiGgBq5o1 WafI1lnjf3p2NTVgo/DGCpfR/ceBdo3aWCoVX/MT8IYg4xqNYCElYotZmR0uiBin C/xfiHq3l3xRJw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrtdehgdduudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepkfguohcuufgthhhimhhmvghluceoihguohhstghhsehiugho shgthhdrohhrgheqnecuggftrfgrthhtvghrnhepudetieevffffveelkeeljeffkefhke ehgfdtffethfelvdejgffghefgveejkefhnecukfhppeekgedrvddvledrudehfedrgeeg necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihguoh hstghhsehiughoshgthhdrohhrgh 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 6EFA024005C; Sun, 17 Jan 2021 03:02:52 -0500 (EST) From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, petrm@nvidia.com, jiri@nvidia.com, amcohen@nvidia.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH net-next 2/5] mlxsw: spectrum_trap: Add ecn_mark trap Date: Sun, 17 Jan 2021 10:02:20 +0200 Message-Id: <20210117080223.2107288-3-idosch@idosch.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210117080223.2107288-1-idosch@idosch.org> References: <20210117080223.2107288-1-idosch@idosch.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Petr Machata Register with devlink a new buffer drop trap, ecn_mark. Since Spectrum-1 does not support the ecn_mark trap, do it only for Spectrum-2 and above. Reviewed-by: Jiri Pirko Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c index 4ef12e3e021a..45cf6c027cac 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c @@ -51,6 +51,8 @@ enum { enum { /* Packet was early dropped. */ MLXSW_SP_MIRROR_REASON_INGRESS_WRED = 9, + /* Packet was ECN marked. */ + MLXSW_SP_MIRROR_REASON_EGRESS_ECN = 13, }; static int mlxsw_sp_rx_listener(struct mlxsw_sp *mlxsw_sp, struct sk_buff *skb, @@ -1760,6 +1762,13 @@ mlxsw_sp2_trap_items_arr[] = { }, .is_source = true, }, + { + .trap = MLXSW_SP_TRAP_BUFFER_DROP(ECN_MARK), + .listeners_arr = { + MLXSW_SP_RXL_BUFFER_DISCARD(EGRESS_ECN), + }, + .is_source = true, + }, }; static int