Re: [ovs-dev] [PATCH] dpif-netdev-avx512: fix ubsan shift error in bitmasks

2022-04-22 Thread Van Haaren, Harry
> -Original Message- > From: Eelco Chaudron > Sent: Friday, April 22, 2022 9:48 AM > To: David Marchand > Cc: Van Haaren, Harry ; ovs-dev@openvswitch.org; > Ilya Maximets > Subject: Re: [ovs-dev] [PATCH] dpif-netdev-avx512: fix ubsan shift error in > bitmasks &

Re: [ovs-dev] [PATCH] dpif-netdev-avx512: fix ubsan shift error in bitmasks

2022-04-22 Thread Eelco Chaudron
On 22 Apr 2022, at 10:29, David Marchand wrote: > On Wed, Apr 20, 2022 at 10:19 AM Eelco Chaudron wrote: >> On 19 Apr 2022, at 18:20, Harry van Haaren wrote: >> >>> The code changes here are to handle (1 << i) shifts where 'i' is the >>> packet index in the batch, and 1 << 31 is an overflow

Re: [ovs-dev] [PATCH] dpif-netdev-avx512: fix ubsan shift error in bitmasks

2022-04-22 Thread David Marchand
On Wed, Apr 20, 2022 at 10:19 AM Eelco Chaudron wrote: > On 19 Apr 2022, at 18:20, Harry van Haaren wrote: > > > The code changes here are to handle (1 << i) shifts where 'i' is the > > packet index in the batch, and 1 << 31 is an overflow of the signed '1'. > > > > Fixed by adding ULL suffix to

Re: [ovs-dev] [PATCH] dpif-netdev-avx512: fix ubsan shift error in bitmasks

2022-04-20 Thread Eelco Chaudron
On 19 Apr 2022, at 18:20, Harry van Haaren wrote: > The code changes here are to handle (1 << i) shifts where 'i' is the > packet index in the batch, and 1 << 31 is an overflow of the signed '1'. > > Fixed by adding ULL suffix to the 1 character, ensuring compiler knows > the 1 is unsigned

[ovs-dev] [PATCH] dpif-netdev-avx512: fix ubsan shift error in bitmasks

2022-04-19 Thread Harry van Haaren
The code changes here are to handle (1 << i) shifts where 'i' is the packet index in the batch, and 1 << 31 is an overflow of the signed '1'. Fixed by adding ULL suffix to the 1 character, ensuring compiler knows the 1 is unsigned (and 32-bits minimum). Undefined Behaviour sanitizer is now happy