mbox series

[v4,net-next,0/4] net: introduce rps_default_mask

Message ID cover.1675789134.git.pabeni@redhat.com (mailing list archive)
Headers show
Series net: introduce rps_default_mask | expand

Message

Paolo Abeni Feb. 7, 2023, 6:44 p.m. UTC
Real-time setups try hard to ensure proper isolation between time
critical applications and e.g. network processing performed by the
network stack in softirq and RPS is used to move the softirq 
activity away from the isolated core.

If the network configuration is dynamic, with netns and devices
routinely created at run-time, enforcing the correct RPS setting
on each newly created device allowing to transient bad configuration
became complex.

Additionally, when multi-queue devices are involved, configuring rps
in user-space on each queue easily becomes very expensive, e.g.
some setups use veths with per cpu queues.

These series try to address the above, introducing a new
sysctl knob: rps_default_mask. The new sysctl entry allows
configuring a netns-wide RPS mask, to be enforced since receive 
queue creation time without any fourther per device configuration
required.

Additionally, a simple self-test is introduced to check the 
rps_default_mask behavior.

v3 -> v4:
 - fix build warning

v2 -> v3:
 - reduce code duplication
 - rebased

Paolo Abeni (4):
  net-sysctl: factor out cpumask parsing helper
  net-sysctl: factor-out rpm mask manipulation helpers
  net: introduce default_rps_mask netns attribute
  self-tests: introduce self-tests for RPS default mask

 Documentation/admin-guide/sysctl/net.rst      |  6 ++
 include/linux/netdevice.h                     |  1 +
 net/core/dev.h                                |  2 +
 net/core/net-sysfs.c                          | 79 +++++++++++-------
 net/core/sysctl_net_core.c                    | 81 ++++++++++++++-----
 tools/testing/selftests/net/Makefile          |  1 +
 tools/testing/selftests/net/config            |  3 +
 .../testing/selftests/net/rps_default_mask.sh | 57 +++++++++++++
 8 files changed, 182 insertions(+), 48 deletions(-)
 create mode 100755 tools/testing/selftests/net/rps_default_mask.sh

Comments

Eric Dumazet Feb. 9, 2023, 11:25 a.m. UTC | #1
On Tue, Feb 7, 2023 at 7:46 PM Paolo Abeni <pabeni@redhat.com> wrote:
>
> Real-time setups try hard to ensure proper isolation between time
> critical applications and e.g. network processing performed by the
> network stack in softirq and RPS is used to move the softirq
> activity away from the isolated core.
>
> If the network configuration is dynamic, with netns and devices
> routinely created at run-time, enforcing the correct RPS setting
> on each newly created device allowing to transient bad configuration
> became complex.
>
> Additionally, when multi-queue devices are involved, configuring rps
> in user-space on each queue easily becomes very expensive, e.g.
> some setups use veths with per cpu queues.
>
> These series try to address the above, introducing a new
> sysctl knob: rps_default_mask. The new sysctl entry allows
> configuring a netns-wide RPS mask, to be enforced since receive
> queue creation time without any fourther per device configuration
> required.

Reviewed-by: Eric Dumazet <edumazet@google.com>
patchwork-bot+netdevbpf@kernel.org Feb. 10, 2023, 2 a.m. UTC | #2
Hello:

This series was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Tue,  7 Feb 2023 19:44:54 +0100 you wrote:
> Real-time setups try hard to ensure proper isolation between time
> critical applications and e.g. network processing performed by the
> network stack in softirq and RPS is used to move the softirq
> activity away from the isolated core.
> 
> If the network configuration is dynamic, with netns and devices
> routinely created at run-time, enforcing the correct RPS setting
> on each newly created device allowing to transient bad configuration
> became complex.
> 
> [...]

Here is the summary with links:
  - [v4,net-next,1/4] net-sysctl: factor out cpumask parsing helper
    https://git.kernel.org/netdev/net-next/c/135746c61fa6
  - [v4,net-next,2/4] net-sysctl: factor-out rpm mask manipulation helpers
    https://git.kernel.org/netdev/net-next/c/370ca718fd5e
  - [v4,net-next,3/4] net: introduce default_rps_mask netns attribute
    https://git.kernel.org/netdev/net-next/c/605cfa1b1090
  - [v4,net-next,4/4] self-tests: introduce self-tests for RPS default mask
    https://git.kernel.org/netdev/net-next/c/c12e0d5f267d

You are awesome, thank you!