[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1f7ec7e0-2f25-0a06-0333-665fa2df46aa@intel.com>
Date: Mon, 28 Aug 2023 12:59:55 +0200
From: Alexander Lobakin <aleksander.lobakin@...el.com>
To: Jakub Kicinski <kuba@...nel.org>, Jesper Dangaard Brouer <hawk@...nel.org>
CC: Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
<netdev@...r.kernel.org>, Ratheesh Kannoth <rkannoth@...vell.com>, "David S.
Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, "Geetha
sowjanya" <gakula@...vell.com>, Ilias Apalodimas
<ilias.apalodimas@...aro.org>, Paolo Abeni <pabeni@...hat.com>, "Subbaraya
Sundeep" <sbhatta@...vell.com>, Sunil Goutham <sgoutham@...vell.com>, "Thomas
Gleixner" <tglx@...utronix.de>, hariprasad <hkelam@...vell.com>, Qingfang
DENG <qingfang.deng@...lower.com.cn>
Subject: Re: [BUG] Possible unsafe page_pool usage in octeontx2
From: Jakub Kicinski <kuba@...nel.org>
Date: Fri, 25 Aug 2023 17:42:58 -0700
> On Fri, 25 Aug 2023 19:25:42 +0200 Jesper Dangaard Brouer wrote:
>>>> This WQ process is not allowed to use the page_pool_alloc() API this
>>>> way (from a work-queue). The PP alloc-side API must only be used
>>>> under NAPI protection.
>>>
>>> Who did say that? If I don't set p.napi, how is Page Pool then tied to NAPI?
>>
>> *I* say that (as the PP inventor) as that was the design and intent,
>> that this is tied to a NAPI instance and rely on the NAPI protection to
>> make it safe to do lockless access to this cache array.
>
> Absolutely no objection to us making the NAPI / bh context a requirement
> past the startup stage, but just to be sure I understand the code -
> technically if the driver never recycles direct, does not set the NAPI,
> does not use xdp_return_frame_rx_napi etc. - the cache is always empty
> so we good?
+1, I don't say Otx2 is correct, but I don't see any issues in having
consumer and producer running on different cores and in different
contexes, as long as p.napi is not set.
Split queue model is trending and I don't see reasons why PP may require
serializing -> effectively making it work the same way as "single queue"
mode works. Esp. given that we have ptr_ring with locks, not only the
direct cache.
>
> I wonder if we can add a check like "mark the pool as BH-only on first
> BH use, and WARN() on process use afterwards". But I'm not sure what
Why do we use spin_lock_bh() and friends then and check in_softirq(), if
PP can work only in one context?
> CONFIG you'd accept that being under ;)
Thanks,
Olek
Powered by blists - more mailing lists