OpenCloudOS-Kernel/drivers/net/xen-netback
Juergen Gross 0e3657c619 xen/netback: don't queue unlimited number of packages
commit be81992f90 upstream.

In case a guest isn't consuming incoming network traffic as fast as it
is coming in, xen-netback is buffering network packages in unlimited
numbers today. This can result in host OOM situations.

Commit f48da8b14d ("xen-netback: fix unlimited guest Rx internal
queue and carrier flapping") meant to introduce a mechanism to limit
the amount of buffered data by stopping the Tx queue when reaching the
data limit, but this doesn't work for cases like UDP.

When hitting the limit don't queue further SKBs, but drop them instead.
In order to be able to tell Rx packages have been dropped increment the
rx_dropped statistics counter in this case.

It should be noted that the old solution to continue queueing SKBs had
the additional problem of an overflow of the 32-bit rx_queue_len value
would result in intermittent Tx queue enabling.

This is part of XSA-392

Fixes: f48da8b14d ("xen-netback: fix unlimited guest Rx internal queue and carrier flapping")
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Honglin Li <honglinli@tencent.com>
2024-06-11 20:43:47 +08:00
..
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
common.h xen/netback: fix rx queue stall detection 2024-06-11 20:43:47 +08:00
hash.c xen-netback: don't populate the hash cache on XenBus disconnect 2019-02-28 12:50:37 -08:00
interface.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
netback.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
rx.c xen/netback: don't queue unlimited number of packages 2024-06-11 20:43:47 +08:00
xenbus.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00