]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Fix bail out from 'ringbuf_process_ring()' on error
authorPedro Tammela <pctammela@gmail.com>
Thu, 25 Mar 2021 15:01:15 +0000 (12:01 -0300)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 26 Mar 2021 04:13:24 +0000 (21:13 -0700)
commit6ba1215a3945cea3558656f5b81d97295e9a274f
treee4ad349834f0f3a96193e5e38b9e3e8f1809b068
parentb1286a0cfffc86bc57b5e8320f125fb3a923e420
libbpf: Fix bail out from 'ringbuf_process_ring()' on error

The current code bails out with negative and positive returns.
If the callback returns a positive return code, 'ring_buffer__consume()'
and 'ring_buffer__poll()' will return a spurious number of records
consumed, but mostly important will continue the processing loop.

This patch makes positive returns from the callback a no-op.

Fixes: 001a8f977507 ("libbpf: Add BPF ring buffer support")
Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210325150115.138750-1-pctammela@mojatatu.com
tools/lib/bpf/ringbuf.c