In some situations, when a virtual machine is starting,
vring_state_changed can be called while there was no change in the
queue state. This fix makes sure that there was really a change in the
queue state before calling the callback for EVENT_QUEUE_STATE.
Fixes:
ee584e9710b9 ("vhost: add driver on top of the library")
Cc: stable@dpdk.org
Signed-off-by: Noa Ezra <noae@mellanox.com>
Reviewed-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
/* won't be NULL */
state = vring_states[eth_dev->data->port_id];
rte_spinlock_lock(&state->lock);
+ if (state->cur[vring] == enable) {
+ rte_spinlock_unlock(&state->lock);
+ return 0;
+ }
state->cur[vring] = enable;
state->max_vring = RTE_MAX(vring, state->max_vring);
rte_spinlock_unlock(&state->lock);