[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <DM6PR18MB26020126CE7BB48D3C2AEC26CDFF9@DM6PR18MB2602.namprd18.prod.outlook.com>
Date: Tue, 10 Jan 2023 07:54:34 +0000
From: Geethasowjanya Akula <gakula@...vell.com>
To: Leon Romanovsky <leon@...nel.org>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"edumazet@...gle.com" <edumazet@...gle.com>,
Subbaraya Sundeep Bhatta <sbhatta@...vell.com>,
Hariprasad Kelam <hkelam@...vell.com>,
Sunil Kovvuri Goutham <sgoutham@...vell.com>
Subject: Re: [net PATCH] octeontx2-pf: Use GFP_ATOMIC in atomic context
-----Original Message-----
From: Leon Romanovsky <leon@...nel.org>
Sent: Sunday, January 8, 2023 6:39 PM
To: Geethasowjanya Akula <gakula@...vell.com>
Cc: netdev@...r.kernel.org; linux-kernel@...r.kernel.org; kuba@...nel.org; pabeni@...hat.com; davem@...emloft.net; edumazet@...gle.com; Subbaraya Sundeep Bhatta <sbhatta@...vell.com>; Hariprasad Kelam <hkelam@...vell.com>; Sunil Kovvuri Goutham <sgoutham@...vell.com>
Subject: [EXT] Re: [net PATCH] octeontx2-pf: Use GFP_ATOMIC in atomic context
External Email
----------------------------------------------------------------------
On Sat, Jan 07, 2023 at 10:11:39AM +0530, Geetha sowjanya wrote:
>> Use GFP_ATOMIC flag instead of GFP_KERNEL while allocating memory in
>> atomic context.
>Awesome, but the changed functions don't run in atomic context.
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
1368 /* Flush accumulated messages */
1369 err = otx2_sync_mbox_msg(&pfvf->mbox);
1370 if (err)
1371 goto fail;
1372
1373 get_cpu();
^^^^^^^^^
The get_cpu() disables preemption.
1374 /* Allocate pointers and free them to aura/pool */
1375 for (qidx = 0; qidx < hw->tot_tx_queues; qidx++) {
1376 pool_id = otx2_get_pool_idx(pfvf, AURA_NIX_SQ, qidx);
1377 pool = &pfvf->qset.pool[pool_id];
1378
1379 sq = &qset->sq[qidx];
1380 sq->sqb_count = 0;
1381 sq->sqb_ptrs = kcalloc(num_sqbs, sizeof(*sq->sqb_ptrs), GFP_ATOMIC);
>> Fixes: 4af1b64f80fb ("octeontx2-pf: Fix lmtst ID used in aura free")
>> Signed-off-by: Sunil Goutham <sgoutham@...vell.com>
>> Signed-off-by: Geetha sowjanya <gakula@...vell.com>
>> ---
>> drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
>> b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
>> index 88f8772a61cd..12e4365d53df 100644
>> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
>> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
>> @@ -886,7 +886,7 @@ static int otx2_sq_init(struct otx2_nic *pfvf, u16 qidx, u16 sqb_aura)
>> }
>>
>> sq->sqe_base = sq->sqe->base;
>> - sq->sg = kcalloc(qset->sqe_cnt, sizeof(struct sg_list), GFP_KERNEL);
>> + sq->sg = kcalloc(qset->sqe_cnt, sizeof(struct sg_list),
>> +GFP_ATOMIC);
>> if (!sq->sg)
>> return -ENOMEM;
>>
>> @@ -1378,7 +1378,7 @@ int otx2_sq_aura_pool_init(struct otx2_nic
>> *pfvf)
>>
>> sq = &qset->sq[qidx];
>> sq->sqb_count = 0;
>> - sq->sqb_ptrs = kcalloc(num_sqbs, sizeof(*sq->sqb_ptrs), GFP_KERNEL);
>> + sq->sqb_ptrs = kcalloc(num_sqbs, sizeof(*sq->sqb_ptrs),
>> +GFP_ATOMIC);
>> if (!sq->sqb_ptrs) {
>> err = -ENOMEM;
>> goto err_mem;
>> --
>> 2.25.1
>>
Powered by blists - more mailing lists