From: Jianbo Liu mlx5e_ipsec_init_macs() falls back to a neighbour lookup when the route lookup yields no neighbour, but always in the ARP table. For an IPv6 SA the first four bytes of the address are used as an IPv4 key: the SA takes the MAC of an unrelated ARP entry, or creates one, probes for it and drops traffic waiting for a reply that never comes. Look the neighbour up in the table of the SA's address family. Found while debugging IPsec tunnel failures on a ConnectX-8 Kubernetes cluster. Reproduced on ConnectX-7 (fw 28.48.1000): IPv6 RX SA with an unreachable route to the peer fd00:99::2. An ARP entry for 253.0.0.153 is probed and the SA drops all packets. With the fix the peer is resolved by ND and traffic passes. Fixes: 37a417ca911a ("net/mlx5e: Support IPsec RX packet offload in tunnel mode") Signed-off-by: Jianbo Liu Reviewed-by: Saeed Mahameed Reviewed-by: Cosmin Ratiu Signed-off-by: Tariq Toukan --- .../net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c index 4daad648460f..4084f8a88695 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c @@ -365,9 +365,15 @@ static void mlx5e_ipsec_init_macs(struct mlx5e_ipsec_sa_entry *sa_entry, return; neigh: - n = ipv4_neigh_lookup(netdev, pkey); + if (addrs->family == AF_INET) + n = ipv4_neigh_lookup(netdev, pkey); + else + n = ipv6_neigh_lookup(netdev, pkey); if (!n) { - n = ipv4_neigh_create(netdev, pkey); + if (addrs->family == AF_INET) + n = ipv4_neigh_create(netdev, pkey); + else + n = ipv6_neigh_create(netdev, pkey); attrs->drop = true; if (IS_ERR(n)) return; -- 2.44.0