From: Jakub Sitnicki <jkbs@redhat.com>
To: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Hannes Frederic Sowa <hannes@stressinduktion.org>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Tom Herbert <tom@herbertland.com>
Subject: [PATCH net-next v2 3/5] ipv6: Use multipath hash from flow info if available
Date: Fri, 28 Oct 2016 14:32:33 +0200 [thread overview]
Message-ID: <1477657955-5157-4-git-send-email-jkbs@redhat.com> (raw)
In-Reply-To: <1477657955-5157-1-git-send-email-jkbs@redhat.com>
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>
---
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
next prev parent reply other threads:[~2016-10-28 12:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-28 12:32 [PATCH net-next v2 0/5] Route ICMPv6 errors with the flow when ECMP in use Jakub Sitnicki
2016-10-28 12:32 ` [PATCH net-next v2 1/5] ipv6: Fold rt6_info_hash_nhsfn() into its only caller Jakub Sitnicki
2016-10-28 12:32 ` [PATCH net-next v2 2/5] net: Extend struct flowi6 with multipath hash Jakub Sitnicki
2016-10-28 12:32 ` Jakub Sitnicki [this message]
2016-10-28 12:32 ` [PATCH net-next v2 4/5] ipv6: Compute multipath hash for sent ICMP errors from offending packet Jakub Sitnicki
2016-10-28 12:32 ` [PATCH net-next v2 5/5] ipv6: Compute multipath hash for forwarded " Jakub Sitnicki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1477657955-5157-4-git-send-email-jkbs@redhat.com \
--to=jkbs@redhat.com \
--cc=davem@davemloft.net \
--cc=hannes@stressinduktion.org \
--cc=netdev@vger.kernel.org \
--cc=tom@herbertland.com \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).