From patchwork Fri Dec 1 20:52:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin KaFai Lau X-Patchwork-Id: 843722 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=fb.com header.i=@fb.com header.b="VJ7ABWJ4"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3ypRKz2y8dz9sNc for ; Sat, 2 Dec 2017 07:52:39 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751352AbdLAUwg (ORCPT ); Fri, 1 Dec 2017 15:52:36 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:45008 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750914AbdLAUwf (ORCPT ); Fri, 1 Dec 2017 15:52:35 -0500 Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vB1KmClP007943 for ; Fri, 1 Dec 2017 12:52:34 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=TvCM8Cs23F1ec/l58yyvHWcIZUm2e5oAERilBzT72oA=; b=VJ7ABWJ4S6aM2xpgmBb9nj0zXGulo+88X5JddFkeMJGKL1hy0CReeyx0qJcX8qfVzYKs Q1Q8SLhMN75OBNZqc6HhvFWG4rKepd7WIZYq+nN+sTuCT4j7bwfKTe3xjqiBZl4qSQ8r gK2KclsOULVVMQEfSy4pUkzUJyNF5jzB8Nk= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2ekaauh0c1-3 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 01 Dec 2017 12:52:34 -0800 Received: from mx-out.facebook.com (192.168.52.123) by PRN-CHUB04.TheFacebook.com (192.168.16.14) with Microsoft SMTP Server id 14.3.361.1; Fri, 1 Dec 2017 12:52:33 -0800 Received: by devbig738.prn1.facebook.com (Postfix, from userid 6611) id 592AD4500A92; Fri, 1 Dec 2017 12:52:32 -0800 (PST) Smtp-Origin-Hostprefix: devbig From: Martin KaFai Lau Smtp-Origin-Hostname: devbig738.prn1.facebook.com To: netdev CC: "David S . Miller" , Eric Dumazet , Kernel Team Smtp-Origin-Cluster: prn1c29 Subject: [PATCH v2 net-next 4/4] tcp: Enable 2nd listener hashtable in TCP Date: Fri, 1 Dec 2017 12:52:32 -0800 Message-ID: <20171201205232.3012584-5-kafai@fb.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20171201205232.3012584-1-kafai@fb.com> References: <20171201205232.3012584-1-kafai@fb.com> X-FB-Internal: Safe MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-12-01_05:, , signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Enable the second listener hashtable in TCP. The scale is the same as UDP which is one slot per 2MB. Signed-off-by: Martin KaFai Lau Reviewed-by: Eric Dumazet --- net/ipv4/tcp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index bf97317e6c97..180311636023 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -3577,6 +3577,9 @@ void __init tcp_init(void) percpu_counter_init(&tcp_sockets_allocated, 0, GFP_KERNEL); percpu_counter_init(&tcp_orphan_count, 0, GFP_KERNEL); inet_hashinfo_init(&tcp_hashinfo); + inet_hashinfo2_init(&tcp_hashinfo, "tcp_listen_portaddr_hash", + thash_entries, 21, /* one slot per 2 MB*/ + 0, 64 * 1024); tcp_hashinfo.bind_bucket_cachep = kmem_cache_create("tcp_bind_bucket", sizeof(struct inet_bind_bucket), 0,