Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1507029

[PATCH net-next 3/5] ipv6: Use multipath hash from flow info if available

From Jakub Sitnicki <jkbs@redhat.com>
Newsgroups linux.kernel
Subject [PATCH net-next 3/5] ipv6: Use multipath hash from flow info if available
Date 2016-10-24 11:30 +0200
Message-ID <svJJU-5DE-23@gated-at.bofh.it> (permalink)
References <svJJT-5DE-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Allow our callers to influence the choice of ECMP link by honoring the
hash passed together with the flow info. This will allow for special
treatment of ICMP errors which we would like to route over the same link
as the IP datagram that triggered the error.

Signed-off-by: Jakub Sitnicki <jkbs@redhat.com>
---
 net/ipv6/route.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 0514b35..1184c2b 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -430,9 +430,11 @@ static struct rt6_info *rt6_multipath_select(struct rt6_info *match,
 					     int strict)
 {
 	struct rt6_info *sibling, *next_sibling;
+	unsigned int hash;
 	int route_choosen;
 
-	route_choosen = get_hash_from_flowi6(fl6) % (match->rt6i_nsiblings + 1);
+	hash = fl6->mp_hash ? : get_hash_from_flowi6(fl6);
+	route_choosen = hash % (match->rt6i_nsiblings + 1);
 	/* Don't change the route, if route_choosen == 0
 	 * (siblings does not include ourself)
 	 */
-- 
2.7.4

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next 0/5] Route ICMPv6 errors with the flow when ECMP in use Jakub Sitnicki <jkbs@redhat.com> - 2016-10-24 11:30 +0200
  [PATCH net-next 3/5] ipv6: Use multipath hash from flow info if available Jakub Sitnicki <jkbs@redhat.com> - 2016-10-24 11:30 +0200
    Re: [PATCH net-next 3/5] ipv6: Use multipath hash from flow info if  available Hannes Frederic Sowa <hannes@stressinduktion.org> - 2016-10-24 11:50 +0200
  [PATCH net-next 2/5] net: Extend struct flowi6 with multipath hash Jakub Sitnicki <jkbs@redhat.com> - 2016-10-24 11:30 +0200
    Re: [PATCH net-next 2/5] net: Extend struct flowi6 with multipath  hash Hannes Frederic Sowa <hannes@stressinduktion.org> - 2016-10-24 11:40 +0200
  [PATCH net-next 1/5] ipv6: Fold rt6_info_hash_nhsfn() into its only caller Jakub Sitnicki <jkbs@redhat.com> - 2016-10-24 11:40 +0200

csiph-web