Displaying 7 results from an estimated 7 matches for "fill_mergeable_rx_buff".
2018 Nov 05
2
[PATCH 1/5] VSOCK: support fill mergeable rx buffer in guest
...@@ -64,6 +64,7 @@ struct virtio_vsock {
struct virtio_vsock_event event_list[8];
u32 guest_cid;
+ bool mergeable;
};
static struct virtio_vsock *virtio_vsock_get(void)
@@ -256,6 +257,25 @@ static int virtio_transport_send_pkt_loopback(struct virtio_vsock *vsock,
return 0;
}
+static int fill_mergeable_rx_buff(struct virtqueue *vq)
+{
+ void *page = NULL;
+ struct scatterlist sg;
+ int err;
+
+ page = (void *)get_zeroed_page(GFP_KERNEL);
+ if (!page)
+ return -ENOMEM;
+
+ sg_init_one(&sg, page, PAGE_SIZE);
+
+ err = virtqueue_add_inbuf(vq, &sg, 1, page, GFP_KERNEL);
+ if (err < 0)
+ free_pag...
2018 Nov 05
2
[PATCH 1/5] VSOCK: support fill mergeable rx buffer in guest
...@@ -64,6 +64,7 @@ struct virtio_vsock {
struct virtio_vsock_event event_list[8];
u32 guest_cid;
+ bool mergeable;
};
static struct virtio_vsock *virtio_vsock_get(void)
@@ -256,6 +257,25 @@ static int virtio_transport_send_pkt_loopback(struct virtio_vsock *vsock,
return 0;
}
+static int fill_mergeable_rx_buff(struct virtqueue *vq)
+{
+ void *page = NULL;
+ struct scatterlist sg;
+ int err;
+
+ page = (void *)get_zeroed_page(GFP_KERNEL);
+ if (!page)
+ return -ENOMEM;
+
+ sg_init_one(&sg, page, PAGE_SIZE);
+
+ err = virtqueue_add_inbuf(vq, &sg, 1, page, GFP_KERNEL);
+ if (err < 0)
+ free_pag...
2018 Dec 12
2
[PATCH v2 1/5] VSOCK: support fill mergeable rx buffer in guest
...};
static struct virtio_vsock *virtio_vsock_get(void)
@@ -256,39 +261,89 @@ static int virtio_transport_send_pkt_loopback(struct virtio_vsock *vsock,
return 0;
}
-static void virtio_vsock_rx_fill(struct virtio_vsock *vsock)
+/* This segment of codes are copied from virtio-net.c */
+static int fill_mergeable_rx_buff(struct virtio_vsock *vsock,
+ struct virtqueue *vq)
+{
+ struct page_frag *alloc_frag = &vsock->alloc_frag;
+ struct scatterlist sg;
+ /* Currently we don't use ewma len, use PAGE_SIZE instead, because too
+ * small size can't fill one full packet, sadly we only 128 vq num now.
+...
2018 Dec 12
2
[PATCH v2 1/5] VSOCK: support fill mergeable rx buffer in guest
...};
static struct virtio_vsock *virtio_vsock_get(void)
@@ -256,39 +261,89 @@ static int virtio_transport_send_pkt_loopback(struct virtio_vsock *vsock,
return 0;
}
-static void virtio_vsock_rx_fill(struct virtio_vsock *vsock)
+/* This segment of codes are copied from virtio-net.c */
+static int fill_mergeable_rx_buff(struct virtio_vsock *vsock,
+ struct virtqueue *vq)
+{
+ struct page_frag *alloc_frag = &vsock->alloc_frag;
+ struct scatterlist sg;
+ /* Currently we don't use ewma len, use PAGE_SIZE instead, because too
+ * small size can't fill one full packet, sadly we only 128 vq num now.
+...
2018 Nov 06
1
[PATCH 1/5] VSOCK: support fill mergeable rx buffer in guest
...2 guest_cid;
>> + bool mergeable;
>> };
>>
>> static struct virtio_vsock *virtio_vsock_get(void)
>> @@ -256,6 +257,25 @@ static int virtio_transport_send_pkt_loopback(struct virtio_vsock *vsock,
>> return 0;
>> }
>>
>> +static int fill_mergeable_rx_buff(struct virtqueue *vq)
>> +{
>> + void *page = NULL;
>> + struct scatterlist sg;
>> + int err;
>> +
>> + page = (void *)get_zeroed_page(GFP_KERNEL);
>
>
> Any reason to use zeroed page?
In previous version, the entire structure of virtio_vs...
2018 Nov 06
0
[PATCH 1/5] VSOCK: support fill mergeable rx buffer in guest
...vsock_event event_list[8];
>
> u32 guest_cid;
> + bool mergeable;
> };
>
> static struct virtio_vsock *virtio_vsock_get(void)
> @@ -256,6 +257,25 @@ static int virtio_transport_send_pkt_loopback(struct virtio_vsock *vsock,
> return 0;
> }
>
> +static int fill_mergeable_rx_buff(struct virtqueue *vq)
> +{
> + void *page = NULL;
> + struct scatterlist sg;
> + int err;
> +
> + page = (void *)get_zeroed_page(GFP_KERNEL);
Any reason to use zeroed page?
> + if (!page)
> + return -ENOMEM;
> +
> + sg_init_one(&sg, page, PAGE_SIZE);
FYI, fo...
2018 Dec 12
0
[PATCH v2 1/5] VSOCK: support fill mergeable rx buffer in guest
From: jiangyiwen <jiangyiwen at huawei.com>
Date: Wed, 12 Dec 2018 17:28:16 +0800
> +static int fill_mergeable_rx_buff(struct virtio_vsock *vsock,
> + struct virtqueue *vq)
> +{
> + struct page_frag *alloc_frag = &vsock->alloc_frag;
> + struct scatterlist sg;
> + /* Currently we don't use ewma len, use PAGE_SIZE instead, because too
> + * small size can't fill one full packet, sad...