]> git.baikalelectronics.ru Git - kernel.git/commit
tun: compute the RFS hash only if needed.
authorPaolo Abeni <pabeni@redhat.com>
Wed, 7 Nov 2018 09:34:36 +0000 (10:34 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Nov 2018 06:22:16 +0000 (22:22 -0800)
commita1afd51cf283db59c579ae9eb832a70a0b93dd7e
tree1393cffb15545baf0cb514096d274b4aa33c5c50
parent64aea8898c3bde58b9e0c23e68e4d6e299a39342
tun: compute the RFS hash only if needed.

The tun XDP sendmsg code path, unconditionally computes the symmetric
hash of each packet for RFS's sake, even when we could skip it. e.g.
when the device has a single queue.

This change adds the check already in-place for the skb sendmsg path
to avoid unneeded hashing.

The above gives small, but measurable, performance gain for VM xmit
path when zerocopy is not enabled.

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