net: introduce managed frags infrastructure
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 12 Jul 2022 20:52:31 +0000 (21:52 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 19 Jul 2022 21:20:54 +0000 (14:20 -0700)
commit753f1ca4e1e50248a1b760c9774d6d6b354562cc
tree2d424a8b10b6dce562b451787136367a6ad7371c
parentebe73a284f4de8c5d401adeccd9b8fe3183b6e95
net: introduce managed frags infrastructure

Some users like io_uring can do page pinning more efficiently, so we
want a way to delegate referencing to other subsystems. For that add
a new flag called SKBFL_MANAGED_FRAG_REFS. When set, skb doesn't hold
page references and upper layers are responsivle to managing page
lifetime.

It's allowed to convert skbs from managed to normal by calling
skb_zcopy_downgrade_managed(). The function will take all needed
page references and clear the flag. It's needed, for instance,
to avoid mixing managed modes.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/skbuff.h
net/core/skbuff.c