linux-stable/drivers/platform
Liming Sun 8cbc756b80 platform/mellanox: mlxbf-tmfifo: Drop Tx network packet when Tx TmFIFO is full
Starting from Linux 5.16 kernel, Tx timeout mechanism was added
in the virtio_net driver which prints the "Tx timeout" warning
message when a packet stays in Tx queue for too long. Below is an
example of the reported message:

"[494105.316739] virtio_net virtio1 tmfifo_net0: TX timeout on
queue: 0, sq: output.0, vq: 0×1, name: output.0, usecs since
last trans: 3079892256".

This issue could happen when external host driver which drains the
FIFO is restared, stopped or upgraded. To avoid such confusing
"Tx timeout" messages, this commit adds logic to drop the outstanding
Tx packet if it's not able to transmit in two seconds due to Tx FIFO
full, which can be considered as congestion or out-of-resource drop.

This commit also handles the special case that the packet is half-
transmitted into the Tx FIFO. In such case, the packet is discarded
with remaining length stored in vring->rem_padding. So paddings with
zeros can be sent out when Tx space is available to maintain the
integrity of the packet format. The padded packet will be dropped on
the receiving side.

Signed-off-by: Liming Sun <limings@nvidia.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240111173106.96958-1-limings@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2024-01-22 12:21:40 +01:00
..
chrome TTY/Serial changes for 6.8-rc1 2024-01-18 11:37:24 -08:00
goldfish platform/goldfish: goldfish_pipe: Convert to platform remove callback returning void 2023-11-28 19:03:24 +00:00
loongarch platform/loongarch: laptop: Fix possible UAF and simplify generic_acpi_laptop_init() 2022-10-29 16:29:31 +08:00
mellanox platform/mellanox: mlxbf-tmfifo: Drop Tx network packet when Tx TmFIFO is full 2024-01-22 12:21:40 +01:00
mips mips: rs870e: stop exporting local functions 2023-12-10 17:21:39 -08:00
olpc platform/olpc: olpc-xo175-ec: Use SPI device ID data to bind device 2023-03-20 14:43:35 +01:00
surface TTY/Serial changes for 6.8-rc1 2024-01-18 11:37:24 -08:00
x86 platform/x86: intel-wmi-sbl-fw-update: Fix function name in error message 2024-01-22 11:37:28 +01:00
Kconfig platform/mips: Adjust Kconfig to keep consistency 2022-12-08 11:51:52 +01:00
Makefile LoongArch: Add ACPI-based generic laptop driver 2022-10-12 16:36:20 +08:00