title: How can I work out the meaning of the return codes for BPF helper functions?
body: <p>I am writing a <code>BPF_PROG_TYPE_SOCKET_OPS</code> program and I am seeing the following in <code>/sys/kernel/debug/tracing/trace_pipe</code>:</p>
  
  <pre><code>&lt;...&gt;-12586 [001] ....  6972.409111: 0: update err: -95
  </code></pre>
  
  <p>when I load it due to the following snippet:</p>
  
  <pre><code>ret = bpf_sock_map_update(ops, &amp;sock_ops, &amp;idx, BPF_ANY);
  if (ret &lt; 0) {
      bpf_debug("update err: %d\n", ret);
  }
  </code></pre>
  
  <p>How can I work out what -95 means? When I look in <a href="https://elixir.bootlin.com/linux/latest/source/arch/alpha/include/uapi/asm/errno.h" rel="nofollow noreferrer">https://elixir.bootlin.com/linux/latest/source/arch/alpha/include/uapi/asm/errno.h</a> I see:</p>
  
  <pre><code>#define ENOCSI      95  /* No CSI structure available */
  </code></pre>
  
  <p>Is this the correct way to find the meaning of the error? And what is the meaning of the description if so?</p>