All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: David Ahern <dsahern@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
	petrm@nvidia.com, roopa@nvidia.com, nikolay@nvidia.com,
	ssuryaextr@gmail.com, mlxsw@nvidia.com,
	Ido Schimmel <idosch@nvidia.com>
Subject: Re: [RFC PATCH net-next v2 02/10] ipv4: Add a sysctl to control multipath hash fields
Date: Tue, 11 May 2021 23:05:19 +0300	[thread overview]
Message-ID: <YJrjf7yj3+Xj5KhO@shredder> (raw)
In-Reply-To: <95516cbb-1fa3-566c-62f9-ae6adcbf8fe9@gmail.com>

On Tue, May 11, 2021 at 09:49:30AM -0600, David Ahern wrote:
> On 5/9/21 9:16 AM, Ido Schimmel wrote:
> > diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
> > index a62934b9f15a..da627c4d633a 100644
> > --- a/net/ipv4/sysctl_net_ipv4.c
> > +++ b/net/ipv4/sysctl_net_ipv4.c
> > @@ -19,6 +19,7 @@
> >  #include <net/snmp.h>
> >  #include <net/icmp.h>
> >  #include <net/ip.h>
> > +#include <net/ip_fib.h>
> >  #include <net/route.h>
> >  #include <net/tcp.h>
> >  #include <net/udp.h>
> > @@ -48,6 +49,8 @@ static int ip_ping_group_range_min[] = { 0, 0 };
> >  static int ip_ping_group_range_max[] = { GID_T_MAX, GID_T_MAX };
> >  static u32 u32_max_div_HZ = UINT_MAX / HZ;
> >  static int one_day_secs = 24 * 3600;
> > +static u32 fib_multipath_hash_fields_all_mask __maybe_unused =
> > +	FIB_MULTIPATH_HASH_FIELD_ALL_MASK;
> >  
> >  /* obsolete */
> >  static int sysctl_tcp_low_latency __read_mostly;
> > @@ -1052,6 +1055,14 @@ static struct ctl_table ipv4_net_table[] = {
> >  		.extra1		= SYSCTL_ZERO,
> >  		.extra2		= &two,
> >  	},
> > +	{
> > +		.procname	= "fib_multipath_hash_fields",
> > +		.data		= &init_net.ipv4.sysctl_fib_multipath_hash_fields,
> > +		.maxlen		= sizeof(u32),
> > +		.mode		= 0644,
> > +		.proc_handler	= proc_douintvec_minmax,
> > +		.extra2		= &fib_multipath_hash_fields_all_mask,
> 
> no .extra1 means 0 is allowed which effectively disables hashing and
> multipath selection; only the first leg will be used. Is that intended?

I didn't see any reason to forbid it, but I don't see any reason to use
it with '0' either. With this patch:

diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 81343037de06..4fa77f182dcb 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -1078,6 +1078,7 @@ static struct ctl_table ipv4_net_table[] = {
 		.maxlen		= sizeof(u32),
 		.mode		= 0644,
 		.proc_handler	= proc_fib_multipath_hash_fields,
+		.extra1		= SYSCTL_ONE,
 		.extra2		= &fib_multipath_hash_fields_all_mask,
 	},
 #endif

We get:

# sysctl -w net.ipv4.fib_multipath_hash_fields=0
sysctl: setting key "net.ipv4.fib_multipath_hash_fields": Invalid argument

I assume you want to see this change in the next version (and for IPv6)?

> 
> 
> 
> > +	},
> >  #endif
> >  	{
> >  		.procname	= "ip_unprivileged_port_start",
> > 
> 

  reply	other threads:[~2021-05-11 20:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-09 15:16 [RFC PATCH net-next v2 00/10] Add support for custom multipath hash Ido Schimmel
2021-05-09 15:16 ` [RFC PATCH net-next v2 01/10] ipv4: Calculate multipath hash inside switch statement Ido Schimmel
2021-05-09 15:16 ` [RFC PATCH net-next v2 02/10] ipv4: Add a sysctl to control multipath hash fields Ido Schimmel
2021-05-11 15:10   ` David Ahern
2021-05-11 19:58     ` Ido Schimmel
2021-05-11 15:49   ` David Ahern
2021-05-11 20:05     ` Ido Schimmel [this message]
2021-05-17 14:47       ` David Ahern
2021-05-09 15:16 ` [RFC PATCH net-next v2 03/10] ipv4: Add custom multipath hash policy Ido Schimmel
2021-05-11 15:46   ` David Ahern
2021-05-11 20:02     ` Ido Schimmel
2021-05-09 15:16 ` [RFC PATCH net-next v2 04/10] ipv6: Use a more suitable label name Ido Schimmel
2021-05-09 15:16 ` [RFC PATCH net-next v2 05/10] ipv6: Calculate multipath hash inside switch statement Ido Schimmel
2021-05-09 15:16 ` [RFC PATCH net-next v2 06/10] ipv6: Add a sysctl to control multipath hash fields Ido Schimmel
2021-05-09 15:16 ` [RFC PATCH net-next v2 07/10] ipv6: Add custom multipath hash policy Ido Schimmel
2021-05-09 15:16 ` [RFC PATCH net-next v2 08/10] selftests: forwarding: Add test for custom multipath hash Ido Schimmel
2021-05-09 15:16 ` [RFC PATCH net-next v2 09/10] selftests: forwarding: Add test for custom multipath hash with IPv4 GRE Ido Schimmel
2021-05-09 15:16 ` [RFC PATCH net-next v2 10/10] selftests: forwarding: Add test for custom multipath hash with IPv6 GRE Ido Schimmel

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=YJrjf7yj3+Xj5KhO@shredder \
    --to=idosch@idosch.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=mlxsw@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@nvidia.com \
    --cc=petrm@nvidia.com \
    --cc=roopa@nvidia.com \
    --cc=ssuryaextr@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.