Re: [PATCH net v1] octeontx2-pf: Fix page pool cache index corruption.

From: Sebastian Andrzej Siewior
Date: Wed Sep 06 2023 - 04:08:49 EST


On 2023-09-06 09:09:26 [+0530], Ratheesh Kannoth wrote:
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
> index 8511906cb4e2..5bba1f34e4f6 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
> @@ -1082,38 +1070,16 @@ static int otx2_cq_init(struct otx2_nic *pfvf, u16 qidx)
> static void otx2_pool_refill_task(struct work_struct *work)
> {

> + napi_schedule(wrk->napi);

This will delay NAPI until "some random point in the future" for
instance if an interrupt on _this_ CPU fires. You only set the softirq
state and never enforce it here. This works as intended if invoked from
an IRQ but this here a worker/ process context.

You can either put local_bh_disable()/enable() around napi_schedule() or
use it from a timer callback and skip the worker.

Sebastian