mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-01-16 12:55:29 -07:00
virtio-net: Fix num_buffers for version 1
The specification says the device MUST set num_buffers to 1 if VIRTIO_NET_F_MRG_RXBUF has not been negotiated. Fixes:df91055db5("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 commitc17ad4b11b) (Mjt: adjust for 7.2.x) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
d34c201195
commit
cefd67f254
1 changed files with 2 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue