summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRich Lane <rich.lane@bigswitch.com>2016-07-01 09:31:12 -0700
committerYuanhan Liu <yuanhan.liu@linux.intel.com>2016-07-11 04:57:39 +0200
commitf4e4b1f1f85e0eed4c3b2b7e40e7e797e618f368 (patch)
tree09c3853fbe6b38be17220c2fecb72fa2345cee35 /drivers
parentbb7085b46ac502e9b494e30d2961400d4baf7a4f (diff)
downloaddpdk-f4e4b1f1f85e0eed4c3b2b7e40e7e797e618f368.zip
dpdk-f4e4b1f1f85e0eed4c3b2b7e40e7e797e618f368.tar.gz
dpdk-f4e4b1f1f85e0eed4c3b2b7e40e7e797e618f368.tar.xz
net/vhost: fix queue state not reset on destroy
Fixes a bug where rte_eth_vhost_get_queue_event would not return enabled queues after a guest application restart. Fixes: ee584e9710b9 ("vhost: add driver on top of the library") Signed-off-by: Rich Lane <rich.lane@bigswitch.com> Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/vhost/rte_eth_vhost.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 596faea..7539cd4 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -303,6 +303,7 @@ destroy_device(int vid)
struct internal_list *list;
char ifname[PATH_MAX];
unsigned i;
+ struct rte_vhost_vring_state *state;
rte_vhost_get_ifname(vid, ifname, sizeof(ifname));
list = find_internal_resource(ifname);
@@ -345,6 +346,15 @@ destroy_device(int vid)
vq->vid = -1;
}
+ state = vring_states[eth_dev->data->port_id];
+ rte_spinlock_lock(&state->lock);
+ for (i = 0; i <= state->max_vring; i++) {
+ state->cur[i] = false;
+ state->seen[i] = false;
+ }
+ state->max_vring = 0;
+ rte_spinlock_unlock(&state->lock);
+
RTE_LOG(INFO, PMD, "Connection closed\n");
_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC);