All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
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 <idosch@nvidia.com>
Subject: [PATCH net-next 06/14] mlxsw: reg: Add Router IP version Six Register
Date: Thu, 23 Sep 2021 15:36:52 +0300	[thread overview]
Message-ID: <20210923123700.885466-7-idosch@idosch.org> (raw)
In-Reply-To: <20210923123700.885466-1-idosch@idosch.org>

From: Amit Cohen <amcohen@nvidia.com>

The RIPS register is used to store IPv6 addresses for use by the NVE and
IP-in-IP.

For IPv6 underlay support, RATR register needs to hold a pointer to the
remote IPv6 address for encapsulation and RTDP register needs to hold a
pointer to the local IPv6 address for decapsulation check.

Add the required register for saving IPv6 addresses.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlxsw/reg.h | 32 +++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h
index 6c96e124e4c8..22f5c26fc0e7 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h
@@ -8200,6 +8200,37 @@ mlxsw_reg_rtdp_ipip4_pack(char *payload, u16 irif,
 	mlxsw_reg_rtdp_ipip_expected_gre_key_set(payload, expected_gre_key);
 }
 
+/* RIPS - Router IP version Six Register
+ * -------------------------------------
+ * The RIPS register is used to store IPv6 addresses for use by the NVE and
+ * IPinIP
+ */
+#define MLXSW_REG_RIPS_ID 0x8021
+#define MLXSW_REG_RIPS_LEN 0x14
+
+MLXSW_REG_DEFINE(rips, MLXSW_REG_RIPS_ID, MLXSW_REG_RIPS_LEN);
+
+/* reg_rips_index
+ * Index to IPv6 address.
+ * For Spectrum, the index is to the KVD linear.
+ * Access: Index
+ */
+MLXSW_ITEM32(reg, rips, index, 0x00, 0, 24);
+
+/* reg_rips_ipv6
+ * IPv6 address
+ * Access: RW
+ */
+MLXSW_ITEM_BUF(reg, rips, ipv6, 0x04, 16);
+
+static inline void mlxsw_reg_rips_pack(char *payload, u32 index,
+				       const struct in6_addr *ipv6)
+{
+	MLXSW_REG_ZERO(rips, payload);
+	mlxsw_reg_rips_index_set(payload, index);
+	mlxsw_reg_rips_ipv6_memcpy_to(payload, (const char *)ipv6);
+}
+
 /* RATRAD - Router Adjacency Table Activity Dump Register
  * ------------------------------------------------------
  * The RATRAD register is used to dump and optionally clear activity bits of
@@ -12281,6 +12312,7 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = {
 	MLXSW_REG(rtar),
 	MLXSW_REG(ratr),
 	MLXSW_REG(rtdp),
+	MLXSW_REG(rips),
 	MLXSW_REG(ratrad),
 	MLXSW_REG(rdpm),
 	MLXSW_REG(ricnt),
-- 
2.31.1


  parent reply	other threads:[~2021-09-23 12:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23 12:36 [PATCH net-next 00/14] mlxsw: Add support for IP-in-IP with IPv6 underlay Ido Schimmel
2021-09-23 12:36 ` [PATCH net-next 01/14] mlxsw: spectrum_router: Create common function for fib_entry_type_unset() code Ido Schimmel
2021-09-23 12:36 ` [PATCH net-next 02/14] mlxsw: spectrum_ipip: Pass IP tunnel parameters by reference and as 'const' Ido Schimmel
2021-09-23 12:36 ` [PATCH net-next 03/14] mlxsw: spectrum_router: Fix arguments alignment Ido Schimmel
2021-09-23 12:36 ` [PATCH net-next 04/14] mlxsw: spectrum_ipip: Create common function for mlxsw_sp_ipip_ol_netdev_change_gre() Ido Schimmel
2021-09-23 12:36 ` [PATCH net-next 05/14] mlxsw: Take tunnel's type into account when searching underlay device Ido Schimmel
2021-09-23 12:36 ` Ido Schimmel [this message]
2021-09-23 12:36 ` [PATCH net-next 07/14] mlxsw: reg: Add support for rtdp_ipip6_pack() Ido Schimmel
2021-09-23 12:36 ` [PATCH net-next 08/14] mlxsw: reg: Add support for ratr_ipip6_entry_pack() Ido Schimmel
2021-09-23 12:36 ` [PATCH net-next 09/14] mlxsw: reg: Add support for ritr_loopback_ipip6_pack() Ido Schimmel
2021-09-23 12:36 ` [PATCH net-next 10/14] mlxsw: Create separate ipip_ops_arr for different ASICs Ido Schimmel
2021-09-23 12:36 ` [PATCH net-next 11/14] mlxsw: spectrum_ipip: Add mlxsw_sp_ipip_gre6_ops Ido Schimmel
2021-09-23 12:36 ` [PATCH net-next 12/14] mlxsw: Add IPV6_ADDRESS kvdl entry type Ido Schimmel
2021-09-23 12:36 ` [PATCH net-next 13/14] mlxsw: spectrum_router: Increase parsing depth for IPv6 decapsulation Ido Schimmel
2021-09-23 12:37 ` [PATCH net-next 14/14] mlxsw: Add support for IP-in-IP with IPv6 underlay for Spectrum-2 and above Ido Schimmel
2021-09-24  9:40 ` [PATCH net-next 00/14] mlxsw: Add support for IP-in-IP with IPv6 underlay patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210923123700.885466-7-idosch@idosch.org \
    --to=idosch@idosch.org \
    --cc=amcohen@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=idosch@nvidia.com \
    --cc=jiri@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=mlxsw@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.