[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4c5be7f3-7ab4-411a-a285-9ddeedcaf6b3@intel.com>
Date: Fri, 14 Jun 2024 03:26:29 +0200
From: Przemek Kitszel <przemyslaw.kitszel@...el.com>
To: "Nelson, Shannon" <shannon.nelson@....com>, Jakub Kicinski
<kuba@...nel.org>
CC: <netdev@...r.kernel.org>, <davem@...emloft.net>, <edumazet@...gle.com>,
<pabeni@...hat.com>, <brett.creeley@....com>, <drivers@...sando.io>
Subject: Re: [PATCH net-next 4/8] ionic: add work item for missed-doorbell
check
On 6/13/24 22:38, Nelson, Shannon wrote:
>
>
> On 6/12/2024 6:19 PM, Jakub Kicinski wrote:
>> Caution: This message originated from an External Source. Use proper
>> caution when opening attachments, clicking links, or responding.
>>
>>
>> On Mon, 10 Jun 2024 16:07:02 -0700 Shannon Nelson wrote:
>>> +static void ionic_napi_schedule_do_softirq(struct napi_struct *napi)
>>> +{
>>> + if (napi_schedule_prep(napi)) {
>>> + local_bh_disable();
>>> + __napi_schedule(napi);
>>> + local_bh_enable();
>>
>> No need to open code napi_schedule()
>>
>> local_bh_disable();
>> napi_schedule(napi);
>> local_bh_enable();
>>
>> is a fairly well-established pattern
>
> Sure, we can do that.
>
>>
>>> + }
>>> +}
>>
>>> +static void ionic_doorbell_check_dwork(struct work_struct *work)
>>> +{
>>> + struct ionic *ionic = container_of(work, struct ionic,
>>> + doorbell_check_dwork.work);
>>> + struct ionic_lif *lif = ionic->lif;
>>> +
>>> + if (test_bit(IONIC_LIF_F_FW_STOPPING, lif->state) ||
>>> + test_bit(IONIC_LIF_F_FW_RESET, lif->state))
>>> + return;
>>> +
>>> + mutex_lock(&lif->queue_lock);
>>
>> This will deadlock under very inopportune circumstances, no?
>>
>> The best way of implementing periodic checks using a workqueue is to
>> only cancel it sync from the .remove callback, before you free the
>> netdev. Otherwise cancel it non-sync or don't cancel at all, and once
>> it takes the lock double check the device is still actually running.
>
> Hmmm... we'll dig a little more on this.
>
> Thanks,
> sln
We had a very similar error (with stopping a VF, IIRC); it's easiest to
repro on RT kernels
Powered by blists - more mailing lists