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)
Wed, Aug 26, 1:21 PM
Unknown Object (File)
Tue, Aug 25, 7:09 AM
Unknown Object (File)
Tue, Aug 25, 7:09 AM
Unknown Object (File)
Wed, Aug 12, 8:01 PM
Unknown Object (File)
Tue, Aug 11, 11:31 PM
Unknown Object (File)
Tue, Aug 11, 11:30 PM
Unknown Object (File)
Tue, Aug 11, 11:25 PM
Unknown Object (File)
Mon, Aug 10, 5:02 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