Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1507028 > unrolled thread
| Started by | Jakub Sitnicki <jkbs@redhat.com> |
|---|---|
| First post | 2016-10-24 11:30 +0200 |
| Last post | 2016-10-24 11:40 +0200 |
| Articles | 6 — 2 participants |
Back to article view | Back to linux.kernel
[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
| From | Jakub Sitnicki <jkbs@redhat.com> |
|---|---|
| Date | 2016-10-24 11:30 +0200 |
| Subject | [PATCH net-next 0/5] Route ICMPv6 errors with the flow when ECMP in use |
| Message-ID | <svJJT-5DE-5@gated-at.bofh.it> |
The motivation for this series is to route ICMPv6 error messages
together with the flow they belong to when multipath routing is in
use. It intends to bring the ECMP routing in IPv6 stack on par with
IPv4.
This enables the use of tools that rely on ICMP error messages such as
traceroute and makes PMTU discovery work both ways. However, for it to
work IPv6 flow labels have to be same in both directions
(i.e. reflected) or need to be chosen in a manner that ensures that
the flow going in the opposite direction would actually be routed to a
given path.
Changes have been tested in a virtual setup with a topology as below:
Re1 --- Hs1
/
Hc --- Ri --- Rc
\
Re1 --- Hs2
Hc - client host
HsX - server host
Rc - core router
ReX - edge router
Ri - intermediate router
To test the changes, traceroute in UDP mode to the client host, with
flow label set, has been run from one of the server hosts. Full test
is available at [1].
-Jakub
[1] https://github.com/jsitnicki/tools/blob/master/net/tests/ecmp/test-ecmp-icmpv6-error-routing.sh
Jakub Sitnicki (5):
ipv6: Fold rt6_info_hash_nhsfn() into its only caller
net: Extend struct flowi6 with multipath hash
ipv6: Use multipath hash from flow info if available
ipv6: Compute multipath hash for sent ICMP errors from offending
packet
ipv6: Compute multipath hash for forwarded ICMP errors from offending
packet
include/linux/icmpv6.h | 2 ++
include/net/flow.h | 1 +
net/ipv6/icmp.c | 21 +++++++++++++++++++++
net/ipv6/route.c | 40 +++++++++++++++++++++++++++++-----------
4 files changed, 53 insertions(+), 11 deletions(-)
--
2.7.4
[toc] | [next] | [standalone]
| From | Jakub Sitnicki <jkbs@redhat.com> |
|---|---|
| Date | 2016-10-24 11:30 +0200 |
| Subject | [PATCH net-next 3/5] ipv6: Use multipath hash from flow info if available |
| Message-ID | <svJJU-5DE-23@gated-at.bofh.it> |
| In reply to | #1507028 |
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
[toc] | [prev] | [next] | [standalone]
| From | Hannes Frederic Sowa <hannes@stressinduktion.org> |
|---|---|
| Date | 2016-10-24 11:50 +0200 |
| Subject | Re: [PATCH net-next 3/5] ipv6: Use multipath hash from flow info if available |
| Message-ID | <svK3f-5Kp-17@gated-at.bofh.it> |
| In reply to | #1507029 |
On 24.10.2016 11:28, Jakub Sitnicki wrote: > 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> Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
[toc] | [prev] | [next] | [standalone]
| From | Jakub Sitnicki <jkbs@redhat.com> |
|---|---|
| Date | 2016-10-24 11:30 +0200 |
| Subject | [PATCH net-next 2/5] net: Extend struct flowi6 with multipath hash |
| Message-ID | <svJJU-5DE-21@gated-at.bofh.it> |
| In reply to | #1507028 |
Allow for functions that fill out the IPv6 flow info to also pass a hash
computed over the skb contents. The hash value will drive the multipath
routing decisions.
This is intended for special treatment of ICMPv6 errors, where we would
like to make a routing decision based on the flow identifying the
offending IPv6 datagram that triggered the error, rather than the flow
of the ICMP error itself.
Signed-off-by: Jakub Sitnicki <jkbs@redhat.com>
---
include/net/flow.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/net/flow.h b/include/net/flow.h
index 035aa77..73ee3aa 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -143,6 +143,7 @@ struct flowi6 {
#define fl6_ipsec_spi uli.spi
#define fl6_mh_type uli.mht.type
#define fl6_gre_key uli.gre_key
+ __u32 mp_hash;
} __attribute__((__aligned__(BITS_PER_LONG/8)));
struct flowidn {
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Hannes Frederic Sowa <hannes@stressinduktion.org> |
|---|---|
| Date | 2016-10-24 11:40 +0200 |
| Subject | Re: [PATCH net-next 2/5] net: Extend struct flowi6 with multipath hash |
| Message-ID | <svJTz-5GY-11@gated-at.bofh.it> |
| In reply to | #1507030 |
On 24.10.2016 11:28, Jakub Sitnicki wrote: > Allow for functions that fill out the IPv6 flow info to also pass a hash > computed over the skb contents. The hash value will drive the multipath > routing decisions. > > This is intended for special treatment of ICMPv6 errors, where we would > like to make a routing decision based on the flow identifying the > offending IPv6 datagram that triggered the error, rather than the flow > of the ICMP error itself. > > Signed-off-by: Jakub Sitnicki <jkbs@redhat.com> Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
[toc] | [prev] | [next] | [standalone]
| From | Jakub Sitnicki <jkbs@redhat.com> |
|---|---|
| Date | 2016-10-24 11:40 +0200 |
| Subject | [PATCH net-next 1/5] ipv6: Fold rt6_info_hash_nhsfn() into its only caller |
| Message-ID | <svJTz-5GY-7@gated-at.bofh.it> |
| In reply to | #1507028 |
Commit 644d0e656958 ("ipv6 Use get_hash_from_flowi6 for rt6 hash") has
turned rt6_info_hash_nhsfn() into a one-liner, so it no longer makes
sense to keep it around.
Also the accompanying documentation comment has become outdated, so just
remove it altogether.
Signed-off-by: Jakub Sitnicki <jkbs@redhat.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
net/ipv6/route.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index bdbc38e..0514b35 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -425,16 +425,6 @@ static bool rt6_check_expired(const struct rt6_info *rt)
return false;
}
-/* Multipath route selection:
- * Hash based function using packet header and flowlabel.
- * Adapted from fib_info_hashfn()
- */
-static int rt6_info_hash_nhsfn(unsigned int candidate_count,
- const struct flowi6 *fl6)
-{
- return get_hash_from_flowi6(fl6) % candidate_count;
-}
-
static struct rt6_info *rt6_multipath_select(struct rt6_info *match,
struct flowi6 *fl6, int oif,
int strict)
@@ -442,7 +432,7 @@ static struct rt6_info *rt6_multipath_select(struct rt6_info *match,
struct rt6_info *sibling, *next_sibling;
int route_choosen;
- route_choosen = rt6_info_hash_nhsfn(match->rt6i_nsiblings + 1, fl6);
+ route_choosen = get_hash_from_flowi6(fl6) % (match->rt6i_nsiblings + 1);
/* Don't change the route, if route_choosen == 0
* (siblings does not include ourself)
*/
--
2.7.4
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web