linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/7] tun: Introduce virtio-net hashing feature
@ 2023-10-15 14:16 Akihiko Odaki
  2023-10-15 14:16 ` [RFC PATCH v2 1/7] bpf: Introduce BPF_PROG_TYPE_VNET_HASH Akihiko Odaki
                   ` (6 more replies)
  0 siblings, 7 replies; 26+ messages in thread
From: Akihiko Odaki @ 2023-10-15 14:16 UTC (permalink / raw)
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
	Jonathan Corbet, Willem de Bruijn, Jason Wang, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Michael S. Tsirkin,
	Xuan Zhuo, Mykola Lysenko, Shuah Khan, bpf, linux-doc,
	linux-kernel, netdev, kvm, virtualization, linux-kselftest,
	Yuri Benditovich, Andrew Melnychenko, Akihiko Odaki

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.

Extend the steering program feature by introducing a dedicated program
type: BPF_PROG_TYPE_VNET_HASH. This program type is capable to report
the hash value and the queue to use at the same time.

This is a rewrite of a RFC patch series submitted by Yuri Benditovich that
incorporates feedbacks for the series and V1 of this series:
https://lore.kernel.org/lkml/20210112194143.1494-1-yuri.benditovich@daynix.com/

QEMU patched to use this new feature is available at:
https://github.com/daynix/qemu/tree/akihikodaki/bpf

The QEMU patches will soon be submitted to the upstream as RFC too.

V1 -> V2:
  Changed to introduce a new BPF program type.

Akihiko Odaki (7):
  bpf: Introduce BPF_PROG_TYPE_VNET_HASH
  bpf: Add vnet_hash members to __sk_buff
  skbuff: Introduce SKB_EXT_TUN_VNET_HASH
  virtio_net: Add virtio_net_hdr_v1_hash_from_skb()
  tun: Support BPF_PROG_TYPE_VNET_HASH
  selftests/bpf: Test BPF_PROG_TYPE_VNET_HASH
  vhost_net: Support VIRTIO_NET_F_HASH_REPORT

 Documentation/bpf/bpf_prog_run.rst            |   1 +
 Documentation/bpf/libbpf/program_types.rst    |   2 +
 drivers/net/tun.c                             | 158 +++++--
 drivers/vhost/net.c                           |  16 +-
 include/linux/bpf_types.h                     |   2 +
 include/linux/filter.h                        |   7 +
 include/linux/skbuff.h                        |  10 +
 include/linux/virtio_net.h                    |  22 +
 include/uapi/linux/bpf.h                      |   5 +
 kernel/bpf/verifier.c                         |   6 +
 net/core/filter.c                             |  86 +++-
 net/core/skbuff.c                             |   3 +
 tools/include/uapi/linux/bpf.h                |   5 +
 tools/lib/bpf/libbpf.c                        |   2 +
 tools/testing/selftests/bpf/config            |   1 +
 tools/testing/selftests/bpf/config.aarch64    |   1 -
 .../selftests/bpf/prog_tests/vnet_hash.c      | 385 ++++++++++++++++++
 tools/testing/selftests/bpf/progs/vnet_hash.c |  16 +
 18 files changed, 681 insertions(+), 47 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/vnet_hash.c
 create mode 100644 tools/testing/selftests/bpf/progs/vnet_hash.c

-- 
2.42.0


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2023-12-11 17:40 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-15 14:16 [RFC PATCH v2 0/7] tun: Introduce virtio-net hashing feature Akihiko Odaki
2023-10-15 14:16 ` [RFC PATCH v2 1/7] bpf: Introduce BPF_PROG_TYPE_VNET_HASH Akihiko Odaki
2023-10-15 16:07   ` Alexei Starovoitov
2023-10-15 17:10     ` Akihiko Odaki
2023-10-16 23:53       ` Alexei Starovoitov
2023-10-17  0:36         ` Willem de Bruijn
2023-10-17  2:38         ` Jason Wang
2023-10-17 19:03           ` Alexei Starovoitov
2023-10-17 19:19             ` Akihiko Odaki
2023-11-18 10:38               ` Akihiko Odaki
2023-11-18 16:08                 ` Song Liu
2023-11-19  8:03                   ` Akihiko Odaki
2023-11-19 21:02                     ` Song Liu
2023-11-20  8:05                       ` Akihiko Odaki
2023-11-22  5:25                         ` Song Liu
2023-11-22  5:36                           ` Akihiko Odaki
2023-12-10  7:03                             ` Akihiko Odaki
2023-12-11  1:40                               ` Song Liu
2023-12-11  5:04                                 ` Akihiko Odaki
2023-12-11 17:40                                   ` Song Liu
2023-10-15 14:16 ` [RFC PATCH v2 2/7] bpf: Add vnet_hash members to __sk_buff Akihiko Odaki
2023-10-15 14:16 ` [RFC PATCH v2 3/7] skbuff: Introduce SKB_EXT_TUN_VNET_HASH Akihiko Odaki
2023-10-15 14:16 ` [RFC PATCH v2 4/7] virtio_net: Add virtio_net_hdr_v1_hash_from_skb() Akihiko Odaki
2023-10-15 14:16 ` [RFC PATCH v2 5/7] tun: Support BPF_PROG_TYPE_VNET_HASH Akihiko Odaki
2023-10-15 14:16 ` [RFC PATCH v2 6/7] selftests/bpf: Test BPF_PROG_TYPE_VNET_HASH Akihiko Odaki
2023-10-15 14:16 ` [RFC PATCH v2 7/7] vhost_net: Support VIRTIO_NET_F_HASH_REPORT Akihiko Odaki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).