[PATCH] net: improve vlan header type alignment

Morten Brørup mb at smartsharesystems.com
Fri Oct 18 01:41:23 CEST 2024


> From: Thomas Monjalon [mailto:thomas at monjalon.net]
> Sent: Thursday, 17 October 2024 22.44
> 
> 13/10/2024 10:35, Morten Brørup:
> > +static_assert(sizeof(struct rte_ether_addr) == 6,
> > +		"sizeof(struct rte_ether_addr) == 6");
> > +static_assert(alignof(struct rte_ether_addr) == 2,
> > +		"alignof(struct rte_ether_addr) == 2");
> 
> Instead of repeating the condition twice,
> it would be simpler to use RTE_BUILD_BUG_ON

RTE_BUILD_BUG_ON can only be used in code blocks, so it would need to be wrapped in some dummy function.



More information about the dev mailing list