HomeFreeBSD

vtnet: Avoid ifdefs based on __NO_STRICT_ALIGNMENT

Description

vtnet: Avoid ifdefs based on __NO_STRICT_ALIGNMENT

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
Reviewed by: bz, bryanv
Differential Revision: https://reviews.freebsd.org/D43654

(cherry picked from commit 0ea4b4084845bfeedc8c692e4d34252023b78cb3)
(cherry picked from commit 9ae56ea964c89284a998a501e6cf1b57d000d968)

Approved-by: re (cperciva)

Details

Provenance
impAuthored on Feb 5 2024, 5:43 AM
Reviewer
bz
Differential Revision
D43654: vtnet: Avoid ifdefs based on __NO_STRICT_ALIGNMENT
Parents
rG67aff34d9ad0: vtnet: Account for the padding when selecting allocation size
Branches
Unknown
Tags
Unknown