Change-Id: I1e57a86b8872798a888e7d6128d9c4537a8090e6
Signed-off-by: Damjan Marion <damarion@cisco.com>
#define foreach_memif_tx_func_error \
_(NO_FREE_SLOTS, "no free tx slots") \
_(TRUNC_PACKET, "packet > buffer size -- truncated in tx ring") \
#define foreach_memif_tx_func_error \
_(NO_FREE_SLOTS, "no free tx slots") \
_(TRUNC_PACKET, "packet > buffer size -- truncated in tx ring") \
-_(PENDING_MSGS, "pending msgs in tx ring") \
-_(NO_TX_QUEUES, "no tx queues")
+_(PENDING_MSGS, "pending msgs in tx ring")
u32 thread_index = vlib_get_thread_index ();
u8 tx_queues = vec_len (mif->tx_queues);
memif_queue_t *mq;
u32 thread_index = vlib_get_thread_index ();
u8 tx_queues = vec_len (mif->tx_queues);
memif_queue_t *mq;
-
- if (PREDICT_FALSE (tx_queues == 0))
- {
- vlib_error_count (vm, node->node_index, MEMIF_TX_ERROR_NO_TX_QUEUES,
- n_left);
- goto error;
- }
if (tx_queues < vec_len (vlib_mains))
{
if (tx_queues < vec_len (vlib_mains))
{
clib_spinlock_lock_if_init (&mif->lockp);
}
else
clib_spinlock_lock_if_init (&mif->lockp);
}
else
- {
- qid = thread_index;
- }
mq = vec_elt_at_index (mif->tx_queues, qid);
ring = mq->ring;
ring_size = 1 << mq->log2_ring_size;
mask = ring_size - 1;
mq = vec_elt_at_index (mif->tx_queues, qid);
ring = mq->ring;
ring_size = 1 << mq->log2_ring_size;
mask = ring_size - 1;
/* free consumed buffers */
/* free consumed buffers */
CLIB_MEMORY_STORE_BARRIER ();
ring->head = head;
CLIB_MEMORY_STORE_BARRIER ();
ring->head = head;
+ if (n_left && n_retries--)
+ goto retry;
+
clib_spinlock_unlock_if_init (&mif->lockp);
if (n_left)
clib_spinlock_unlock_if_init (&mif->lockp);
if (n_left)
vlib_buffer_free (vm, vlib_frame_args (frame), frame->n_vectors);
return frame->n_vectors;
vlib_buffer_free (vm, vlib_frame_args (frame), frame->n_vectors);
return frame->n_vectors;