Skip to content

Commit 8423be8

Browse files
sriramydavem330
authored andcommitted
ipv6: ignore dst hint for multipath routes
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: 197dbf2 ("ipv6: introduce and uses route look hints for list input.") Signed-off-by: Sriram Yagnaraman <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Reviewed-by: David Ahern <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6ac66cb commit 8423be8

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

include/linux/ipv6.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ struct inet6_skb_parm {
147147
#define IP6SKB_JUMBOGRAM 128
148148
#define IP6SKB_SEG6 256
149149
#define IP6SKB_FAKEJUMBO 512
150+
#define IP6SKB_MULTIPATH 1024
150151
};
151152

152153
#if defined(CONFIG_NET_L3_MASTER_DEV)

net/ipv6/ip6_input.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ static bool ip6_can_use_hint(const struct sk_buff *skb,
9999
static struct sk_buff *ip6_extract_route_hint(const struct net *net,
100100
struct sk_buff *skb)
101101
{
102-
if (fib6_routes_require_src(net) || fib6_has_custom_rules(net))
102+
if (fib6_routes_require_src(net) || fib6_has_custom_rules(net) ||
103+
IP6CB(skb)->flags & IP6SKB_MULTIPATH)
103104
return NULL;
104105

105106
return skb;

net/ipv6/route.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,9 @@ void fib6_select_path(const struct net *net, struct fib6_result *res,
423423
if (match->nh && have_oif_match && res->nh)
424424
return;
425425

426+
if (skb)
427+
IP6CB(skb)->flags |= IP6SKB_MULTIPATH;
428+
426429
/* We might have already computed the hash for ICMPv6 errors. In such
427430
* case it will always be non-zero. Otherwise now is the time to do it.
428431
*/

0 commit comments

Comments
 (0)