virtio: remove unnecessary if

This `if` came from the original DPDK virtio PMD.
Generally, we do not want to trigger cache coherency
updates if we don't have to, but in this particular
case we know we always do.

If there were no changes to the avail index, there
would be no requests started and the function would
return much earlier.

Change-Id: Ic1231cf82288c1cb95dc89346f54d51849b8bae9
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/415589
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
Dariusz Stojaczyk 2018-06-16 17:45:27 +02:00 committed by Jim Harris
parent ba43426c3d
commit 8c6bd59704

View File

@ -460,9 +460,7 @@ virtqueue_req_flush(struct virtqueue *vq)
* descriptor.
*/
avail_idx = (uint16_t)(vq->vq_avail_idx & (vq->vq_nentries - 1));
if (spdk_unlikely(vq->vq_ring.avail->ring[avail_idx] != vq->req_start)) {
vq->vq_ring.avail->ring[avail_idx] = vq->req_start;
}
vq->vq_avail_idx++;
vq->req_start = VQ_RING_DESC_CHAIN_END;