Skip to content

Commit 6ac66cb

Browse files
sriramydavem330
authored andcommitted
ipv4: 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 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: 02b2494 ("ipv4: use dst hint for ipv4 list receive") 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 2ea3528 commit 6ac66cb

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

include/net/ip.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ struct inet_skb_parm {
5757
#define IPSKB_FRAG_PMTU BIT(6)
5858
#define IPSKB_L3SLAVE BIT(7)
5959
#define IPSKB_NOPOLICY BIT(8)
60+
#define IPSKB_MULTIPATH BIT(9)
6061

6162
u16 frag_max_size;
6263
};

net/ipv4/ip_input.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,8 @@ static void ip_sublist_rcv_finish(struct list_head *head)
584584
static struct sk_buff *ip_extract_route_hint(const struct net *net,
585585
struct sk_buff *skb, int rt_type)
586586
{
587-
if (fib4_has_custom_rules(net) || rt_type == RTN_BROADCAST)
587+
if (fib4_has_custom_rules(net) || rt_type == RTN_BROADCAST ||
588+
IPCB(skb)->flags & IPSKB_MULTIPATH)
588589
return NULL;
589590

590591
return skb;

net/ipv4/route.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2144,6 +2144,7 @@ static int ip_mkroute_input(struct sk_buff *skb,
21442144
int h = fib_multipath_hash(res->fi->fib_net, NULL, skb, hkeys);
21452145

21462146
fib_select_multipath(res, h);
2147+
IPCB(skb)->flags |= IPSKB_MULTIPATH;
21472148
}
21482149
#endif
21492150

0 commit comments

Comments
 (0)