]> git.baikalelectronics.ru Git - kernel.git/commit
arp: postpone addr_type calculation to as late as possible
authorIhar Hrachyshka <ihrachys@redhat.com>
Thu, 18 May 2017 19:41:20 +0000 (12:41 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 21 May 2017 17:26:45 +0000 (13:26 -0400)
commit89a315038ac1634a2e3b1af46c9577f1f8186bc8
treee74202e0a4b22c1fc7d41b435c1fab43fab48ed2
parentf0faea0baa2c4145c5694b3491628dbb8e7a09a5
arp: postpone addr_type calculation to as late as possible

The addr_type retrieval can be costly, so it's worth trying to avoid its
calculation as much as possible. This patch makes it calculated only
for gratuitous ARP packets. This is especially important since later we
may want to move is_garp calculation outside of arp_accept block, at
which point the costly operation will be executed for all setups.

The patch is the result of a discussion in net-dev:
http://marc.info/?l=linux-netdev&m=149506354216994

Suggested-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Ihar Hrachyshka <ihrachys@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/arp.c