OSDN Git Service

mlxsw: reg: Add support for rtdp_ipip6_pack()
authorAmit Cohen <amcohen@nvidia.com>
Thu, 23 Sep 2021 12:36:53 +0000 (15:36 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 24 Sep 2021 09:26:51 +0000 (10:26 +0100)
commita917bb271d16c0fc4d325f2ab31566c3faac298c
treef90cf719d807fa77853324ea522db2479cbeb9b0
parentdd8a9552d48482dbf3812489bfdec9486cce0cf4
mlxsw: reg: Add support for rtdp_ipip6_pack()

The RTDP register is used for configuring the tunnel decapsulation
properties of NVE and IP-in-IP.

Linux tunnels verify packets before decapsulation based on the packet's
source IP, which must match tunnel remote IP.
RTDP is used to configure decapsulation so that it filters out packets that
are not IPv6 or have the wrong source IP or wrong GRE key.

For IP-in-IP entry, source IPv4 is saved as part of this register and
source IPv6 is saved by RIPS register and RTDP saves pointer to it.

Create common function for configuring both IPv4 and IPv6 and add
dedicated functions for each protocol.

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