vhost: split desc_to_iovs function
Use the payload to construct iovs so that split desc or packed desc can both work. Change-Id: Ib2c60b6eb53d0d615594e97b3d3ae1a365908b6c Signed-off-by: Jin Yu <jin.yu@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1000 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
parent
af561c1a4a
commit
a8bdd24bc2
@ -468,14 +468,12 @@ vhost_vring_desc_is_wr(struct vring_desc *cur_desc)
|
||||
return !!(cur_desc->flags & VRING_DESC_F_WRITE);
|
||||
}
|
||||
|
||||
int
|
||||
vhost_vring_desc_to_iov(struct spdk_vhost_session *vsession, struct iovec *iov,
|
||||
uint16_t *iov_index, const struct vring_desc *desc)
|
||||
static int
|
||||
vhost_vring_desc_payload_to_iov(struct spdk_vhost_session *vsession, struct iovec *iov,
|
||||
uint16_t *iov_index, uintptr_t payload, uint64_t remaining)
|
||||
{
|
||||
uint64_t len;
|
||||
uint64_t remaining = desc->len;
|
||||
uintptr_t payload = desc->addr;
|
||||
uintptr_t vva;
|
||||
uint64_t len;
|
||||
|
||||
do {
|
||||
if (*iov_index >= SPDK_VHOST_IOVS_MAX) {
|
||||
@ -498,6 +496,14 @@ vhost_vring_desc_to_iov(struct spdk_vhost_session *vsession, struct iovec *iov,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
vhost_vring_desc_to_iov(struct spdk_vhost_session *vsession, struct iovec *iov,
|
||||
uint16_t *iov_index, const struct vring_desc *desc)
|
||||
{
|
||||
return vhost_vring_desc_payload_to_iov(vsession, iov, iov_index,
|
||||
desc->addr, desc->len);
|
||||
}
|
||||
|
||||
static struct spdk_vhost_session *
|
||||
vhost_session_find_by_id(struct spdk_vhost_dev *vdev, unsigned id)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user