All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v3 2/3] ipv6: ignore dst hint for multipath routes
  2023-08-28 11:32 [PATCH net v3 0/3] Avoid TCP resets when using ECMP for load-balancing between multiple servers Sriram Yagnaraman
@ 2023-08-28 11:32 ` Sriram Yagnaraman
  2023-08-28 15:16   ` Ido Schimmel
  2023-08-28 18:56   ` David Ahern
  0 siblings, 2 replies; 4+ messages in thread
From: Sriram Yagnaraman @ 2023-08-28 11:32 UTC (permalink / raw)
  Cc: netdev, linux-kselftest, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, David Ahern, Ido Schimmel,
	Shuah Khan, Petr Machata, Sriram Yagnaraman

Route hints when the nexthop is part of a multipath group causes packets
in the same receive batch to be sent to the same nexthop irrespective of
the multipath hash of the packet. So, do not extract route hint for
packets whose destination is part of a multipath group.

A new SKB flag IP6SKB_MULTIPATH is introduced for this purpose, set the
flag when route is looked up in fib6_select_path() and use it in
ip6_can_use_hint() to check for the existence of the flag.

Fixes: 197dbf24e360 ("ipv6: introduce and uses route look hints for list input.")
Signed-off-by: Sriram Yagnaraman <sriram.yagnaraman@est.tech>
---
 include/linux/ipv6.h | 1 +
 net/ipv6/ip6_input.c | 3 ++-
 net/ipv6/route.c     | 3 +++
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 839247a4f48e..fe3492a67b35 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -146,6 +146,7 @@ struct inet6_skb_parm {
 #define IP6SKB_JUMBOGRAM      128
 #define IP6SKB_SEG6	      256
 #define IP6SKB_FAKEJUMBO      512
+#define IP6SKB_MULTIPATH      1024
 };
 
 #if defined(CONFIG_NET_L3_MASTER_DEV)
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index d94041bb4287..b8378814532c 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -99,7 +99,8 @@ static bool ip6_can_use_hint(const struct sk_buff *skb,
 static struct sk_buff *ip6_extract_route_hint(const struct net *net,
 					      struct sk_buff *skb)
 {
-	if (fib6_routes_require_src(net) || fib6_has_custom_rules(net))
+	if (fib6_routes_require_src(net) || fib6_has_custom_rules(net) ||
+	    IP6CB(skb)->flags & IP6SKB_MULTIPATH)
 		return NULL;
 
 	return skb;
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 56a55585eb79..a02328c93a53 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -424,6 +424,9 @@ void fib6_select_path(const struct net *net, struct fib6_result *res,
 	if (match->nh && have_oif_match && res->nh)
 		return;
 
+	if (skb)
+		IP6CB(skb)->flags |= IP6SKB_MULTIPATH;
+
 	/* We might have already computed the hash for ICMPv6 errors. In such
 	 * case it will always be non-zero. Otherwise now is the time to do it.
 	 */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net v3 2/3] ipv6: ignore dst hint for multipath routes
  2023-08-28 11:32 ` [PATCH net v3 2/3] ipv6: ignore dst hint for multipath routes Sriram Yagnaraman
@ 2023-08-28 15:16   ` Ido Schimmel
  2023-08-28 18:56   ` David Ahern
  1 sibling, 0 replies; 4+ messages in thread
From: Ido Schimmel @ 2023-08-28 15:16 UTC (permalink / raw)
  To: Sriram Yagnaraman
  Cc: netdev, linux-kselftest, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, David Ahern, Ido Schimmel,
	Shuah Khan, Petr Machata

On Mon, Aug 28, 2023 at 01:32:20PM +0200, Sriram Yagnaraman wrote:
> Route hints when the nexthop is part of a multipath group causes packets
> in the same receive batch to be sent to the same nexthop irrespective of
> the multipath hash of the packet. So, do not extract route hint for
> packets whose destination is part of a multipath group.
> 
> A new SKB flag IP6SKB_MULTIPATH is introduced for this purpose, set the
> flag when route is looked up in fib6_select_path() and use it in
> ip6_can_use_hint() to check for the existence of the flag.
> 
> Fixes: 197dbf24e360 ("ipv6: introduce and uses route look hints for list input.")
> Signed-off-by: Sriram Yagnaraman <sriram.yagnaraman@est.tech>

Reviewed-by: Ido Schimmel <idosch@nvidia.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net v3 2/3] ipv6: ignore dst hint for multipath routes
  2023-08-28 11:32 ` [PATCH net v3 2/3] ipv6: ignore dst hint for multipath routes Sriram Yagnaraman
  2023-08-28 15:16   ` Ido Schimmel
