Re: [RESEND PATCH] net/core: consolidate RPS dispatch into netif_rps() helpers

From: Jakub Kicinski

Date: Mon Jul 20 2026 - 19:25:34 EST


On Tue, 7 Jul 2026 23:48:55 +0800 Jemmy Wong wrote:
> The RPS steering logic in netif_rx_internal(), netif_receive_skb_internal()
> and netif_receive_skb_list_internal() was open-coded three times, each with
> its own #ifdef CONFIG_RPS block and manual rcu_read_lock()/unlock() pairs.
>
> Factor it into two helpers, netif_rps() for the single-skb path and
> netif_rps_list() for the list path, and switch the callers to
> guard(rcu)/scoped_guard(rcu). A new internal NET_RX_UNHANDLED sentinel lets
> a helper report "RPS did not take this skb" so the caller falls back to the
> local enqueue / __netif_receive_skb() path; it never escapes to callers.
>
> netif_rps_list() keeps the early static_branch_unlikely(&rps_needed) bail
> out so the list is not needlessly walked and re-spliced when RPS is
> compiled in but disabled.
>
> No functional change intended.

You haven't read Paolo's reply, please go away.