Displaying 3 results from an estimated 3 matches for "__zerocopy_sg_from_iter".
2023 Aug 01
0
[PATCH net-next v5 4/4] vsock/virtio: MSG_ZEROCOPY flag support
On Sun, 2023-07-30 at 11:59 +0300, Arseniy Krasnov wrote:
> +static int virtio_transport_fill_skb(struct sk_buff *skb,
> + struct virtio_vsock_pkt_info *info,
> + size_t len,
> + bool zcopy)
> +{
> + if (zcopy) {
> + return __zerocopy_sg_from_iter(info->msg, NULL, skb,
> + &info->msg->msg_iter,
> + len);
> + } else {
No need for an else statement after 'return'
> + void *payload;
> + int err;
> +
> + payload = skb_put(skb, len);
> + err = memcpy_from_msg(payload, info-&g...
2023 Aug 01
0
[PATCH net-next v5 4/4] vsock/virtio: MSG_ZEROCOPY flag support
...iy Krasnov wrote:
> > > +static int virtio_transport_fill_skb(struct sk_buff *skb,
> > > + struct virtio_vsock_pkt_info *info,
> > > + size_t len,
> > > + bool zcopy)
> > > +{
> > > + if (zcopy) {
> > > + return __zerocopy_sg_from_iter(info->msg, NULL, skb,
> > > + &info->msg->msg_iter,
> > > + len);
> > > + } else {
> >
> >
> > No need for an else statement after 'return'
> >
> > > + void *payload;
> > > + int err;...
2023 Sep 04
0
[PATCH net-next v7 4/4] vsock/virtio: MSG_ZEROCOPY flag support
...t;>> buffer are locked in memory by 'get_user_pages()'. Second thing that
>>> this patch does is replace type of skb owning: instead of calling
>>> 'skb_set_owner_sk_safe()' it calls 'skb_set_owner_w()'. Reason of this
>>> change is that '__zerocopy_sg_from_iter()' increments 'sk_wmem_alloc'
>>> of socket, so to decrease this field correctly proper skb destructor is
>>> needed: 'sock_wfree()'. This destructor is set by 'skb_set_owner_w()'.
>>>
>>> Signed-off-by: Arseniy Krasnov <avkrasnov a...