Trigger reset in ENA if there are too many Rx descriptors

Whenever the driver will receive too many descriptors from the device,
it should trigger the device reset, as it is indicating that the device
is in invalid state.

Submitted by:  Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Amazon, Inc.
This commit is contained in:
Marcin Wojtas 2019-05-30 13:13:15 +00:00
parent 277f11c401
commit c9b099ec94

View File

@ -1717,7 +1717,12 @@ ena_rx_cleanup(struct ena_ring *rx_ring)
error:
counter_u64_add(rx_ring->rx_stats.bad_desc_num, 1);
return (RX_BUDGET - budget);
/* Too many desc from the device. Trigger reset */
adapter->reset_reason = ENA_REGS_RESET_TOO_MANY_RX_DESCS;
adapter->trigger_reset = true;
return (0);
}
/*********************************************************************