net: ena: Add more information on TX timeouts
authorDavid Arinzon <darinzon@amazon.com>
Tue, 30 Jan 2024 09:53:49 +0000 (09:53 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 1 Feb 2024 12:22:12 +0000 (13:22 +0100)
commit071271f39ce833a3534d1fbd47174d1bed6d9326
treeea87eabb33cd6bef06b662c77c979fad39272637
parentae82209293297c423c0c40575cae7b464248866c
net: ena: Add more information on TX timeouts

The function responsible for polling TX completions might not receive
the CPU resources it needs due to higher priority tasks running on the
requested core.

The driver might not be able to recognize such cases, but it can use its
state to suspect that they happened. If both conditions are met:

- napi hasn't been executed more than the TX completion timeout value
- napi is scheduled (meaning that we've received an interrupt)

Then it's more likely that the napi handler isn't scheduled because of
an overloaded CPU.
It was decided that for this case, the driver would wait twice as long
as the regular timeout before scheduling a reset.
The driver uses ENA_REGS_RESET_SUSPECTED_POLL_STARVATION reset reason to
indicate this case to the device.

This patch also adds more information to the ena_tx_timeout() callback.
This function is called by the kernel when it detects that a specific TX
queue has been closed for too long.

Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: David Arinzon <darinzon@amazon.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/amazon/ena/ena_netdev.c
drivers/net/ethernet/amazon/ena/ena_regs_defs.h