Thread (6 messages) 6 messages, 4 authors, 5d ago

Re: [PATCH bpf] bpf, sockmap: Account for receive queue in FIONREAD without a verdict program

From: "Kumar Kartikeya Dwivedi" <memxor@gmail.com>
Date: 2026-07-08 04:43:17
Also in: bpf

On Tue Jul 7, 2026 at 6:15 PM CEST, Mattia Meleleo via B4 Relay wrote:
From: Mattia Meleleo <redacted>

tcp_bpf_ioctl() answers SIOCINQ from psock->msg_tot_len, which only
counts bytes in ingress_msg. Without a stream/skb verdict program
nothing is diverted there: data stays in sk_receive_queue, so FIONREAD
returns 0 even though read() returns data.

Add tcp_inq() to the reported value when the psock has no verdict
program. The two queues are disjoint, so bytes redirected into
ingress_msg from other sockets stay correctly accounted through
msg_tot_len.

Add a selftest covering FIONREAD without a verdict program.

Fixes: 929e30f93125 ("bpf, sockmap: Fix FIONREAD for sockmap")
Signed-off-by: Mattia Meleleo <redacted>
---
Please respin with the fix and selftest as separate patches, but still targeting
bpf tree. You can add the Reviewed-by: tags to both.

pw-bot: cr
[...]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help