Thread (23 messages) flat view 23 messages, 5 authors, 2020-06-25

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

From: Lorenzo Bianconi <lorenzo@kernel.org>
Date: 2020-06-24 15:37:34
Also in: bpf

On Tue, Jun 23, 2020 at 2:40 PM Lorenzo Bianconi [off-list ref] wrote:
quoted
Similar to what have been done for DEVMAP, introduce tests to verify
[...]
quoted
+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
quoted
+
+       return XDP_PASS;
+}
+
+char _license[] SEC("license") = "GPL";
--
2.26.2

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help