]> www.infradead.org Git - users/hch/configfs.git/commitdiff
ipv4: ignore dst hint for multipath routes
authorSriram Yagnaraman <sriram.yagnaraman@est.tech>
Thu, 31 Aug 2023 08:03:30 +0000 (10:03 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Sep 2023 07:11:51 +0000 (08:11 +0100)
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 IPSKB_MULTIPATH is introduced for this purpose, set the
flag when route is looked up in ip_mkroute_input() and use it in
ip_extract_route_hint() to check for the existence of the flag.

Fixes: 02b24941619f ("ipv4: use dst hint for ipv4 list receive")
Signed-off-by: Sriram Yagnaraman <sriram.yagnaraman@est.tech>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ip.h
net/ipv4/ip_input.c
net/ipv4/route.c

index 9276cea775cc2c26ccabcfea34822b19cfedb1a7..3489a1cca5e7bc315ba646f6bc125b2b6ded9416 100644 (file)
@@ -57,6 +57,7 @@ struct inet_skb_parm {
 #define IPSKB_FRAG_PMTU                BIT(6)
 #define IPSKB_L3SLAVE          BIT(7)
 #define IPSKB_NOPOLICY         BIT(8)
+#define IPSKB_MULTIPATH                BIT(9)
 
        u16                     frag_max_size;
 };
index fe9ead9ee863d6d7da1ac78643e9527ae5ddff1e..5e9c8156656a7642acc7a1bb08488b7482e52ce7 100644 (file)
@@ -584,7 +584,8 @@ static void ip_sublist_rcv_finish(struct list_head *head)
 static struct sk_buff *ip_extract_route_hint(const struct net *net,
                                             struct sk_buff *skb, int rt_type)
 {
-       if (fib4_has_custom_rules(net) || rt_type == RTN_BROADCAST)
+       if (fib4_has_custom_rules(net) || rt_type == RTN_BROADCAST ||
+           IPCB(skb)->flags & IPSKB_MULTIPATH)
                return NULL;
 
        return skb;
index a4e153dd615ba9321d8252a5026acafaa294a149..6a3f57a3fa415f020487f75c93a85614a420b50f 100644 (file)
@@ -2144,6 +2144,7 @@ static int ip_mkroute_input(struct sk_buff *skb,
                int h = fib_multipath_hash(res->fi->fib_net, NULL, skb, hkeys);
 
                fib_select_multipath(res, h);
+               IPCB(skb)->flags |= IPSKB_MULTIPATH;
        }
 #endif