Re: [dpdk-dev] Define statement with UB prevents compilation using UBSAN

2021-06-11 Thread Owen Hilyard
Seeing the discussion so far, do we want to change the single definition to be (0b1u << 31) so it works, or should we make this change in a wider scope (file, directory, project-wide). If we do make the change in a wider scope, should we only change instances where there is UB (1 << 31) or should w

Re: [dpdk-dev] Define statement with UB prevents compilation using UBSAN

2021-06-11 Thread Aaron Conole
Stephen Hemminger writes: > On Thu, 10 Jun 2021 16:51:37 -0400 > Owen Hilyard wrote: > >> Working backward to the define >> statement, AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY is defined as >> >> #define AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY (0x1 << 31) > > Why not (1u << 31)? +1

Re: [dpdk-dev] Define statement with UB prevents compilation using UBSAN

2021-06-11 Thread Morten Brørup
> From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Stephen Hemminger > Sent: Thursday, 10 June 2021 23.36 > > On Thu, 10 Jun 2021 16:51:37 -0400 > Owen Hilyard wrote: > > > Working backward to the define > > statement, AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY is defined > as > > > > #de

Re: [dpdk-dev] Define statement with UB prevents compilation using UBSAN

2021-06-10 Thread Stephen Hemminger
On Thu, 10 Jun 2021 16:51:37 -0400 Owen Hilyard wrote: > Working backward to the define > statement, AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY is defined as > > #define AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY (0x1 << 31) Why not (1u << 31)?

[dpdk-dev] Define statement with UB prevents compilation using UBSAN

2021-06-10 Thread Owen Hilyard
Hello, While starting work on adding UBSAN to the community lab CI, I found that DPDK does not compile in its default configuration with UBSAN enabled, failing with the error message: ../drivers/net/bnx2x/bnx2x.c: In function ‘bnx2x_check_blocks_with_parity3’: ../drivers/net/bnx2x/bnx2x.c:3363:4: