/* avoid ring wrap */
n_desc_left = txq->size - clib_max (txq->next, txq->n_enqueued + 8);
+ if (n_desc_left == 0)
+ return 0;
+
while (n_packets_left && n_desc_left)
{
u32 or_flags;
avf_txq_t *txq = vec_elt_at_index (ad->txqs, qid % ad->num_queue_pairs);
u32 *buffers = vlib_frame_vector_args (frame);
u16 n_enq, n_left;
- u16 n_retry = 5;
+ u16 n_retry = 2;
clib_spinlock_lock_if_init (&txq->lock);
if (slot == 0)
break;
- complete_slot = slot[0];
- if (avf_tx_desc_get_dtyp (txq->descs + complete_slot) != 0x0F)
+ if (avf_tx_desc_get_dtyp (txq->descs + slot[0]) != 0x0F)
break;
+ complete_slot = slot[0];
+
clib_ring_deq (txq->rs_slots);
}