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)
Tue, Sep 15, 1:40 PM
Unknown Object (File)
Sat, Sep 12, 4:14 PM
Unknown Object (File)
Sat, Sep 12, 11:19 AM
Unknown Object (File)
Sat, Sep 12, 6:53 AM
Unknown Object (File)
Mon, Sep 7, 5:49 AM
Unknown Object (File)
Fri, Sep 4, 9:07 PM
Unknown Object (File)
Fri, Sep 4, 3:21 PM
Unknown Object (File)
Wed, Aug 26, 1:21 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