# Re: \[PATCH 01/14\] bpf/tests: Add BPF\_JMP32 test cases

- From: Johan Almbladh \<johan.almbladh@anyfinetworks.com\>
- Date: 2021-07-29 21:30:55 
- List: netdev
- Page: https://ratatoskr.run/netdev/2021/07/7775559
- Thread: https://ratatoskr.run/netdev/2021/07/7774981/t.md

```text
On Thu, Jul 29, 2021 at 12:31 AM Yonghong Song [ref] wrote:
> > +     /* BPF_JMP32 | BPF_JGT | BPF_X */
> > +     {
> > +             "JMP32_JGT_X",
> > +             .u.insns_int = {
> > +                     BPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),
> > +                     BPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),
> > +                     BPF_JMP32_REG(BPF_JGT, R0, R1, 1),
>
> Maybe change the offset from 1 to 2? Otherwise, this may jump to
>    BPF_JMP32_REG(BPF_JGT, R0, R1, 1)
> which will just do the same comparison and jump to BTT_EXIT_INSN()
> which will also have R0 = 0xfffffffe at the end.

You are right. All BPF_X versions should have the first jump offset
incremented by one to account for the extra MOV that is not present in
the BPF_K version of the test. I'll correct it.
```
