Re: [PATCH bpf-next v4 2/5] selftests/bpf: allow BTF specs and func infos in test_verifier tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 10, 2022 at 12:16 PM Eduard Zingerman <eddyz87@xxxxxxxxx> wrote:
>
> > On Fri, 2022-06-10 at 11:09 -0700, Song Liu wrote:
>
> > > +static int load_btf_for_test(struct bpf_test *test)
> > > +{
> > > +       int types_num = 0;
> > > +
> > > +       while (types_num < MAX_BTF_TYPES &&
> > > +              test->btf_types[types_num] != BTF_END_RAW)
> > > +               ++types_num;
> > > +
> > > +       int types_len = types_num * sizeof(test->btf_types[0]);
> > > +
> > > +       return load_btf_spec(test->btf_types, types_len,
> > > +                            test->btf_strings, sizeof(test->btf_strings));
> >
> > IIUC, strings_len is always 256. Is this expected?
>
> Yes, as long as strings are zero terminated the actual buffer size
> shouldn't matter. So I decided that it would be better to avoid
> strings length specification in the test definition to keep things
> simpler.

Hmm.. OK, I guess this is acceptable for the test.

Acked-by: Song Liu <songliubraving@xxxxxx>



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux