From patchwork Mon Nov 23 07:12:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 332008 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, 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 D7164C63697 for ; Mon, 23 Nov 2020 07:14:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83B5120729 for ; Mon, 23 Nov 2020 07:14:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727995AbgKWHOV (ORCPT ); Mon, 23 Nov 2020 02:14:21 -0500 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:42085 "EHLO wout5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727852AbgKWHOU (ORCPT ); Mon, 23 Nov 2020 02:14:20 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 5DAFAF5F; Mon, 23 Nov 2020 02:14:19 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 23 Nov 2020 02:14:19 -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=lL5IATZ9pNa4k1GUyc0QT/cuR7rc5QGaL1Ky9QU6ySQ=; b=Dl9MHSnR x8O1x0pOttQwvbwbevFbCjCv7DstehgLzGVjvhe6VCRspTLhv32ExKYOLkLEtaaY OgMPsqTVI35oRaQG/W6gFcDJjL1/APXizE86Ky9MqQgpmn2aZBtj8Pd7OFHcnfzb zbWIo4rvNGmfN2tK8odZX7eAvbsNYb4dmgr3NppEMO6wtc5sGTERxDP22ZNQFHze Blm+/8v4fteX2MgrG/ak4d6luhmM0yyapIWwa6vpqg7vzByEQeWI9yJXDq2JZRuZ TzNezJ8NGj/Z85zR22790zQQYbhhXQ4YcQNxjUCneLqY4RNQV+PFjxJfomyQ9AqQ y4Z/AxRggdMf1Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudeghedguddtvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefkughoucfutghhihhmmhgvlhcuoehiughoshgthhesihgu ohhstghhrdhorhhgqeenucggtffrrghtthgvrhhnpeduteeiveffffevleekleejffekhf ekhefgtdfftefhledvjefggfehgfevjeekhfenucfkphepkeegrddvvdelrdduheegrddu geejnecuvehluhhsthgvrhfuihiivgepheenucfrrghrrghmpehmrghilhhfrhhomhepih guohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: from shredder.lan (igld-84-229-154-147.inter.net.il [84.229.154.147]) by mail.messagingengine.com (Postfix) with ESMTPA id 91F5C328005E; Mon, 23 Nov 2020 02:14:17 -0500 (EST) From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, jiri@nvidia.com, dsahern@gmail.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH net-next 09/10] mlxsw: spectrum_trap: Add blackhole_nexthop trap Date: Mon, 23 Nov 2020 09:12:29 +0200 Message-Id: <20201123071230.676469-10-idosch@idosch.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201123071230.676469-1-idosch@idosch.org> References: <20201123071230.676469-1-idosch@idosch.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Ido Schimmel Register with devlink the blackhole_nexthop trap so that mlxsw will be able to report packets dropped due to a blackhole nexthop. The internal trap identifier is "DISCARD_ROUTER3", which traps packets dropped in the adjacency table. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko --- drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c index 8fd7d858f3c8..4ef12e3e021a 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c @@ -1007,6 +1007,12 @@ static const struct mlxsw_sp_trap_item mlxsw_sp_trap_items_arr[] = { false), }, }, + { + .trap = MLXSW_SP_TRAP_DROP(BLACKHOLE_NEXTHOP, L3_DROPS), + .listeners_arr = { + MLXSW_SP_RXL_DISCARD(ROUTER3, L3_DISCARDS), + }, + }, }; static struct mlxsw_sp_trap_policer_item *