On Tue, Jul 13, 2021 at 09:49:08AM +0300, Eli Britstein wrote:
> In rte_vlan_insert there is a casting of rte_pktmbuf_prepend returned
> value to (struct rte_ether_hdr *), which causes cast-align warning when
> using gcc flags '-Werror -Wcast-align':
>
> In file included from .../include/rte_ethdev.h:165,
> from lib/netdev-dpdk.c:33:
> .../include/rte_ether.h: In function 'rte_vlan_insert':
> .../include/rte_ether.h:375:7: error: cast increases required alignment
> of target type [-Werror=cast-align]
> 375 | nh = (struct rte_ether_hdr *)
> | ^
>
> As the code assumes correct alignment, add first a (void *) casting, to
> avoid the warning.
>
> Fixes: c974021a5949 ("ether: add soft vlan encap/decap")
> Cc: [email protected]
>
> Signed-off-by: Eli Britstein <[email protected]>
Acked-by: Olivier Matz <[email protected]>