search for: vhost_get_avail_buf

Displaying 20 results from an estimated 25 matches for "vhost_get_avail_buf".

2020 Jun 03
2
[PATCH RFC 07/13] vhost: format-independent API for used buffers
...unsigned int iov_size, > - unsigned int *out_num, unsigned int *in_num, > - struct vhost_log *log, unsigned int *log_num) > + * This function returns a value > 0 if a descriptor was found, or 0 if none were found. > + * A negative code is returned on error. */ > +int vhost_get_avail_buf(struct vhost_virtqueue *vq, struct vhost_buf *buf, > + struct iovec iov[], unsigned int iov_size, > + unsigned int *out_num, unsigned int *in_num, > + struct vhost_log *log, unsigned int *log_num) > { > int ret = fetch_descs(vq); > int i; > @@ -2311,6 +2310,8 @@ i...
2020 Jun 03
2
[PATCH RFC 07/13] vhost: format-independent API for used buffers
...unsigned int iov_size, > - unsigned int *out_num, unsigned int *in_num, > - struct vhost_log *log, unsigned int *log_num) > + * This function returns a value > 0 if a descriptor was found, or 0 if none were found. > + * A negative code is returned on error. */ > +int vhost_get_avail_buf(struct vhost_virtqueue *vq, struct vhost_buf *buf, > + struct iovec iov[], unsigned int iov_size, > + unsigned int *out_num, unsigned int *in_num, > + struct vhost_log *log, unsigned int *log_num) > { > int ret = fetch_descs(vq); > int i; > @@ -2311,6 +2310,8 @@ i...
2020 Jun 11
2
[PATCH RFC v6 02/11] vhost: use batched get_vq_desc version
On 2020/6/10 ??7:05, Michael S. Tsirkin wrote: >>> +EXPORT_SYMBOL_GPL(vhost_get_vq_desc); >>> /* Reverse the effect of vhost_get_vq_desc. Useful for error handling. */ >>> void vhost_discard_vq_desc(struct vhost_virtqueue *vq, int n) >>> { >>> + unfetch_descs(vq); >>> vq->last_avail_idx -= n; >> So unfetch_descs() has
2020 Jun 11
2
[PATCH RFC v6 02/11] vhost: use batched get_vq_desc version
On 2020/6/10 ??7:05, Michael S. Tsirkin wrote: >>> +EXPORT_SYMBOL_GPL(vhost_get_vq_desc); >>> /* Reverse the effect of vhost_get_vq_desc. Useful for error handling. */ >>> void vhost_discard_vq_desc(struct vhost_virtqueue *vq, int n) >>> { >>> + unfetch_descs(vq); >>> vq->last_avail_idx -= n; >> So unfetch_descs() has
2020 Jun 02
0
[PATCH RFC 11/13] vhost/scsi: switch to buf APIs
...drivers/vhost/scsi.c index c39952243fd3..c426c4e899c7 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -71,8 +71,8 @@ struct vhost_scsi_inflight { }; struct vhost_scsi_cmd { - /* Descriptor from vhost_get_vq_desc() for virt_queue segment */ - int tvc_vq_desc; + /* Descriptor from vhost_get_avail_buf() for virt_queue segment */ + struct vhost_buf tvc_vq_desc; /* virtio-scsi initiator task attribute */ int tvc_task_attr; /* virtio-scsi response incoming iovecs */ @@ -213,7 +213,7 @@ struct vhost_scsi { * Context for processing request and control queue operations. */ struct vhost_scsi...
2020 Jun 07
0
[PATCH RFC v5 11/13] vhost/scsi: switch to buf APIs
...drivers/vhost/scsi.c index 0cbaa0b3893d..a5cdd4c01a3a 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -71,8 +71,8 @@ struct vhost_scsi_inflight { }; struct vhost_scsi_cmd { - /* Descriptor from vhost_get_vq_desc() for virt_queue segment */ - int tvc_vq_desc; + /* Descriptor from vhost_get_avail_buf() for virt_queue segment */ + struct vhost_buf tvc_vq_desc; /* virtio-scsi initiator task attribute */ int tvc_task_attr; /* virtio-scsi response incoming iovecs */ @@ -213,7 +213,7 @@ struct vhost_scsi { * Context for processing request and control queue operations. */ struct vhost_scsi...
2020 Jun 08
2
[PATCH RFC v5 12/13] vhost/vsock: switch to the buf API
...nd_pkt(struct vhost_vsock *vsock, > list_del_init(&pkt->list); > spin_unlock_bh(&vsock->send_pkt_list_lock); > > - head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), > - &out, &in, NULL, NULL); > - if (head < 0) { > + ret = vhost_get_avail_buf(vq, &buf, > + vq->iov, ARRAY_SIZE(vq->iov), > + &out, &in, NULL, NULL); > + if (ret < 0) { > spin_lock_bh(&vsock->send_pkt_list_lock); > list_add(&pkt->list, &vsock->send_pkt_list); > spin_unlock_bh(&vsock->...
2020 Jun 08
2
[PATCH RFC v5 12/13] vhost/vsock: switch to the buf API
...nd_pkt(struct vhost_vsock *vsock, > list_del_init(&pkt->list); > spin_unlock_bh(&vsock->send_pkt_list_lock); > > - head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), > - &out, &in, NULL, NULL); > - if (head < 0) { > + ret = vhost_get_avail_buf(vq, &buf, > + vq->iov, ARRAY_SIZE(vq->iov), > + &out, &in, NULL, NULL); > + if (ret < 0) { > spin_lock_bh(&vsock->send_pkt_list_lock); > list_add(&pkt->list, &vsock->send_pkt_list); > spin_unlock_bh(&vsock->...
2020 Jun 02
0
[PATCH RFC 07/13] vhost: format-independent API for used buffers
...struct iovec iov[], unsigned int iov_size, - unsigned int *out_num, unsigned int *in_num, - struct vhost_log *log, unsigned int *log_num) + * This function returns a value > 0 if a descriptor was found, or 0 if none were found. + * A negative code is returned on error. */ +int vhost_get_avail_buf(struct vhost_virtqueue *vq, struct vhost_buf *buf, + struct iovec iov[], unsigned int iov_size, + unsigned int *out_num, unsigned int *in_num, + struct vhost_log *log, unsigned int *log_num) { int ret = fetch_descs(vq); int i; @@ -2311,6 +2310,8 @@ int vhost_get_vq_desc(struct vhost_virt...
2020 Jun 04
0
[PATCH RFC 07/13] vhost: format-independent API for used buffers
...t; > - unsigned int *out_num, unsigned int *in_num, > > - struct vhost_log *log, unsigned int *log_num) > > + * This function returns a value > 0 if a descriptor was found, or 0 if none were found. > > + * A negative code is returned on error. */ > > +int vhost_get_avail_buf(struct vhost_virtqueue *vq, struct vhost_buf *buf, > > + struct iovec iov[], unsigned int iov_size, > > + unsigned int *out_num, unsigned int *in_num, > > + struct vhost_log *log, unsigned int *log_num) > > { > > int ret = fetch_descs(vq); > > int i...
2020 Jun 10
18
[PATCH RFC v7 00/14] vhost: ring format independence
This intentionally leaves "fixup" changes separate - hopefully that is enough to fix vhost-net crashes reported here, but it helps me keep track of what changed. I will naturally squash them later when we are done. This adds infrastructure required for supporting multiple ring formats. The idea is as follows: we convert descriptors to an independent format first, and process that
2020 Jun 10
18
[PATCH RFC v7 00/14] vhost: ring format independence
This intentionally leaves "fixup" changes separate - hopefully that is enough to fix vhost-net crashes reported here, but it helps me keep track of what changed. I will naturally squash them later when we are done. This adds infrastructure required for supporting multiple ring formats. The idea is as follows: we convert descriptors to an independent format first, and process that
2020 Jun 08
14
[PATCH RFC v6 00/11] vhost: ring format independence
This adds infrastructure required for supporting multiple ring formats. The idea is as follows: we convert descriptors to an independent format first, and process that converting to iov later. Used ring is similar: we fetch into an independent struct first, convert that to IOV later. The point is that we have a tight loop that fetches descriptors, which is good for cache utilization. This will
2020 Jun 07
17
[PATCH RFC v5 00/13] vhost: ring format independence
This adds infrastructure required for supporting multiple ring formats. The idea is as follows: we convert descriptors to an independent format first, and process that converting to iov later. Used ring is similar: we fetch into an independent struct first, convert that to IOV later. The point is that we have a tight loop that fetches descriptors, which is good for cache utilization. This will
2020 Jun 02
0
[PATCH RFC 12/13] vhost/vsock: switch to the buf API
...16 +118,17 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock, list_del_init(&pkt->list); spin_unlock_bh(&vsock->send_pkt_list_lock); - head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), - &out, &in, NULL, NULL); - if (head < 0) { + ret = vhost_get_avail_buf(vq, &buf, + vq->iov, ARRAY_SIZE(vq->iov), + &out, &in, NULL, NULL); + if (ret < 0) { spin_lock_bh(&vsock->send_pkt_list_lock); list_add(&pkt->list, &vsock->send_pkt_list); spin_unlock_bh(&vsock->send_pkt_list_lock); break...
2020 Jun 07
0
[PATCH RFC v5 12/13] vhost/vsock: switch to the buf API
...16 +118,17 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock, list_del_init(&pkt->list); spin_unlock_bh(&vsock->send_pkt_list_lock); - head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), - &out, &in, NULL, NULL); - if (head < 0) { + ret = vhost_get_avail_buf(vq, &buf, + vq->iov, ARRAY_SIZE(vq->iov), + &out, &in, NULL, NULL); + if (ret < 0) { spin_lock_bh(&vsock->send_pkt_list_lock); list_add(&pkt->list, &vsock->send_pkt_list); spin_unlock_bh(&vsock->send_pkt_list_lock); break...
2020 Jun 08
0
[PATCH RFC v6 10/11] vhost/vsock: switch to the buf API
...16 +118,17 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock, list_del_init(&pkt->list); spin_unlock_bh(&vsock->send_pkt_list_lock); - head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), - &out, &in, NULL, NULL); - if (head < 0) { + ret = vhost_get_avail_buf(vq, &buf, + vq->iov, ARRAY_SIZE(vq->iov), + &out, &in, NULL, NULL); + if (ret < 0) { spin_lock_bh(&vsock->send_pkt_list_lock); list_add(&pkt->list, &vsock->send_pkt_list); spin_unlock_bh(&vsock->send_pkt_list_lock); break...
2020 Jun 11
0
[PATCH RFC v6 02/11] vhost: use batched get_vq_desc version
...h_buf() > ??? ??? last_avail_idx++; > > Then we want do discard it: > vhost_discard_avail_buf(1) > ??? unfetch_descs() > ??? ??? last_avail_idx--; > ??? last_avail_idx -= 1; > > Thanks I don't think that happens. vhost_discard_avail_buf(1) is only called after get vhost_get_avail_buf. vhost_get_avail_buf increments first_desc. unfetch_descs only counts from first_desc to ndescs. If I'm wrong, could you show values of first_desc and ndescs in this scenario? -- MST
2020 Jun 02
21
[PATCH RFC 00/13] vhost: format independence
We let the specifics of the ring format seep through to vhost API callers - mostly because there was only one format so it was hard to imagine what an independent API would look like. Now that there's an alternative in form of the packed ring, it's easier to see the issues, and fixing them is perhaps the cleanest way to add support for more formats. This patchset does this by indtroducing
2020 Jun 08
0
[PATCH RFC v5 12/13] vhost/vsock: switch to the buf API
...gt; > list_del_init(&pkt->list); > > spin_unlock_bh(&vsock->send_pkt_list_lock); > > > > - head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), > > - &out, &in, NULL, NULL); > > - if (head < 0) { > > + ret = vhost_get_avail_buf(vq, &buf, > > + vq->iov, ARRAY_SIZE(vq->iov), > > + &out, &in, NULL, NULL); > > + if (ret < 0) { > > spin_lock_bh(&vsock->send_pkt_list_lock); > > list_add(&pkt->list, &vsock->send_pkt_list); > >...