From patchwork Mon Nov 23 07:12:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 332009 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 85CBDC64E75 for ; Mon, 23 Nov 2020 07:14:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2991920732 for ; Mon, 23 Nov 2020 07:14:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727957AbgKWHOT (ORCPT ); Mon, 23 Nov 2020 02:14:19 -0500 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:38453 "EHLO wout5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727852AbgKWHOT (ORCPT ); Mon, 23 Nov 2020 02:14:19 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id D7A0BF5A; Mon, 23 Nov 2020 02:14:17 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 23 Nov 2020 02:14:18 -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=MC3yhjWySVLJjDMo6OSWTe8aq7Y2rVccojQcGLIxpjc=; b=D/Hi6x+K rPA5T0xufcPzyZHQUxsAY3wnAOdCE/855oMqRLbZ2DxFNDNKlOL44Xp71m3C5kno HMFo64vuyRLUPAtA/FHJJcv5T/GwhFxiQVEj2w+MWXqB82DR/CGapiBCBPzzoETt p80kSg48rPQbKJYIr6zVvvnCZLspGld5qQ+LFNNaAkknsnEb0rU9MGSalmP4cpd5 gtId/SorkqBhmnWQeyj31XeZUfIGZXwbPJ87BYozXLJw9vPCBcJq7uAo/RAjR67j KCaTpthC+5LYZDCFrITfN115qlsBognt8S7b2cbHxkAeB0XhTQ9nHoWkdedr0UGV EpMaVpUCULqUwA== 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 1B1103280063; Mon, 23 Nov 2020 02:14:15 -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 08/10] devlink: Add blackhole_nexthop trap Date: Mon, 23 Nov 2020 09:12:28 +0200 Message-Id: <20201123071230.676469-9-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 Add a packet trap to report packets that were dropped due to a blackhole nexthop. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko --- Documentation/networking/devlink/devlink-trap.rst | 4 ++++ include/net/devlink.h | 4 +++- net/core/devlink.c | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Documentation/networking/devlink/devlink-trap.rst b/Documentation/networking/devlink/devlink-trap.rst index ef719ceac299..d875f3e1e9cf 100644 --- a/Documentation/networking/devlink/devlink-trap.rst +++ b/Documentation/networking/devlink/devlink-trap.rst @@ -476,6 +476,10 @@ be added to the following table: * - ``esp_parsing`` - ``drop`` - Traps packets dropped due to an error in the ESP header parsing + * - ``blackhole_nexthop`` + - ``drop`` + - Traps packets that the device decided to drop in case they hit a + blackhole nexthop Driver-specific Packet Traps ============================ diff --git a/include/net/devlink.h b/include/net/devlink.h index 457c537d0ef2..f466819cc477 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -835,6 +835,7 @@ enum devlink_trap_generic_id { DEVLINK_TRAP_GENERIC_ID_DCCP_PARSING, DEVLINK_TRAP_GENERIC_ID_GTP_PARSING, DEVLINK_TRAP_GENERIC_ID_ESP_PARSING, + DEVLINK_TRAP_GENERIC_ID_BLACKHOLE_NEXTHOP, /* Add new generic trap IDs above */ __DEVLINK_TRAP_GENERIC_ID_MAX, @@ -1058,7 +1059,8 @@ enum devlink_trap_group_generic_id { "gtp_parsing" #define DEVLINK_TRAP_GENERIC_NAME_ESP_PARSING \ "esp_parsing" - +#define DEVLINK_TRAP_GENERIC_NAME_BLACKHOLE_NEXTHOP \ + "blackhole_nexthop" #define DEVLINK_TRAP_GROUP_GENERIC_NAME_L2_DROPS \ "l2_drops" diff --git a/net/core/devlink.c b/net/core/devlink.c index e6fb1fdedded..7c05e8603bff 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -9490,6 +9490,7 @@ static const struct devlink_trap devlink_trap_generic[] = { DEVLINK_TRAP(DCCP_PARSING, DROP), DEVLINK_TRAP(GTP_PARSING, DROP), DEVLINK_TRAP(ESP_PARSING, DROP), + DEVLINK_TRAP(BLACKHOLE_NEXTHOP, DROP), }; #define DEVLINK_TRAP_GROUP(_id) \