Page MenuHomeFreeBSD

vtnet: Avoid ifdefs based on __NO_STRICT_ALIGNMENT
ClosedPublic

Authored by imp on Jan 29 2024, 8:53 PM.
Tags
None
Referenced Files
F174709187: D43654.id133865.diff
Mon, Oct 5, 9:29 AM
F174657480: D43654.id133559.diff
Mon, Oct 5, 12:28 AM
Unknown Object (File)
Sun, Oct 4, 5:17 PM
Unknown Object (File)
Sun, Oct 4, 4:31 AM
Unknown Object (File)
Thu, Oct 1, 7:28 PM
Unknown Object (File)
Thu, Oct 1, 4:20 AM
Unknown Object (File)
Wed, Sep 30, 6:59 PM
Unknown Object (File)
Wed, Sep 30, 5:29 PM
Subscribers
None

Details

Summary

Some platforms require an adjustment of the ethernet hearders. Rather
than make this be on __NO_STRICT_ALIGNMENT being defined, define
VTNET_ETHER_ALIGN to be either 0 or ETHER_ALIGN (aka 2). Add a test to
the if statements to only do them when != 0. This eliminates the #ifdef
sprinkled in the code, still communicates the intent and gives the same
compiled results.

Sponsored by: Netflix

Diff Detail

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

Event Timeline

imp requested review of this revision.Jan 29 2024, 8:53 PM
imp created this revision.
sys/dev/virtio/network/if_vtnet.c
95

s/2/ETHER_ALIGN/ to understand the magic number

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

Right. I'd meant to do that and has a braino

update to use ETHER_ALIGN

This revision is now accepted and ready to land.Jan 31 2024, 3:39 AM