Re: [RFC PATCH 0/7] tun: Introduce virtio-net hashing feature

From: Willem de Bruijn
Date: Sun Oct 08 2023 - 14:37:39 EST


On Sun, Oct 8, 2023 at 7:21 AM Akihiko Odaki <akihiko.odaki@xxxxxxxxxx> wrote:
>
> 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.

But using the existing BPF steering may have the benefit of requiring
a lot less new code.

There is ample precedence for BPF programs that work this way. The
flow dissector comes to mind.