[dpdk-dev] [PATCH] ethdev: fix VXLAN mask initialization value

Ivan Malov Ivan.Malov at oktetlabs.ru
Thu Apr 8 18:31:31 CEST 2021


On 4/8/2021 7:48 AM, Gregory Etelson wrote:
 > In GCC compiler, __builtin_constant_p(exp) is a function.
 > The function returns the integer 1 if the argument is known to be
 > a compile-time constant.
 > Therefore, __builtin_constant_p(0xffffff << 8) returned 1.
 > As the result, rte_flow_item_vxlan_mask was initiated to
 > {{
 >    {flags = 0x0, rsvd0 = {0x0, 0x0, 0x0},
 >     vni = {0x0, 0x0, 0x0}, rsvd1 = 0x1},
 >    hdr = {vx_flags = 0x0, vx_vni = 0x1000000}}}
 > }}
 > GCC fails initialization
 > rte_flow_item_vxlan_mask.hdr.vni = (0xffffff << 8)
 > with "initializer element is not a constant expression" error.
 > Use immediate 0xffffff00 value instead.
 >
 > Cc: stable at dpdk.org
 > Fixes: 43af98e687cf ("ethdev: reuse VXLAN header definition in flow 
item")
 >
 > Signed-off-by: Gregory Etelson <getelson at nvidia.com>
 > Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>

Reviewed-by: Ivan Malov <ivan.malov at oktetlabs.ru>

-- 
Ivan M


More information about the dev mailing list