Displaying 8 results from an estimated 8 matches for "remain_len".
2018 Dec 12
4
[PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest
...s(+), 35 deletions(-)
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index dc52b0f..c7ab0dd 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -179,6 +179,8 @@ static int get_rx_bufs(struct vhost_virtqueue *vq,
size_t nbytes;
size_t len;
s16 headcount;
+ size_t remain_len;
+ int i;
spin_lock_bh(&vsock->send_pkt_list_lock);
if (list_empty(&vsock->send_pkt_list)) {
@@ -221,11 +223,19 @@ static int get_rx_bufs(struct vhost_virtqueue *vq,
break;
}
- nbytes = copy_to_iter(pkt->buf, pkt->len, &iov_iter);
- if (nbytes != pkt->le...
2018 Dec 12
4
[PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest
...s(+), 35 deletions(-)
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index dc52b0f..c7ab0dd 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -179,6 +179,8 @@ static int get_rx_bufs(struct vhost_virtqueue *vq,
size_t nbytes;
size_t len;
s16 headcount;
+ size_t remain_len;
+ int i;
spin_lock_bh(&vsock->send_pkt_list_lock);
if (list_empty(&vsock->send_pkt_list)) {
@@ -221,11 +223,19 @@ static int get_rx_bufs(struct vhost_virtqueue *vq,
break;
}
- nbytes = copy_to_iter(pkt->buf, pkt->len, &iov_iter);
- if (nbytes != pkt->le...
2018 Dec 13
2
[PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest
...t/vsock.c
>> index dc52b0f..c7ab0dd 100644
>> --- a/drivers/vhost/vsock.c
>> +++ b/drivers/vhost/vsock.c
>> @@ -179,6 +179,8 @@ static int get_rx_bufs(struct vhost_virtqueue *vq,
>> size_t nbytes;
>> size_t len;
>> s16 headcount;
>> + size_t remain_len;
>> + int i;
>>
>> spin_lock_bh(&vsock->send_pkt_list_lock);
>> if (list_empty(&vsock->send_pkt_list)) {
>> @@ -221,11 +223,19 @@ static int get_rx_bufs(struct vhost_virtqueue *vq,
>> break;
>> }
>>
>> - nbytes = cop...
2018 Dec 13
2
[PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest
...t/vsock.c
>> index dc52b0f..c7ab0dd 100644
>> --- a/drivers/vhost/vsock.c
>> +++ b/drivers/vhost/vsock.c
>> @@ -179,6 +179,8 @@ static int get_rx_bufs(struct vhost_virtqueue *vq,
>> size_t nbytes;
>> size_t len;
>> s16 headcount;
>> + size_t remain_len;
>> + int i;
>>
>> spin_lock_bh(&vsock->send_pkt_list_lock);
>> if (list_empty(&vsock->send_pkt_list)) {
>> @@ -221,11 +223,19 @@ static int get_rx_bufs(struct vhost_virtqueue *vq,
>> break;
>> }
>>
>> - nbytes = cop...
2018 Dec 12
0
[PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest
...ers/vhost/vsock.c b/drivers/vhost/vsock.c
> index dc52b0f..c7ab0dd 100644
> --- a/drivers/vhost/vsock.c
> +++ b/drivers/vhost/vsock.c
> @@ -179,6 +179,8 @@ static int get_rx_bufs(struct vhost_virtqueue *vq,
> size_t nbytes;
> size_t len;
> s16 headcount;
> + size_t remain_len;
> + int i;
>
> spin_lock_bh(&vsock->send_pkt_list_lock);
> if (list_empty(&vsock->send_pkt_list)) {
> @@ -221,11 +223,19 @@ static int get_rx_bufs(struct vhost_virtqueue *vq,
> break;
> }
>
> - nbytes = copy_to_iter(pkt->buf, pkt->len...
2018 Dec 13
0
[PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest
...7ab0dd 100644
> >> --- a/drivers/vhost/vsock.c
> >> +++ b/drivers/vhost/vsock.c
> >> @@ -179,6 +179,8 @@ static int get_rx_bufs(struct vhost_virtqueue *vq,
> >> size_t nbytes;
> >> size_t len;
> >> s16 headcount;
> >> + size_t remain_len;
> >> + int i;
> >>
> >> spin_lock_bh(&vsock->send_pkt_list_lock);
> >> if (list_empty(&vsock->send_pkt_list)) {
> >> @@ -221,11 +223,19 @@ static int get_rx_bufs(struct vhost_virtqueue *vq,
> >> break;
> >>...
2018 Dec 12
2
[PATCH v2 5/5] VSOCK: batch sending rx buffer to increase bandwidth
...len + pkt->len, &in,
+ likely(vsock->mergeable) ? UIO_MAXIOV : 1);
if (headcount <= 0) {
spin_lock_bh(&vsock->send_pkt_list_lock);
list_add(&pkt->list, &vsock->send_pkt_list);
@@ -238,8 +241,12 @@ static int get_rx_bufs(struct vhost_virtqueue *vq,
remain_len -= tmp_len;
}
- vhost_add_used_n(vq, vq->heads, headcount);
- added = true;
+ batch_count += headcount;
+ if (batch_count > VHOST_VSOCK_BATCH) {
+ vhost_add_used_and_signal_n(&vsock->dev, vq,
+ vq->heads, batch_count);
+ batch_count = 0;
+ }
if (pkt->reply) {...
2018 Dec 12
2
[PATCH v2 5/5] VSOCK: batch sending rx buffer to increase bandwidth
...len + pkt->len, &in,
+ likely(vsock->mergeable) ? UIO_MAXIOV : 1);
if (headcount <= 0) {
spin_lock_bh(&vsock->send_pkt_list_lock);
list_add(&pkt->list, &vsock->send_pkt_list);
@@ -238,8 +241,12 @@ static int get_rx_bufs(struct vhost_virtqueue *vq,
remain_len -= tmp_len;
}
- vhost_add_used_n(vq, vq->heads, headcount);
- added = true;
+ batch_count += headcount;
+ if (batch_count > VHOST_VSOCK_BATCH) {
+ vhost_add_used_and_signal_n(&vsock->dev, vq,
+ vq->heads, batch_count);
+ batch_count = 0;
+ }
if (pkt->reply) {...