[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <96ee283f-53cc-4317-8ac5-f08c4291a887@denx.de>
Date: Tue, 2 Apr 2024 19:38:26 +0200
From: Marek Vasut <marex@...x.de>
To: Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Eric Dumazet <edumazet@...gle.com>, Mark Brown <broonie@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Ronald Wahl <ronald.wahl@...itan.com>,
Simon Horman <horms@...nel.org>
Subject: Re: [PATCH 2/2] net: ks8851: Handle softirqs at the end of IRQ thread
to fix hang
On 4/2/24 6:06 AM, Jakub Kicinski wrote:
> On Sun, 31 Mar 2024 16:21:46 +0200 Marek Vasut wrote:
>> diff --git a/drivers/net/ethernet/micrel/ks8851_common.c b/drivers/net/ethernet/micrel/ks8851_common.c
>> index 896d43bb8883d..b6b727e651f3d 100644
>> --- a/drivers/net/ethernet/micrel/ks8851_common.c
>> +++ b/drivers/net/ethernet/micrel/ks8851_common.c
>> @@ -299,7 +299,7 @@ static void ks8851_rx_pkts(struct ks8851_net *ks)
>> ks8851_dbg_dumpkkt(ks, rxpkt);
>>
>> skb->protocol = eth_type_trans(skb, ks->netdev);
>> - netif_rx(skb);
>> + __netif_rx(skb);
>
> maybe return the packets from ks8851_rx_pkts()
> (you can put them on a queue / struct sk_buff_head)
> and process them once the lock is released?
I think that's what netif_rx() basically already does internally in
netif_rx_internal():
enqueue_to_backlog(skb, smp_processor_id(), &qtail);
> Also why not NAPI?
I am not quite sure what to answer here. Are you asking me to add NAPI
support to the driver ?
>> ks->netdev->stats.rx_packets++;
>> ks->netdev->stats.rx_bytes += rxlen;
>> @@ -325,11 +325,15 @@ static void ks8851_rx_pkts(struct ks8851_net *ks)
>> */
>> static irqreturn_t ks8851_irq(int irq, void *_ks)
>> {
>> + bool need_bh_off = !(hardirq_count() | softirq_count());
>
> I don't think IRQ / RT developers look approvingly at uses of such
> low level macros in drivers.
I _think_ the need_bh_off will be always true as Ratheesh suggested, so
this can be dropped. I will test that before doing a V2.
Powered by blists - more mailing lists