> 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