• David Ahern's avatar
    neighbor: Call __ipv4_neigh_lookup_noref in neigh_xmit · 4b2a2bfe
    David Ahern authored
    Commit cd9ff4de 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: cd9ff4de ("ipv4: Make neigh lookup keys for loopback/point-to-point devices be INADDR_ANY")
    Reported-by: default avatarAlan Maguire <alan.maguire@oracle.com>
    Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
    Tested-by: default avatarAlan Maguire <alan.maguire@oracle.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    4b2a2bfe
neighbour.c 91.1 KB