vhost: eliminate loop log print when no available requests
Change-Id: I3cd72317392b15bad888391b7bc7e1bc5e69385c Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
parent
2621c7bdc4
commit
fa511620c4
@ -54,6 +54,7 @@
|
||||
#include "spdk/conf.h"
|
||||
#include "spdk/event.h"
|
||||
#include "spdk/scsi_spec.h"
|
||||
#include "spdk/likely.h"
|
||||
|
||||
#include "spdk/vhost.h"
|
||||
#include "task.h"
|
||||
@ -120,6 +121,10 @@ vq_avail_ring_get(struct vhost_virtqueue *vq, uint16_t *reqs, uint16_t reqs_len)
|
||||
uint16_t count = RTE_MIN((avail_idx - last_idx) & size_mask, reqs_len);
|
||||
uint16_t i;
|
||||
|
||||
if (spdk_likely(count == 0)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
vq->last_avail_idx += count;
|
||||
for (i = 0; i < count; i++) {
|
||||
reqs[i] = vq->avail->ring[(last_idx + i) & size_mask];
|
||||
|
Loading…
Reference in New Issue
Block a user