[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6ba23f52-6a80-4db4-8081-f6568c81b6ca@intel.com>
Date: Thu, 7 Dec 2023 15:27:13 +0100
From: Alexander Lobakin <aleksander.lobakin@...el.com>
To: Eric Dumazet <edumazet@...gle.com>
CC: Simon Horman <horms@...nel.org>, <intel-wired-lan@...ts.osuosl.org>,
Michal Kubiak <michal.kubiak@...el.com>, Przemek Kitszel
<przemyslaw.kitszel@...el.com>, Maciej Fijalkowski
<maciej.fijalkowski@...el.com>, "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH iwl] idpf: fix corrupted frames and skb leaks in singleq
mode
From: Eric Dumazet <edumazet@...gle.com>
Date: Thu, 7 Dec 2023 13:48:52 +0100
> On Thu, Dec 7, 2023 at 12:58 PM Simon Horman <horms@...nel.org> wrote:
>>
>> On Fri, Dec 01, 2023 at 03:38:21PM +0100, Alexander Lobakin wrote:
>>> idpf_ring::skb serves only for keeping an incomplete frame between
>>> several NAPI Rx polling cycles, as one cycle may end up before
>>> processing the end of packet descriptor. The pointer is taken from
>>> the ring onto the stack before entering the loop and gets written
>>> there after the loop exits. When inside the loop, only the onstack
>>> pointer is used.
>>> For some reason, the logics is broken in the singleq mode, where the
>>> pointer is taken from the ring each iteration. This means that if a
>>> frame got fragmented into several descriptors, each fragment will have
>>> its own skb, but only the last one will be passed up the stack
>>> (containing garbage), leaving the rest leaked.
>>> Just don't touch the ring skb field inside the polling loop, letting
>>> the onstack skb pointer work as expected: build a new skb if it's the
>>> first frame descriptor and attach a frag otherwise.
>>>
>>> Fixes: a5ab9ee0df0b ("idpf: add singleq start_xmit and napi poll")
>>> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@...el.com>
>>> Reviewed-by: Michal Kubiak <michal.kubiak@...el.com>
>>> Signed-off-by: Alexander Lobakin <aleksander.lobakin@...el.com>
>>
>> Reviewed-by: Simon Horman <horms@...nel.org>
>
> It seems singlequeue mode is not really used on idpf :)
>From what I know, there's currently no hardware supporting singleq mode.
I'd remove it completely, but seems like it was decided to keep it in
case someone would like to support it one day...
>
> Reviewed-by: Eric Dumazet <edumazet@...gle.com>
Thanks,
Olek
Powered by blists - more mailing lists