diff options
| author | Kuniyuki Iwashima <[email protected]> | 2025-07-02 22:35:16 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2025-07-09 01:05:25 +0000 |
| commit | f4e1fb04c12384fb1b69a95c33527b515a652a74 (patch) | |
| tree | 153a0bb97038b6e4a5e3d9c619a63c2dc662688f /net/lapb/lapb_out.c | |
| parent | af_unix: Don't use skb_recv_datagram() in unix_stream_read_skb(). (diff) | |
| download | kernel-f4e1fb04c12384fb1b69a95c33527b515a652a74.tar.gz kernel-f4e1fb04c12384fb1b69a95c33527b515a652a74.zip | |
af_unix: Use cached value for SOCK_STREAM in unix_inq_len().
Compared to TCP, ioctl(SIOCINQ) for AF_UNIX SOCK_STREAM socket is more
expensive, as unix_inq_len() requires iterating through the receive queue
and accumulating skb->len.
Let's cache the value for SOCK_STREAM to a new field during sendmsg()
and recvmsg().
The field is protected by the receive queue lock.
Note that ioctl(SIOCINQ) for SOCK_DGRAM returns the length of the first
skb in the queue.
SOCK_SEQPACKET still requires iterating through the queue because we do
not touch functions shared with unix_dgram_ops. But, if really needed,
we can support it by switching __skb_try_recv_datagram() to a custom
version.
Signed-off-by: Kuniyuki Iwashima <[email protected]>
Reviewed-by: Willem de Bruijn <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/lapb/lapb_out.c')
0 files changed, 0 insertions, 0 deletions
