mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Geethasowjanya Akula <gakula@marvell.com>
To: Eric Dumazet <edumazet@google.com>
Cc: Leon Romanovsky <leon@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	Subbaraya Sundeep Bhatta <sbhatta@marvell.com>,
	Hariprasad Kelam <hkelam@marvell.com>,
	Sunil Kovvuri Goutham <sgoutham@marvell.com>
Subject: RE: [EXT] Re: [net PATCH] octeontx2-pf: Use GFP_ATOMIC in atomic context
Date: Tue, 10 Jan 2023 08:55:50 +0000	[thread overview]
Message-ID: <DM6PR18MB26024CFB14D98C93F04DCB02CDFF9@DM6PR18MB2602.namprd18.prod.outlook.com> (raw)
In-Reply-To: <CANn89i+Sunn-C-pcG3utPQsx4qykYJ9kLvS2FVZPMELALcq0UA@mail.gmail.com>



-----Original Message-----
From: Eric Dumazet <edumazet@google.com> 
Sent: Tuesday, January 10, 2023 2:05 PM
To: Geethasowjanya Akula <gakula@marvell.com>
Cc: Leon Romanovsky <leon@kernel.org>; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; kuba@kernel.org; pabeni@redhat.com; davem@davemloft.net; Subbaraya Sundeep Bhatta <sbhatta@marvell.com>; Hariprasad Kelam <hkelam@marvell.com>; Sunil Kovvuri Goutham <sgoutham@marvell.com>
Subject: [EXT] Re: [net PATCH] octeontx2-pf: Use GFP_ATOMIC in atomic context

External Email

----------------------------------------------------------------------
On Tue, Jan 10, 2023 at 8:54 AM Geethasowjanya Akula <gakula@marvell.com> wrote:
>>
>>
>>
>> -----Original Message-----
>> From: Leon Romanovsky <leon@kernel.org>
>> Sent: Sunday, January 8, 2023 6:39 PM
>> To: Geethasowjanya Akula <gakula@marvell.com>
>> Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; 
>> kuba@kernel.org; pabeni@redhat.com; davem@davemloft.net; 
>> edumazet@google.com; Subbaraya Sundeep Bhatta <sbhatta@marvell.com>; 
>> Hariprasad Kelam <hkelam@marvell.com>; Sunil Kovvuri Goutham 
>> <sgoutham@marvell.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.

>Forcing GFP_ATOMIC in init functions is not desirable.
>
>Please move around the get_cpu() so that we keep GFP_KERNEL whenever possible.
Ok will submit v2 with suggested changes.
>
>diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
>b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
>index 88f8772a61cd527c2ab138fb5a996470a7dfd456..2e628e12cd1ff92756f054639abd777ea185680f
>100644
>--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
>+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
>@@ -1370,7 +1370,6 @@ int otx2_sq_aura_pool_init(struct otx2_nic *pfvf)
>       if (err)
>                goto fail;
>
>-       get_cpu();
>        /* Allocate pointers and free them to aura/pool */
>       for (qidx = 0; qidx < hw->tot_tx_queues; qidx++) {
>                pool_id = otx2_get_pool_idx(pfvf, AURA_NIX_SQ, qidx); @@ -1388,13 +1387,17 @@ int otx2_sq_aura_pool_init(struct otx2_nic *pfvf)
>                        err = otx2_alloc_rbuf(pfvf, pool, &bufptr);
>                        if (err)
>                                goto err_mem;
>+                       /* __cn10k_aura_freeptr() needs to be called
>+                        * with preemption disabled.
>+                        */
>+                       get_cpu();
>                        pfvf->hw_ops->aura_freeptr(pfvf, pool_id, bufptr);
>+                       put_cpu();
>                        sq->sqb_ptrs[sq->sqb_count++] = (u64)bufptr;
>               }
>        }
>
> err_mem:
>-       put_cpu();
>        return err ? -ENOMEM : 0;
>
> fail:

      reply	other threads:[~2023-01-10  9:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-07  4:41 Geetha sowjanya
2023-01-08 13:08 ` Leon Romanovsky
     [not found]   ` <DM6PR18MB2602C7D1546455B12340D140CDFF9@DM6PR18MB2602.namprd18.prod.outlook.com>
2023-01-10  7:54     ` Geethasowjanya Akula
2023-01-10  8:35       ` Eric Dumazet
2023-01-10  8:55         ` Geethasowjanya Akula [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM6PR18MB26024CFB14D98C93F04DCB02CDFF9@DM6PR18MB2602.namprd18.prod.outlook.com \
    --to=gakula@marvell.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkelam@marvell.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®