On Fri, 2024-05-10 at 14:59 -0700, Kui-Feng Lee wrote: > > For the sake of completeness, would it be possible to create a test > > case where there are several struct arrays following each other? > > E.g. as below: > > > > struct foo { > > ... __kptr *a; > > ... __kptr *b; > > } > > > > struct bar { > > ... __kptr *c; > > } > > > > struct { > > struct foo foos[3]; > > struct bar bars[2]; > > } > > > > Just to check that offset is propagated correctly. > > Sure! Great, thank you > > Also, in the tests below you check that a pointer to some object could > > be put into an array at different indexes. Tbh, I find it not very > > interesting if we want to check that offsets are correct. > > Would it be possible to create an array of object kptrs, > > put specific references at specific indexes and somehow check which > > object ended up where? (not necessarily 'bpf_cpumask'). > > Do you mean checking index in the way like the following code? > > if (array[0] != ref0 || array[1] != ref1 || array[2] != ref2 ....) > return err; Probably, but I'd need your help here. There goal is to verify that offsets of __kptr's in the 'info' array had been set correctly. Where is this information is used later on? E.g. I'd like to trigger some action that "touches" __kptr at index N and verify that all others had not been "touched". But this "touch" action has to use offset stored in the 'info'. [...]