Re: [PATCH] net: improve vlan header type alignment

2024-10-18 Thread Thomas Monjalon
13/10/2024 10:35, Morten Brørup: > 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

RE: [PATCH] net: improve vlan header type alignment

2024-10-17 Thread Morten Brørup
> From: Thomas Monjalon [mailto:tho...@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, >

Re: [PATCH] net: improve vlan header type alignment

2024-10-17 Thread Thomas Monjalon
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 wo

Re: [PATCH] net: improve vlan header type alignment

2024-10-14 Thread Bruce Richardson
On Sun, Oct 13, 2024 at 08:35:54AM +, 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 t

Re: [PATCH] net: improve vlan header type alignment

2024-10-13 Thread fengchengwen
Acked-by: Chengwen Feng 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 V

RE: [PATCH] net: improve vlan header type alignment

2024-10-13 Thread Morten Brørup
> From: Morten Brørup [mailto:m...@smartsharesystems.com] > Sent: Sunday, 13 October 2024 10.36 > > 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 > rela

[PATCH] net: improve vlan header type alignment

2024-10-13 Thread Morten Brørup
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 nec