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
Unknown Object (File)
Fri, Jul 3, 5:30 AM
Unknown Object (File)
Fri, Jun 12, 2:05 AM
Unknown Object (File)
Jun 4 2026, 7:31 AM
Unknown Object (File)
May 25 2026, 9:05 AM
Unknown Object (File)
May 25 2026, 9:02 AM
Unknown Object (File)
May 19 2026, 2:20 AM
Unknown Object (File)
May 19 2026, 2:16 AM
Unknown Object (File)
May 17 2026, 11:15 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