Re: [PATCH] bitfield.h: don't compile-time validate _val in FIELD_FIT

2020-07-08 Thread Jakub Kicinski
On Wed, 8 Jul 2020 10:56:43 -0700 Nick Desaulniers wrote: > On Wed, Jul 8, 2020 at 10:34 AM Alex Elder wrote: > > > > I understand why something needs to be done to handle that case. > > There's fancy macro gymnastics in "bitfield.h" to add convenient > > build-time checks for usage problems; I ju

Re: [PATCH] bitfield.h: don't compile-time validate _val in FIELD_FIT

2020-07-08 Thread Alex Elder
On 7/8/20 12:10 PM, Nick Desaulniers wrote: > On Tue, Jul 7, 2020 at 3:43 PM Alex Elder wrote: >> >> On 7/7/20 4:16 PM, Nick Desaulniers wrote: >>> From: Jakub Kicinski >>> >>> When ur_load_imm_any() is inlined into jeq_imm(), it's possible for the >>> compiler to deduce a case where _val can onl

Re: [PATCH] bitfield.h: don't compile-time validate _val in FIELD_FIT

2020-07-07 Thread Alex Elder
On 7/7/20 4:16 PM, Nick Desaulniers wrote: > From: Jakub Kicinski > > When ur_load_imm_any() is inlined into jeq_imm(), it's possible for the > compiler to deduce a case where _val can only have the value of -1 at > compile time. Specifically, > > /* struct bpf_insn: _s32 imm */ > u64 imm = insn