search for: vsock_vq_rx

Displaying 20 results from an estimated 100 matches for "vsock_vq_rx".

2018 Nov 05
2
[PATCH 1/5] VSOCK: support fill mergeable rx buffer in guest
...a/include/linux/virtio_vsock.h +++ b/include/linux/virtio_vsock.h @@ -14,6 +14,9 @@ #define VIRTIO_VSOCK_MAX_BUF_SIZE 0xFFFFFFFFUL #define VIRTIO_VSOCK_MAX_PKT_BUF_SIZE (1024 * 64) +/* Virtio-vsock feature */ +#define VIRTIO_VSOCK_F_MRG_RXBUF 0 /* Host can merge receive buffers. */ + enum { VSOCK_VQ_RX = 0, /* for host to guest data */ VSOCK_VQ_TX = 1, /* for guest to host data */ diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index 5d3cce9..2040a9e 100644 --- a/net/vmw_vsock/virtio_transport.c +++ b/net/vmw_vsock/virtio_transport.c @@ -64,6 +64,7 @@ st...
2018 Nov 05
2
[PATCH 1/5] VSOCK: support fill mergeable rx buffer in guest
...a/include/linux/virtio_vsock.h +++ b/include/linux/virtio_vsock.h @@ -14,6 +14,9 @@ #define VIRTIO_VSOCK_MAX_BUF_SIZE 0xFFFFFFFFUL #define VIRTIO_VSOCK_MAX_PKT_BUF_SIZE (1024 * 64) +/* Virtio-vsock feature */ +#define VIRTIO_VSOCK_F_MRG_RXBUF 0 /* Host can merge receive buffers. */ + enum { VSOCK_VQ_RX = 0, /* for host to guest data */ VSOCK_VQ_TX = 1, /* for guest to host data */ diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index 5d3cce9..2040a9e 100644 --- a/net/vmw_vsock/virtio_transport.c +++ b/net/vmw_vsock/virtio_transport.c @@ -64,6 +64,7 @@ st...
2018 Nov 06
0
[PATCH 1/5] VSOCK: support fill mergeable rx buffer in guest
...ux/virtio_vsock.h > @@ -14,6 +14,9 @@ > #define VIRTIO_VSOCK_MAX_BUF_SIZE 0xFFFFFFFFUL > #define VIRTIO_VSOCK_MAX_PKT_BUF_SIZE (1024 * 64) > > +/* Virtio-vsock feature */ > +#define VIRTIO_VSOCK_F_MRG_RXBUF 0 /* Host can merge receive buffers. */ > + > enum { > VSOCK_VQ_RX = 0, /* for host to guest data */ > VSOCK_VQ_TX = 1, /* for guest to host data */ > diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c > index 5d3cce9..2040a9e 100644 > --- a/net/vmw_vsock/virtio_transport.c > +++ b/net/vmw_vsock/virtio_transp...
2018 Dec 12
2
[PATCH v2 1/5] VSOCK: support fill mergeable rx buffer in guest
...a/include/linux/virtio_vsock.h +++ b/include/linux/virtio_vsock.h @@ -14,6 +14,9 @@ #define VIRTIO_VSOCK_MAX_BUF_SIZE 0xFFFFFFFFUL #define VIRTIO_VSOCK_MAX_PKT_BUF_SIZE (1024 * 64) +/* Virtio-vsock feature */ +#define VIRTIO_VSOCK_F_MRG_RXBUF 0 /* Host can merge receive buffers. */ + enum { VSOCK_VQ_RX = 0, /* for host to guest data */ VSOCK_VQ_TX = 1, /* for guest to host data */ diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index 5d3cce9..c4a465c 100644 --- a/net/vmw_vsock/virtio_transport.c +++ b/net/vmw_vsock/virtio_transport.c @@ -64,6 +64,11 @@ s...
2018 Dec 12
2
[PATCH v2 1/5] VSOCK: support fill mergeable rx buffer in guest
...a/include/linux/virtio_vsock.h +++ b/include/linux/virtio_vsock.h @@ -14,6 +14,9 @@ #define VIRTIO_VSOCK_MAX_BUF_SIZE 0xFFFFFFFFUL #define VIRTIO_VSOCK_MAX_PKT_BUF_SIZE (1024 * 64) +/* Virtio-vsock feature */ +#define VIRTIO_VSOCK_F_MRG_RXBUF 0 /* Host can merge receive buffers. */ + enum { VSOCK_VQ_RX = 0, /* for host to guest data */ VSOCK_VQ_TX = 1, /* for guest to host data */ diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index 5d3cce9..c4a465c 100644 --- a/net/vmw_vsock/virtio_transport.c +++ b/net/vmw_vsock/virtio_transport.c @@ -64,6 +64,11 @@ s...
2018 Nov 06
1
[PATCH 1/5] VSOCK: support fill mergeable rx buffer in guest
...t; #define VIRTIO_VSOCK_MAX_BUF_SIZE 0xFFFFFFFFUL >> #define VIRTIO_VSOCK_MAX_PKT_BUF_SIZE (1024 * 64) >> >> +/* Virtio-vsock feature */ >> +#define VIRTIO_VSOCK_F_MRG_RXBUF 0 /* Host can merge receive buffers. */ >> + >> enum { >> VSOCK_VQ_RX = 0, /* for host to guest data */ >> VSOCK_VQ_TX = 1, /* for guest to host data */ >> diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c >> index 5d3cce9..2040a9e 100644 >> --- a/net/vmw_vsock/virtio_transport.c >> +++ b/net/...
2013 Jun 27
2
[RFC 4/5] VSOCK: Introduce vhost-vsock.ko
...unlock(&vq->mutex); > +} > + > +static void vhost_transport_send_pkt_work(struct vhost_work *work) > +{ > + struct vhost_virtqueue *vq; > + struct vhost_vsock *vsock; > + > + vsock = container_of(work, struct vhost_vsock, send_pkt_work); > + vq = &vsock->vqs[VSOCK_VQ_RX].vq; > + > + vhost_transport_do_send_pkt(vsock, vq); > +} > + > +static int > +vhost_transport_send_pkt(struct vsock_sock *vsk, > + struct virtio_vsock_pkt_info *info) > +{ > + u32 src_cid, src_port, dst_cid, dst_port; > + struct virtio_transport *trans; > + stru...
2013 Jun 27
2
[RFC 4/5] VSOCK: Introduce vhost-vsock.ko
...unlock(&vq->mutex); > +} > + > +static void vhost_transport_send_pkt_work(struct vhost_work *work) > +{ > + struct vhost_virtqueue *vq; > + struct vhost_vsock *vsock; > + > + vsock = container_of(work, struct vhost_vsock, send_pkt_work); > + vq = &vsock->vqs[VSOCK_VQ_RX].vq; > + > + vhost_transport_do_send_pkt(vsock, vq); > +} > + > +static int > +vhost_transport_send_pkt(struct vsock_sock *vsk, > + struct virtio_vsock_pkt_info *info) > +{ > + u32 src_cid, src_port, dst_cid, dst_port; > + struct virtio_transport *trans; > + stru...
2020 Nov 03
0
[PATCH 04/17] vhost: prep vhost_dev_init users to handle failures
...3fc58e6bf2c8b Asias He 2016-07-28 626 atomic_set(&vsock->queued_replies, 0); 433fc58e6bf2c8b Asias He 2016-07-28 627 433fc58e6bf2c8b Asias He 2016-07-28 628 vqs[VSOCK_VQ_TX] = &vsock->vqs[VSOCK_VQ_TX]; 433fc58e6bf2c8b Asias He 2016-07-28 629 vqs[VSOCK_VQ_RX] = &vsock->vqs[VSOCK_VQ_RX]; 433fc58e6bf2c8b Asias He 2016-07-28 630 vsock->vqs[VSOCK_VQ_TX].handle_kick = vhost_vsock_handle_tx_kick; 433fc58e6bf2c8b Asias He 2016-07-28 631 vsock->vqs[VSOCK_VQ_RX].handle_kick = vhost_vsock_handle_rx_kick; 433fc58e6bf2c8b Asias He...
2013 Jun 27
0
[RFC 4/5] VSOCK: Introduce vhost-vsock.ko
...host_signal(&vsock->dev, vq); + mutex_unlock(&vq->mutex); +} + +static void vhost_transport_send_pkt_work(struct vhost_work *work) +{ + struct vhost_virtqueue *vq; + struct vhost_vsock *vsock; + + vsock = container_of(work, struct vhost_vsock, send_pkt_work); + vq = &vsock->vqs[VSOCK_VQ_RX].vq; + + vhost_transport_do_send_pkt(vsock, vq); +} + +static int +vhost_transport_send_pkt(struct vsock_sock *vsk, + struct virtio_vsock_pkt_info *info) +{ + u32 src_cid, src_port, dst_cid, dst_port; + struct virtio_transport *trans; + struct virtio_vsock_pkt *pkt; + struct vhost_virtqueue *vq;...
2020 Apr 30
2
[PATCH] vhost: vsock: don't send pkt when vq is not started
...; +struct vhost_virtqueue *vq; > > > > > > rcu_read_lock(); > > > > > > @@ -252,6 +253,13 @@ vhost_transport_send_pkt(struct virtio_vsock_pkt > > *pkt) > > > return -ENODEV; > > > } > > > > > > +vq = &vsock->vqs[VSOCK_VQ_RX]; > > > +if (!vq->private_data) { > > > > I think is better to use vhost_vq_get_backend(): > > > > if (!vhost_vq_get_backend(&vsock->vqs[VSOCK_VQ_RX])) { > > ... > > > > This function should be called with 'vq->mutex' acquired...
2020 Apr 30
2
[PATCH] vhost: vsock: don't send pkt when vq is not started
...; +struct vhost_virtqueue *vq; > > > > > > rcu_read_lock(); > > > > > > @@ -252,6 +253,13 @@ vhost_transport_send_pkt(struct virtio_vsock_pkt > > *pkt) > > > return -ENODEV; > > > } > > > > > > +vq = &vsock->vqs[VSOCK_VQ_RX]; > > > +if (!vq->private_data) { > > > > I think is better to use vhost_vq_get_backend(): > > > > if (!vhost_vq_get_backend(&vsock->vqs[VSOCK_VQ_RX])) { > > ... > > > > This function should be called with 'vq->mutex' acquired...
2015 Dec 09
0
[PATCH v3 3/4] VSOCK: Introduce vhost-vsock.ko
...mp;vq->mutex); + + if (added) + wake_up(&vsock->queue_wait); +} + +static void vhost_transport_send_pkt_work(struct vhost_work *work) +{ + struct vhost_virtqueue *vq; + struct vhost_vsock *vsock; + + vsock = container_of(work, struct vhost_vsock, send_pkt_work); + vq = &vsock->vqs[VSOCK_VQ_RX].vq; + + vhost_transport_do_send_pkt(vsock, vq); +} + +static int +vhost_transport_send_pkt(struct vsock_sock *vsk, + struct virtio_vsock_pkt_info *info) +{ + u32 src_cid, src_port, dst_cid, dst_port; + struct virtio_transport *trans; + struct virtio_vsock_pkt *pkt; + struct vhost_virtqueue *vq;...
2016 Nov 11
2
[PATCH] vhost/vsock: Remove unused but set variable
...t virtio_vsock_pkt *pkt) { struct vhost_vsock *vsock; - struct vhost_virtqueue *vq; int len = pkt->len; /* Find the vhost_vsock according to guest context id */ @@ -205,8 +204,6 @@ vhost_transport_send_pkt(struct virtio_vsock_pkt *pkt) return -ENODEV; } - vq = &vsock->vqs[VSOCK_VQ_RX]; - if (pkt->reply) atomic_inc(&vsock->queued_replies); -- 2.11.0.rc0.7.gbe5a750
2016 Nov 11
2
[PATCH] vhost/vsock: Remove unused but set variable
...t virtio_vsock_pkt *pkt) { struct vhost_vsock *vsock; - struct vhost_virtqueue *vq; int len = pkt->len; /* Find the vhost_vsock according to guest context id */ @@ -205,8 +204,6 @@ vhost_transport_send_pkt(struct virtio_vsock_pkt *pkt) return -ENODEV; } - vq = &vsock->vqs[VSOCK_VQ_RX]; - if (pkt->reply) atomic_inc(&vsock->queued_replies); -- 2.11.0.rc0.7.gbe5a750
2020 Apr 30
0
[PATCH] vhost: vsock: don't send pkt when vq is not started
...t) > { > struct vhost_vsock *vsock; > int len = pkt->len; > + struct vhost_virtqueue *vq; > > rcu_read_lock(); > > @@ -252,6 +253,13 @@ vhost_transport_send_pkt(struct virtio_vsock_pkt *pkt) > return -ENODEV; > } > > + vq = &vsock->vqs[VSOCK_VQ_RX]; > + if (!vq->private_data) { I think is better to use vhost_vq_get_backend(): 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 n...
2015 Dec 11
1
[PATCH v3 3/4] VSOCK: Introduce vhost-vsock.ko
...amp;vsock->queue_wait); > +} > + > +static void vhost_transport_send_pkt_work(struct vhost_work *work) > +{ > + struct vhost_virtqueue *vq; > + struct vhost_vsock *vsock; > + > + vsock = container_of(work, struct vhost_vsock, send_pkt_work); > + vq = &vsock->vqs[VSOCK_VQ_RX].vq; > + > + vhost_transport_do_send_pkt(vsock, vq); > +} > + > +static int > +vhost_transport_send_pkt(struct vsock_sock *vsk, > + struct virtio_vsock_pkt_info *info) > +{ > + u32 src_cid, src_port, dst_cid, dst_port; > + struct virtio_transport *trans; > + stru...
2015 Dec 11
1
[PATCH v3 3/4] VSOCK: Introduce vhost-vsock.ko
...amp;vsock->queue_wait); > +} > + > +static void vhost_transport_send_pkt_work(struct vhost_work *work) > +{ > + struct vhost_virtqueue *vq; > + struct vhost_vsock *vsock; > + > + vsock = container_of(work, struct vhost_vsock, send_pkt_work); > + vq = &vsock->vqs[VSOCK_VQ_RX].vq; > + > + vhost_transport_do_send_pkt(vsock, vq); > +} > + > +static int > +vhost_transport_send_pkt(struct vsock_sock *vsk, > + struct virtio_vsock_pkt_info *info) > +{ > + u32 src_cid, src_port, dst_cid, dst_port; > + struct virtio_transport *trans; > + stru...
2018 Dec 12
0
[PATCH v2 4/5] VSOCK: increase send pkt len in mergeable mode to improve performance
...tatic int vhost_transport_cancel_pkt(struct vsock_sock *vsk) { @@ -602,6 +618,8 @@ static int vhost_vsock_dev_open(struct inode *inode, struct file *file) atomic_set(&vsock->queued_replies, 0); + vsock->mergeable = false; + vqs[VSOCK_VQ_TX] = &vsock->vqs[VSOCK_VQ_TX]; vqs[VSOCK_VQ_RX] = &vsock->vqs[VSOCK_VQ_RX]; vsock->vqs[VSOCK_VQ_TX].handle_kick = vhost_vsock_handle_tx_kick; @@ -726,6 +744,9 @@ static int vhost_vsock_set_features(struct vhost_vsock *vsock, u64 features) return -EFAULT; } + if (features & (1 << VIRTIO_VSOCK_F_MRG_RXBUF)) + vsock-&g...
2020 Apr 30
0
[PATCH] vhost: vsock: don't send pkt when vq is not started
...> > > > > rcu_read_lock(); > > > > > > > > @@ -252,6 +253,13 @@ vhost_transport_send_pkt(struct virtio_vsock_pkt > > > *pkt) > > > > return -ENODEV; > > > > } > > > > > > > > +vq = &vsock->vqs[VSOCK_VQ_RX]; > > > > +if (!vq->private_data) { > > > > > > I think is better to use vhost_vq_get_backend(): > > > > > > if (!vhost_vq_get_backend(&vsock->vqs[VSOCK_VQ_RX])) { > > > ... > > > > > > This function should be call...