Files
xdp-project-bpf-examples/AF_XDP-interaction
Jesper Dangaard Brouer 8db4d3b33c lib_xsk_extend: Avoid crashing in XSK_BTF_READ_xxx macros
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>
2021-11-12 10:01:58 +01:00
..
2021-11-05 13:40:20 +01:00

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.