virtio-net have two usage of hashes: one is RSS and another is hash reporting. Conventionally the hash calculation was done by the VMM. However, computing the hash after the queue was chosen defeats the purpose of RSS. Another approach is to use eBPF steering program. This approach has another downside: it cannot report the calculated hash due to the restrictive nature of eBPF. Introduce the code to compute hashes to the kernel in order to overcome thse challenges. An alternative solution is to extend the eBPF steering program so that it will be able to report to the userspace, but it makes little sense to allow to implement different hashing algorithms with eBPF since the hash value reported by virtio-net is strictly defined by the specification. An implementation of this alternative solution was submitted as RFC patches in the past: https://lore.kernel.org/lkml/20210112194143.1494-1-yuri.benditovich@xxxxxxxxxx/ QEMU patched to use this new feature is available at: https://github.com/daynix/qemu/tree/akihikodaki/rss The QEMU patches will soon be submitted to the upstream as RFC too. Akihiko Odaki (7): net: skbuff: Add tun_vnet_hash flag net/core: Ensure qdisc_skb_cb will not be overwritten net: sched: Add members to qdisc_skb_cb virtio_net: Add functions for hashing tun: Introduce virtio-net hashing feature selftest: tun: Add tests for virtio-net hashing vhost_net: Support VIRTIO_NET_F_HASH_REPORT drivers/net/tun.c | 187 ++++++++- drivers/vhost/net.c | 16 +- include/linux/skbuff.h | 2 + include/linux/virtio_net.h | 157 ++++++++ include/net/sch_generic.h | 12 +- include/uapi/linux/if_tun.h | 16 + net/core/dev.c | 1 + tools/testing/selftests/net/Makefile | 2 +- tools/testing/selftests/net/tun.c | 578 ++++++++++++++++++++++++++- 9 files changed, 933 insertions(+), 38 deletions(-) -- 2.42.0