git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/ice/base: fix uninitialized stack variables
[dpdk.git]
/
lib
/
librte_vhost
/
vdpa.c
diff --git
a/lib/librte_vhost/vdpa.c
b/lib/librte_vhost/vdpa.c
index
1ff9b00
..
2b86708
100644
(file)
--- a/
lib/librte_vhost/vdpa.c
+++ b/
lib/librte_vhost/vdpa.c
@@
-49,7
+49,7
@@
rte_vdpa_register_device(struct rte_vdpa_dev_addr *addr,
char device_name[MAX_VDPA_NAME_LEN];
int i;
char device_name[MAX_VDPA_NAME_LEN];
int i;
- if (vdpa_device_num >= MAX_VHOST_DEVICE)
+ if (vdpa_device_num >= MAX_VHOST_DEVICE
|| addr == NULL || ops == NULL
)
return -1;
for (i = 0; i < MAX_VHOST_DEVICE; i++) {
return -1;
for (i = 0; i < MAX_VHOST_DEVICE; i++) {
@@
-66,7
+66,7
@@
rte_vdpa_register_device(struct rte_vdpa_dev_addr *addr,
if (i == MAX_VHOST_DEVICE)
return -1;
if (i == MAX_VHOST_DEVICE)
return -1;
- s
printf(device_name
, "vdpa-dev-%d", i);
+ s
nprintf(device_name, sizeof(device_name)
, "vdpa-dev-%d", i);
dev = rte_zmalloc(device_name, sizeof(struct rte_vdpa_device),
RTE_CACHE_LINE_SIZE);
if (!dev)
dev = rte_zmalloc(device_name, sizeof(struct rte_vdpa_device),
RTE_CACHE_LINE_SIZE);
if (!dev)
@@
-99,6
+99,9
@@
rte_vdpa_find_device_id(struct rte_vdpa_dev_addr *addr)
struct rte_vdpa_device *dev;
int i;
struct rte_vdpa_device *dev;
int i;
+ if (addr == NULL)
+ return -1;
+
for (i = 0; i < MAX_VHOST_DEVICE; ++i) {
dev = vdpa_devices[i];
if (dev && is_same_vdpa_device(&dev->addr, addr))
for (i = 0; i < MAX_VHOST_DEVICE; ++i) {
dev = vdpa_devices[i];
if (dev && is_same_vdpa_device(&dev->addr, addr))
@@
-123,7
+126,7
@@
rte_vdpa_get_device_num(void)
return vdpa_device_num;
}
return vdpa_device_num;
}
-int
__rte_experimental
+int
rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m)
{
struct virtio_net *dev = get_device(vid);
rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m)
{
struct virtio_net *dev = get_device(vid);
@@
-178,7
+181,7
@@
rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m)
return -1;
if (unlikely(dlen < vq->desc[desc_id].len)) {
return -1;
if (unlikely(dlen < vq->desc[desc_id].len)) {
- idesc = alloc_copy_ind_table(dev, vq,
+ idesc =
vhost_
alloc_copy_ind_table(dev, vq,
vq->desc[desc_id].addr,
vq->desc[desc_id].len);
if (unlikely(!idesc))
vq->desc[desc_id].addr,
vq->desc[desc_id].len);
if (unlikely(!idesc))
@@
-198,7
+201,8
@@
rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m)
goto fail;
desc = desc_ring[desc_id];
if (desc.flags & VRING_DESC_F_WRITE)
goto fail;
desc = desc_ring[desc_id];
if (desc.flags & VRING_DESC_F_WRITE)
- vhost_log_write(dev, desc.addr, desc.len);
+ vhost_log_write_iova(dev, vq, desc.addr,
+ desc.len);
desc_id = desc.next;
} while (desc.flags & VRING_DESC_F_NEXT);
desc_id = desc.next;
} while (desc.flags & VRING_DESC_F_NEXT);