我如何计算出 BPF 辅助函数的 return 代码的含义?

How can I work out the meaning of the return codes for BPF helper functions?

我正在编写 BPF_PROG_TYPE_SOCKET_OPS 程序,我在 /sys/kernel/debug/tracing/trace_pipe 中看到以下内容:

<...>-12586 [001] ....  6972.409111: 0: update err: -95

当我由于以下片段加载它时:

ret = bpf_sock_map_update(ops, &sock_ops, &idx, BPF_ANY);
if (ret < 0) {
    bpf_debug("update err: %d\n", ret);
}

我怎么知道 -95 是什么意思?当我查看 https://elixir.bootlin.com/linux/latest/source/arch/alpha/include/uapi/asm/errno.h 时,我看到:

#define ENOCSI      95  /* No CSI structure available */

这是找到错误含义的正确方法吗?如果是这样,描述的含义是什么?

错误是 EOPNOTSUPP from here. This was caused by the socket not being 'full' when trying to add the socket (i.e. the TCP connection must be established)。