OSDN Git Service

mlxsw: spectrum: Add hash table for IPv6 address mapping
authorAmit Cohen <amcohen@nvidia.com>
Tue, 14 Dec 2021 14:25:44 +0000 (16:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Dec 2021 15:05:43 +0000 (15:05 +0000)
commite846efe2737b25a5c0a75b0995eb9ac084c87f5c
treec238d8b41f2ce637b47d820e8caf72601509dbaa
parentf71f1bcbd87ff7274ac6fb5ace454178dc5246f6
mlxsw: spectrum: Add hash table for IPv6 address mapping

The device supports forwarding entries such as routes and FDBs that
perform tunnel (e.g., VXLAN, IP-in-IP) encapsulation or decapsulation.
When the underlay is IPv6, these entries do not encode the 128 bit IPv6
address used for encapsulation / decapsulation. Instead, these entries
encode a 24 bit pointer to an array called KVDL where the IPv6 address
is stored.

Currently, only IP-in-IP with IPv6 underlay is supported, but subsequent
patches will add support for VxLAN with IPv6 underlay. To avoid
duplicating the logic required to store and retrieve these IPv6
addresses, introduce a hash table that will store the mapping between
IPv6 addresses and their KVDL index.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.h