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,12 +777,17 @@ 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,
|
||||
if (buf->last)
|
||||
count = buf->last - buf->head;
|
||||
|
||||
if (count) {
|
||||
n = rte_event_enqueue_new_burst(rx_adapter->eventdev_id,
|
||||
rx_adapter->event_port_id,
|
||||
&buf->events[buf->head],
|
||||
count);
|
||||
@ -790,6 +795,7 @@ rxa_flush_event_buffer(struct event_eth_rx_adapter *rx_adapter,
|
||||
stats->rx_enq_retry++;
|
||||
|
||||
buf->head += n;
|
||||
}
|
||||
|
||||
if (buf->last && n == count) {
|
||||
uint16_t n1;
|
||||
|
Loading…
Reference in New Issue
Block a user