Skip to content

Commit f230d1e

Browse files
iamkafaidavem330
authored andcommitted
ipv6: Rename the dst_cache helper functions in ip6_tunnel
It is a prep work to fix the dst_entry refcnt bugs in ip6_tunnel. This patch rename: 1. ip6_tnl_dst_check() to ip6_tnl_dst_get() to better reflect that it will take a dst refcnt in the next patch. 2. ip6_tnl_dst_store() to ip6_tnl_dst_set() to have a more conventional name matching with ip6_tnl_dst_get(). Signed-off-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a3c119d commit f230d1e

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

include/net/ip6_tunnel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ struct ipv6_tlv_tnl_enc_lim {
6060
__u8 encap_limit; /* tunnel encapsulation limit */
6161
} __packed;
6262

63-
struct dst_entry *ip6_tnl_dst_check(struct ip6_tnl *t);
63+
struct dst_entry *ip6_tnl_dst_get(struct ip6_tnl *t);
6464
void ip6_tnl_dst_reset(struct ip6_tnl *t);
65-
void ip6_tnl_dst_store(struct ip6_tnl *t, struct dst_entry *dst);
65+
void ip6_tnl_dst_set(struct ip6_tnl *t, struct dst_entry *dst);
6666
int ip6_tnl_rcv_ctl(struct ip6_tnl *t, const struct in6_addr *laddr,
6767
const struct in6_addr *raddr);
6868
int ip6_tnl_xmit_ctl(struct ip6_tnl *t, const struct in6_addr *laddr,

net/ipv6/ip6_gre.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
634634
}
635635

636636
if (!fl6->flowi6_mark)
637-
dst = ip6_tnl_dst_check(tunnel);
637+
dst = ip6_tnl_dst_get(tunnel);
638638

639639
if (!dst) {
640640
ndst = ip6_route_output(net, NULL, fl6);
@@ -763,7 +763,7 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
763763

764764
ip6tunnel_xmit(NULL, skb, dev);
765765
if (ndst)
766-
ip6_tnl_dst_store(tunnel, ndst);
766+
ip6_tnl_dst_set(tunnel, ndst);
767767
return 0;
768768
tx_err_link_failure:
769769
stats->tx_carrier_errors++;

net/ipv6/ip6_tunnel.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static struct net_device_stats *ip6_get_stats(struct net_device *dev)
126126
* Locking : hash tables are protected by RCU and RTNL
127127
*/
128128

129-
struct dst_entry *ip6_tnl_dst_check(struct ip6_tnl *t)
129+
struct dst_entry *ip6_tnl_dst_get(struct ip6_tnl *t)
130130
{
131131
struct dst_entry *dst = t->dst_cache;
132132

@@ -139,7 +139,7 @@ struct dst_entry *ip6_tnl_dst_check(struct ip6_tnl *t)
139139

140140
return dst;
141141
}
142-
EXPORT_SYMBOL_GPL(ip6_tnl_dst_check);
142+
EXPORT_SYMBOL_GPL(ip6_tnl_dst_get);
143143

144144
void ip6_tnl_dst_reset(struct ip6_tnl *t)
145145
{
@@ -148,14 +148,14 @@ void ip6_tnl_dst_reset(struct ip6_tnl *t)
148148
}
149149
EXPORT_SYMBOL_GPL(ip6_tnl_dst_reset);
150150

151-
void ip6_tnl_dst_store(struct ip6_tnl *t, struct dst_entry *dst)
151+
void ip6_tnl_dst_set(struct ip6_tnl *t, struct dst_entry *dst)
152152
{
153153
struct rt6_info *rt = (struct rt6_info *) dst;
154154
t->dst_cookie = rt6_get_cookie(rt);
155155
dst_release(t->dst_cache);
156156
t->dst_cache = dst;
157157
}
158-
EXPORT_SYMBOL_GPL(ip6_tnl_dst_store);
158+
EXPORT_SYMBOL_GPL(ip6_tnl_dst_set);
159159

160160
/**
161161
* ip6_tnl_lookup - fetch tunnel matching the end-point addresses
@@ -1010,7 +1010,7 @@ static int ip6_tnl_xmit2(struct sk_buff *skb,
10101010
memcpy(&fl6->daddr, addr6, sizeof(fl6->daddr));
10111011
neigh_release(neigh);
10121012
} else if (!fl6->flowi6_mark)
1013-
dst = ip6_tnl_dst_check(t);
1013+
dst = ip6_tnl_dst_get(t);
10141014

10151015
if (!ip6_tnl_xmit_ctl(t, &fl6->saddr, &fl6->daddr))
10161016
goto tx_err_link_failure;
@@ -1102,7 +1102,7 @@ static int ip6_tnl_xmit2(struct sk_buff *skb,
11021102
ipv6h->daddr = fl6->daddr;
11031103
ip6tunnel_xmit(NULL, skb, dev);
11041104
if (ndst)
1105-
ip6_tnl_dst_store(t, ndst);
1105+
ip6_tnl_dst_set(t, ndst);
11061106
return 0;
11071107
tx_err_link_failure:
11081108
stats->tx_carrier_errors++;

0 commit comments

Comments
 (0)