[PATCH] net: improve vlan header type alignment

fengchengwen fengchengwen at huawei.com
Mon Oct 14 07:42:41 CEST 2024


Acked-by: Chengwen Feng <fengchengwen at huawei.com>

On 2024/10/13 16:35, Morten Brørup wrote:
> Ethernet packets can be VLAN tagged, i.e. an Ethernet header can have a
> VLAN tag (a.k.a. VLAN header) embedded.
> Since the Ethernet header is 2 byte aligned, and the VLAN tag is directly
> related to the Ethernet header, the VLAN tag is also 2 byte aligned, so
> packing the VLAN tag structure is not necessary.
> 
> Furthermore, the Ethernet header type is implictly 2 byte aligned, so
> removed the superfluous explicit 2 byte alignment.
> 
> Added static_asserts to verify the size and alignment of the various
> Ethernet types.
> 
> Signed-off-by: Morten Brørup <mb at smartsharesystems.com>



More information about the dev mailing list