From: "Michael S. Tsirkin" <mst@redhat.com>
To: Akihiko Odaki <akihiko.odaki@daynix.com>
Cc: Jonathan Corbet <corbet@lwn.net>,
Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
Jason Wang <jasowang@redhat.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
Shuah Khan <shuah@kernel.org>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, kvm@vger.kernel.org,
virtualization@lists.linux-foundation.org,
linux-kselftest@vger.kernel.org,
Yuri Benditovich <yuri.benditovich@daynix.com>,
Andrew Melnychenko <andrew@daynix.com>,
Stephen Hemminger <stephen@networkplumber.org>,
gur.stavi@huawei.com, Lei Yang <leiyang@redhat.com>,
Simon Horman <horms@kernel.org>
Subject: Re: [PATCH net-next v12 00/10] tun: Introduce virtio-net hashing feature
Date: Wed, 16 Jul 2025 04:55:30 -0400 [thread overview]
Message-ID: <20250716045513-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20250530-rss-v12-0-95d8b348de91@daynix.com>
On Fri, May 30, 2025 at 01:50:04PM +0900, Akihiko Odaki wrote:
> NOTE: I'm leaving Daynix Computing Ltd., for which I worked on this
> patch series, by the end of this month.
>
> While net-next is closed, this is the last chance for me to send another
> version so let me send the local changes now.
>
> Please contact Yuri Benditovich, who is CCed on this email, for anything
> about this series.
>
> 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 is based on context
> rewrites, which is in feature freeze. We can adopt kfuncs, but they will
> not be UAPIs. We opt to ioctl to align with other relevant UAPIs (KVM
> and vhost_net).
>
> The patches for QEMU to use this new feature was submitted as RFC and
> is available at:
> https://patchew.org/QEMU/20250530-hash-v5-0-343d7d7a8200@daynix.com/
>
> This work was presented at LPC 2024:
> https://lpc.events/event/18/contributions/1963/
It's been a while, do you intend to post v13?
> V1 -> V2:
> Changed to introduce a new BPF program type.
>
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
> Changes in v12:
> - Updated tools/testing/selftests/net/config.
> - Split TUNSETVNETHASH.
> - Link to v11: https://lore.kernel.org/r/20250317-rss-v11-0-4cacca92f31f@daynix.com
>
> Changes in v11:
> - Added the missing code to free vnet_hash in patch
> "tap: Introduce virtio-net hash feature".
> - Link to v10: https://lore.kernel.org/r/20250313-rss-v10-0-3185d73a9af0@daynix.com
>
> Changes in v10:
> - Split common code and TUN/TAP-specific code into separate patches.
> - Reverted a spurious style change in patch "tun: Introduce virtio-net
> hash feature".
> - Added a comment explaining disable_ipv6 in tests.
> - Used AF_PACKET for patch "selftest: tun: Add tests for
> virtio-net hashing". I also added the usage of FIXTURE_VARIANT() as
> the testing function now needs access to more variant-specific
> variables.
> - Corrected the message of patch "selftest: tun: Add tests for
> virtio-net hashing"; it mentioned validation of configuration but
> it is not scope of this patch.
> - Expanded the description of patch "selftest: tun: Add tests for
> virtio-net hashing".
> - Added patch "tun: Allow steering eBPF program to fall back".
> - Changed to handle TUNGETVNETHASHCAP before taking the rtnl lock.
> - Removed redundant tests for tun_vnet_ioctl().
> - Added patch "selftest: tap: Add tests for virtio-net ioctls".
> - Added a design explanation of ioctls for extensibility and migration.
> - Removed a few branches in patch
> "vhost/net: Support VIRTIO_NET_F_HASH_REPORT".
> - Link to v9: https://lore.kernel.org/r/20250307-rss-v9-0-df76624025eb@daynix.com
>
> Changes in v9:
> - Added a missing return statement in patch
> "tun: Introduce virtio-net hash feature".
> - Link to v8: https://lore.kernel.org/r/20250306-rss-v8-0-7ab4f56ff423@daynix.com
>
> Changes in v8:
> - Disabled IPv6 to eliminate noises in tests.
> - Added a branch in tap to avoid unnecessary dissection when hash
> reporting is disabled.
> - Removed unnecessary rtnl_lock().
> - Extracted code to handle new ioctls into separate functions to avoid
> adding extra NULL checks to the code handling other ioctls.
> - Introduced variable named "fd" to __tun_chr_ioctl().
> - s/-/=/g in a patch message to avoid confusing Git.
> - Link to v7: https://lore.kernel.org/r/20250228-rss-v7-0-844205cbbdd6@daynix.com
>
> Changes in v7:
> - Ensured to set hash_report to VIRTIO_NET_HASH_REPORT_NONE for
> VHOST_NET_F_VIRTIO_NET_HDR.
> - s/4/sizeof(u32)/ in patch "virtio_net: Add functions for hashing".
> - Added tap_skb_cb type.
> - Rebased.
> - Link to v6: https://lore.kernel.org/r/20250109-rss-v6-0-b1c90ad708f6@daynix.com
>
> Changes in v6:
> - Extracted changes to fill vnet header holes into another series.
> - Squashed patches "skbuff: Introduce SKB_EXT_TUN_VNET_HASH", "tun:
> Introduce virtio-net hash reporting feature", and "tun: Introduce
> virtio-net RSS" into patch "tun: Introduce virtio-net hash feature".
> - Dropped the RFC tag.
> - Link to v5: https://lore.kernel.org/r/20241008-rss-v5-0-f3cf68df005d@daynix.com
>
> Changes in v5:
> - Fixed a compilation error with CONFIG_TUN_VNET_CROSS_LE.
> - Optimized the calculation of the hash value according to:
> https://git.dpdk.org/dpdk/commit/?id=3fb1ea032bd6ff8317af5dac9af901f1f324cab4
> - Added patch "tun: Unify vnet implementation".
> - Dropped patch "tap: Pad virtio header with zero".
> - Added patch "selftest: tun: Test vnet ioctls without device".
> - Reworked selftests to skip for older kernels.
> - Documented the case when the underlying device is deleted and packets
> have queue_mapping set by TC.
> - Reordered test harness arguments.
> - Added code to handle fragmented packets.
> - Link to v4: https://lore.kernel.org/r/20240924-rss-v4-0-84e932ec0e6c@daynix.com
>
> Changes in v4:
> - Moved tun_vnet_hash_ext to if_tun.h.
> - Renamed virtio_net_toeplitz() to virtio_net_toeplitz_calc().
> - Replaced htons() with cpu_to_be16().
> - Changed virtio_net_hash_rss() to return void.
> - Reordered variable declarations in virtio_net_hash_rss().
> - Removed virtio_net_hdr_v1_hash_from_skb().
> - Updated messages of "tap: Pad virtio header with zero" and
> "tun: Pad virtio header with zero".
> - Fixed vnet_hash allocation size.
> - Ensured to free vnet_hash when destructing tun_struct.
> - Link to v3: https://lore.kernel.org/r/20240915-rss-v3-0-c630015db082@daynix.com
>
> Changes in v3:
> - Reverted back to add ioctl.
> - Split patch "tun: Introduce virtio-net hashing feature" into
> "tun: Introduce virtio-net hash reporting feature" and
> "tun: Introduce virtio-net RSS".
> - Changed to reuse hash values computed for automq instead of performing
> RSS hashing when hash reporting is requested but RSS is not.
> - Extracted relevant data from struct tun_struct to keep it minimal.
> - Added kernel-doc.
> - Changed to allow calling TUNGETVNETHASHCAP before TUNSETIFF.
> - Initialized num_buffers with 1.
> - Added a test case for unclassified packets.
> - Fixed error handling in tests.
> - Changed tests to verify that the queue index will not overflow.
> - Rebased.
> - Link to v2: https://lore.kernel.org/r/20231015141644.260646-1-akihiko.odaki@daynix.com
>
> ---
> Akihiko Odaki (10):
> virtio_net: Add functions for hashing
> net: flow_dissector: Export flow_keys_dissector_symmetric
> tun: Allow steering eBPF program to fall back
> tun: Add common virtio-net hash feature code
> tun: Introduce virtio-net hash feature
> tap: Introduce virtio-net hash feature
> selftest: tun: Test vnet ioctls without device
> selftest: tun: Add tests for virtio-net hashing
> selftest: tap: Add tests for virtio-net ioctls
> vhost/net: Support VIRTIO_NET_F_HASH_REPORT
>
> Documentation/networking/tuntap.rst | 7 +
> drivers/net/Kconfig | 1 +
> drivers/net/ipvlan/ipvtap.c | 2 +-
> drivers/net/macvtap.c | 2 +-
> drivers/net/tap.c | 80 +++++-
> drivers/net/tun.c | 92 +++++--
> drivers/net/tun_vnet.h | 165 +++++++++++-
> drivers/vhost/net.c | 68 ++---
> include/linux/if_tap.h | 4 +-
> include/linux/skbuff.h | 3 +
> include/linux/virtio_net.h | 188 ++++++++++++++
> include/net/flow_dissector.h | 1 +
> include/uapi/linux/if_tun.h | 80 ++++++
> net/core/flow_dissector.c | 3 +-
> net/core/skbuff.c | 4 +
> tools/testing/selftests/net/Makefile | 2 +-
> tools/testing/selftests/net/config | 1 +
> tools/testing/selftests/net/tap.c | 131 +++++++++-
> tools/testing/selftests/net/tun.c | 485 ++++++++++++++++++++++++++++++++++-
> 19 files changed, 1234 insertions(+), 85 deletions(-)
> ---
> base-commit: 5cb8274d66c611b7889565c418a8158517810f9b
> change-id: 20240403-rss-e737d89efa77
>
> Best regards,
> --
> Akihiko Odaki <akihiko.odaki@daynix.com>
prev parent reply other threads:[~2025-07-16 8:55 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-30 4:50 [PATCH net-next v12 00/10] tun: Introduce virtio-net hashing feature Akihiko Odaki
2025-05-30 4:50 ` [PATCH net-next v12 01/10] virtio_net: Add functions for hashing Akihiko Odaki
2025-06-03 3:19 ` Jason Wang
2025-06-03 5:31 ` Akihiko Odaki
2025-06-04 1:18 ` Jason Wang
2025-06-04 7:20 ` Akihiko Odaki
2025-06-05 1:53 ` Jason Wang
2025-06-05 7:57 ` Akihiko Odaki
2025-06-06 0:48 ` Jason Wang
2025-06-06 9:10 ` Akihiko Odaki
2025-06-17 3:28 ` Jason Wang
2025-06-21 5:50 ` Akihiko Odaki
2025-06-22 17:40 ` Yuri Benditovich
2025-06-23 8:07 ` Jason Wang
2025-06-23 14:28 ` Yuri Benditovich
2025-06-24 0:49 ` Jason Wang
2025-05-30 4:50 ` [PATCH net-next v12 02/10] net: flow_dissector: Export flow_keys_dissector_symmetric Akihiko Odaki
2025-06-03 3:20 ` Jason Wang
2025-05-30 4:50 ` [PATCH net-next v12 03/10] tun: Allow steering eBPF program to fall back Akihiko Odaki
2025-06-04 1:27 ` Jason Wang
2025-06-04 7:24 ` Akihiko Odaki
2025-06-05 1:55 ` Jason Wang
2025-05-30 4:50 ` [PATCH net-next v12 04/10] tun: Add common virtio-net hash feature code Akihiko Odaki
2025-06-04 1:53 ` Jason Wang
2025-06-04 8:42 ` Akihiko Odaki
2025-06-05 2:46 ` Jason Wang
2025-06-05 8:18 ` Akihiko Odaki
2025-06-06 1:01 ` Jason Wang
2025-06-06 9:26 ` Akihiko Odaki
2025-06-17 3:39 ` Jason Wang
2025-06-19 17:01 ` Akihiko Odaki
2025-06-23 7:59 ` Jason Wang
2025-05-30 4:50 ` [PATCH net-next v12 05/10] tun: Introduce virtio-net hash feature Akihiko Odaki
2025-05-30 4:50 ` [PATCH net-next v12 06/10] tap: " Akihiko Odaki
2025-05-30 4:50 ` [PATCH net-next v12 07/10] selftest: tun: Test vnet ioctls without device Akihiko Odaki
2025-05-30 4:50 ` [PATCH net-next v12 08/10] selftest: tun: Add tests for virtio-net hashing Akihiko Odaki
2025-05-30 4:50 ` [PATCH net-next v12 09/10] selftest: tap: Add tests for virtio-net ioctls Akihiko Odaki
2025-05-30 4:50 ` [PATCH net-next v12 10/10] vhost/net: Support VIRTIO_NET_F_HASH_REPORT Akihiko Odaki
2025-07-16 8:55 ` Michael S. Tsirkin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250716045513-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=akihiko.odaki@daynix.com \
--cc=andrew@daynix.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gur.stavi@huawei.com \
--cc=horms@kernel.org \
--cc=jasowang@redhat.com \
--cc=kuba@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=leiyang@redhat.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=stephen@networkplumber.org \
--cc=virtualization@lists.linux-foundation.org \
--cc=willemdebruijn.kernel@gmail.com \
--cc=xuanzhuo@linux.alibaba.com \
--cc=yuri.benditovich@daynix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).