Thread (4 messages) 4 messages, 2 authors, 2026-02-22

Re: [PATCH net-next] net: ipv4: add lwtunnel hash to fib_info_hash to fix mpls collisions

From: Vitaliy Guschin <hidden>
Date: 2026-02-22 15:46:44

On Sun, Feb 22, 2026, Ido Schimmel wrote:
Did you consider using the nexthop API [1]?

It doesn't suffer from this problem since the nexthop ID is used in the
FIB info hash computation and it does not require patching every LWT
family.

[1]
# cat lwt_hash_nhid.sh
#!/bin/bash

ip link add name dummy1 up type dummy
ip address add 192.168.1.2/24 dev dummy1

rm -f /tmp/batch.txt
for i in {1..100000}; do
        echo "nexthop add id $i encap mpls $((i+15)) via 192.168.1.1 dev dummy1"
        echo "route add 100.$((i>>16&255)).$((i>>8&255)).$((i&255))/32 nhid $i"
done > /tmp/batch.txt

time ip -batch /tmp/batch.txt
# ./lwt_hash_nhid.sh

real    0m0.467s
user    0m0.109s
sys     0m0.347s
Hi, Ido Schimmel.

Thanks for the feedback!

The nexthop ID approach works well. I agree that using nexthop ID in
userspace is a better way than writing patches for each type of LWT.

Please consider this patch withdrawn.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help