}
vq->vq_free_thresh = rx_free_thresh;
- if (nb_desc == 0 || nb_desc > vq->vq_nentries)
+ /*
+ * For split ring vectorized path descriptors number must be
+ * equal to the ring size.
+ */
+ if (nb_desc > vq->vq_nentries ||
+ (!virtio_with_packed_queue(hw) && hw->use_vec_rx)) {
nb_desc = vq->vq_nentries;
+ }
vq->vq_free_cnt = RTE_MIN(vq->vq_free_cnt, nb_desc);
rxvq = &vq->rxq;
if (unlikely(error)) {
for (i = 0; i < free_cnt; i++)
rte_pktmbuf_free(pkts[i]);
+ } else {
+ nbufs += free_cnt;
}
}
- nbufs += free_cnt;
vq_update_avail_idx(vq);
}
} else {
if (tx_free_thresh >= (vq->vq_nentries - 3)) {
PMD_DRV_LOG(ERR, "tx_free_thresh must be less than the "
"number of TX entries minus 3 (%u)."
- " (tx_free_thresh=%u port=%u queue=%u)\n",
+ " (tx_free_thresh=%u port=%u queue=%u)",
vq->vq_nentries - 3,
tx_free_thresh, dev->data->port_id, queue_idx);
return -EINVAL;