Re: [PATCH V7 4/5] bnxt_en: Add TPH support in BNXT driver

From: Wei Huang
Date: Tue Oct 15 2024 - 15:51:03 EST


[These question are for both Jakub and Bjorn]

Any suggestions on how to proceed? I can send out a V8 patchset if Jakub
is OK with Manoj's solution? Or only a new patch #4 is needed since the
rest are intact.

Thanks,
-Wei

On 10/11/24 13:35, Panicker, Manoj wrote:
> [AMD Official Use Only - AMD Internal Distribution Only]
>
> Hello Jakub,
>
> Thanks for the feedback. We'll update the patch to cover the code under the rtnl_lock.
>
> About the empty function, there are no actions to perform when the driver's notify.release function is called. The IRQ notifier is only registered once and there are no older IRQ notifiers for the driver that could get called back. We also followed the precedent seen from other drivers in the kernel tree that follow the same mechanism .
>
> See code:
> From drivers/net/ethernet/intel/i40e/i40e_main.c
> static void i40e_irq_affinity_release(struct kref *ref) {}
>
>
> From drivers/net/ethernet/intel/iavf/iavf_main.c
> static void iavf_irq_affinity_release(struct kref *ref) {}
>
>
> From drivers/net/ethernet/fungible/funeth/funeth_main.c
> static void fun_irq_aff_release(struct kref __always_unused *ref)
> {
> }
>
>
> Thanks
> Manoj
>
> -----Original Message-----
> From: Jakub Kicinski <kuba@xxxxxxxxxx>
> Sent: Tuesday, October 8, 2024 6:40 AM
> To: Huang2, Wei <Wei.Huang2@xxxxxxx>
> Cc: linux-pci@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; linux-doc@xxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; Jonathan.Cameron@xxxxxxxxxx; helgaas@xxxxxxxxxx; corbet@xxxxxxx; davem@xxxxxxxxxxxxx; edumazet@xxxxxxxxxx; pabeni@xxxxxxxxxx; alex.williamson@xxxxxxxxxx; gospo@xxxxxxxxxxxx; michael.chan@xxxxxxxxxxxx; ajit.khaparde@xxxxxxxxxxxx; somnath.kotur@xxxxxxxxxxxx; andrew.gospodarek@xxxxxxxxxxxx; Panicker, Manoj <Manoj.Panicker2@xxxxxxx>; VanTassell, Eric <Eric.VanTassell@xxxxxxx>; vadim.fedorenko@xxxxxxxxx; horms@xxxxxxxxxx; bagasdotme@xxxxxxxxx; bhelgaas@xxxxxxxxxx; lukas@xxxxxxxxx; paul.e.luse@xxxxxxxxx; jing2.liu@xxxxxxxxx
> Subject: Re: [PATCH V7 4/5] bnxt_en: Add TPH support in BNXT driver
>
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
>
>
> On Wed, 2 Oct 2024 11:59:53 -0500 Wei Huang wrote:
>> + if (netif_running(irq->bp->dev)) {
>> + rtnl_lock();
>> + err = netdev_rx_queue_restart(irq->bp->dev, irq->ring_nr);
>> + if (err)
>> + netdev_err(irq->bp->dev,
>> + "rx queue restart failed: err=%d\n", err);
>> + rtnl_unlock();
>> + }
>> +}
>> +
>> +static void __bnxt_irq_affinity_release(struct kref __always_unused
>> +*ref) { }
>
> An empty release function is always a red flag.
> How is the reference counting used here?
> Is irq_set_affinity_notifier() not synchronous?
> Otherwise the rtnl_lock() should probably cover the running check.