From patchwork Thu Sep 23 12:36:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12512761 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,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 13232C433EF for ; Thu, 23 Sep 2021 12:38:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EF1DF60FE6 for ; Thu, 23 Sep 2021 12:38:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240960AbhIWMji (ORCPT ); Thu, 23 Sep 2021 08:39:38 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:56851 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232201AbhIWMjf (ORCPT ); Thu, 23 Sep 2021 08:39:35 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id DA2EF5C00EB; Thu, 23 Sep 2021 08:38:03 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 23 Sep 2021 08:38:03 -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=fm3; bh=pAQKnumKSgsDNMZsu j1flwnfYn62yWROAi+rXlc2p7U=; b=FIB7320lKqr1Zsx1sIY6FiZ3XxqQ1hErx ZCesAaBlna5DCezHhIRzSVcU7wr4g7lLmgdQPbMcN9tFpl8lr69BEBjjXAFeyDSh qihQwN10M3XgY6STXIg5gqRTSIEZ8nksubuZm/3BLRncIInUEvAkprZXbDPSw5nB 6HU3K5IN0hcqFFc9qftNxjn8gGkAnHGZWycr9IHFh6fcHXOS5k7KXRVM/6BxoboT hB2r+nplRWvSkSv/Odea0XGoXCMtUcJviDXb21hTuez8X/W/bvO8v6dqSxNov0X0 dqAEnrG7hNNozjOqX4sFDIQeY2mVbGJqzWqVzShyJWd2C4hjuEo4w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudeiledgheefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomhepkfguohcuufgthhhimhhmvghluceoihguohhstghhsehiughoshgt hhdrohhrgheqnecuggftrfgrthhtvghrnhepteevgefhvefggfffkeeuffeuvdfhueehhe etffeikeegheevfedvgeelvdffudfhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 23 Sep 2021 08:38:01 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, amcohen@nvidia.com, petrm@nvidia.com, jiri@nvidia.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH net-next 00/14] mlxsw: Add support for IP-in-IP with IPv6 underlay Date: Thu, 23 Sep 2021 15:36:46 +0300 Message-Id: <20210923123700.885466-1-idosch@idosch.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Ido Schimmel Currently, mlxsw only supports IP-in-IP with IPv4 underlay. Traffic routed through 'gre' netdevs is encapsulated with IPv4 and GRE headers. Similarly, incoming IPv4 GRE packets are decapsulated and routed in the overlay VRF (which can be the same as the underlay VRF). This patchset adds support for IPv6 underlay using the 'ip6gre' netdev. Due to architectural differences between Spectrum-1 and later ASICs, this functionality is only supported on Spectrum-2 onwards (the software data path is used for Spectrum-1). Patchset overview: Patches #1-#5 are preparations. Patches #6-#9 add and extend required device registers. Patches #10-#14 gradually add IPv6 underlay support. A follow-up patchset will add net/forwarding/ selftests. Amit Cohen (14): mlxsw: spectrum_router: Create common function for fib_entry_type_unset() code mlxsw: spectrum_ipip: Pass IP tunnel parameters by reference and as 'const' mlxsw: spectrum_router: Fix arguments alignment mlxsw: spectrum_ipip: Create common function for mlxsw_sp_ipip_ol_netdev_change_gre() mlxsw: Take tunnel's type into account when searching underlay device mlxsw: reg: Add Router IP version Six Register mlxsw: reg: Add support for rtdp_ipip6_pack() mlxsw: reg: Add support for ratr_ipip6_entry_pack() mlxsw: reg: Add support for ritr_loopback_ipip6_pack() mlxsw: Create separate ipip_ops_arr for different ASICs mlxsw: spectrum_ipip: Add mlxsw_sp_ipip_gre6_ops mlxsw: Add IPV6_ADDRESS kvdl entry type mlxsw: spectrum_router: Increase parsing depth for IPv6 decapsulation mlxsw: Add support for IP-in-IP with IPv6 underlay for Spectrum-2 and above drivers/net/ethernet/mellanox/mlxsw/reg.h | 86 +++- .../net/ethernet/mellanox/mlxsw/spectrum.h | 2 + .../ethernet/mellanox/mlxsw/spectrum2_kvdl.c | 1 + .../ethernet/mellanox/mlxsw/spectrum_ipip.c | 432 ++++++++++++++++-- .../ethernet/mellanox/mlxsw/spectrum_ipip.h | 27 +- .../ethernet/mellanox/mlxsw/spectrum_router.c | 186 ++++++-- .../ethernet/mellanox/mlxsw/spectrum_router.h | 2 + 7 files changed, 641 insertions(+), 95 deletions(-)