]> git.baikalelectronics.ru Git - kernel.git/commit
neighbor: Call __ipv4_neigh_lookup_noref in neigh_xmit
authorDavid Ahern <dsahern@gmail.com>
Thu, 2 May 2019 01:18:42 +0000 (18:18 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 4 May 2019 04:38:53 +0000 (00:38 -0400)
commit8281b72bf01da7bf480ffd3bcd0dc4a2fb0b2d72
treebea0822c13d5c2845b82d8923dfcb1fe2f58d887
parent6e637a72db28955f1c9ea7fe9fa0393519f4a944
neighbor: Call __ipv4_neigh_lookup_noref in neigh_xmit

Commit 1705a51b7b0c changed the key for IFF_POINTOPOINT devices to
INADDR_ANY but neigh_xmit which is used for MPLS encapsulations was not
updated to use the altered key. The result is that every packet Tx does
a lookup on the gateway address which does not find an entry, a new one
is created only to find the existing one in the table right before the
insert since arp_constructor was updated to reset the primary key. This
is seen in the allocs and destroys counters:
    ip -s -4 ntable show | head -10 | grep alloc

which increase for each packet showing the unnecessary overhread.

Fix by having neigh_xmit use __ipv4_neigh_lookup_noref for NEIGH_ARP_TABLE.

Fixes: 1705a51b7b0c ("ipv4: Make neigh lookup keys for loopback/point-to-point devices be INADDR_ANY")
Reported-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
Tested-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/neighbour.c