> -----Original Message----- > From: Eelco Chaudron <[email protected]> > Sent: Friday, April 22, 2022 9:48 AM > To: David Marchand <[email protected]> > Cc: Van Haaren, Harry <[email protected]>; [email protected]; > Ilya Maximets <[email protected]> > Subject: Re: [ovs-dev] [PATCH] dpif-netdev-avx512: fix ubsan shift error in > bitmasks > > > > On 22 Apr 2022, at 10:29, David Marchand wrote: > > > On Wed, Apr 20, 2022 at 10:19 AM Eelco Chaudron <[email protected]> > 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 the 1 character, ensuring compiler knows > >>> the 1 is unsigned (and 32-bits minimum). Undefined Behaviour sanitizer > >>> is now happy with the shifts at runtime. > >> > >> Change looks good to me, but should 1UL not be enough, as the destinations > >> are > all 32-bit? > > > > For storing/comparing to explicit uint32_t variables, either > > (uint32_t)1 or UINT32_C(1) are more natural. > > Any reason not to use those? > > Forgot about those :) They are even better...
OK, thanks folks, will respin a v2 with those. Regards, -Harry _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
