Re: [PATCH v3 bpf-next 9/9] selftest: add tests for XDP programs in CPUMAP entries

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

 



> On Tue, Jun 23, 2020 at 2:40 PM Lorenzo Bianconi <lorenzo@xxxxxxxxxx> wrote:
> >
> > Similar to what have been done for DEVMAP, introduce tests to verify

[...]

> > +SEC("xdp_cpumap/dummy_cm")
> > +int xdp_dummy_cm(struct xdp_md *ctx)
> > +{
> > +       char fmt[] = "devmap redirect: dev %u len %u\n";
> > +       void *data_end = (void *)(long)ctx->data_end;
> > +       void *data = (void *)(long)ctx->data;
> > +       unsigned int len = data_end - data;
> > +
> > +       ingress_ifindex = ctx->ingress_ifindex;
> 
> Have you checked the generated BPF assembly to verify
> ctx->ingress_ifindex is actually read? ingress_ifindex variable is
> declared static, so I'm guessing Clang just optimized it away. If you
> want to be sure this actually gets executed, make ingress_ifindex
> global var.

ack, thx for the review. I will fix it in v4.

Regards,
Lorenzo

> 
> > +
> > +       return XDP_PASS;
> > +}
> > +
> > +char _license[] SEC("license") = "GPL";
> > --
> > 2.26.2
> >

Attachment: signature.asc
Description: PGP signature


[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