[dpdk-dev] [PATCH 1/2] net: add endianness annotations to ethernet headers
Olivier Matz
olivier.matz at 6wind.com
Tue May 11 15:09:30 CEST 2021
On Thu, May 06, 2021 at 05:14:25PM +0200, David Marchand wrote:
> Spotted by sparse in OVS build:
>
> /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h:789:27:
> error: incorrect type in initializer (different base types)
> /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h:789:27:
> expected unsigned short [usertype] ether_type
> /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h:789:27:
> got restricted ovs_be16 [usertype]
> /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h:829:25:
> error: incorrect type in initializer (different base types)
> /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h:829:25:
> expected unsigned short [usertype] vlan_tci
> /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h:829:25:
> got restricted ovs_be16 [usertype]
> /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h:830:26:
> error: incorrect type in initializer (different base types)
> /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h:830:26:
> expected unsigned short [usertype] eth_proto
> /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h:830:26:
> got restricted ovs_be16 [usertype]
>
> This was not caught before as no code in headers was using those fields.
> This changed with commit 6f2168b69aee ("ethdev: reuse ethernet header
> definition in flow item") and commit a56a262e3408 ("ethdev: reuse VLAN
> header definition in flow item").
>
> Signed-off-by: David Marchand <david.marchand at redhat.com>
I was wondering if it wouldn't be safer to change the initializer
instead of the structure definition, to avoid any API breakage.
But after some off-list discussions, it appears that there is no API
breakage (rte_be16_t is a typedef to uint16_t), and this kind of changes
was already done in the past.
Acked-by: Olivier Matz <olivier.matz at 6wind.com>
More information about the dev
mailing list