mbox series

[net-next,0/3] net: introduce rps_default_mask

Message ID cover.1603906564.git.pabeni@redhat.com
Headers show
Series net: introduce rps_default_mask | expand

Message

Paolo Abeni Oct. 28, 2020, 5:46 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.

These series try to address the above, introducing a new
sysctl knob: rps_default_mask. The new sysctl entry allows
configuring a systemwide 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.

Paolo Abeni (3):
  net/sysctl: factor-out netdev_rx_queue_set_rps_mask() helper
  net/core: introduce default_rps_mask netns attribute
  self-tests: introduce self-tests for RPS default mask

 Documentation/admin-guide/sysctl/net.rst      |  6 ++
 net/core/net-sysfs.c                          | 75 +++++++++++--------
 net/core/sysctl_net_core.c                    | 58 ++++++++++++++
 tools/testing/selftests/net/Makefile          |  1 +
 tools/testing/selftests/net/config            |  3 +
 .../testing/selftests/net/rps_default_mask.sh | 57 ++++++++++++++
 6 files changed, 170 insertions(+), 30 deletions(-)
 create mode 100644 tools/testing/selftests/net/rps_default_mask.sh

Comments

Jakub Kicinski Oct. 29, 2020, 3:16 p.m. UTC | #1
On Wed, 28 Oct 2020 18:46:02 +0100 Paolo Abeni wrote:
> @@ -46,6 +47,54 @@ int sysctl_devconf_inherit_init_net __read_mostly;
>  EXPORT_SYMBOL(sysctl_devconf_inherit_init_net);
>  
>  #ifdef CONFIG_RPS
> +struct cpumask rps_default_mask;

net/core/sysctl_net_core.c:50:16: warning: symbol 'rps_default_mask' was not declared. Should it be static?
Paolo Abeni Oct. 29, 2020, 5:38 p.m. UTC | #2
On Thu, 2020-10-29 at 08:16 -0700, Jakub Kicinski wrote:
> On Wed, 28 Oct 2020 18:46:02 +0100 Paolo Abeni wrote:

> > @@ -46,6 +47,54 @@ int sysctl_devconf_inherit_init_net __read_mostly;

> >  EXPORT_SYMBOL(sysctl_devconf_inherit_init_net);

> >  

> >  #ifdef CONFIG_RPS

> > +struct cpumask rps_default_mask;

> 

> net/core/sysctl_net_core.c:50:16: warning: symbol 'rps_default_mask' was not declared. Should it be static?


Thank you for the feedback! I'll address that in v2.

Cheers,

Paolo