* [dpdk-dev] Question regarding rte_eth_tx_burst()
@ 2013-07-26 14:16 Jesus Velazquez
0 siblings, 0 replies; only message in thread
From: Jesus Velazquez @ 2013-07-26 14:16 UTC (permalink / raw)
To: dev
Hi all,
Any ideas would be helpful, I have an application that uses a rte_ring
for queuing packets to be sent (a single consumer - multiple producer).
The problem I am facing is with rte_eth_tx_burst(), once I dequeue N
packets from tx ring, there is no guaranty that all packets will be
sent, if not all packets
are sent, rte_ring does not allow pushing packets at front (it is a
FIFO). So, if I re-queue them in the ring, packets will be network
reordered.
There is no mechanism to know the number of TX free descriptors in a
particular queue. I'm working with ixgbe and I found that nb_tx_free is
an approximation of that,
it is updated every time at ixgbe_xmit_cleanup() that is called during
ixgbe_xmit_pkts().
I was wondering to add a function that returns nb_tx_free value in order
to have an idea of how many packets can be safety sent.
Right now my code does this:
....
nbulk = RTE_MIN(rte_ring_count(queue->tx_ring), (uint16_t)TX_DRAIN_PKTS);
ret = rte_ring_sc_dequeue_bulk(queue->tx_ring, (void **)ptrs, nbulk);
if(unlikely(ret < 0))
return 0; /* Not enough objects?, I asked a moment ago */
ret = rte_eth_tx_burst(queue->port, queue->id, ptrs, nbulk);
if(unlikely(ret > nbulk)) {
TRACE(RTE, ">>>Imposible sent more than existing\n");
return -1;
}
while(ret < nbulk) {
/* bad case: packet reordering */
ret2 = rte_ring_mp_enqueue(queue->tx_ring, (void *)&ptrs[ret]);
if(ret2 < 0) {
/* TODO: may be an emergency tx queue? */
/* wrost case: dropping */
rte_pktmbuf_free(ptrs[ret]);
}
ret++;
}
I would appreciate any ideas of how to overcome this situation.
Thanks and regards,
Jesus
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-07-26 14:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-26 14:16 [dpdk-dev] Question regarding rte_eth_tx_burst() Jesus Velazquez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).