search for: vsock_vq_tx

Displaying 20 results from an estimated 90 matches for "vsock_vq_tx".

Did you mean: vsock_vq_rx
2018 Dec 12
0
[PATCH v2 4/5] VSOCK: increase send pkt len in mergeable mode to improve performance
...vers/vhost/vsock.c @@ -44,6 +44,8 @@ struct vhost_vsock { atomic_t queued_replies; u32 guest_cid; + + bool mergeable; }; static u32 vhost_transport_get_local_cid(void) @@ -151,7 +153,6 @@ static int get_rx_bufs(struct vhost_virtqueue *vq, struct vhost_virtqueue *tx_vq = &vsock->vqs[VSOCK_VQ_TX]; bool added = false; bool restart_tx = false; - int mergeable; size_t vsock_hlen; mutex_lock(&vq->mutex); @@ -159,12 +160,11 @@ static int get_rx_bufs(struct vhost_virtqueue *vq, if (!vq->private_data) goto out; - mergeable = vhost_has_feature(vq, VIRTIO_VSOCK_F_MRG_RXBUF)...
2020 Nov 03
0
[PATCH 04/17] vhost: prep vhost_dev_init users to handle failures
...sock->guest_cid = 0; /* no CID assigned yet */ a72b69dc083a931 Stefan Hajnoczi 2017-11-09 625 433fc58e6bf2c8b 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...
2017 Nov 09
0
[PATCH] vhost/vsock: fix uninitialized vhost_vsock->guest_cid
.....5a5e981bd8e4 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -518,6 +518,8 @@ static int vhost_vsock_dev_open(struct inode *inode, struct file *file) goto out; } + vsock->guest_cid = 0; /* no CID assigned yet */ + atomic_set(&vsock->queued_replies, 0); vqs[VSOCK_VQ_TX] = &vsock->vqs[VSOCK_VQ_TX]; -- 2.13.6
2017 Nov 09
0
[PATCH] vhost/vsock: fix uninitialized vhost_vsock->guest_cid
.....5a5e981bd8e4 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -518,6 +518,8 @@ static int vhost_vsock_dev_open(struct inode *inode, struct file *file) goto out; } + vsock->guest_cid = 0; /* no CID assigned yet */ + atomic_set(&vsock->queued_replies, 0); vqs[VSOCK_VQ_TX] = &vsock->vqs[VSOCK_VQ_TX]; -- 2.13.6
2019 Jun 28
0
[PATCH v2 2/3] vsock/virtio: stop workers during the .remove()
...k(struct work_struct *work) virtio_transport_recv_pkt(pkt); } +out: mutex_unlock(&vsock->rx_lock); } @@ -130,6 +138,9 @@ virtio_transport_send_pkt_work(struct work_struct *work) mutex_lock(&vsock->tx_lock); + if (!vsock->tx_run) + goto out; + vq = vsock->vqs[VSOCK_VQ_TX]; for (;;) { @@ -188,6 +199,7 @@ virtio_transport_send_pkt_work(struct work_struct *work) if (added) virtqueue_kick(vq); +out: mutex_unlock(&vsock->tx_lock); if (restart_rx) @@ -323,6 +335,10 @@ static void virtio_transport_tx_work(struct work_struct *work) vq = vsock-&g...
2019 Jul 05
0
[PATCH v3 2/3] vsock/virtio: stop workers during the .remove()
...k(struct work_struct *work) virtio_transport_recv_pkt(pkt); } +out: mutex_unlock(&vsock->rx_lock); } @@ -130,6 +138,9 @@ virtio_transport_send_pkt_work(struct work_struct *work) mutex_lock(&vsock->tx_lock); + if (!vsock->tx_run) + goto out; + vq = vsock->vqs[VSOCK_VQ_TX]; for (;;) { @@ -188,6 +199,7 @@ virtio_transport_send_pkt_work(struct work_struct *work) if (added) virtqueue_kick(vq); +out: mutex_unlock(&vsock->tx_lock); if (restart_rx) @@ -323,6 +335,10 @@ static void virtio_transport_tx_work(struct work_struct *work) vq = vsock-&g...
2015 Dec 10
1
[PATCH v3 2/4] VSOCK: Introduce virtio-vsock.ko
...> + if (!info->remote_cid) { > + dst_cid = vsk->remote_addr.svm_cid; > + dst_port = vsk->remote_addr.svm_port; > + } else { > + dst_cid = info->remote_cid; > + dst_port = info->remote_port; > + } > + > + trans = vsk->trans; > + vq = vsock->vqs[VSOCK_VQ_TX]; > + > + if (pkt_len > VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE) > + pkt_len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE; > + pkt_len = virtio_transport_get_credit(trans, pkt_len); > + /* Do not send zero length OP_RW pkt*/ > + if (pkt_len == 0 && info->op == VIRTIO_VSOCK_OP_RW) &g...
2015 Dec 10
1
[PATCH v3 2/4] VSOCK: Introduce virtio-vsock.ko
...> + if (!info->remote_cid) { > + dst_cid = vsk->remote_addr.svm_cid; > + dst_port = vsk->remote_addr.svm_port; > + } else { > + dst_cid = info->remote_cid; > + dst_port = info->remote_port; > + } > + > + trans = vsk->trans; > + vq = vsock->vqs[VSOCK_VQ_TX]; > + > + if (pkt_len > VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE) > + pkt_len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE; > + pkt_len = virtio_transport_get_credit(trans, pkt_len); > + /* Do not send zero length OP_RW pkt*/ > + if (pkt_len == 0 && info->op == VIRTIO_VSOCK_OP_RW) &g...
2013 Jun 27
2
[RFC 4/5] VSOCK: Introduce vhost-vsock.ko
...-ENOMEM; > + > + pr_debug("%s:vsock=%p\n", __func__, vsock); > + > + vqs = kmalloc(VSOCK_VQ_MAX * sizeof(*vqs), GFP_KERNEL); > + if (!vqs) { > + ret = -ENOMEM; > + goto out; > + } > + > + vqs[VSOCK_VQ_CTRL] = &vsock->vqs[VSOCK_VQ_CTRL].vq; > + vqs[VSOCK_VQ_TX] = &vsock->vqs[VSOCK_VQ_TX].vq; > + vqs[VSOCK_VQ_RX] = &vsock->vqs[VSOCK_VQ_RX].vq; > + vsock->vqs[VSOCK_VQ_CTRL].vq.handle_kick = vhost_vsock_handle_ctl_kick; > + vsock->vqs[VSOCK_VQ_TX].vq.handle_kick = vhost_vsock_handle_tx_kick; > + vsock->vqs[VSOCK_VQ_RX].vq....
2013 Jun 27
2
[RFC 4/5] VSOCK: Introduce vhost-vsock.ko
...-ENOMEM; > + > + pr_debug("%s:vsock=%p\n", __func__, vsock); > + > + vqs = kmalloc(VSOCK_VQ_MAX * sizeof(*vqs), GFP_KERNEL); > + if (!vqs) { > + ret = -ENOMEM; > + goto out; > + } > + > + vqs[VSOCK_VQ_CTRL] = &vsock->vqs[VSOCK_VQ_CTRL].vq; > + vqs[VSOCK_VQ_TX] = &vsock->vqs[VSOCK_VQ_TX].vq; > + vqs[VSOCK_VQ_RX] = &vsock->vqs[VSOCK_VQ_RX].vq; > + vsock->vqs[VSOCK_VQ_CTRL].vq.handle_kick = vhost_vsock_handle_ctl_kick; > + vsock->vqs[VSOCK_VQ_TX].vq.handle_kick = vhost_vsock_handle_tx_kick; > + vsock->vqs[VSOCK_VQ_RX].vq....
2019 May 28
8
[PATCH 0/4] vsock/virtio: several fixes in the .probe() and .remove()
During the review of "[PATCH] vsock/virtio: Initialize core virtio vsock before registering the driver", Stefan pointed out some possible issues in the .probe() and .remove() callbacks of the virtio-vsock driver. This series tries to solve these issues: - Patch 1 postpones the 'the_virtio_vsock' assignment at the end of the .probe() to avoid that some sockets queue works when
2019 May 28
8
[PATCH 0/4] vsock/virtio: several fixes in the .probe() and .remove()
During the review of "[PATCH] vsock/virtio: Initialize core virtio vsock before registering the driver", Stefan pointed out some possible issues in the .probe() and .remove() callbacks of the virtio-vsock driver. This series tries to solve these issues: - Patch 1 postpones the 'the_virtio_vsock' assignment at the end of the .probe() to avoid that some sockets queue works when
2013 Jun 27
0
[RFC 4/5] VSOCK: Introduce vhost-vsock.ko
...c(sizeof(*vsock), GFP_KERNEL); + if (!vsock) + return -ENOMEM; + + pr_debug("%s:vsock=%p\n", __func__, vsock); + + vqs = kmalloc(VSOCK_VQ_MAX * sizeof(*vqs), GFP_KERNEL); + if (!vqs) { + ret = -ENOMEM; + goto out; + } + + vqs[VSOCK_VQ_CTRL] = &vsock->vqs[VSOCK_VQ_CTRL].vq; + vqs[VSOCK_VQ_TX] = &vsock->vqs[VSOCK_VQ_TX].vq; + vqs[VSOCK_VQ_RX] = &vsock->vqs[VSOCK_VQ_RX].vq; + vsock->vqs[VSOCK_VQ_CTRL].vq.handle_kick = vhost_vsock_handle_ctl_kick; + vsock->vqs[VSOCK_VQ_TX].vq.handle_kick = vhost_vsock_handle_tx_kick; + vsock->vqs[VSOCK_VQ_RX].vq.handle_kick = vhost_...
2018 Nov 05
2
[PATCH 1/5] VSOCK: support fill mergeable rx buffer in guest
...irtio_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 @@ struct virtio_vsock { struct virtio_vsock_event even...
2018 Nov 05
2
[PATCH 1/5] VSOCK: support fill mergeable rx buffer in guest
...irtio_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 @@ struct virtio_vsock { struct virtio_vsock_event even...
2016 Dec 12
3
[PATCH v4 2/4] vhost-vsock: add pkt cancel capability
...mp;freeme); + } + spin_unlock_bh(&vsock->send_pkt_list_lock); + + list_for_each_entry_safe(pkt, n, &freeme, list) { + if (pkt->reply) + cnt++; + list_del(&pkt->list); + virtio_transport_free_pkt(pkt); + } + + if (cnt) { + struct vhost_virtqueue *tx_vq = &vsock->vqs[VSOCK_VQ_TX]; + int new_cnt; + + new_cnt = atomic_sub_return(cnt, &vsock->queued_replies); + if (new_cnt + cnt >= tx_vq->num && new_cnt < tx_vq->num) + vhost_poll_queue(&tx_vq->poll); + } + + return 0; +} + static struct virtio_vsock_pkt * vhost_vsock_alloc_pkt(struct v...
2016 Dec 12
3
[PATCH v4 2/4] vhost-vsock: add pkt cancel capability
...mp;freeme); + } + spin_unlock_bh(&vsock->send_pkt_list_lock); + + list_for_each_entry_safe(pkt, n, &freeme, list) { + if (pkt->reply) + cnt++; + list_del(&pkt->list); + virtio_transport_free_pkt(pkt); + } + + if (cnt) { + struct vhost_virtqueue *tx_vq = &vsock->vqs[VSOCK_VQ_TX]; + int new_cnt; + + new_cnt = atomic_sub_return(cnt, &vsock->queued_replies); + if (new_cnt + cnt >= tx_vq->num && new_cnt < tx_vq->num) + vhost_poll_queue(&tx_vq->poll); + } + + return 0; +} + static struct virtio_vsock_pkt * vhost_vsock_alloc_pkt(struct v...
2015 Dec 09
0
[PATCH v3 3/4] VSOCK: Introduce vhost-vsock.ko
...c(sizeof(*vsock), GFP_KERNEL); + if (!vsock) + return -ENOMEM; + + pr_debug("%s:vsock=%p\n", __func__, vsock); + + vqs = kmalloc(VSOCK_VQ_MAX * sizeof(*vqs), GFP_KERNEL); + if (!vqs) { + ret = -ENOMEM; + goto out; + } + + vqs[VSOCK_VQ_CTRL] = &vsock->vqs[VSOCK_VQ_CTRL].vq; + vqs[VSOCK_VQ_TX] = &vsock->vqs[VSOCK_VQ_TX].vq; + vqs[VSOCK_VQ_RX] = &vsock->vqs[VSOCK_VQ_RX].vq; + vsock->vqs[VSOCK_VQ_CTRL].vq.handle_kick = vhost_vsock_handle_ctl_kick; + vsock->vqs[VSOCK_VQ_TX].vq.handle_kick = vhost_vsock_handle_tx_kick; + vsock->vqs[VSOCK_VQ_RX].vq.handle_kick = vhost_...
2018 Nov 06
1
[PATCH 1/5] VSOCK: support fill mergeable rx buffer in guest
...t; #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 @@ struct vi...
2014 Jul 05
0
[RFC V2 4/7] VSOCK: Introduce virtio-vsock.ko
...l_cid(); + src_port = vsk->local_addr.svm_port; + if (!info->remote_cid) { + dst_cid = vsk->remote_addr.svm_cid; + dst_port = vsk->remote_addr.svm_port; + } else { + dst_cid = info->remote_cid; + dst_port = info->remote_port; + } + + trans = vsk->trans; + vq = vsock->vqs[VSOCK_VQ_TX]; + + if (pkt_len > VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE) + pkt_len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE; + pkt_len = virtio_transport_get_credit(trans, pkt_len); + /* Do not send zero length OP_RW pkt*/ + if (pkt_len == 0 && info->op == VIRTIO_VSOCK_OP_RW) + return pkt_len; + + /* Respec...