I define a map with its pinning field set to LIBBPF_PIN_BY_NAME as shown below:
struct {
__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
__uint(max_entries, XDP_ACTION_MAX);
__type(key, int);
__type(value, struct datarec);
__uint(pinning, LIBBPF_PIN_BY_NAME);
} xdp_stats_map SEC(".maps");
The code compiles and bpf2go generates the .o files successfully. However, when I load it and run it with the user program it gives error message error: failed to create xdp program: field XskSockProg: program xsk_sock_prog: map xdp_stats_map: pin by name: missing MapOptions.PinPath.
How can I provide the PinPath to load the code?