patches will soon be submitted to the upstream as RFC too.
This work will be presented at LPC 2024:
https://lpc.events/event/18/contributions/1963/
V1 -> V2:
Changed to introduce a new BPF program type.
Signed-off-by: Akihiko Odaki
---
Changes in v3:
- Reverted back to add ioctl.
- Split patch &
This new extension will be used by tun to carry the hash values and
types to report with virtio-net headers.
Signed-off-by: Akihiko Odaki
---
include/linux/skbuff.h | 10 ++
net/core/skbuff.c | 3 +++
2 files changed, 13 insertions(+)
diff --git a/include/linux/skbuff.h b/include
They are useful to implement VIRTIO_NET_F_RSS and
VIRTIO_NET_F_HASH_REPORT.
Signed-off-by: Akihiko Odaki
---
include/linux/virtio_net.h | 198 +
1 file changed, 198 insertions(+)
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
flow_keys_dissector_symmetric is useful to derive a symmetric hash
and to know its source such as IPv4, IPv6, TCP, and UDP.
Signed-off-by: Akihiko Odaki
---
include/net/flow_dissector.h | 1 +
net/core/flow_dissector.c| 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a
leaving the garbage in the buffer is
awkward anyway so fill the buffer in tap.
Signed-off-by: Akihiko Odaki
---
drivers/net/tap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index 77574f7a3bd4..ba044302ccc6 100644
--- a/drivers/net/tap.c
leaving the garbage in the buffer is
awkward anyway so fill the buffer in tun.
Signed-off-by: Akihiko Odaki
---
drivers/net/tun.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 1d06c560c5e6..9d93ab9ee58f 100644
--- a/drivers/net
Allow the guest to reuse the hash value to make receive steering
consistent between the host and guest, and to save hash computation.
Signed-off-by: Akihiko Odaki
---
Documentation/networking/tuntap.rst | 7 ++
drivers/net/Kconfig | 1 +
drivers/net/tun.c
UAPIs.
Signed-off-by: Akihiko Odaki
---
drivers/net/tun.c | 119 +++-
include/uapi/linux/if_tun.h | 27 ++
2 files changed, 133 insertions(+), 13 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index b8fcd71becac..5a429b3
The added tests confirm tun can perform RSS and hash reporting, and
reject invalid configurations for them.
Signed-off-by: Akihiko Odaki
---
tools/testing/selftests/net/Makefile | 2 +-
tools/testing/selftests/net/tun.c| 666 ++-
2 files changed, 660
reported.
VIRTIO_NET_F_HASH_REPORT requires VIRTIO_F_VERSION_1.
Signed-off-by: Akihiko Odaki
---
drivers/vhost/net.c | 16
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index f16279351db5..ec1167a782ec 100644
--- a/drivers
This new extension will be used by tun to carry the hash values and
types to report with virtio-net headers.
Signed-off-by: Akihiko Odaki
---
include/linux/skbuff.h | 3 +++
net/core/skbuff.c | 4
2 files changed, 7 insertions(+)
diff --git a/include/linux/skbuff.h b/include/linux
-hash-v3-0-79cb08d28...@daynix.com/
This work was presented at LPC 2024:
https://lpc.events/event/18/contributions/1963/
V1 -> V2:
Changed to introduce a new BPF program type.
Signed-off-by: Akihiko Odaki
---
Changes in v5:
- Fixed a compilation error with CONFIG_TUN_VNET_CROSS_LE.
- Optimi
They are useful to implement VIRTIO_NET_F_RSS and
VIRTIO_NET_F_HASH_REPORT.
Signed-off-by: Akihiko Odaki
---
include/linux/virtio_net.h | 188 +
1 file changed, 188 insertions(+)
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
flow_keys_dissector_symmetric is useful to derive a symmetric hash
and to know its source such as IPv4, IPv6, TCP, and UDP.
Signed-off-by: Akihiko Odaki
---
include/net/flow_dissector.h | 1 +
net/core/flow_dissector.c| 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a
Both tun and tap exposes the same set of virtio-net-related features.
Unify their implementations to ease future changes.
Signed-off-by: Akihiko Odaki
---
MAINTAINERS| 1 +
drivers/net/tap.c | 172 ++--
drivers/net/tun.c | 208
Allow the guest to reuse the hash value to make receive steering
consistent between the host and guest, and to save hash computation.
Signed-off-by: Akihiko Odaki
---
Documentation/networking/tuntap.rst | 7 +++
drivers/net/Kconfig | 1 +
drivers/net/tap.c
read() to avoid such a problem, but leaving the garbage in the buffer is
awkward anyway so fill the buffer in tun.
Signed-off-by: Akihiko Odaki
---
drivers/net/tun_vnet.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/tun_vnet.h b/drivers/net/tun_vnet.h
index
UAPIs.
Signed-off-by: Akihiko Odaki
---
drivers/net/tap.c | 11 +-
drivers/net/tun.c | 57 ---
drivers/net/tun_vnet.h | 96 +
include/linux/if_tap.h | 4 +-
include/uapi/linux/if_tun.h
Ensure that vnet ioctls result in EBADFD when the underlying device is
deleted.
Signed-off-by: Akihiko Odaki
---
tools/testing/selftests/net/tun.c | 74 +++
1 file changed, 74 insertions(+)
diff --git a/tools/testing/selftests/net/tun.c
b/tools/testing
reported.
VIRTIO_NET_F_HASH_REPORT requires VIRTIO_F_VERSION_1.
Signed-off-by: Akihiko Odaki
---
drivers/vhost/net.c | 16
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index f16279351db5..ec1167a782ec 100644
--- a/drivers
The added tests confirm tun can perform RSS and hash reporting, and
reject invalid configurations for them.
Signed-off-by: Akihiko Odaki
---
tools/testing/selftests/net/Makefile | 2 +-
tools/testing/selftests/net/tun.c| 558 ++-
2 files changed, 551
On 2024/10/09 22:55, Willem de Bruijn wrote:
Akihiko Odaki wrote:
Both tun and tap exposes the same set of virtio-net-related features.
Unify their implementations to ease future changes.
Signed-off-by: Akihiko Odaki
---
MAINTAINERS| 1 +
drivers/net/tap.c | 172
On 2024/10/02 1:31, Stephen Hemminger wrote:
On Tue, 1 Oct 2024 14:54:29 +0900
Akihiko Odaki wrote:
On 2024/09/30 0:33, Stephen Hemminger wrote:
On Sun, 29 Sep 2024 16:10:47 +0900
Akihiko Odaki wrote:
On 2024/09/29 11:07, Jason Wang wrote:
On Fri, Sep 27, 2024 at 3:51 PM Akihiko Odaki
On 2024/10/09 17:05, Jason Wang wrote:
On Tue, Oct 8, 2024 at 2:55 PM Akihiko Odaki wrote:
Allow the guest to reuse the hash value to make receive steering
consistent between the host and guest, and to save hash computation.
Signed-off-by: Akihiko Odaki
I wonder if this would cause
On 2024/10/09 17:14, Jason Wang wrote:
On Tue, Oct 8, 2024 at 2:55 PM Akihiko Odaki wrote:
RSS is a receive steering algorithm that can be negotiated to use with
virtio_net. Conventionally the hash calculation was done by the VMM.
However, computing the hash after the queue was chosen defeats
On 2024/10/09 22:51, Willem de Bruijn wrote:
Akihiko Odaki wrote:
They are useful to implement VIRTIO_NET_F_RSS and
VIRTIO_NET_F_HASH_REPORT.
Signed-off-by: Akihiko Odaki
---
include/linux/virtio_net.h | 188 +
No need for these to be in header
On 2024/09/15 21:48, Stephen Hemminger wrote:
On Sun, 15 Sep 2024 10:17:39 +0900
Akihiko Odaki 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
On 2024/09/18 14:50, Willem de Bruijn wrote:
Akihiko Odaki wrote:
They are useful to implement VIRTIO_NET_F_RSS and
VIRTIO_NET_F_HASH_REPORT.
Signed-off-by: Akihiko Odaki
---
include/linux/virtio_net.h | 198 +
1 file changed, 198 insertions
On 2024/09/18 15:17, Willem de Bruijn wrote:
Akihiko Odaki wrote:
Allow the guest to reuse the hash value to make receive steering
consistent between the host and guest, and to save hash computation.
Signed-off-by: Akihiko Odaki
---
Documentation/networking/tuntap.rst | 7 ++
drivers/net
On 2024/09/24 10:56, Akihiko Odaki wrote:
On 2024/09/18 15:28, Willem de Bruijn wrote:
Akihiko Odaki wrote:
RSS is a receive steering algorithm that can be negotiated to use with
virtio_net. Conventionally the hash calculation was done by the VMM.
However, computing the hash after the queue
On 2024/09/18 15:28, Willem de Bruijn wrote:
Akihiko Odaki wrote:
RSS is a receive steering algorithm that can be negotiated to use with
virtio_net. Conventionally the hash calculation was done by the VMM.
However, computing the hash after the queue was chosen defeats the
purpose of RSS
-hash-v3-0-79cb08d28...@daynix.com/
This work was presented at LPC 2024:
https://lpc.events/event/18/contributions/1963/
V1 -> V2:
Changed to introduce a new BPF program type.
Signed-off-by: Akihiko Odaki
---
Changes in v4:
- Moved tun_vnet_hash_ext to if_tun.h.
- Renamed virtio_net_toeplitz()
They are useful to implement VIRTIO_NET_F_RSS and
VIRTIO_NET_F_HASH_REPORT.
Signed-off-by: Akihiko Odaki
---
include/linux/virtio_net.h | 174 +
1 file changed, 174 insertions(+)
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
flow_keys_dissector_symmetric is useful to derive a symmetric hash
and to know its source such as IPv4, IPv6, TCP, and UDP.
Signed-off-by: Akihiko Odaki
---
include/net/flow_dissector.h | 1 +
net/core/flow_dissector.c| 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a
This new extension will be used by tun to carry the hash values and
types to report with virtio-net headers.
Signed-off-by: Akihiko Odaki
---
include/linux/if_tun.h | 5 +
include/linux/skbuff.h | 3 +++
net/core/skbuff.c | 4
3 files changed, 12 insertions(+)
diff --git a
Allow the guest to reuse the hash value to make receive steering
consistent between the host and guest, and to save hash computation.
Signed-off-by: Akihiko Odaki
---
Documentation/networking/tuntap.rst | 7 +++
drivers/net/Kconfig | 1 +
drivers/net/tun.c
read() to avoid such a problem, but leaving the garbage in the buffer is
awkward anyway so fill the buffer in tap.
Signed-off-by: Akihiko Odaki
---
drivers/net/tap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index 77574f7a3bd4
read() to avoid such a problem, but leaving the garbage in the buffer is
awkward anyway so fill the buffer in tun.
Signed-off-by: Akihiko Odaki
---
drivers/net/tun.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 1d06c560c5e6
The added tests confirm tun can perform RSS and hash reporting, and
reject invalid configurations for them.
Signed-off-by: Akihiko Odaki
---
tools/testing/selftests/net/Makefile | 2 +-
tools/testing/selftests/net/tun.c| 666 ++-
2 files changed, 660
UAPIs.
Signed-off-by: Akihiko Odaki
---
drivers/net/tun.c | 158 ++--
include/uapi/linux/if_tun.h | 27
2 files changed, 163 insertions(+), 22 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 986e4a5bf04d..680eb45
reported.
VIRTIO_NET_F_HASH_REPORT requires VIRTIO_F_VERSION_1.
Signed-off-by: Akihiko Odaki
---
drivers/vhost/net.c | 16
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index f16279351db5..ec1167a782ec 100644
--- a/drivers
On 2024/09/24 22:05, Simon Horman wrote:
On Tue, Sep 24, 2024 at 11:01:12AM +0200, Akihiko Odaki wrote:
RSS is a receive steering algorithm that can be negotiated to use with
virtio_net. Conventionally the hash calculation was done by the VMM.
However, computing the hash after the queue was
On 2024/09/25 12:30, Jason Wang wrote:
On Tue, Sep 24, 2024 at 5:01 PM Akihiko Odaki 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
On 2024/09/27 13:31, Jason Wang wrote:
On Fri, Sep 27, 2024 at 10:11 AM Akihiko Odaki wrote:
On 2024/09/25 12:30, Jason Wang wrote:
On Tue, Sep 24, 2024 at 5:01 PM Akihiko Odaki wrote:
virtio-net have two usage of hashes: one is RSS and another is hash
reporting. Conventionally the hash
On 2024/09/29 11:07, Jason Wang wrote:
On Fri, Sep 27, 2024 at 3:51 PM Akihiko Odaki wrote:
On 2024/09/27 13:31, Jason Wang wrote:
On Fri, Sep 27, 2024 at 10:11 AM Akihiko Odaki wrote:
On 2024/09/25 12:30, Jason Wang wrote:
On Tue, Sep 24, 2024 at 5:01 PM Akihiko Odaki wrote:
virtio
On 2024/09/30 0:33, Stephen Hemminger wrote:
On Sun, 29 Sep 2024 16:10:47 +0900
Akihiko Odaki wrote:
On 2024/09/29 11:07, Jason Wang wrote:
On Fri, Sep 27, 2024 at 3:51 PM Akihiko Odaki wrote:
On 2024/09/27 13:31, Jason Wang wrote:
On Fri, Sep 27, 2024 at 10:11 AM Akihiko Odaki wrote
f (be32_to_cpu(*input) & bit)
state->hash ^= state->key_buffer;
state->key_buffer =
(state->key_buffer << 1) | (key & 1);
}
This unfortunately does not work. swab32() works at *byte*-level but we
need to reverse the order of *bits*. bitrev32() is what we need, but it
cannot eliminate be32_to_cpu().
Regards,
Akihiko Odaki
https://lore.kernel.org/r/20241008-rss-v5-0-f3cf68df0...@daynix.com
[2]: https://lore.kernel.org/r/20241227084256-mutt-send-email-...@kernel.org/
Signed-off-by: Akihiko Odaki
---
Changes in v5:
- s/vnet_hdr_len_sz/vnet_hdr_sz/ for patch "tun: Decouple vnet handling"
(Willem de Bruijn)
- Changed
Decouple vnet-related functions from tun_struct so that we can reuse
them for tap in the future.
Signed-off-by: Akihiko Odaki
Reviewed-by: Willem de Bruijn
---
drivers/net/tun.c | 51 ++-
1 file changed, 26 insertions(+), 25 deletions(-)
diff
hdr_len is repeatedly used so keep it in a local variable.
Signed-off-by: Akihiko Odaki
Reviewed-by: Willem de Bruijn
---
drivers/net/tun.c | 24 +++-
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index
Check IS_ENABLED(CONFIG_TUN_VNET_CROSS_LE) to save some lines and make
future changes easier.
Signed-off-by: Akihiko Odaki
Reviewed-by: Willem de Bruijn
---
drivers/net/tun.c | 26 --
1 file changed, 8 insertions(+), 18 deletions(-)
diff --git a/drivers/net/tun.c b
The vnet handling code will be reused by tap.
Signed-off-by: Akihiko Odaki
---
MAINTAINERS| 2 +-
drivers/net/tun.c | 179 +--
drivers/net/tun_vnet.h | 184 +
3 files changed, 187
Decouple the vnet handling code so that we can reuse it for tap.
Signed-off-by: Akihiko Odaki
Reviewed-by: Willem de Bruijn
---
drivers/net/tun.c | 237 --
1 file changed, 139 insertions(+), 98 deletions(-)
diff --git a/drivers/net/tun.c b
tun and tap implements the same vnet-related features so reuse the code.
Signed-off-by: Akihiko Odaki
---
drivers/net/tap.c | 152 ++
1 file changed, 16 insertions(+), 136 deletions(-)
diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index
hdr_len is repeatedly used so keep it in a local variable.
Signed-off-by: Akihiko Odaki
---
drivers/net/tap.c | 30 +-
1 file changed, 13 insertions(+), 17 deletions(-)
diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index
On 2025/02/06 6:06, Willem de Bruijn wrote:
Akihiko Odaki wrote:
Check IS_ENABLED(CONFIG_TUN_VNET_CROSS_LE) to save some lines and make
future changes easier.
Signed-off-by: Akihiko Odaki
Reviewed-by: Willem de Bruijn
---
drivers/net/tun.c | 26 --
1 file changed
On 2025/02/06 6:21, Willem de Bruijn wrote:
Akihiko Odaki wrote:
hdr_len is repeatedly used so keep it in a local variable.
Signed-off-by: Akihiko Odaki
@@ -682,11 +683,8 @@ static ssize_t tap_get_user(struct tap_queue *q, void
*msg_control,
if (msg_control && sock_fla
On 2025/02/06 6:12, Willem de Bruijn wrote:
Akihiko Odaki wrote:
The vnet handling code will be reused by tap.
Signed-off-by: Akihiko Odaki
---
MAINTAINERS| 2 +-
drivers/net/tun.c | 179 +--
drivers/net/tun_vnet.h | 184
hdr_len is repeatedly used so keep it in a local variable.
Signed-off-by: Akihiko Odaki
Reviewed-by: Willem de Bruijn
---
drivers/net/tun.c | 24 +++-
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index
https://lore.kernel.org/r/20241008-rss-v5-0-f3cf68df0...@daynix.com
[2]: https://lore.kernel.org/r/20241227084256-mutt-send-email-...@kernel.org/
Signed-off-by: Akihiko Odaki
---
Changes in v6:
- Added an intermediate variable in tun_vnet_legacy_is_little_endian()
to reduce a complexity of an expre
Check IS_ENABLED(CONFIG_TUN_VNET_CROSS_LE) to save some lines and make
future changes easier.
Signed-off-by: Akihiko Odaki
Reviewed-by: Willem de Bruijn
---
drivers/net/tun.c | 29 ++---
1 file changed, 10 insertions(+), 19 deletions(-)
diff --git a/drivers/net/tun.c b
The vnet handling code will be reused by tap.
Functions are renamed to ensure that their names contain "vnet" to
clarify that they are part of the decoupled vnet handling code.
Signed-off-by: Akihiko Odaki
---
MAINTAINERS| 2 +-
drivers/net/tun.c
Decouple the vnet handling code so that we can reuse it for tap.
Signed-off-by: Akihiko Odaki
Reviewed-by: Willem de Bruijn
---
drivers/net/tun.c | 237 --
1 file changed, 139 insertions(+), 98 deletions(-)
diff --git a/drivers/net/tun.c b
tun and tap implements the same vnet-related features so reuse the code.
Signed-off-by: Akihiko Odaki
Reviewed-by: Willem de Bruijn
---
drivers/net/tap.c | 152 ++
1 file changed, 16 insertions(+), 136 deletions(-)
diff --git a/drivers/net
Decouple vnet-related functions from tun_struct so that we can reuse
them for tap in the future.
Signed-off-by: Akihiko Odaki
Reviewed-by: Willem de Bruijn
---
drivers/net/tun.c | 51 ++-
1 file changed, 26 insertions(+), 25 deletions(-)
diff
hdr_len is repeatedly used so keep it in a local variable.
Signed-off-by: Akihiko Odaki
---
drivers/net/tap.c | 28 ++--
1 file changed, 10 insertions(+), 18 deletions(-)
diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index
5aa41d5f7765a6dcf185bccd3cba2299bad89398
V1 -> V2:
Changed to introduce a new BPF program type.
Signed-off-by: Akihiko Odaki
---
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 f
They are useful to implement VIRTIO_NET_F_RSS and
VIRTIO_NET_F_HASH_REPORT.
Signed-off-by: Akihiko Odaki
---
include/linux/virtio_net.h | 188 +
1 file changed, 188 insertions(+)
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
flow_keys_dissector_symmetric is useful to derive a symmetric hash
and to know its source such as IPv4, IPv6, TCP, and UDP.
Signed-off-by: Akihiko Odaki
---
include/net/flow_dissector.h | 1 +
net/core/flow_dissector.c| 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a
es on legacy context rewriting, and
introducing kfunc-based eBPF will result in non-UAPI dependency while
the other relevant virtualization APIs such as KVM and vhost_net are
UAPIs.
Signed-off-by: Akihiko Odaki
---
Documentation/networking/tuntap.rst | 7 ++
drivers/net/Kconfig
Ensure that vnet ioctls result in EBADFD when the underlying device is
deleted.
Signed-off-by: Akihiko Odaki
---
tools/testing/selftests/net/tun.c | 74 +++
1 file changed, 74 insertions(+)
diff --git a/tools/testing/selftests/net/tun.c
b/tools/testing
reported.
VIRTIO_NET_F_HASH_REPORT requires VIRTIO_F_VERSION_1.
Signed-off-by: Akihiko Odaki
---
drivers/vhost/net.c | 16
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 9ad37c012189..ed1bf01a7fcf 100644
--- a/drivers
The added tests confirm tun can perform RSS and hash reporting, and
reject invalid configurations for them.
Signed-off-by: Akihiko Odaki
---
tools/testing/selftests/net/Makefile | 2 +-
tools/testing/selftests/net/tun.c| 558 ++-
2 files changed, 551
On 2025/01/09 16:31, Michael S. Tsirkin wrote:
On Thu, Jan 09, 2025 at 03:58:44PM +0900, Akihiko Odaki wrote:
tun used to simply advance iov_iter when it needs to pad virtio header,
which leaves the garbage in the buffer as is. This is especially
problematic when tun starts to allow enabling
Both tun and tap exposes the same set of virtio-net-related features.
Unify their implementations to ease future changes.
Signed-off-by: Akihiko Odaki
---
MAINTAINERS| 1 +
drivers/net/Kconfig| 5 ++
drivers/net/Makefile | 1 +
drivers/net/tap.c | 172
https://lore.kernel.org/r/20241008-rss-v5-0-f3cf68df0...@daynix.com
[2]: https://lore.kernel.org/r/20241227084256-mutt-send-email-...@kernel.org/
Signed-off-by: Akihiko Odaki
---
Changes in v2:
- Fixed num_buffers endian.
- Link to v1:
https://lore.kernel.org/r/20250108-tun-v1-0-67d784b34...@dayni
read() to avoid such a problem, but leaving the garbage in the buffer is
awkward anyway so fill the buffer in tun.
Signed-off-by: Akihiko Odaki
---
drivers/net/tun_vnet.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/tun_vnet.c b/drivers/net/tun_vnet.c
index
The specification says the device MUST set num_buffers to 1 if
VIRTIO_NET_F_MRG_RXBUF has not been negotiated.
Signed-off-by: Akihiko Odaki
---
drivers/net/tap.c | 2 +-
drivers/net/tun.c | 6 --
drivers/net/tun_vnet.c | 14 +-
drivers/net/tun_vnet.h | 4 ++--
4
On 2025/01/10 12:27, Jason Wang wrote:
On Thu, Jan 9, 2025 at 2:59 PM Akihiko Odaki wrote:
The specification says the device MUST set num_buffers to 1 if
VIRTIO_NET_F_MRG_RXBUF has not been negotiated.
Have we agreed on how to fix the spec or not?
As I replied in the spec patch, if we just
On 2025/01/10 12:27, Jason Wang wrote:
On Thu, Jan 9, 2025 at 2:59 PM Akihiko Odaki wrote:
tun used to simply advance iov_iter when it needs to pad virtio header,
which leaves the garbage in the buffer as is. This is especially
problematic when tun starts to allow enabling the hash reporting
On 2025/01/09 23:06, Willem de Bruijn wrote:
Akihiko Odaki wrote:
Both tun and tap exposes the same set of virtio-net-related features.
Unify their implementations to ease future changes.
Signed-off-by: Akihiko Odaki
---
MAINTAINERS| 1 +
drivers/net/Kconfig| 5
On 2025/01/09 23:36, Willem de Bruijn wrote:
Akihiko Odaki wrote:
The added tests confirm tun can perform RSS and hash reporting, and
reject invalid configurations for them.
Signed-off-by: Akihiko Odaki
---
tools/testing/selftests/net/Makefile | 2 +-
tools/testing/selftests/net/tun.c
On 2025/01/09 23:13, Willem de Bruijn wrote:
Akihiko Odaki wrote:
They are useful to implement VIRTIO_NET_F_RSS and
VIRTIO_NET_F_HASH_REPORT.
Toeplitz potentially has users beyond virtio. I wonder if we should
from the start implement this as net/core/rss.c.
Or in lib/toeplitz.c just as
On 2025/01/09 23:28, Willem de Bruijn wrote:
Akihiko Odaki wrote:
Hash reporting
--
Allow the guest to reuse the hash value to make receive steering
consistent between the host and guest, and to save hash computation.
RSS
---
RSS is a receive steering algorithm that can be
On 2025/01/10 19:23, Michael S. Tsirkin wrote:
On Fri, Jan 10, 2025 at 11:27:13AM +0800, Jason Wang wrote:
On Thu, Jan 9, 2025 at 2:59 PM Akihiko Odaki wrote:
The specification says the device MUST set num_buffers to 1 if
VIRTIO_NET_F_MRG_RXBUF has not been negotiated.
Have we agreed on
On 2025/01/09 21:46, Willem de Bruijn wrote:
Akihiko Odaki wrote:
On 2025/01/09 16:31, Michael S. Tsirkin wrote:
On Thu, Jan 09, 2025 at 03:58:44PM +0900, Akihiko Odaki wrote:
tun used to simply advance iov_iter when it needs to pad virtio header,
which leaves the garbage in the buffer as is
On 2025/01/20 20:19, Willem de Bruijn wrote:
On Mon, Jan 20, 2025 at 1:37 AM Jason Wang wrote:
On Fri, Jan 17, 2025 at 6:35 PM Akihiko Odaki wrote:
On 2025/01/17 18:23, Willem de Bruijn wrote:
Akihiko Odaki wrote:
tun and tap implements the same vnet-related features so reuse the code
On 2025/01/20 20:24, Willem de Bruijn wrote:
Akihiko Odaki wrote:
hdr_len is repeatedly used so keep it in a local variable.
Signed-off-by: Akihiko Odaki
---
drivers/net/tap.c | 17 +++--
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/net/tap.c b/drivers
On 2025/01/20 9:40, Jason Wang wrote:
On Thu, Jan 16, 2025 at 1:30 PM Akihiko Odaki wrote:
On 2025/01/16 10:06, Jason Wang wrote:
On Wed, Jan 15, 2025 at 1:07 PM Akihiko Odaki wrote:
On 2025/01/13 12:04, Jason Wang wrote:
On Fri, Jan 10, 2025 at 7:12 PM Akihiko Odaki wrote:
On 2025/01
https://lore.kernel.org/r/20241008-rss-v5-0-f3cf68df0...@daynix.com
[2]: https://lore.kernel.org/r/20241227084256-mutt-send-email-...@kernel.org/
Signed-off-by: Akihiko Odaki
---
Changes in v4:
- s/sz/vnet_hdr_len_sz/ for patch "tun: Decouple vnet handling"
(Willem de Bruijn)
- Reverted to add
Decouple the vnet handling code so that we can reuse it for tap.
Signed-off-by: Akihiko Odaki
---
drivers/net/tun.c | 229 +++---
1 file changed, 133 insertions(+), 96 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index
tun and tap implements the same vnet-related features so reuse the code.
Signed-off-by: Akihiko Odaki
---
drivers/net/Kconfig | 1 +
drivers/net/tap.c | 152 ++--
2 files changed, 16 insertions(+), 137 deletions(-)
diff --git a/drivers/net
tun_get_user() used to track the length of iov_iter with another
variable. We can use iov_iter_count() to determine the current length
to avoid such chores.
Signed-off-by: Akihiko Odaki
Reviewed-by: Willem de Bruijn
---
drivers/net/tun.c | 12 ++--
1 file changed, 6 insertions(+), 6
Check IS_ENABLED(CONFIG_TUN_VNET_CROSS_LE) to save some lines and make
future changes easier.
Signed-off-by: Akihiko Odaki
Reviewed-by: Willem de Bruijn
---
drivers/net/tun.c | 26 --
1 file changed, 8 insertions(+), 18 deletions(-)
diff --git a/drivers/net/tun.c b
Decouple vnet-related functions from tun_struct so that we can reuse
them for tap in the future.
Signed-off-by: Akihiko Odaki
---
drivers/net/tun.c | 53 +++--
1 file changed, 27 insertions(+), 26 deletions(-)
diff --git a/drivers/net/tun.c b
hdr_len is repeatedly used so keep it in a local variable.
Signed-off-by: Akihiko Odaki
Reviewed-by: Willem de Bruijn
---
drivers/net/tun.c | 14 +-
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index
The vnet handling code will be reused by tap.
Signed-off-by: Akihiko Odaki
---
MAINTAINERS| 2 +-
drivers/net/Kconfig| 4 ++
drivers/net/Makefile | 1 +
drivers/net/tun.c | 174 +-
drivers/net/tun_vnet.c | 184
hdr_len is repeatedly used so keep it in a local variable.
Signed-off-by: Akihiko Odaki
---
drivers/net/tap.c | 17 +++--
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index
061c2f27dfc83f5e6d0bea4da0e845cc429b1fd8
tap_get_user() used to track the length of iov_iter with another
variable. We can use iov_iter_count() to determine the current length
to avoid such chores.
Signed-off-by: Akihiko Odaki
---
drivers/net/tap.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers
On 2025/01/13 12:04, Jason Wang wrote:
On Fri, Jan 10, 2025 at 7:12 PM Akihiko Odaki wrote:
On 2025/01/10 19:23, Michael S. Tsirkin wrote:
On Fri, Jan 10, 2025 at 11:27:13AM +0800, Jason Wang wrote:
On Thu, Jan 9, 2025 at 2:59 PM Akihiko Odaki wrote:
The specification says the device
1 - 100 of 192 matches
Mail list logo