Re: [RFC bpf-next 9/9] selftests/bpf: add selftests for indirect jumps

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

 



On 25/06/17 08:24PM, Alexei Starovoitov wrote:
> On Sun, Jun 15, 2025 at 1:55 AM Anton Protopopov
> <a.s.protopopov@xxxxxxxxx> wrote:
> > +SEC("syscall")
> > +int two_towers(struct simple_ctx *ctx)
> > +{
> > +       switch (ctx->x) {
> >
> 
> Not sure why you went with switch() statements everywhere.
> Please add few tests with explicit indirect goto
> like interpreter does: goto *jumptable[insn->code];

This requires to patch libbpf a bit more, as some meta-info
accompanying this instruction should be emitted, like LLVM does with
jump_table_sizes. And this probably should be a different section,
such that it doesn't conflict with LLVM/GCC. I thought to add this
later, but will try to add to the next version.

> Remove all bpf_printk() too and get easy on names.

The `bpf_printk` is there to emit some instructions which later will
be replaced by the verifier with more instructions; this is to
additionally test "instruction set" basic functionality
(orig->xlated mapping). Do you think this selftest shouldn't have
this?

> i_am_a_little_tiny_foo() sounds funny today, but
> it won't be funny at all tomorrow.

Yeah, thanks, will rename it.




[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