HomeFreeBSD

Add ETHER_ALIGN support to ng_device(4).

Description

Add ETHER_ALIGN support to ng_device(4).

This adds a new ng_device command, NGM_DEVICE_ETHERALIGN, which has no
associated args. After the command arrives, the device begins adjusting all
packets sent out its hook to have ETHER_ALIGN bytes of padding at the
beginning of the packet. The ETHER_ALIGN padding is added only when
running on an architecture that requires strict alignment of IP headers
(based on the __NO_STRICT_ALIGNMENT macro, which is only #define'd on
x86 as of this writing).

This also adds ascii <-> binary command translation to ng_device, both for
the existing NGM_DEVICE_GET_DEVNAME and the new ETHERALIGN command.

This also gives a name to every ng_device node when it is constructed, using
the cdev device name (ngd0, ngd1, etc). This makes it easier to address
command msgs to the device using ngctl(8).

Reviewed by: donner, ray, adrian
Differential Revision: https://reviews.freebsd.org/D32905
MFC after: 1 week

(cherry picked from commit 44aae623ab858387301358b9b054cd229ce41068)

Details

Provenance
ianAuthored on Nov 9 2021, 2:34 PM
manuCommitted on Jan 14 2022, 1:28 PM
Reviewer
donner
Differential Revision
D32905: Add ETHER_ALIGN support to ng_device(4).
Parents
rG1e2a0cef6bf1: tcptw: count how many times a tcptw was actually useful
Branches
Unknown
Tags
Unknown