Re: [RFC 2/6] net: add callback for setting a ubuf_info to skb

David Ahern
2024-04-13T17:18:25Z

On 4/12/24 6:55 AM, Pavel Begunkov wrote:
> At the moment an skb can only have one ubuf_info associated with it,
> which might be a performance problem for zerocopy sends in cases like
> TCP via io_uring. Add a callback for assigning ubuf_info to skb, this
> way we will implement smarter assignment later like linking ubuf_info
> together.
>
> Note, it's an optional callback, which should be compatible with
> skb_zcopy_set(), that's because the net stack might potentially decide
> to clone an skb and take another reference to ubuf_info whenever it
> wishes. Also, a correct implementation should always be able to bind to
> an skb without prior ubuf_info, otherwise we could end up in a situation
> when the send would not be able to progress.
>
> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
> ---
> include/linux/skbuff.h | 2 ++
> net/core/skbuff.c | 20 ++++++++++++++------
> 2 files changed, 16 insertions(+), 6 deletions(-)
>

Reviewed-by: David Ahern <dsahern@kernel.org>