All of lore.kernel.org
 help / color / mirror / Atom feed
* Packet access from bpf_perf_event_output
@ 2018-06-18  1:07 Zvi Effron
  2018-06-18  1:54 ` Y Song
  2018-06-18  7:40 ` Jesper Dangaard Brouer
  0 siblings, 2 replies; 7+ messages in thread
From: Zvi Effron @ 2018-06-18  1:07 UTC (permalink / raw)
  To: Xdp

Hi XDPeople!

In /include/uapi/linux/bpf.h, (in 4.18-rc1) the comment describing
bpf_perf_event_output says:

/*
 * Note that this helper is not restricted to tracing use cases
 * and can be used with programs attached to TC or XDP as well,
 * where it allows for passing data to user space listeners. Data
 * can be:
 *
 * * Only custom structs,
 * * Only the packet payload, or
 * * A combination of both.
 */

This seems to imply that for both TC and XDP, the packet can be used
for passing data. When I try this, the verifier rejects the program
with "helper access to the packet is not allowed". Looking through the
kernel it doesn't look like bpf_perf_output_event has been tagged with
the appropriate metadata to allow it to access the packet structure,
either for TC or for XDP. Neither bpf_skb_event_output_proto nor
bpf_xdp_event_output_proto have pkt_acess set to true. Is the
documentation incorrect, should that metadata be updated to allow
packet access, or is there something I'm missing?

Thank you!
--Zvi

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-06-18 11:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-18  1:07 Packet access from bpf_perf_event_output Zvi Effron
2018-06-18  1:54 ` Y Song
2018-06-18  7:40 ` Jesper Dangaard Brouer
2018-06-18  9:59   ` Zvi Effron
2018-06-18 10:47     ` Toke Høiland-Jørgensen
2018-06-18 10:50       ` Zvi Effron
2018-06-18 11:12         ` Toke Høiland-Jørgensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.