eventdev/eth_rx: fix stalls on event device backpressure
In the Eventdev Ethernet RX Adapter, correctly handle the case where
the circular enqueue buffer head and last index point to the same
element.
This bug may be triggered in case there is backpressure from the event
device to the RX adapter.
Fixes: 8113fd15e2
("eventdev/eth_rx: make enqueue buffer circular")
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
This commit is contained in:
parent
741b499e64
commit
572dce2bf9
@ -777,19 +777,25 @@ rxa_flush_event_buffer(struct event_eth_rx_adapter *rx_adapter,
|
||||
struct eth_event_enqueue_buffer *buf,
|
||||
struct rte_event_eth_rx_adapter_stats *stats)
|
||||
{
|
||||
uint16_t count = buf->last ? buf->last - buf->head : buf->count;
|
||||
uint16_t count = buf->count;
|
||||
uint16_t n = 0;
|
||||
|
||||
if (!count)
|
||||
return 0;
|
||||
|
||||
uint16_t n = rte_event_enqueue_new_burst(rx_adapter->eventdev_id,
|
||||
rx_adapter->event_port_id,
|
||||
&buf->events[buf->head],
|
||||
count);
|
||||
if (n != count)
|
||||
stats->rx_enq_retry++;
|
||||
if (buf->last)
|
||||
count = buf->last - buf->head;
|
||||
|
||||
buf->head += n;
|
||||
if (count) {
|
||||
n = rte_event_enqueue_new_burst(rx_adapter->eventdev_id,
|
||||
rx_adapter->event_port_id,
|
||||
&buf->events[buf->head],
|
||||
count);
|
||||
if (n != count)
|
||||
stats->rx_enq_retry++;
|
||||
|
||||
buf->head += n;
|
||||
}
|
||||
|
||||
if (buf->last && n == count) {
|
||||
uint16_t n1;
|
||||
|
Loading…
Reference in New Issue
Block a user