From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin KaFai Lau Subject: [PATCH v2 net-next 0/4] tcp: Add a 2nd listener hashtable (port+addr) Date: Fri, 1 Dec 2017 12:52:28 -0800 Message-ID: <20171201205232.3012584-1-kafai@fb.com> Mime-Version: 1.0 Content-Type: text/plain Cc: "David S . Miller" , Eric Dumazet , Kernel Team To: netdev Return-path: Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:60646 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751031AbdLAUxL (ORCPT ); Fri, 1 Dec 2017 15:53:11 -0500 Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.16.0.21/8.16.0.21) with SMTP id vB1KmRYI002550 for ; Fri, 1 Dec 2017 12:53:10 -0800 Received: from mail.thefacebook.com ([199.201.64.23]) by m0089730.ppops.net with ESMTP id 2ekc8v0fh0-3 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 01 Dec 2017 12:53:10 -0800 Sender: netdev-owner@vger.kernel.org List-ID: This patch set adds a 2nd listener hashtable. It is to resolve the performance issue when a process is listening at many IP addresses with the same port (e.g. [IP1]:443, [IP2]:443... [IPN]:443) v2: - Move the new lhash2 and lhash2_mask before the existing listening_hash to avoid adding another cacheline to inet_hashinfo (Suggested by Eric Dumazet, Thanks!) - I take this chance to plug an existing 4 bytes hole while adding 'unsigned int lhash2_mask'. - Add some comments about lhash2 in inet_hashtables.h Martin KaFai Lau (4): inet: Add a count to struct inet_listen_hashbucket udp: Move udp[46]_portaddr_hash() to net/ip[v6].h inet: Add a 2nd listener hashtable (port+addr) tcp: Enable 2nd listener hashtable in TCP include/net/inet_connection_sock.h | 2 + include/net/inet_hashtables.h | 29 +++++-- include/net/ip.h | 9 ++ include/net/ipv6.h | 17 ++++ net/ipv4/inet_hashtables.c | 173 +++++++++++++++++++++++++++++++++++-- net/ipv4/tcp.c | 3 + net/ipv4/udp.c | 22 ++--- net/ipv6/inet6_hashtables.c | 66 ++++++++++++++ net/ipv6/udp.c | 32 ++----- 9 files changed, 301 insertions(+), 52 deletions(-) -- 2.9.5