Re: [PATCH V11 net-next 07/10] net: hibmcge: Implement rx_poll function to receive packets
From: Joe Damato
Date: Wed Oct 09 2024 - 17:36:11 EST
On Tue, Oct 08, 2024 at 10:23:55AM +0800, Jijie Shao wrote:
> Implement rx_poll function to read the rx descriptor after
> receiving the rx interrupt. Adjust the skb based on the
> descriptor to complete the reception of the packet.
>
> Signed-off-by: Jijie Shao <shaojijie@xxxxxxxxxx>
[...]
> +
> +static int hbg_napi_rx_poll(struct napi_struct *napi, int budget)
> +{
[...]
> +
> + if (likely(packet_done < budget &&
> + napi_complete_done(napi, packet_done)))
> + hbg_hw_irq_enable(priv, HBG_INT_MSK_RX_B, true);
I am not sure this is correct.
napi_complete_done might return false if napi_defer_hard_irqs is
being used [1].
In that case you'd probably want to avoid re-enabling IRQs even
though (packet_done < budget) is true.
[1]: https://lore.kernel.org/netdev/20200422161329.56026-1-edumazet@xxxxxxxxxx/