aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_api.c
diff options
context:
space:
mode:
authorJunnan Wu <[email protected]>2025-02-14 01:22:00 +0000
committerJakub Kicinski <[email protected]>2025-02-15 03:52:06 +0000
commit55eff109e76a14e5ed10c8c3c3978d20a35e2a4d (patch)
treee78ba8b368dc4ebf2b83ac3ff2d5b48e4885af2c /net/sched/cls_api.c
parentnet: wwan: mhi_wwan_mbim: Silence sequence number glitch errors (diff)
downloadkernel-55eff109e76a14e5ed10c8c3c3978d20a35e2a4d.tar.gz
kernel-55eff109e76a14e5ed10c8c3c3978d20a35e2a4d.zip
vsock/virtio: fix variables initialization during resuming
When executing suspend to ram twice in a row, the `rx_buf_nr` and `rx_buf_max_nr` increase to three times vq->num_free. Then after virtqueue_get_buf and `rx_buf_nr` decreased in function virtio_transport_rx_work, the condition to fill rx buffer (rx_buf_nr < rx_buf_max_nr / 2) will never be met. It is because that `rx_buf_nr` and `rx_buf_max_nr` are initialized only in virtio_vsock_probe(), but they should be reset whenever virtqueues are recreated, like after a suspend/resume. Move the `rx_buf_nr` and `rx_buf_max_nr` initialization in virtio_vsock_vqs_init(), so we are sure that they are properly initialized, every time we initialize the virtqueues, either when we load the driver or after a suspend/resume. To prevent erroneous atomic load operations on the `queued_replies` in the virtio_transport_send_pkt_work() function which may disrupt the scheduling of vsock->rx_work when transmitting reply-required socket packets, this atomic variable must undergo synchronized initialization alongside the preceding two variables after a suspend/resume. Fixes: bd50c5dc182b ("vsock/virtio: add support for device suspend/resume") Link: https://lore.kernel.org/virtualization/[email protected]/ Co-developed-by: Ying Gao <[email protected]> Signed-off-by: Ying Gao <[email protected]> Signed-off-by: Junnan Wu <[email protected]> Reviewed-by: Luigi Leonardi <[email protected]> Acked-by: Michael S. Tsirkin <[email protected]> Reviewed-by: Stefano Garzarella <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/sched/cls_api.c')
0 files changed, 0 insertions, 0 deletions