OpenCloudOS-Kernel/drivers/platform/mellanox
Liming Sun 763c59714c platform/mellanox: mlxbf-tmfifo: Drop Tx network packet when Tx TmFIFO is full
[ Upstream commit 8cbc756b802605dee3dd40019bd75960772bacf5 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-01 13:34:49 +01:00
..
Kconfig platform/mellanox: NVSW_SN2201 should depend on ACPI 2023-09-11 13:21:46 +02:00
Makefile platform/mellanox: Add support for new SN2201 system 2022-05-12 15:35:29 +02:00
mlxbf-bootctl.c mlxbf-bootctl: correctly identify secure boot with development keys 2023-12-13 18:45:05 +01:00
mlxbf-bootctl.h mlxbf-bootctl: Support sysfs entries for MFG fields 2023-08-23 17:31:27 +02:00
mlxbf-pmc.c platform/mellanox: Check devm_hwmon_device_register_with_groups() return value 2023-12-13 18:45:05 +01:00
mlxbf-tmfifo-regs.h platform/mellanox: Add BlueField-3 support in the tmfifo driver 2022-11-16 08:48:19 +01:00
mlxbf-tmfifo.c platform/mellanox: mlxbf-tmfifo: Drop Tx network packet when Tx TmFIFO is full 2024-03-01 13:34:49 +01:00
mlxreg-hotplug.c platform: mellanox: mlxreg-hotplug: Extend condition for notification callback processing 2023-08-23 17:31:30 +02:00
mlxreg-io.c platform: Explicitly include correct DT includes 2023-07-26 10:58:36 +02:00
mlxreg-lc.c platform/mellanox: mlxreg-lc: Make error handling flow consistent 2022-09-09 21:58:16 +02:00
nvsw-sn2201.c platform: mellanox: nvsw-sn2201: change fans i2c busses. 2023-08-23 17:31:30 +02:00