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=-9.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 9B1C7C04AB6 for ; Tue, 28 May 2019 12:31:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6B116208C3 for ; Tue, 28 May 2019 12:31:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="5cJz+O6k" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727133AbfE1MbV (ORCPT ); Tue, 28 May 2019 08:31:21 -0400 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:55557 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726974AbfE1MbV (ORCPT ); Tue, 28 May 2019 08:31:21 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id D04DE1E2; Tue, 28 May 2019 08:22:56 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 28 May 2019 08:22:56 -0400 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= fm2; bh=fCjZ3E6f0rzOz9DRO9S9e6OwIcEgxSGgXEMHtbxO7+E=; b=5cJz+O6k vDLpbT5cNbdXLBca7A8thoelqGIr8ZiNw6BVlY12vy5IFg1Crzdc6y5K7Axk1AVh rSHA6t08NSEF3xMtKM5HMfoXDetCDrUoRlVAxx1bZ3cjJwx2u7KteEDzSsBHlYrY FzuBuGQmwxPUZ7vHt87LDuhCcDVlSS1ezuDCaw5ouxZreQcA/mIEdNFx2qYrShPv vDkm60+kp0mP6OOc+/06Um89Rf+hw0GBbT2KXHcJ/29oUtiVNYkDqLK/ENp0C/eY TV1bx//1aSzaU59acEm0kaB4Q72PCUlRpQhTfktvdWcK2BkojICQYVZugyLQzc2+ LulAe+qgx8LX7g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddruddvhedgheduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepkfguohcuufgthhhimhhmvghluceoihguohhstghhsehiugho shgthhdrohhrgheqnecukfhppeduleefrdegjedrudeihedrvdehudenucfrrghrrghmpe hmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrghenucevlhhushhtvghr ufhiiigvpeei X-ME-Proxy: Received: from splinter.mtl.com (unknown [193.47.165.251]) by mail.messagingengine.com (Postfix) with ESMTPA id 33E90380089; Tue, 28 May 2019 08:22:54 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, jiri@mellanox.com, mlxsw@mellanox.com, dsahern@gmail.com, roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com, andy@greyhouse.net, pablo@netfilter.org, jakub.kicinski@netronome.com, pieter.jansenvanvuuren@netronome.com, andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@savoirfairelinux.com, Ido Schimmel Subject: [RFC PATCH net-next 09/12] mlxsw: reg: Add new trap action Date: Tue, 28 May 2019 15:21:33 +0300 Message-Id: <20190528122136.30476-10-idosch@idosch.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528122136.30476-1-idosch@idosch.org> References: <20190528122136.30476-1-idosch@idosch.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Ido Schimmel Subsequent patches will add discard traps support in mlxsw. The driver cannot configure such traps with a normal trap action, but need to use exception trap action, which also increments an error counter. Signed-off-by: Ido Schimmel Acked-by: Jiri Pirko --- drivers/net/ethernet/mellanox/mlxsw/reg.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h index e8002bfc1e8f..b4c9c7edd866 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/reg.h +++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h @@ -5429,6 +5429,7 @@ enum mlxsw_reg_hpkt_action { MLXSW_REG_HPKT_ACTION_DISCARD, MLXSW_REG_HPKT_ACTION_SOFT_DISCARD, MLXSW_REG_HPKT_ACTION_TRAP_AND_SOFT_DISCARD, + MLXSW_REG_HPKT_ACTION_TRAP_EXCEPTION_TO_CPU, }; /* reg_hpkt_action @@ -5439,6 +5440,7 @@ enum mlxsw_reg_hpkt_action { * 3 - Discard. * 4 - Soft discard (allow other traps to act on the packet). * 5 - Trap and soft discard (allow other traps to overwrite this trap). + * 6 - Trap to CPU (CPU receives sole copy) and count it as error. * Access: RW * * Note: Must be set to 0 (forward) for event trap IDs, as they are already -- 2.20.1