Displaying 20 results from an estimated 84 matches for "virtio_transport_send_credit_upd".
2019 Apr 04
1
[PATCH RFC 1/4] vsock/virtio: reduce credit update messages
...struct virtio_vsock_pkt *pkt;
size_t bytes, total = 0;
+ s64 free_space;
int err = -EFAULT;
spin_lock_bh(&vvs->rx_lock);
@@ -288,9 +290,15 @@ virtio_transport_stream_do_dequeue(struct vsock_sock *vsk,
}
spin_unlock_bh(&vvs->rx_lock);
- /* Send a credit pkt to peer */
- virtio_transport_send_credit_update(vsk, VIRTIO_VSOCK_TYPE_STREAM,
- NULL);
+ /* We send a credit update only when the space available seen
+ * by the transmitter is less than VIRTIO_VSOCK_MAX_PKT_BUF_SIZE
+ */
+ free_space = vvs->buf_alloc - (vvs->fwd_cnt - vvs->last_fwd_cnt);
+ if (free_space < VIRTIO_VSOCK...
2019 Sep 26
5
[PATCH] vsock/virtio: add support for MSG_PEEK
...1 file changed, 47 insertions(+), 3 deletions(-)
diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
index 94cc0fa..938f2ed 100644
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -264,6 +264,50 @@ static int virtio_transport_send_credit_update(struct vsock_sock *vsk,
}
static ssize_t
+virtio_transport_stream_do_peek(struct vsock_sock *vsk,
+ struct msghdr *msg,
+ size_t len)
+{
+ struct virtio_vsock_sock *vvs = vsk->trans;
+ struct virtio_vsock_pkt *pkt;
+ size_t bytes, total = 0;
+ int err = -EFAULT;
+
+ spin_lock_bh(&am...
2019 Sep 26
5
[PATCH] vsock/virtio: add support for MSG_PEEK
...1 file changed, 47 insertions(+), 3 deletions(-)
diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
index 94cc0fa..938f2ed 100644
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -264,6 +264,50 @@ static int virtio_transport_send_credit_update(struct vsock_sock *vsk,
}
static ssize_t
+virtio_transport_stream_do_peek(struct vsock_sock *vsk,
+ struct msghdr *msg,
+ size_t len)
+{
+ struct virtio_vsock_sock *vvs = vsk->trans;
+ struct virtio_vsock_pkt *pkt;
+ size_t bytes, total = 0;
+ int err = -EFAULT;
+
+ spin_lock_bh(&am...
2019 Sep 03
2
[PATCH v4 2/5] vsock/virtio: reduce credit update messages
...ort_stream_do_dequeue(struct vsock_sock *vsk,
> virtio_transport_free_pkt(pkt);
> }
> }
> +
> + free_space = vvs->buf_alloc - (vvs->fwd_cnt - vvs->last_fwd_cnt);
> +
> spin_unlock_bh(&vvs->rx_lock);
>
> - /* Send a credit pkt to peer */
> - virtio_transport_send_credit_update(vsk, VIRTIO_VSOCK_TYPE_STREAM,
> - NULL);
> + /* We send a credit update only when the space available seen
> + * by the transmitter is less than VIRTIO_VSOCK_MAX_PKT_BUF_SIZE
This is just repeating what code does though.
Please include the *reason* for the condition.
E.g. her...
2019 Sep 03
2
[PATCH v4 2/5] vsock/virtio: reduce credit update messages
...ort_stream_do_dequeue(struct vsock_sock *vsk,
> virtio_transport_free_pkt(pkt);
> }
> }
> +
> + free_space = vvs->buf_alloc - (vvs->fwd_cnt - vvs->last_fwd_cnt);
> +
> spin_unlock_bh(&vvs->rx_lock);
>
> - /* Send a credit pkt to peer */
> - virtio_transport_send_credit_update(vsk, VIRTIO_VSOCK_TYPE_STREAM,
> - NULL);
> + /* We send a credit update only when the space available seen
> + * by the transmitter is less than VIRTIO_VSOCK_MAX_PKT_BUF_SIZE
This is just repeating what code does though.
Please include the *reason* for the condition.
E.g. her...
2019 Apr 04
0
[PATCH RFC 1/4] vsock/virtio: reduce credit update messages
...lt;= buf_alloc is always true.
> int err = -EFAULT;
>
> spin_lock_bh(&vvs->rx_lock);
> @@ -288,9 +290,15 @@ virtio_transport_stream_do_dequeue(struct vsock_sock *vsk,
> }
> spin_unlock_bh(&vvs->rx_lock);
>
> - /* Send a credit pkt to peer */
> - virtio_transport_send_credit_update(vsk, VIRTIO_VSOCK_TYPE_STREAM,
> - NULL);
> + /* We send a credit update only when the space available seen
> + * by the transmitter is less than VIRTIO_VSOCK_MAX_PKT_BUF_SIZE
> + */
> + free_space = vvs->buf_alloc - (vvs->fwd_cnt - vvs->last_fwd_cnt);
Locking?...
2019 Jul 17
0
[PATCH v4 2/5] vsock/virtio: reduce credit update messages
...->rx_lock);
@@ -291,11 +293,19 @@ virtio_transport_stream_do_dequeue(struct vsock_sock *vsk,
virtio_transport_free_pkt(pkt);
}
}
+
+ free_space = vvs->buf_alloc - (vvs->fwd_cnt - vvs->last_fwd_cnt);
+
spin_unlock_bh(&vvs->rx_lock);
- /* Send a credit pkt to peer */
- virtio_transport_send_credit_update(vsk, VIRTIO_VSOCK_TYPE_STREAM,
- NULL);
+ /* We send a credit update only when the space available seen
+ * by the transmitter is less than VIRTIO_VSOCK_MAX_PKT_BUF_SIZE
+ */
+ if (free_space < VIRTIO_VSOCK_MAX_PKT_BUF_SIZE) {
+ virtio_transport_send_credit_update(vsk,
+ V...
2019 Apr 05
1
[PATCH RFC 1/4] vsock/virtio: reduce credit update messages
...nt err = -EFAULT;
> >
> > spin_lock_bh(&vvs->rx_lock);
> > @@ -288,9 +290,15 @@ virtio_transport_stream_do_dequeue(struct vsock_sock *vsk,
> > }
> > spin_unlock_bh(&vvs->rx_lock);
> >
> > - /* Send a credit pkt to peer */
> > - virtio_transport_send_credit_update(vsk, VIRTIO_VSOCK_TYPE_STREAM,
> > - NULL);
> > + /* We send a credit update only when the space available seen
> > + * by the transmitter is less than VIRTIO_VSOCK_MAX_PKT_BUF_SIZE
> > + */
> > + free_space = vvs->buf_alloc - (vvs->fwd_cnt - vvs->...
2019 Apr 05
1
[PATCH RFC 1/4] vsock/virtio: reduce credit update messages
...nt err = -EFAULT;
> >
> > spin_lock_bh(&vvs->rx_lock);
> > @@ -288,9 +290,15 @@ virtio_transport_stream_do_dequeue(struct vsock_sock *vsk,
> > }
> > spin_unlock_bh(&vvs->rx_lock);
> >
> > - /* Send a credit pkt to peer */
> > - virtio_transport_send_credit_update(vsk, VIRTIO_VSOCK_TYPE_STREAM,
> > - NULL);
> > + /* We send a credit update only when the space available seen
> > + * by the transmitter is less than VIRTIO_VSOCK_MAX_PKT_BUF_SIZE
> > + */
> > + free_space = vvs->buf_alloc - (vvs->fwd_cnt - vvs->...
2019 Sep 03
2
[PATCH net-next] vsock/virtio: a better comment on credit update
...ting the limit
+ * too high causes extra messages. Too low causes transmitter
+ * stalls. As stalls are in theory more expensive than extra
+ * messages, we set the limit to a high value. TODO: experiment
+ * with different values.
*/
if (free_space < VIRTIO_VSOCK_MAX_PKT_BUF_SIZE) {
virtio_transport_send_credit_update(vsk,
--
MST
2019 Sep 23
1
[RFC] VSOCK: add support for MSG_PEEK
...(+), 3 deletions(-)
>
> diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
> index 94cc0fa..830e890 100644
> --- a/net/vmw_vsock/virtio_transport_common.c
> +++ b/net/vmw_vsock/virtio_transport_common.c
> @@ -264,6 +264,59 @@ static int virtio_transport_send_credit_update(struct vsock_sock *vsk,
> }
>
> static ssize_t
> +virtio_transport_stream_do_peek(struct vsock_sock *vsk,
> + struct msghdr *msg,
> + size_t len)
> +{
> + struct virtio_vsock_sock *vvs = vsk->trans;
> + struct virtio_vsock_pkt *pkt;
> + size_t bytes, of...
2018 Dec 12
4
[PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest
...ue)
skb_put_data(skb, &pkt->hdr, sizeof(pkt->hdr));
if (pkt->len) {
- skb_put_data(skb, pkt->buf, pkt->len);
+ for (i = 0; i < pkt->nr_vecs; i++)
+ skb_put_data(skb, pkt->vec[i].iov_base, pkt->vec[i].iov_len);
}
return skb;
@@ -260,6 +267,9 @@ static int virtio_transport_send_credit_update(struct vsock_sock *vsk,
spin_lock_bh(&vvs->rx_lock);
while (total < len && !list_empty(&vvs->rx_queue)) {
+ size_t copy_bytes, last_vec_total = 0, vec_off;
+ int i;
+
pkt = list_first_entry(&vvs->rx_queue,
struct virtio_vsock_pkt, list);
@@...
2018 Dec 12
4
[PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest
...ue)
skb_put_data(skb, &pkt->hdr, sizeof(pkt->hdr));
if (pkt->len) {
- skb_put_data(skb, pkt->buf, pkt->len);
+ for (i = 0; i < pkt->nr_vecs; i++)
+ skb_put_data(skb, pkt->vec[i].iov_base, pkt->vec[i].iov_len);
}
return skb;
@@ -260,6 +267,9 @@ static int virtio_transport_send_credit_update(struct vsock_sock *vsk,
spin_lock_bh(&vvs->rx_lock);
while (total < len && !list_empty(&vvs->rx_queue)) {
+ size_t copy_bytes, last_vec_total = 0, vec_off;
+ int i;
+
pkt = list_first_entry(&vvs->rx_queue,
struct virtio_vsock_pkt, list);
@@...
2018 Dec 13
2
[PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest
...t; if (pkt->len) {
>> - skb_put_data(skb, pkt->buf, pkt->len);
>> + for (i = 0; i < pkt->nr_vecs; i++)
>> + skb_put_data(skb, pkt->vec[i].iov_base, pkt->vec[i].iov_len);
>> }
>>
>> return skb;
>> @@ -260,6 +267,9 @@ static int virtio_transport_send_credit_update(struct vsock_sock *vsk,
>>
>> spin_lock_bh(&vvs->rx_lock);
>> while (total < len && !list_empty(&vvs->rx_queue)) {
>> + size_t copy_bytes, last_vec_total = 0, vec_off;
>> + int i;
>> +
>> pkt = list_first_entry(&vvs-...
2018 Dec 13
2
[PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest
...t; if (pkt->len) {
>> - skb_put_data(skb, pkt->buf, pkt->len);
>> + for (i = 0; i < pkt->nr_vecs; i++)
>> + skb_put_data(skb, pkt->vec[i].iov_base, pkt->vec[i].iov_len);
>> }
>>
>> return skb;
>> @@ -260,6 +267,9 @@ static int virtio_transport_send_credit_update(struct vsock_sock *vsk,
>>
>> spin_lock_bh(&vvs->rx_lock);
>> while (total < len && !list_empty(&vvs->rx_queue)) {
>> + size_t copy_bytes, last_vec_total = 0, vec_off;
>> + int i;
>> +
>> pkt = list_first_entry(&vvs-...
2018 Nov 05
2
[PATCH 3/5] VSOCK: support receive mergeable rx buffer in guest
...kt(pkt);
virtio_transport_recv_pkt(pkt);
}
diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
index 3ae3a33..7bef1d5 100644
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -272,14 +272,49 @@ static int virtio_transport_send_credit_update(struct vsock_sock *vsk,
*/
spin_unlock_bh(&vvs->rx_lock);
- err = memcpy_to_msg(msg, pkt->buf + pkt->off, bytes);
- if (err)
- goto out;
+ if (pkt->mergeable) {
+ struct virtio_vsock_mrg_rxbuf *buf = pkt->mrg_rxbuf;
+ size_t mrg_copy_bytes, last_buf_total = 0,...
2018 Nov 05
2
[PATCH 3/5] VSOCK: support receive mergeable rx buffer in guest
...kt(pkt);
virtio_transport_recv_pkt(pkt);
}
diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
index 3ae3a33..7bef1d5 100644
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -272,14 +272,49 @@ static int virtio_transport_send_credit_update(struct vsock_sock *vsk,
*/
spin_unlock_bh(&vvs->rx_lock);
- err = memcpy_to_msg(msg, pkt->buf + pkt->off, bytes);
- if (err)
- goto out;
+ if (pkt->mergeable) {
+ struct virtio_vsock_mrg_rxbuf *buf = pkt->mrg_rxbuf;
+ size_t mrg_copy_bytes, last_buf_total = 0,...
2019 Apr 04
15
[PATCH RFC 0/4] vsock/virtio: optimizations to increase the throughput
This series tries to increase the throughput of virtio-vsock with slight
changes:
- patch 1/4: reduces the number of credit update messages sent to the
transmitter
- patch 2/4: allows the host to split packets on multiple buffers,
in this way, we can remove the packet size limit to
VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE
- patch 3/4: uses
2019 Apr 04
15
[PATCH RFC 0/4] vsock/virtio: optimizations to increase the throughput
This series tries to increase the throughput of virtio-vsock with slight
changes:
- patch 1/4: reduces the number of credit update messages sent to the
transmitter
- patch 2/4: allows the host to split packets on multiple buffers,
in this way, we can remove the packet size limit to
VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE
- patch 3/4: uses
2018 Dec 12
0
[PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest
...eof(pkt->hdr));
>
> if (pkt->len) {
> - skb_put_data(skb, pkt->buf, pkt->len);
> + for (i = 0; i < pkt->nr_vecs; i++)
> + skb_put_data(skb, pkt->vec[i].iov_base, pkt->vec[i].iov_len);
> }
>
> return skb;
> @@ -260,6 +267,9 @@ static int virtio_transport_send_credit_update(struct vsock_sock *vsk,
>
> spin_lock_bh(&vvs->rx_lock);
> while (total < len && !list_empty(&vvs->rx_queue)) {
> + size_t copy_bytes, last_vec_total = 0, vec_off;
> + int i;
> +
> pkt = list_first_entry(&vvs->rx_queue,
>...