[PATCH v2] docs: bpf: document BPF_RB_OVERWRITE_POS in bpf_ringbuf_query

Jianlin Shi posted 1 patch 1 week, 5 days ago
include/uapi/linux/bpf.h       | 1 +
tools/include/uapi/linux/bpf.h | 1 +
2 files changed, 2 insertions(+)
[PATCH v2] docs: bpf: document BPF_RB_OVERWRITE_POS in bpf_ringbuf_query
Posted by Jianlin Shi 1 week, 5 days ago
BPF_RB_OVERWRITE_POS is supported by bpf_ringbuf_query() but was missing
from the helper documentation. Add it to the flags list in both the
kernel UAPI header and its tools/ mirror.

Signed-off-by: Jianlin Shi <shijianlin11@foxmail.com>
---
 include/uapi/linux/bpf.h       | 1 +
 tools/include/uapi/linux/bpf.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index c8d400b76..fe2873f6c 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -4664,6 +4664,7 @@ union bpf_attr {
  *		* **BPF_RB_RING_SIZE**: The size of ring buffer.
  *		* **BPF_RB_CONS_POS**: Consumer position (can wrap around).
  *		* **BPF_RB_PROD_POS**: Producer(s) position (can wrap around).
+ *		* **BPF_RB_OVERWRITE_POS**: Overwrite position (can wrap around).
  *
  *		Data returned is just a momentary snapshot of actual values
  *		and could be inaccurate, so this facility should be used to
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 5e38b4887..7b024da3d 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -4664,6 +4664,7 @@ union bpf_attr {
  *		* **BPF_RB_RING_SIZE**: The size of ring buffer.
  *		* **BPF_RB_CONS_POS**: Consumer position (can wrap around).
  *		* **BPF_RB_PROD_POS**: Producer(s) position (can wrap around).
+ *		* **BPF_RB_OVERWRITE_POS**: Overwrite position (can wrap around).
  *
  *		Data returned is just a momentary snapshot of actual values
  *		and could be inaccurate, so this facility should be used to
-- 
2.43.0
Re: [PATCH v2] docs: bpf: document BPF_RB_OVERWRITE_POS in bpf_ringbuf_query
Posted by Xu Kuohai 1 week, 4 days ago
On 7/13/2026 10:49 AM, Jianlin Shi wrote:
> BPF_RB_OVERWRITE_POS is supported by bpf_ringbuf_query() but was missing
> from the helper documentation. Add it to the flags list in both the
> kernel UAPI header and its tools/ mirror.
> 
> Signed-off-by: Jianlin Shi <shijianlin11@foxmail.com>
> ---
>   include/uapi/linux/bpf.h       | 1 +
>   tools/include/uapi/linux/bpf.h | 1 +
>   2 files changed, 2 insertions(+)
> 
> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
> index c8d400b76..fe2873f6c 100644
> --- a/include/uapi/linux/bpf.h
> +++ b/include/uapi/linux/bpf.h
> @@ -4664,6 +4664,7 @@ union bpf_attr {
>    *		* **BPF_RB_RING_SIZE**: The size of ring buffer.
>    *		* **BPF_RB_CONS_POS**: Consumer position (can wrap around).
>    *		* **BPF_RB_PROD_POS**: Producer(s) position (can wrap around).
> + *		* **BPF_RB_OVERWRITE_POS**: Overwrite position (can wrap around).
>    *
>    *		Data returned is just a momentary snapshot of actual values
>    *		and could be inaccurate, so this facility should be used to
> diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
> index 5e38b4887..7b024da3d 100644
> --- a/tools/include/uapi/linux/bpf.h
> +++ b/tools/include/uapi/linux/bpf.h
> @@ -4664,6 +4664,7 @@ union bpf_attr {
>    *		* **BPF_RB_RING_SIZE**: The size of ring buffer.
>    *		* **BPF_RB_CONS_POS**: Consumer position (can wrap around).
>    *		* **BPF_RB_PROD_POS**: Producer(s) position (can wrap around).
> + *		* **BPF_RB_OVERWRITE_POS**: Overwrite position (can wrap around).
>    *
>    *		Data returned is just a momentary snapshot of actual values
>    *		and could be inaccurate, so this facility should be used to

Thanks for updating the docs for this!

Acked-by: Xu Kuohai <xukuohai@huawei.com>