Re: [PATCH net-next v6 6/7] tap: Keep hdr_len in tap_get_user()

2025-02-07 Thread Willem de Bruijn
Akihiko Odaki wrote: > hdr_len is repeatedly used so keep it in a local variable. > > Signed-off-by: Akihiko Odaki Reviewed-by: Willem de Bruijn

Re: [PATCH net-next v6 5/7] tun: Extract the vnet handling code

2025-02-07 Thread Willem de Bruijn
Akihiko Odaki wrote: > 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 Reviewed-by: Willem de Bruijn

Re: [PATCH net-next v5 6/7] tap: Keep hdr_len in tap_get_user()

2025-02-06 Thread Willem de Bruijn
Akihiko Odaki wrote: > 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 @@ st

Re: [PATCH net-next v3 5/6] net: devmem: Implement TX path

2025-02-05 Thread Willem de Bruijn
Mina Almasry wrote: > Augment dmabuf binding to be able to handle TX. Additional to all the RX > binding, we also create tx_vec needed for the TX path. > > Provide API for sendmsg to be able to send dmabufs bound to this device: > > - Provide a new dmabuf_tx_cmsg which includes the dmabuf to send

Re: [PATCH net-next v5 6/7] tap: Keep hdr_len in tap_get_user()

2025-02-05 Thread Willem de Bruijn
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_flag(&q->sk, SOCK_ZEROCOPY)) { > struct i

Re: [PATCH net-next v5 7/7] tap: Use tun's vnet-related code

2025-02-05 Thread Willem de Bruijn
Akihiko Odaki wrote: > tun and tap implements the same vnet-related features so reuse the code. > > Signed-off-by: Akihiko Odaki Reviewed-by: Willem de Bruijn

Re: [PATCH net-next v5 6/7] tap: Keep hdr_len in tap_get_user()

2025-02-05 Thread Willem de Bruijn
Akihiko Odaki wrote: > hdr_len is repeatedly used so keep it in a local variable. > > Signed-off-by: Akihiko Odaki Reviewed-by: Willem de Bruijn

Re: [PATCH net-next v5 5/7] tun: Extract the vnet handling code

2025-02-05 Thread Willem de Bruijn
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 > +++

Re: [PATCH net-next v5 1/7] tun: Refactor CONFIG_TUN_VNET_CROSS_LE

2025-02-05 Thread Willem de Bruijn
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, 8 ins

Re: [PATCH RFC net-next v1 5/5] net: devmem: Implement TX path

2025-01-28 Thread Willem de Bruijn
> > > +struct net_devmem_dmabuf_binding * > > > +net_devmem_get_sockc_binding(struct sock *sk, struct sockcm_cookie > > > *sockc) > > > +{ > > > + struct net_devmem_dmabuf_binding *binding; > > > + int err = 0; > > > + > > > + binding = net_devmem_lookup_dmabuf(sockc->dmabuf_id); > > >

Re: [PATCH net v3 9/9] tap: Use tun's vnet-related code

2025-01-21 Thread Willem de Bruijn
Akihiko Odaki wrote: > 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 B

Re: [PATCH net-next v4 8/9] tap: Keep hdr_len in tap_get_user()

2025-01-21 Thread Willem de Bruijn
Akihiko Odaki wrote: > 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 ++

Re: [PATCH net-next v4 8/9] tap: Keep hdr_len in tap_get_user()

2025-01-20 Thread Willem de Bruijn
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/net/tap.c > index > 061c2f27dfc83

Re: [PATCH net-next v4 7/9] tap: Avoid double-tracking iov_iter length changes

2025-01-20 Thread Willem de Bruijn
Akihiko Odaki wrote: > 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 d

Re: [PATCH net-next v4 5/9] tun: Decouple vnet handling

2025-01-20 Thread Willem de Bruijn
Akihiko Odaki wrote: > Decouple the vnet handling code so that we can reuse it for tap. > > Signed-off-by: Akihiko Odaki Reviewed-by: Willem de Bruijn

Re: [PATCH net v3 9/9] tap: Use tun's vnet-related code

2025-01-20 Thread Willem de Bruijn
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 s

Re: [PATCH net-next v4 4/9] tun: Decouple vnet from tun_struct

2025-01-20 Thread Willem de Bruijn
Akihiko Odaki wrote: > 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

Re: [PATCH net-next v4 0/9] tun: Unify vnet implementation

2025-01-20 Thread Willem de Bruijn
I'll review for when you resend. > --- > Changes in v4: > - s/sz/vnet_hdr_len_sz/ for patch "tun: Decouple vnet handling" > (Willem de Bruijn) Minor, and sorry my bad: len_sz is duplicative, vnet_hdr_sz is common. > - Reverted to add CONFIG_TUN_VNET. > - Link to v

Re: [PATCH net v3 6/9] tun: Extract the vnet handling code

2025-01-17 Thread Willem de Bruijn
Akihiko Odaki wrote: > The vnet handling code will be reused by tap. > > Signed-off-by: Akihiko Odaki > --- > MAINTAINERS| 2 +- > drivers/net/Makefile | 3 +- > drivers/net/tun.c | 174 +--- > drivers/net/tun_vnet.c | 175 > +++

Re: [PATCH net v3 4/9] tun: Decouple vnet from tun_struct

2025-01-17 Thread Willem de Bruijn
Willem de Bruijn wrote: > Akihiko Odaki wrote: > > 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 > >

Re: [PATCH net v3 3/9] tun: Keep hdr_len in tun_get_user()

2025-01-17 Thread Willem de Bruijn
Akihiko Odaki wrote: > hdr_len is repeatedly used so keep it in a local variable. > > Signed-off-by: Akihiko Odaki Reviewed-by: Willem de Bruijn

Re: [PATCH net v3 2/9] tun: Avoid double-tracking iov_iter length changes

2025-01-17 Thread Willem de Bruijn
Akihiko Odaki wrote: > 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

Re: [PATCH net v3 1/9] tun: Refactor CONFIG_TUN_VNET_CROSS_LE

2025-01-17 Thread Willem de Bruijn
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

Re: [PATCH net v3 9/9] tap: Use tun's vnet-related code

2025-01-17 Thread Willem de Bruijn
Akihiko Odaki wrote: > tun and tap implements the same vnet-related features so reuse the code. > > Signed-off-by: Akihiko Odaki > --- > drivers/net/Kconfig| 1 + > drivers/net/Makefile | 6 +- > drivers/net/tap.c | 152 > + > drive

Re: [PATCH net v3 5/9] tun: Decouple vnet handling

2025-01-17 Thread Willem de Bruijn
Akihiko Odaki wrote: > 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/t

Re: [PATCH net v3 4/9] tun: Decouple vnet from tun_struct

2025-01-17 Thread Willem de Bruijn
Akihiko Odaki wrote: > 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(-) >

Re: [PATCH net v3 0/9] tun: Unify vnet implementation

2025-01-16 Thread Willem de Bruijn
Michael S. Tsirkin wrote: > On Thu, Jan 16, 2025 at 05:08:03PM +0900, Akihiko Odaki wrote: > > When I implemented virtio's hash-related features to tun/tap [1], > > I found tun/tap does not fill the entire region reserved for the virtio > > header, leaving some uninitialized hole in the middle of t

Re: [PATCH v2 2/3] tun: Pad virtio header with zero

2025-01-10 Thread Willem de Bruijn
Akihiko Odaki wrote: > On 2025/01/10 17:33, Michael S. Tsirkin wrote: > > On Fri, Jan 10, 2025 at 01:38:06PM +0900, Akihiko Odaki wrote: > >> On 2025/01/09 21:46, Willem de Bruijn wrote: > >>> Akihiko Odaki wrote: > >>>> On 2025/01/09 16:31, Michael S

Re: [PATCH v6 5/6] selftest: tun: Add tests for virtio-net hashing

2025-01-09 Thread Willem de Bruijn
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| 558 > +++

Re: [PATCH v6 3/6] tun: Introduce virtio-net hash feature

2025-01-09 Thread Willem de Bruijn
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 negotiated to use with > virtio_net

Re: [PATCH v6 1/6] virtio_net: Add functions for hashing

2025-01-09 Thread Willem de Bruijn
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. > Signed-off-by: Akihiko Odaki > --- > include/linux/virtio_net.h | 188 >

Re: [PATCH v6 0/6] tun: Introduce virtio-net hashing feature

2025-01-09 Thread Willem de Bruijn
Akihiko Odaki wrote: > This series depends on: "[PATCH v2 0/3] tun: Unify vnet implementation > and fill full vnet header" > https://lore.kernel.org/r/20250109-tun-v2-0-388d7d5a2...@daynix.com As mentioned elsewhere: let's first handle that patch series and return to this series only when that is

Re: [PATCH v2 1/3] tun: Unify vnet implementation

2025-01-09 Thread Willem de Bruijn
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 ++ > drivers/net/Makefile | 1 + > drive

Re: [PATCH v2 0/3] tun: Unify vnet implementation and fill full vnet header

2025-01-09 Thread Willem de Bruijn
Akihiko Odaki wrote: > When I implemented virtio's hash-related features to tun/tap [1], > I found tun/tap does not fill the entire region reserved for the virtio > header, leaving some uninitialized hole in the middle of the buffer > after read()/recvmesg(). > > This series fills the uninitialize

Re: [PATCH v2 2/3] tun: Pad virtio header with zero

2025-01-09 Thread Willem de Bruijn
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. This is especially > >> problemati

Re: [PATCH RFC net-next v1 5/5] net: devmem: Implement TX path

2024-12-26 Thread Willem de Bruijn
Mina Almasry wrote: > Augment dmabuf binding to be able to handle TX. Additional to all the RX > binding, we also create tx_vec and tx_iter needed for the TX path. > > Provide API for sendmsg to be able to send dmabufs bound to this device: > > - Provide a new dmabuf_tx_cmsg which includes the dm

Re: [PATCH RFC net-next v1 2/5] selftests: ncdevmem: Implement devmem TCP TX

2024-12-26 Thread Willem de Bruijn
Mina Almasry wrote: > Add support for devmem TX in ncdevmem. > > This is a combination of the ncdevmem from the devmem TCP series RFCv1 > which included the TX path, and work by Stan to include the netlink API > and refactored on top of his generic memory_provider support. > > Signed-off-by: Mina

Re: [PATCH RFC v5 04/10] tun: Unify vnet implementation

2024-10-12 Thread Willem de Bruijn
Akihiko Odaki wrote: > 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-b

Re: [PATCH RFC v5 01/10] virtio_net: Add functions for hashing

2024-10-12 Thread Willem de Bruijn
Akihiko Odaki wrote: > 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 >

Re: [PATCH RFC v5 06/10] tun: Introduce virtio-net hash reporting feature

2024-10-09 Thread Willem de Bruijn
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/Kconfig | 1 + >

Re: [PATCH RFC v5 04/10] tun: Unify vnet implementation

2024-10-09 Thread Willem de Bruijn
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 ++-- > d

Re: [PATCH RFC v5 01/10] virtio_net: Add functions for hashing

2024-10-09 Thread Willem de Bruijn
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 files

Re: [PATCH RFC v3 7/9] tun: Introduce virtio-net RSS

2024-09-18 Thread Willem de Bruijn
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. > > Another approach is to use eBPF steering p

Re: [PATCH RFC v3 6/9] tun: Introduce virtio-net hash reporting feature

2024-09-18 Thread Willem de Bruijn
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/Kconfig | 1 + > d

Re: [PATCH RFC v3 4/9] tap: Pad virtio header with zero

2024-09-18 Thread Willem de Bruijn
Akihiko Odaki wrote: > tap used to simply advance iov_iter when it needs to pad virtio header. > This leaves the garbage in the buffer as is and prevents telling if the > header is padded or contains some real data. > > In theory, a user of tap can fill the buffer with zero before calling > read()

Re: [PATCH RFC v3 2/9] virtio_net: Add functions for hashing

2024-09-18 Thread Willem de Bruijn
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(+) > > diff --git a/include/linux/vir

Re: [PATCH RFC v3 1/9] skbuff: Introduce SKB_EXT_TUN_VNET_HASH

2024-09-18 Thread Willem de Bruijn
Akihiko Odaki wrote: > 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