Page MenuHomeFreeBSD

virtio_net: Set rx/tx busdma alignment to 1 byte
AbandonedPublic

Authored by sarah.walker2_arm.com on Apr 28 2026, 1:43 PM.
Tags
None
Referenced Files
F164744337: D56691.diff
Mon, Aug 3, 1:57 PM
Unknown Object (File)
Sun, Aug 2, 3:13 AM
Unknown Object (File)
Sat, Aug 1, 5:21 AM
Unknown Object (File)
Fri, Jul 31, 4:54 AM
Unknown Object (File)
Mon, Jul 27, 4:32 PM
Unknown Object (File)
Tue, Jul 21, 2:17 AM
Unknown Object (File)
Sun, Jul 19, 5:22 PM
Unknown Object (File)
Sun, Jul 19, 2:44 PM
Subscribers

Details

Reviewers
markj
Summary

Previous alignment is unnecessary, and caused locking issues on amd64.

Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 72634
Build 69517: arc lint + arc unit

Event Timeline

Please be sure to add a Fixes: tag to the commit log message.

sys/dev/virtio/network/if_vtnet.c
487

Just write 1?

This revision is now accepted and ready to land.Apr 28 2026, 9:40 PM
This revision now requires review to proceed.Apr 29 2026, 7:26 AM
This revision is now accepted and ready to land.Apr 29 2026, 1:18 PM

How can alignment lead locking issues ? Not an expert on this, just out of curious.

How can alignment lead locking issues ? Not an expert on this, just out of curious.

The standard behaviour for busdma_bounce implementations is that bus_dmamap with alignment > 1 is marked as COULD_BOUNCE. Among other things this can cause a bounce zone to be allocated at bus_dmamap creation time. This causes further allocations without M_NOWAIT which triggers the locking issue.

How can alignment lead locking issues ? Not an expert on this, just out of curious.

The standard behaviour for busdma_bounce implementations is that bus_dmamap with alignment > 1 is marked as COULD_BOUNCE. Among other things this can cause a bounce zone to be allocated at bus_dmamap creation time. This causes further allocations without M_NOWAIT which triggers the locking issue.

WoW !

andrew added a subscriber: andrew.

This can be closed? It's been merged into th re-opened D55492