Vring should not be touched if vq is disabled. This patch adds the vq
status check in async enqueue polling to avoid accessing to a disabled
queue.
Fixes:
cd6760da1076 ("vhost: introduce async enqueue for split ring")
Signed-off-by: Patrick Fu <patrick.fu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
if (n_pkts_put) {
vq->async_pkts_inflight_n -= n_pkts_put;
- __atomic_add_fetch(&vq->used->idx, n_descs, __ATOMIC_RELEASE);
-
- vhost_vring_call_split(dev, vq);
+ if (likely(vq->enabled && vq->access_ok)) {
+ __atomic_add_fetch(&vq->used->idx,
+ n_descs, __ATOMIC_RELEASE);
+ vhost_vring_call_split(dev, vq);
+ }
}
if (start_idx + n_pkts_put <= vq_size) {