@ 2023-08-28 18:56   ` David Ahern
  1 sibling, 0 replies; 4+ messages in thread
From: David Ahern @ 2023-08-28 18:56 UTC (permalink / raw)
  To: Sriram Yagnaraman
  Cc: netdev, linux-kselftest, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Ido Schimmel, Shuah Khan,
	Petr Machata

On 8/28/23 5:32 AM, Sriram Yagnaraman wrote:
> Route hints when the nexthop is part of a multipath group causes packets
> in the same receive batch to be sent to the same nexthop irrespective of
> the multipath hash of the packet. So, do not extract route hint for
> packets whose destination is part of a multipath group.
> 
> A new SKB flag IP6SKB_MULTIPATH is introduced for this purpose, set the
> flag when route is looked up in fib6_select_path() and use it in
> ip6_can_use_hint() to check for the existence of the flag.
> 
> Fixes: 197dbf24e360 ("ipv6: introduce and uses route look hints for list input.")
> Signed-off-by: Sriram Yagnaraman <sriram.yagnaraman@est.tech>
> ---
>  include/linux/ipv6.h | 1 +
>  net/ipv6/ip6_input.c | 3 ++-
>  net/ipv6/route.c     | 3 +++
>  3 files changed, 6 insertions(+), 1 deletion(-)
> 

Reviewed-by: David Ahern <dsahern@kernel.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net v3 2/3] ipv6: ignore dst hint for multipath routes
@ 2023-08-29  3:46 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2023-08-29  3:46 UTC (permalink / raw)
  Cc: oe-kbuild-all, llvm

In-Reply-To: <20230828113221.20123-3-sriram.yagnaraman@est.tech>
References: <20230828113221.20123-3-sriram.yagnaraman@est.tech>
TO: Sriram Yagnaraman <sriram.yagnaraman@est.tech>
CC: netdev@vger.kernel.org
CC: linux-kselftest@vger.kernel.org
CC: "David S . Miller" <davem@davemloft.net>
CC: Eric Dumazet <edumazet@google.com>
CC: Jakub Kicinski <kuba@kernel.org>
CC: Paolo Abeni <pabeni@redhat.com>
CC: David Ahern <dsahern@kernel.org>
CC: Ido Schimmel <idosch@nvidia.com>
CC: Shuah Khan <skhan@linuxfoundation.org>
CC: Petr Machata <petrm@nvidia.com>
CC: Sriram Yagnaraman <sriram.yagnaraman@est.tech>

Hi Sriram,

kernel test robot noticed the following build errors:

[auto build test ERROR on net/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Sriram-Yagnaraman/ipv4-ignore-dst-hint-for-multipath-routes/20230828-203216
base:   net/main
patch link:    https://lore.kernel.org/r/20230828113221.20123-3-sriram.yagnaraman%40est.tech
patch subject: [PATCH net v3 2/3] ipv6: ignore dst hint for multipath routes
config: riscv-randconfig-r033-20230829 (https://download.01.org/0day-ci/archive/20230829/202308291103.hzyzyCB5-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project.git f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230829/202308291103.hzyzyCB5-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308291103.hzyzyCB5-lkp@intel.com/

All errors (new ones prefixed by >>):

>> ld.lld: error: vmlinux.a(init/main.o):(function do_one_initcall: .text+0xc1c): relocation R_RISCV_HI20 out of range: 529094 is not in [-524288, 524287]; references .L.str.17
   >>> referenced by main.c
   >>> defined in vmlinux.a(init/main.o)
--
>> ld.lld: error: vmlinux.a(init/main.o):(function perf_trace_initcall_level: .text+0x3d8): relocation R_RISCV_HI20 out of range: 531219 is not in [-524288, 524287]; references __per_cpu_offset
   >>> referenced by main.c
   >>> defined in vmlinux.a(mm/percpu.o)
--
>> ld.lld: error: vmlinux.a(init/main.o):(function perf_trace_initcall_start: .text+0x620): relocation R_RISCV_HI20 out of range: 531219 is not in [-524288, 524287]; references __per_cpu_offset
   >>> referenced by main.c
   >>> defined in vmlinux.a(mm/percpu.o)
--
>> ld.lld: error: vmlinux.a(init/main.o):(function perf_trace_initcall_finish: .text+0x848): relocation R_RISCV_HI20 out of range: 531219 is not in [-524288, 524287]; references __per_cpu_offset
   >>> referenced by main.c
   >>> defined in vmlinux.a(mm/percpu.o)
--
>> ld.lld: error: vmlinux.a(init/main.o):(function rcu_read_unlock: .text+0x9b8): relocation R_RISCV_HI20 out of range: 529605 is not in [-524288, 524287]; references rcu_lock_map
   >>> referenced by main.c
   >>> defined in vmlinux.a(kernel/rcu/update.o)

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-29  3:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-29  3:46 [PATCH net v3 2/3] ipv6: ignore dst hint for multipath routes kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2023-08-28 11:32 [PATCH net v3 0/3] Avoid TCP resets when using ECMP for load-balancing between multiple servers Sriram Yagnaraman
2023-08-28 11:32 ` [PATCH net v3 2/3] ipv6: ignore dst hint for multipath routes Sriram Yagnaraman
2023-08-28 15:16   ` Ido Schimmel
2023-08-28 18:56   ` David Ahern

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.