[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-7.2.18 09/18] virtio-net: Fix num_buffers for version 1
From: |
Michael Tokarev |
Subject: |
[Stable-7.2.18 09/18] virtio-net: Fix num_buffers for version 1 |
Date: |
Wed, 14 May 2025 15:56:15 +0300 |
From: Akihiko Odaki <akihiko.odaki@daynix.com>
The specification says the device MUST set num_buffers to 1 if
VIRTIO_NET_F_MRG_RXBUF has not been negotiated.
Fixes: df91055db5c9 ("virtio-net: enable virtio 1.0")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20250108-buffers-v1-1-a0c85ff31aeb@daynix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit c17ad4b11bd268a35506cd976884562df6ca69d7)
(Mjt: adjust for 7.2.x)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 204a80ec71..0ba1db5b14 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1914,6 +1914,8 @@ static ssize_t virtio_net_receive_rcu(NetClientState *nc,
const uint8_t *buf,
sg, elem->in_num,
offsetof(typeof(mhdr), num_buffers),
sizeof(mhdr.num_buffers));
+ } else {
+ mhdr.num_buffers = cpu_to_le16(1);
}
receive_header(n, sg, elem->in_num, buf, size);
--
2.39.5
- [Stable-7.2.18 00/18] Patch Round-up for stable 7.2.18, freeze on 2025-05-24, Michael Tokarev, 2025/05/14
- [Stable-7.2.18 02/18] hw/rtc/goldfish: keep time offset when resetting, Michael Tokarev, 2025/05/14
- [Stable-7.2.18 05/18] target/mips: Revert TARGET_PAGE_BITS_VARY, Michael Tokarev, 2025/05/14
- [Stable-7.2.18 04/18] target/avr: Fix buffer read in avr_print_insn, Michael Tokarev, 2025/05/14
- [Stable-7.2.18 03/18] hw/pci-host/designware: Fix ATU_UPPER_TARGET register access, Michael Tokarev, 2025/05/14
- [Stable-7.2.18 01/18] Makefile: "make dist" generates a .xz, not .bz2, Michael Tokarev, 2025/05/14
- [Stable-7.2.18 07/18] target/mips: Simplify and fix update_pagemask, Michael Tokarev, 2025/05/14
- [Stable-7.2.18 06/18] target/mips: Require even maskbits in update_pagemask, Michael Tokarev, 2025/05/14
- [Stable-7.2.18 08/18] migration: fix SEEK_CUR offset calculation in qio_channel_block_seek, Michael Tokarev, 2025/05/14
- [Stable-7.2.18 09/18] virtio-net: Fix num_buffers for version 1,
Michael Tokarev <=
- [Stable-7.2.18 10/18] smbios: Fix buffer overrun when using path= option, Michael Tokarev, 2025/05/14
- [Stable-7.2.18 11/18] plugins/loader: fix deadlock when resetting/uninstalling a plugin, Michael Tokarev, 2025/05/14
- [Stable-7.2.18 12/18] target/i386/hvf: fix lflags_to_rflags, Michael Tokarev, 2025/05/14
- [Stable-7.2.18 14/18] target/arm: Don't assert() for ISB/SB inside IT block, Michael Tokarev, 2025/05/14
- [Stable-7.2.18 13/18] target/avr: Improve decode of LDS, STS, Michael Tokarev, 2025/05/14
- [Stable-7.2.18 16/18] hw/i2c/imx: Always set interrupt status bit if interrupt condition occurs, Michael Tokarev, 2025/05/14
- [Stable-7.2.18 15/18] hw/gpio/imx_gpio: Fix interpretation of GDIR polarity, Michael Tokarev, 2025/05/14
- [Stable-7.2.18 17/18] 9pfs: fix concurrent v9fs_reclaim_fd() calls, Michael Tokarev, 2025/05/14
- [Stable-7.2.18 18/18] 9pfs: fix FD leak and reduce latency of v9fs_reclaim_fd(), Michael Tokarev, 2025/05/14