On Mon, Oct 10, 2016 at 10:42:58PM +0200, Thomas Monjalon wrote:
> > Support New Device Types in Vhost-User: Support will be added to vhost-user 
> > for new device types including vhost-scsi and vhost-blk.
> 
> Great!
> Is it only related to networking or should we expect some storage-related
> code or drivers to come up?

It's not only netowrking related. It just introduces few more APIs to
export those buf infos (virt addr, phys addr, len, etc) to applications,
so that they can handle/parse the data in the way they want. For example,
for SPDK (https://01.org/spdk), they can use those APIs to fetch guest
data and parse it following virtio-SCSI spec.

The dequeue path (guest Tx) might look like something below:

        rte_vhost_dequeue_vring_desc_burst(vid, queue_id, iov, count)
        {
                for (i = 0; i < count; i++) {
                        desc_idx = get_next_desc();

                        iov[i]->addr      = 
desc_virt_addr(desc[desc_idx]->addr);
                        iov[i]->phys_addr = 
desc_phys_addr(desc[desc_idx]->addr);
                        iov[i]->len       = desc[desc_idx]->len;
                        iov[i]->desc      = desc_idx;
                }

                return i;
        }

        rte_vhost_update_used_ring(vid, queue_id, descs, count)
        {
                for (i = 0; i < count; i++) {
                        used_idx = get_next_used_idx();
                        vq->used->ring[used_idx] = descs[i];
                }

                vq->used->idx += i;
        }

And we introduce similar APIs to the enqueue path.

        --yliu

Reply via email to