From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Herbert Subject: [PATCH net-next v4 0/4] ila: Optimization to preserve value of early demux Date: Thu, 10 Dec 2015 16:19:29 -0800 Message-ID: <1449793173-4086221-1-git-send-email-tom@herbertland.com> Mime-Version: 1.0 Content-Type: text/plain Cc: To: , Return-path: Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:32240 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750715AbbLKATl (ORCPT ); Thu, 10 Dec 2015 19:19:41 -0500 Received: from pps.filterd (m0001303.ppops.net [127.0.0.1]) by m0001303.ppops.net (8.15.0.59/8.15.0.59) with SMTP id tBB0Bui4024905 for ; Thu, 10 Dec 2015 16:19:40 -0800 Received: from mail.thefacebook.com ([199.201.64.23]) by m0001303.ppops.net with ESMTP id 1yqg0ph3cb-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Thu, 10 Dec 2015 16:19:40 -0800 Received: from devbig284.prn2.facebook.com (10.35.15.32) by mx-out.facebook.com (10.103.99.99) with ESMTP id dde55b689f9c11e591a00002c9dfb610-747f3210 for ; Thu, 10 Dec 2015 16:19:39 -0800 Sender: netdev-owner@vger.kernel.org List-ID: In the current implementation of ILA, LWT is used to perform translation on both the input and output paths. This is functional, however there is a big performance hit in the receive path. Early demux occurs before the routing lookup (a hit actually obviates the route lookup). Therefore the stack currently performs early demux before translation so that a local connection with ILA addresses is never matched. Note that this issue is not just with ILA, but pretty much any translated or encapsulated packet handled by LWT would miss the opportunity for early demux. Solving the general problem seems non trivial since we would need to move the route lookup before early demx thereby mitigating the value. This patch set addresses the issue for ILA by adding a fast locator lookup that occurs before early demux. This done by hooking in to NF_INET_PRE_ROUTING For the backend we implement an rhashtable that contains identifier to locator to mappings. The table also allows more specific matches that include original locator and interface. This patch set: - Add an rhashtable function to atomically replace and element. This is useful to implement sub-trees from a table entry without needing to use a special anchor structure as the table entry. - Add a start callback for starting a netlink dump. - Creates an ila directory under net/ipv6 and moves ila.c to it. ila.c is split into ila_common.c and ila_lwt.c. - Implement a table to do identifier->locator mapping. This is an rhashtable (in ila_xlat.c). - Configuration for the table with netlink. - Add a hook into NF_INET_PRE_ROUTING to perform ILA translation before early demux. Changes in v2: - Use iptables targets instead of a new xfrm function Changes in v3: - Add __rcu to next pointer in struct ila_map Changes in v4: - Use hook for NF_INET_PRE_ROUTING Testing: Running 200 netperf TCP_RR streams No ILA, baseline 79.26% CPU utilization 1678282 tps 104/189/390 50/90/99% latencies ILA before fix (LWT on both input and output) 81.91% CPU utilization 1464723 tps (-14.5% from baseline) 121/215/411 50/90/99% latencies ILA after fix 80.62% CPU utilization 1622985 (-3.4% from baseline) 110/191/347 50/90/99% latencies Tom Herbert (4): ila: Create net/ipv6/ila directory rhashtable: add function to replace an element netlink: add a start callback for starting a netlink dump ila: Add generic ILA translation facility include/linux/netlink.h | 2 + include/linux/rhashtable.h | 82 ++++++ include/net/genetlink.h | 2 + include/net/ila.h | 18 ++ include/uapi/linux/ila.h | 22 ++ net/ipv6/Makefile | 2 +- net/ipv6/ila.c | 229 --------------- net/ipv6/ila/Makefile | 7 + net/ipv6/ila/ila.h | 48 ++++ net/ipv6/ila/ila_common.c | 103 +++++++ net/ipv6/ila/ila_lwt.c | 152 ++++++++++ net/ipv6/ila/ila_xlat.c | 679 +++++++++++++++++++++++++++++++++++++++++++++ net/netlink/af_netlink.c | 4 + net/netlink/genetlink.c | 16 ++ 14 files changed, 1136 insertions(+), 230 deletions(-) create mode 100644 include/net/ila.h delete mode 100644 net/ipv6/ila.c create mode 100644 net/ipv6/ila/Makefile create mode 100644 net/ipv6/ila/ila.h create mode 100644 net/ipv6/ila/ila_common.c create mode 100644 net/ipv6/ila/ila_lwt.c create mode 100644 net/ipv6/ila/ila_xlat.c -- 2.4.6