public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Shubham Chakraborty <chakrabortyshubham66@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, kuniyu@google.com,
	corbet@lwn.net, skhan@linuxfoundation.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] Documentation: sysctl: document net core sysctls
Date: Mon, 13 Apr 2026 17:47:07 +0100	[thread overview]
Message-ID: <20260413164707.GT469338@kernel.org> (raw)
In-Reply-To: <20260409174859.11854-1-chakrabortyshubham66@gmail.com>

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 <chakrabortyshubham66@gmail.com>

...

> @@ -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.

...

      reply	other threads:[~2026-04-13 16:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260407083213.27045-1-chakrabortyshubham66@gmail.com>
2026-04-09 17:48 ` [PATCH v2] Documentation: sysctl: document net core sysctls Shubham Chakraborty
2026-04-13 16:47   ` Simon Horman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260413164707.GT469338@kernel.org \
    --to=horms@kernel.org \
    --cc=chakrabortyshubham66@gmail.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox