Skip to content

Commit 9d4927f

Browse files
committed
Merge branch 'ipv6-misc'
Tariq Toukan says: ==================== net/ipv6 misc This patchset contains two patches for net/ipv6. Patch 1 is a trivial typo fix in documentation. Patch 2 by Eran is a re-spin. It adds GRO support for IPv6 GRE tunnel, this significantly improves performance in case GRO in native interface is disabled. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents db0aeb3 + 0c1dd2a commit 9d4927f

File tree

2 files changed

+28
-11
lines changed

2 files changed

+28
-11
lines changed

net/ipv6/exthdrs_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ EXPORT_SYMBOL_GPL(ipv6_find_tlv);
161161
* if target < 0. "last header" is transport protocol header, ESP, or
162162
* "No next header".
163163
*
164-
* Note that *offset is used as input/output parameter. an if it is not zero,
164+
* Note that *offset is used as input/output parameter, and if it is not zero,
165165
* then it must be a valid offset to an inner IPv6 header. This can be used
166166
* to explore inner IPv6 header, eg. ICMPv6 error messages.
167167
*

net/ipv6/ip6_gre.c

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,6 +1314,7 @@ static void ip6gre_dev_free(struct net_device *dev)
13141314
{
13151315
struct ip6_tnl *t = netdev_priv(dev);
13161316

1317+
gro_cells_destroy(&t->gro_cells);
13171318
dst_cache_destroy(&t->dst_cache);
13181319
free_percpu(dev->tstats);
13191320
}
@@ -1381,11 +1382,12 @@ static int ip6gre_tunnel_init_common(struct net_device *dev)
13811382
return -ENOMEM;
13821383

13831384
ret = dst_cache_init(&tunnel->dst_cache, GFP_KERNEL);
1384-
if (ret) {
1385-
free_percpu(dev->tstats);
1386-
dev->tstats = NULL;
1387-
return ret;
1388-
}
1385+
if (ret)
1386+
goto cleanup_alloc_pcpu_stats;
1387+
1388+
ret = gro_cells_init(&tunnel->gro_cells, dev);
1389+
if (ret)
1390+
goto cleanup_dst_cache_init;
13891391

13901392
tunnel->tun_hlen = gre_calc_hlen(tunnel->parms.o_flags);
13911393
tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen;
@@ -1405,6 +1407,13 @@ static int ip6gre_tunnel_init_common(struct net_device *dev)
14051407
ip6gre_tnl_init_features(dev);
14061408

14071409
return 0;
1410+
1411+
cleanup_dst_cache_init:
1412+
dst_cache_destroy(&tunnel->dst_cache);
1413+
cleanup_alloc_pcpu_stats:
1414+
free_percpu(dev->tstats);
1415+
dev->tstats = NULL;
1416+
return ret;
14081417
}
14091418

14101419
static int ip6gre_tunnel_init(struct net_device *dev)
@@ -1751,11 +1760,12 @@ static int ip6erspan_tap_init(struct net_device *dev)
17511760
return -ENOMEM;
17521761

17531762
ret = dst_cache_init(&tunnel->dst_cache, GFP_KERNEL);
1754-
if (ret) {
1755-
free_percpu(dev->tstats);
1756-
dev->tstats = NULL;
1757-
return ret;
1758-
}
1763+
if (ret)
1764+
goto cleanup_alloc_pcpu_stats;
1765+
1766+
ret = gro_cells_init(&tunnel->gro_cells, dev);
1767+
if (ret)
1768+
goto cleanup_dst_cache_init;
17591769

17601770
tunnel->tun_hlen = 8;
17611771
tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen +
@@ -1773,6 +1783,13 @@ static int ip6erspan_tap_init(struct net_device *dev)
17731783
ip6gre_tnl_link_config(tunnel, 1);
17741784

17751785
return 0;
1786+
1787+
cleanup_dst_cache_init:
1788+
dst_cache_destroy(&tunnel->dst_cache);
1789+
cleanup_alloc_pcpu_stats:
1790+
free_percpu(dev->tstats);
1791+
dev->tstats = NULL;
1792+
return ret;
17761793
}
17771794

17781795
static const struct net_device_ops ip6erspan_netdev_ops = {

0 commit comments

Comments
 (0)