Available buffer ID should be stored in the zmbuf in the packed-ring
dequeue path. There's no guarantee that local queue avail index is
equal to buffer ID.
Fixes:
d1eafb532268 ("vhost: add packed ring zcopy batch and single dequeue")
Cc: stable@dpdk.org
Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reported-by: Yinan Wang <yinan.wang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) {
zmbufs[i]->mbuf = pkts[i];
- zmbufs[i]->desc_idx = avail_idx + i;
+ zmbufs[i]->desc_idx = ids[i];
zmbufs[i]->desc_count = 1;
}
return -1;
}
zmbuf->mbuf = *pkts;
- zmbuf->desc_idx = vq->last_avail_idx;
+ zmbuf->desc_idx = buf_id;
zmbuf->desc_count = desc_count;
rte_mbuf_refcnt_update(*pkts, 1);