mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
The macros XSK_BTF_READ_xxx doesn't handle or report on errors if the input or field were wrong, which is not uncommon for macros. The bad behavior is that the macro continue to dereference the pointer even-when xsk_btf__read_xxx() functions returns an error. This often leads to crashing the application. Change macro to only dereference when no errors were reported. Side-note: The compiler warnings will detect if API user didn't init the 'dest' value with a default value. As the effect of the change is that the 'dest' value will not be touch, and thus contain the value before the macro was used. Example: warning: ‘mark’ may be used uninitialized in this function Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
How to transfer info from XDP-prog to AF_XDP
This BPF-example show how use BTF to create a communication channel between XDP-prog (running kernel-side) and AF_XDP user-space process.
AF_XDP documentation
In kernel documentation for AF_XDP.
XDP-tools also contain documentation in libxdp for AF_XDP, explaining how to use the API, and the difference between the control-path and data-path APIs.