]> git.baikalelectronics.ru Git - kernel.git/commit
tun: do not compute the rxhash, if not needed
authorPaolo Abeni <pabeni@redhat.com>
Fri, 20 Apr 2018 11:18:16 +0000 (13:18 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Apr 2018 15:51:28 +0000 (11:51 -0400)
commit28ac7b3f67dfd546693df5ef0d0eabff207bd67f
tree794121266cee66f3a36dc9a59c60c649fc45c395
parent933352657b3753a7b03475628d9b08a342371e35
tun: do not compute the rxhash, if not needed

Currently, the tun driver, in absence of an eBPF steering program,
always compute the rxhash in its rx path, even when such value
is later unused due to additional checks (

This changeset moves the all the related checks just before the
__skb_get_hash_symmetric(), so that the latter is no more computed
when unneeded.

Also replace an unneeded RCU section with rcu_access_pointer().

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c