diff options
author | David S. Miller <davem@davemloft.net> | 2016-02-16 20:21:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-02-16 20:21:49 -0500 |
commit | 4cba259f198b93d514ed7be44a7d679c83e7d9f1 (patch) | |
tree | 576d9b9b839017a90b336b2908b95dd6f2668e4e /net/openvswitch/flow_netlink.c | |
parent | 64f63d59ba782ec317fca150895ef8dc6ddbff4b (diff) | |
parent | 3c1cb4d2604c03779a6c9485204e2a80be6c28f0 (diff) |
Merge branch 'unified-tunnel-dst-caching'
Paolo Abeni says:
====================
net: unify dst caching for tunnel devices
This patch series try to unify the dst cache implementations currently
present in the kernel, namely in ip_tunnel.c and ip6_tunnel.c, introducing a
new generic implementation, replacing the existing ones, and then using
the new implementation in other tunnel devices which currently lack it.
The new dst implementation is compiled, as built-in, only if any device using
it is enabled.
Caching the dst for the tunnel remote address gives small, but measurable,
performance improvement when tunneling over ipv4 (in the 2%-4% range) and
significant ones when tunneling over ipv6 (roughly 60% when no
fragmentation/segmentation take place and the tunnel local address
is not specified).
v2:
- move the vxlan dst_cache usage inside the device lookup functions
- fix usage after free for lwt tunnel moving the dst cache storage inside
the dst_metadata,
- sparse codying style cleanup
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch/flow_netlink.c')
-rw-r--r-- | net/openvswitch/flow_netlink.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c index d1bd4a45ca2d..58b8efc23668 100644 --- a/net/openvswitch/flow_netlink.c +++ b/net/openvswitch/flow_netlink.c @@ -1959,6 +1959,12 @@ static int validate_and_copy_set_tun(const struct nlattr *attr, if (!tun_dst) return -ENOMEM; + err = dst_cache_init(&tun_dst->u.tun_info.dst_cache, GFP_KERNEL); + if (err) { + dst_release((struct dst_entry *)tun_dst); + return err; + } + a = __add_action(sfa, OVS_KEY_ATTR_TUNNEL_INFO, NULL, sizeof(*ovs_tun), log); if (IS_ERR(a)) { |