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/i40e: clean LTO warnings
[dpdk.git]
/
drivers
/
net
/
ifc
/
ifcvf_vdpa.c
diff --git
a/drivers/net/ifc/ifcvf_vdpa.c
b/drivers/net/ifc/ifcvf_vdpa.c
index
619cdc2
..
8de9ef1
100644
(file)
--- a/
drivers/net/ifc/ifcvf_vdpa.c
+++ b/
drivers/net/ifc/ifcvf_vdpa.c
@@
-81,6
+81,8
@@
static struct internal_list_head internal_list =
static pthread_mutex_t internal_list_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t internal_list_lock = PTHREAD_MUTEX_INITIALIZER;
+static void update_used_ring(struct ifcvf_internal *internal, uint16_t qid);
+
static struct internal_list *
find_internal_resource_by_did(int did)
{
static struct internal_list *
find_internal_resource_by_did(int did)
{
@@
-631,6
+633,10
@@
m_ifcvf_start(struct ifcvf_internal *internal)
hw->vring[i].size = vq.size;
hw->vring[i].size = vq.size;
+ rte_vhost_get_vring_base(vid, i,
+ &internal->m_vring[i].avail->idx,
+ &internal->m_vring[i].used->idx);
+
rte_vhost_get_vring_base(vid, i, &hw->vring[i].last_avail_idx,
&hw->vring[i].last_used_idx);
rte_vhost_get_vring_base(vid, i, &hw->vring[i].last_avail_idx,
&hw->vring[i].last_used_idx);
@@
-662,6
+668,10
@@
m_ifcvf_stop(struct ifcvf_internal *internal)
ifcvf_stop_hw(hw);
for (i = 0; i < hw->nr_vring; i++) {
ifcvf_stop_hw(hw);
for (i = 0; i < hw->nr_vring; i++) {
+ /* synchronize remaining new used entries if any */
+ if ((i & 1) == 0)
+ update_used_ring(internal, i);
+
rte_vhost_get_vhost_vring(vid, i, &vq);
len = IFCVF_USED_RING_LEN(vq.size);
rte_vhost_log_used_vring(vid, i, 0, len);
rte_vhost_get_vhost_vring(vid, i, &vq);
len = IFCVF_USED_RING_LEN(vq.size);
rte_vhost_log_used_vring(vid, i, 0, len);
@@
-702,11
+712,6
@@
vring_relay(void *arg)
vid = internal->vid;
q_num = rte_vhost_get_vring_num(vid);
vid = internal->vid;
q_num = rte_vhost_get_vring_num(vid);
- /* prepare the mediated vring */
- for (qid = 0; qid < q_num; qid++)
- rte_vhost_get_vring_base(vid, qid,
- &internal->m_vring[qid].avail->idx,
- &internal->m_vring[qid].used->idx);
/* add notify fd and interrupt fd to epoll */
epfd = epoll_create(IFCVF_MAX_QUEUES * 2);
/* add notify fd and interrupt fd to epoll */
epfd = epoll_create(IFCVF_MAX_QUEUES * 2);
@@
-736,6
+741,7
@@
vring_relay(void *arg)
DRV_LOG(ERR, "epoll add error: %s", strerror(errno));
return NULL;
}
DRV_LOG(ERR, "epoll add error: %s", strerror(errno));
return NULL;
}
+ update_used_ring(internal, qid);
}
/* start relay with a first kick */
}
/* start relay with a first kick */
@@
-1108,6
+1114,9
@@
ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return 0;
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return 0;
+ if (!pci_dev->device.devargs)
+ return 1;
+
kvlist = rte_kvargs_parse(pci_dev->device.devargs->args,
ifcvf_valid_arguments);
if (kvlist == NULL)
kvlist = rte_kvargs_parse(pci_dev->device.devargs->args,
ifcvf_valid_arguments);
if (kvlist == NULL)