[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d210e074-432f-025c-1ede-4f9476f1501c@iogearbox.net>
Date: Tue, 24 Nov 2020 22:50:22 +0100
From: Daniel Borkmann <daniel@...earbox.net>
To: Björn Töpel <bjorn.topel@...il.com>,
ast@...nel.org, netdev@...r.kernel.org, bpf@...r.kernel.org
Cc: Björn Töpel <bjorn.topel@...el.com>,
jonathan.lemon@...il.com, yhs@...com, weqaar.janjua@...il.com,
magnus.karlsson@...el.com, weqaar.a.janjua@...el.com
Subject: Re: [PATCH bpf v2] net, xsk: Avoid taking multiple skbuff references
On 11/23/20 6:56 PM, Björn Töpel wrote:
> From: Björn Töpel <bjorn.topel@...el.com>
>
> Commit 642e450b6b59 ("xsk: Do not discard packet when NETDEV_TX_BUSY")
> addressed the problem that packets were discarded from the Tx AF_XDP
> ring, when the driver returned NETDEV_TX_BUSY. Part of the fix was
> bumping the skbuff reference count, so that the buffer would not be
> freed by dev_direct_xmit(). A reference count larger than one means
> that the skbuff is "shared", which is not the case.
>
> If the "shared" skbuff is sent to the generic XDP receive path,
> netif_receive_generic_xdp(), and pskb_expand_head() is entered the
> BUG_ON(skb_shared(skb)) will trigger.
>
> This patch adds a variant to dev_direct_xmit(), __dev_direct_xmit(),
> where a user can select the skbuff free policy. This allows AF_XDP to
> avoid bumping the reference count, but still keep the NETDEV_TX_BUSY
> behavior.
>
> Reported-by: Yonghong Song <yhs@...com>
> Fixes: 642e450b6b59 ("xsk: Do not discard packet when NETDEV_TX_BUSY")
> Signed-off-by: Björn Töpel <bjorn.topel@...el.com>
Yeah looks better! Applied, thanks!
Powered by blists - more mailing lists