Re: [PATCH] netlink: introduce netlink poll to resolve fast return issue

From: Jakub Kicinski
Date: Fri Nov 10 2023 - 14:17:59 EST


On Fri, 10 Nov 2023 23:54:48 +0900 Jong eon Park wrote:
> Interestingly, in this issue, even though netlink overrun frequently
> happened and caused POLLERRs, the user was managing it well through
> POLLIN and 'recv' function without a specific POLLERR handler.
> However, in the current situation, rcv queue is already empty and
> NETLINK_S_CONGESTED flag prevents any more incoming packets. This makes
> it impossible for the user to call 'recv'.
>
> This "congested" situation is a bit ambiguous. The queue is empty, yet
> 'congested' remains. This means kernel can no longer deliver uevents
> despite the empty queue, and it lead to the persistent 'congested' status.
>
> The reason for the difference in netlink lies in the NETLINK_S_CONGESTED
> flag. If it were UDP, upon seeing the empty queue, it might have kept
> pushing the received packets into the queue (making possible to call
> 'recv').

I see, please add a comment saying that NETLINK_S_CONGESTED prevents
new skbs from being queued before the new test in netlink_poll().

Please repost next week (i.e. after the merge window) with subject
tagged [PATCH net-next v2].