Subject: Re: [PATCH v2] Documentation: sysctl: document net core sysctls

From: Simon Horman <[email-masked]>
Date: Mon, 13 Apr 2026 17:47:07 +0100

On Thu, Apr 09, 2026 at 11:18:59PM +0530, Shubham Chakraborty wrote:
> Document missing net.core and net.unix sysctl entries in
> admin-guide/sysctl/net.rst, and correct wording for defaults
> that are derived from PAGE_SIZE, HZ, or CONFIG_MAX_SKB_FRAGS.
> 
> Also clarify that the RFS and flow-limit controls are only present
> when CONFIG_RPS or CONFIG_NET_FLOW_LIMIT is enabled, and describe
> rps_sock_flow_entries the way the handler implements it: non-zero
> values are rounded up to the nearest power of two.
> 
> Signed-off-by: Shubham Chakraborty <[email-masked]>

...

> @@ -238,6 +240,37 @@ rps_default_mask
>  The default RPS CPU mask used on newly created network devices. An empty
>  mask means RPS disabled by default.
>  
> +rps_sock_flow_entries
> +---------------------
> +
> +The total number of entries in the RPS flow table. This is used by

Maybe s/This/The table/ to make it clearer that it is the table,
rather than the number of entries, that track CPUs.

> +RFS (Receive Flow Steering) to track which CPU is currently processing
> +a flow in userspace. Non-zero values are rounded up to the nearest
> +power of two.
> +Available only when ``CONFIG_RPS`` is enabled.

I think it would be worth noting that a value of 0 disables RPS.

> +
> +Default: 0

...

>  netdev_budget_usecs
>  ---------------------

The lines above the following hunk are:

netdev_budget_usecs
---------------------

Maximum number of microseconds in one NAPI polling cycle. Polling

> @@ -297,12 +332,16 @@ Maximum number of microseconds in one NAPI polling cycle. Polling
>  will exit when either netdev_budget_usecs have elapsed during the
>  poll cycle or the number of packets processed reaches netdev_budget.
>  
> +Default: ``2 * USEC_PER_SEC / HZ`` (2000 when ``HZ`` is 1000)
> +

Well, that is awkward.

Looking at git history, it seems that this sysctl was added by 7acf8a1e8a28
("Replace 2 jiffies with sysctl netdev_budget_usecs to enable softirq
tuning") in 2017. And at that time the unic was us, and the default was 2000 us.

But that was changed by a fix for that commit, a4837980fd9f ("net: revert
default NAPI poll timeout to 2 jiffies"), in 2020. As a side-effect of
that commit, the default was changed to what you have documented above,
and the unit changed to jiffies.

So while what you have is correct it seems nonsensical to me for the unit
to be jiffies. Because that's not a meaningful unit for users. And because
the name of the sysctl ends in usecs.

But I'm unsure what to do about it. Since changing the unit this would
represent (another) KABI break.

* Add another knob that shadows this one (But what to call it?)
* Simply remove this one (KAPI break)
* Change the unit of this knob (KAPI break)

If the code is left as is, then I think it should be documented that the
unit is jiffies.

...