]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Merge branch 'af_unix-introduce-so_inq-scm_inq'
authorJakub Kicinski <kuba@kernel.org>
Wed, 9 Jul 2025 01:05:27 +0000 (18:05 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 9 Jul 2025 01:05:27 +0000 (18:05 -0700)
Kuniyuki Iwashima says:

====================
af_unix: Introduce SO_INQ & SCM_INQ.

We have an application that uses almost the same code for TCP and
AF_UNIX (SOCK_STREAM).

The application uses TCP_INQ for TCP, but AF_UNIX doesn't have it
and requires an extra syscall, ioctl(SIOCINQ) or getsockopt(SO_MEMINFO)
as an alternative.

Also, ioctl(SIOCINQ) for AF_UNIX SOCK_STREAM is more expensive because
it needs to iterate all skb in the receive queue.

This series adds a cached field for SIOCINQ to speed it up and introduce
SO_INQ, the generic version of TCP_INQ to get the queue length as cmsg in
each recvmsg().
====================

Link: https://patch.msgid.link/20250702223606.1054680-1-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Trivial merge