Re: git: b5bad6df467c - main - virtio_net: Use bus_dma for command/ack buffers

From: Herbert J. Skuhra <herbert_at_gojira.at>
Date: Fri, 01 May 2026 09:14:57 UTC
On Mon, 27 Apr 2026 13:38:56 +0200, Andrew Turner wrote:
> 
> The branch main has been updated by andrew:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=b5bad6df467cc95bea641afe674c55cd5b9f1510
> 
> commit b5bad6df467cc95bea641afe674c55cd5b9f1510
> Author:     Sarah Walker <sarah.walker2@arm.com>
> AuthorDate: 2026-02-27 14:17:15 +0000
> Commit:     Andrew Turner <andrew@FreeBSD.org>
> CommitDate: 2026-04-27 11:37:53 +0000
> 
>     virtio_net: Use bus_dma for command/ack buffers
>     
>     While the majority of virtio platforms will be fully coherent, some may
>     require cache maintenance or other specific device memory handling (eg for
>     secure partitioning). Using bus_dma allows for these usecases.
>     
>     The virtio buffers are marked as coherent; this should ensure that sync
>     calls are no-ops in the common cases.
>     
>     Reviewed by:    andrew
>     Sponsored by:   Arm Ltd
>     Differential Revision:  https://reviews.freebsd.org/D55564
> ---
>  sys/dev/virtio/network/if_vtnet.c    | 336 +++++++++++++++++++++++++++++------
>  sys/dev/virtio/network/if_vtnetvar.h |   6 +
>  2 files changed, 284 insertions(+), 58 deletions(-)

After this change SFTP transfers are stalling/failing:

Connected to server.
sftp> get file.img 
Fetching /home/herbert/file.img to file.img
file.img                                        1%   35MB   0.0KB/s - stalled -

No new transfer are possible after reconnecting:

Connected to server.
sftp> get file.img 
Fetching /home/herbert/file.img to file.img
file.img                                        0%    0     0.0KB/s   --:-- ETA
file.img                                        0%    0     0.0KB/s - stalled -
Read from remote host xxx Connection reset by peer
client_loop: send disconnect: Broken pipe
Connection closed

And (during/afterwards) /var/log/messages is being filled with the
following error:

May  1 10:42:00 srv03 kernel: ata0: FAILURE - load data
May  1 10:42:00 srv03 kernel: ata0: setting up DMA failed

I am running GENERIC-NODEBUG on a amd64 system.

Reverting this commit (and c16c95192f01) resolves the issue.

--
Herbert