[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <auffsp3vajtsh4gynsfusph74bdbghvhoalalgvcfqyvphj5vw@hgiwneiqcbrd>
Date: Fri, 1 Sep 2023 14:34:08 +0200
From: Stefano Garzarella <sgarzare@...hat.com>
To: Arseniy Krasnov <avkrasnov@...utedevices.com>
Cc: Stefan Hajnoczi <stefanha@...hat.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
"Michael S. Tsirkin" <mst@...hat.com>, Jason Wang <jasowang@...hat.com>,
Bobby Eshleman <bobby.eshleman@...edance.com>, kvm@...r.kernel.org, virtualization@...ts.linux-foundation.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org, kernel@...rdevices.ru,
oxffffaa@...il.com
Subject: Re: [PATCH net-next v7 1/4] vsock/virtio/vhost: read data from
non-linear skb
On Sun, Aug 27, 2023 at 11:54:33AM +0300, Arseniy Krasnov wrote:
>This is preparation patch for MSG_ZEROCOPY support. It adds handling of
>non-linear skbs by replacing direct calls of 'memcpy_to_msg()' with
>'skb_copy_datagram_iter()'. Main advantage of the second one is that it
>can handle paged part of the skb by using 'kmap()' on each page, but if
>there are no pages in the skb, it behaves like simple copying to iov
>iterator. This patch also adds new field to the control block of skb -
>this value shows current offset in the skb to read next portion of data
>(it doesn't matter linear it or not). Idea behind this field is that
>'skb_copy_datagram_iter()' handles both types of skb internally - it
>just needs an offset from which to copy data from the given skb. This
>offset is incremented on each read from skb. This approach allows to
>simplify handling of both linear and non-linear skbs, because for
>linear skb we need to call 'skb_pull()' after reading data from it,
>while in non-linear case we need to update 'data_len'.
>
>Signed-off-by: Arseniy Krasnov <avkrasnov@...utedevices.com>
>---
> Changelog:
> v5(big patchset) -> v1:
> * Merge 'virtio_transport_common.c' and 'vhost/vsock.c' patches into
> this single patch.
> * Commit message update: grammar fix and remark that this patch is
> MSG_ZEROCOPY preparation.
> * Use 'min_t()' instead of comparison using '<>' operators.
> v1 -> v2:
> * R-b tag added.
> v3 -> v4:
> * R-b tag removed due to rebase:
> * Part for 'virtio_transport_stream_do_peek()' is changed.
> * Part for 'virtio_transport_seqpacket_do_peek()' is added.
> * Comments about sleep in 'memcpy_to_msg()' now describe sleep in
> 'skb_copy_datagram_iter()'.
> v5 -> v6:
> * Commit message update.
> * Rename 'frag_off' to 'offset' in 'virtio_vsock_skb_cb'.
>
> drivers/vhost/vsock.c | 14 +++++++----
> include/linux/virtio_vsock.h | 1 +
> net/vmw_vsock/virtio_transport_common.c | 32 +++++++++++++++----------
> 3 files changed, 29 insertions(+), 18 deletions(-)
Reviewed-by: Stefano Garzarella <sgarzare@...hat.com>
Powered by blists - more mailing lists