Displaying 20 results from an estimated 111 matches for "vhost_transport_do_send_pkt".
2019 Aug 01
2
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
.../* Do not send zero length OP_RW pkt */
if (pkt_len == 0 && info->op == VIRTIO_VSOCK_OP_RW)
return pkt_len;
...
}
then it queues the packet for the TX worker calling .send_pkt()
[vhost_transport_send_pkt() in the vhost_transport case]
The main function executed by the TX worker is
vhost_transport_do_send_pkt() that picks up a buffer from the virtqueue
and it tries to copy the packet (up to 4K) on it. If the buffer
allocated from the guest will be smaller then 4K, I think here it will
be discarded with an error:
static void
vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
struct vhost_virtqu...
2019 Aug 01
2
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
.../* Do not send zero length OP_RW pkt */
if (pkt_len == 0 && info->op == VIRTIO_VSOCK_OP_RW)
return pkt_len;
...
}
then it queues the packet for the TX worker calling .send_pkt()
[vhost_transport_send_pkt() in the vhost_transport case]
The main function executed by the TX worker is
vhost_transport_do_send_pkt() that picks up a buffer from the virtqueue
and it tries to copy the packet (up to 4K) on it. If the buffer
allocated from the guest will be smaller then 4K, I think here it will
be discarded with an error:
static void
vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
struct vhost_virtqu...
2020 Jun 08
2
[PATCH RFC v5 12/13] vhost/vsock: switch to the buf API
...so for vsock:
Tested-by: Stefano Garzarella <sgarzare at redhat.com>
Thanks,
Stefano
>
> diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
> index a483cec31d5c..61c6d3dd2ae3 100644
> --- a/drivers/vhost/vsock.c
> +++ b/drivers/vhost/vsock.c
> @@ -103,7 +103,8 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
> unsigned out, in;
> size_t nbytes;
> size_t iov_len, payload_len;
> - int head;
> + struct vhost_buf buf;
> + int ret;
>
> spin_lock_bh(&vsock->send_pkt_list_lock);
> if (list_empty(&vsock->send_pkt_list)) {
&...
2020 Jun 08
2
[PATCH RFC v5 12/13] vhost/vsock: switch to the buf API
...so for vsock:
Tested-by: Stefano Garzarella <sgarzare at redhat.com>
Thanks,
Stefano
>
> diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
> index a483cec31d5c..61c6d3dd2ae3 100644
> --- a/drivers/vhost/vsock.c
> +++ b/drivers/vhost/vsock.c
> @@ -103,7 +103,8 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
> unsigned out, in;
> size_t nbytes;
> size_t iov_len, payload_len;
> - int head;
> + struct vhost_buf buf;
> + int ret;
>
> spin_lock_bh(&vsock->send_pkt_list_lock);
> if (list_empty(&vsock->send_pkt_list)) {
&...
2019 Aug 01
2
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...O_VSOCK_OP_RW)
> > return pkt_len;
> > ...
> > }
> >
> > then it queues the packet for the TX worker calling .send_pkt()
> > [vhost_transport_send_pkt() in the vhost_transport case]
> >
> > The main function executed by the TX worker is
> > vhost_transport_do_send_pkt() that picks up a buffer from the virtqueue
> > and it tries to copy the packet (up to 4K) on it. If the buffer
> > allocated from the guest will be smaller then 4K, I think here it will
> > be discarded with an error:
> >
I'm adding more lines to explain better.
>...
2019 Aug 01
2
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...O_VSOCK_OP_RW)
> > return pkt_len;
> > ...
> > }
> >
> > then it queues the packet for the TX worker calling .send_pkt()
> > [vhost_transport_send_pkt() in the vhost_transport case]
> >
> > The main function executed by the TX worker is
> > vhost_transport_do_send_pkt() that picks up a buffer from the virtqueue
> > and it tries to copy the packet (up to 4K) on it. If the buffer
> > allocated from the guest will be smaller then 4K, I think here it will
> > be discarded with an error:
> >
I'm adding more lines to explain better.
>...
2019 Sep 01
3
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...t; > }
> > > >
> > > > then it queues the packet for the TX worker calling .send_pkt()
> > > > [vhost_transport_send_pkt() in the vhost_transport case]
> > > >
> > > > The main function executed by the TX worker is
> > > > vhost_transport_do_send_pkt() that picks up a buffer from the virtqueue
> > > > and it tries to copy the packet (up to 4K) on it. If the buffer
> > > > allocated from the guest will be smaller then 4K, I think here it will
> > > > be discarded with an error:
> > > >
> >...
2019 Sep 01
3
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...t; > }
> > > >
> > > > then it queues the packet for the TX worker calling .send_pkt()
> > > > [vhost_transport_send_pkt() in the vhost_transport case]
> > > >
> > > > The main function executed by the TX worker is
> > > > vhost_transport_do_send_pkt() that picks up a buffer from the virtqueue
> > > > and it tries to copy the packet (up to 4K) on it. If the buffer
> > > > allocated from the guest will be smaller then 4K, I think here it will
> > > > be discarded with an error:
> > > >
> >...
2019 Apr 04
1
[PATCH RFC 2/4] vhost/vsock: split packets to send using multiple buffers
...com>
---
drivers/vhost/vsock.c | 35 +++++++++++++++++++++++++++++------
1 file changed, 29 insertions(+), 6 deletions(-)
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index bb5fc0e9fbc2..9951b7e661f6 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -94,7 +94,7 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
struct iov_iter iov_iter;
unsigned out, in;
size_t nbytes;
- size_t len;
+ size_t iov_len, payload_len;
int head;
spin_lock_bh(&vsock->send_pkt_list_lock);
@@ -139,8 +139,18 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
break;...
2020 Jun 02
0
[PATCH RFC 12/13] vhost/vsock: switch to the buf API
...t.com>
---
drivers/vhost/vsock.c | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index fb4e944c4d0d..07d1fb340fb4 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -103,7 +103,8 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
unsigned out, in;
size_t nbytes;
size_t iov_len, payload_len;
- int head;
+ struct vhost_buf buf;
+ int ret;
spin_lock_bh(&vsock->send_pkt_list_lock);
if (list_empty(&vsock->send_pkt_list)) {
@@ -117,16 +118,17 @@ vhost_transport_do_send_...
2020 Jun 07
0
[PATCH RFC v5 12/13] vhost/vsock: switch to the buf API
...t.com>
---
drivers/vhost/vsock.c | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index a483cec31d5c..61c6d3dd2ae3 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -103,7 +103,8 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
unsigned out, in;
size_t nbytes;
size_t iov_len, payload_len;
- int head;
+ struct vhost_buf buf;
+ int ret;
spin_lock_bh(&vsock->send_pkt_list_lock);
if (list_empty(&vsock->send_pkt_list)) {
@@ -117,16 +118,17 @@ vhost_transport_do_send_...
2020 Jun 08
0
[PATCH RFC v6 10/11] vhost/vsock: switch to the buf API
...t.com>
---
drivers/vhost/vsock.c | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index a483cec31d5c..61c6d3dd2ae3 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -103,7 +103,8 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
unsigned out, in;
size_t nbytes;
size_t iov_len, payload_len;
- int head;
+ struct vhost_buf buf;
+ int ret;
spin_lock_bh(&vsock->send_pkt_list_lock);
if (list_empty(&vsock->send_pkt_list)) {
@@ -117,16 +118,17 @@ vhost_transport_do_send_...
2019 Aug 01
0
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...(pkt_len == 0 && info->op == VIRTIO_VSOCK_OP_RW)
> return pkt_len;
> ...
> }
>
> then it queues the packet for the TX worker calling .send_pkt()
> [vhost_transport_send_pkt() in the vhost_transport case]
>
> The main function executed by the TX worker is
> vhost_transport_do_send_pkt() that picks up a buffer from the virtqueue
> and it tries to copy the packet (up to 4K) on it. If the buffer
> allocated from the guest will be smaller then 4K, I think here it will
> be discarded with an error:
>
> static void
> vhost_transport_do_send_pkt(struct vhost_vsock *...
2020 Jun 08
0
[PATCH RFC v5 12/13] vhost/vsock: switch to the buf API
...s,
> Stefano
Re-testing v6 would be very much appreciated.
> >
> > diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
> > index a483cec31d5c..61c6d3dd2ae3 100644
> > --- a/drivers/vhost/vsock.c
> > +++ b/drivers/vhost/vsock.c
> > @@ -103,7 +103,8 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
> > unsigned out, in;
> > size_t nbytes;
> > size_t iov_len, payload_len;
> > - int head;
> > + struct vhost_buf buf;
> > + int ret;
> >
> > spin_lock_bh(&vsock->send_pkt_list_lock);
> > if (...
2019 Sep 01
0
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...n;
> > > ...
> > > }
> > >
> > > then it queues the packet for the TX worker calling .send_pkt()
> > > [vhost_transport_send_pkt() in the vhost_transport case]
> > >
> > > The main function executed by the TX worker is
> > > vhost_transport_do_send_pkt() that picks up a buffer from the virtqueue
> > > and it tries to copy the packet (up to 4K) on it. If the buffer
> > > allocated from the guest will be smaller then 4K, I think here it will
> > > be discarded with an error:
> > >
>
> I'm adding more...
2019 Jul 17
0
[PATCH v4 4/5] vhost/vsock: split packets to send using multiple buffers
...+++++++++++-------
net/vmw_vsock/virtio_transport_common.c | 15 ++++--
2 files changed, 60 insertions(+), 21 deletions(-)
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index 6c8390a2af52..9f57736fe15e 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -102,7 +102,7 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
struct iov_iter iov_iter;
unsigned out, in;
size_t nbytes;
- size_t len;
+ size_t iov_len, payload_len;
int head;
spin_lock_bh(&vsock->send_pkt_list_lock);
@@ -147,8 +147,24 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
break;...
2019 Sep 02
0
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...>
> > > > > then it queues the packet for the TX worker calling .send_pkt()
> > > > > [vhost_transport_send_pkt() in the vhost_transport case]
> > > > >
> > > > > The main function executed by the TX worker is
> > > > > vhost_transport_do_send_pkt() that picks up a buffer from the virtqueue
> > > > > and it tries to copy the packet (up to 4K) on it. If the buffer
> > > > > allocated from the guest will be smaller then 4K, I think here it will
> > > > > be discarded with an error:
> > > &...
2020 Apr 30
2
[PATCH] vhost: vsock: don't send pkt when vq is not started
...if (!vhost_vq_get_backend(&vsock->vqs[VSOCK_VQ_RX])) {
> > ...
> >
> > This function should be called with 'vq->mutex' acquired as explained in
> > the comment, but here we can avoid that, because we are not using the vq,
> > so it is safe, because in vhost_transport_do_send_pkt() we check it again.
> >
> > Please add a comment explaining that.
> >
>
> Thanks, vhost_vq_get_backend is better. I chose a 5.3 kernel to develop
> and missed this helper.
:-)
> >
> > As an alternative to this patch, should we kick the send worker when the...
2020 Apr 30
2
[PATCH] vhost: vsock: don't send pkt when vq is not started
...if (!vhost_vq_get_backend(&vsock->vqs[VSOCK_VQ_RX])) {
> > ...
> >
> > This function should be called with 'vq->mutex' acquired as explained in
> > the comment, but here we can avoid that, because we are not using the vq,
> > so it is safe, because in vhost_transport_do_send_pkt() we check it again.
> >
> > Please add a comment explaining that.
> >
>
> Thanks, vhost_vq_get_backend is better. I chose a 5.3 kernel to develop
> and missed this helper.
:-)
> >
> > As an alternative to this patch, should we kick the send worker when the...
2013 Jun 27
2
[RFC 4/5] VSOCK: Introduce vhost-vsock.ko
...or_each_entry(vsock, &vhost_vsock_list, list) {
> + if (vsock->guest_cid == guest_cid) {
> + mutex_unlock(&vhost_vsock_mutex);
> + return vsock;
> + }
> + }
> + mutex_unlock(&vhost_vsock_mutex);
> +
> + return NULL;
> +}
> +
> +static void
> +vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
> + struct vhost_virtqueue *vq)
> +{
> + struct virtio_vsock_pkt *pkt;
> + unsigned out, in;
> + struct sock *sk;
> + int head, ret;
> +
> + mutex_lock(&vq->mutex);
> + vhost_disable_notify(&vsock->dev, vq);
> + for (;;) {...