All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] ila: Don't use dest cache when gateway is set
@ 2016-10-17  4:25 Tom Herbert
  2016-10-17 14:30 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Herbert @ 2016-10-17  4:25 UTC (permalink / raw)
  To: davem, netdev; +Cc: kernel-team

If the gateway is set on an ILA route we don't need to bother with using
the destination cache in the ILA route. Translation does not change the
routing in this case so we can stick with orig_output in the lwstate
output function.

Tested: Ran netperf with and without gateway for LWT route.

Signed-off-by: Tom Herbert <tom@herbertland.com>
---
 net/ipv6/ila/ila_lwt.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/net/ipv6/ila/ila_lwt.c b/net/ipv6/ila/ila_lwt.c
index d0a98d9..9fafba6 100644
--- a/net/ipv6/ila/ila_lwt.c
+++ b/net/ipv6/ila/ila_lwt.c
@@ -36,6 +36,7 @@ static inline struct ila_params *ila_params_lwtunnel(
 static int ila_output(struct net *net, struct sock *sk, struct sk_buff *skb)
 {
 	struct dst_entry *orig_dst = skb_dst(skb);
+	struct rt6_info *rt = (struct rt6_info *)orig_dst;
 	struct ila_lwt *ilwt = ila_lwt_lwtunnel(orig_dst->lwtstate);
 	struct dst_entry *dst;
 	int err = -EINVAL;
@@ -46,6 +47,13 @@ static int ila_output(struct net *net, struct sock *sk, struct sk_buff *skb)
 	ila_update_ipv6_locator(skb, ila_params_lwtunnel(orig_dst->lwtstate),
 				true);
 
+	if (rt->rt6i_flags & (RTF_GATEWAY | RTF_CACHE)) {
+		/* Already have a next hop address in route, no need for
+		 * dest cache route.
+		 */
+		return orig_dst->lwtstate->orig_output(net, sk, skb);
+	}
+
 	dst = dst_cache_get(&ilwt->dst_cache);
 	if (unlikely(!dst)) {
 		struct ipv6hdr *ip6h = ipv6_hdr(skb);
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] ila: Don't use dest cache when gateway is set
  2016-10-17  4:25 [PATCH net-next] ila: Don't use dest cache when gateway is set Tom Herbert
@ 2016-10-17 14:30 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-10-17 14:30 UTC (permalink / raw)
  To: tom; +Cc: netdev, kernel-team

From: Tom Herbert <tom@herbertland.com>
Date: Sun, 16 Oct 2016 21:25:35 -0700

> If the gateway is set on an ILA route we don't need to bother with using
> the destination cache in the ILA route. Translation does not change the
> routing in this case so we can stick with orig_output in the lwstate
> output function.
> 
> Tested: Ran netperf with and without gateway for LWT route.
> 
> Signed-off-by: Tom Herbert <tom@herbertland.com>

Applied, thanks Tom.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-17 14:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-17  4:25 [PATCH net-next] ila: Don't use dest cache when gateway is set Tom Herbert
2016-10-17 14:30 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.