Skip to content

Commit ab3a70b

Browse files
tomratbertdavem330
authored andcommitted
ila: Don't use dest cache when gateway is set
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> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ab530f6 commit ab3a70b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

net/ipv6/ila/ila_lwt.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ static inline struct ila_params *ila_params_lwtunnel(
3636
static int ila_output(struct net *net, struct sock *sk, struct sk_buff *skb)
3737
{
3838
struct dst_entry *orig_dst = skb_dst(skb);
39+
struct rt6_info *rt = (struct rt6_info *)orig_dst;
3940
struct ila_lwt *ilwt = ila_lwt_lwtunnel(orig_dst->lwtstate);
4041
struct dst_entry *dst;
4142
int err = -EINVAL;
@@ -46,6 +47,13 @@ static int ila_output(struct net *net, struct sock *sk, struct sk_buff *skb)
4647
ila_update_ipv6_locator(skb, ila_params_lwtunnel(orig_dst->lwtstate),
4748
true);
4849

50+
if (rt->rt6i_flags & (RTF_GATEWAY | RTF_CACHE)) {
51+
/* Already have a next hop address in route, no need for
52+
* dest cache route.
53+
*/
54+
return orig_dst->lwtstate->orig_output(net, sk, skb);
55+
}
56+
4957
dst = dst_cache_get(&ilwt->dst_cache);
5058
if (unlikely(!dst)) {
5159
struct ipv6hdr *ip6h = ipv6_hdr(skb);

0 commit comments

Comments
 (0)