From owner-freebsd-net@freebsd.org Thu Mar 19 13:08:04 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 002B3260146 for ; Thu, 19 Mar 2020 13:08:04 +0000 (UTC) (envelope-from zec@fer.hr) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2041.outbound.protection.outlook.com [40.107.20.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48jnJg4MVTz41Bv; Thu, 19 Mar 2020 13:08:03 +0000 (UTC) (envelope-from zec@fer.hr) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OA9L+nsiMnNt39ofSIE3jsHk8Ec+fr7XrDAMWXXjB2dA1DKqiLLQY+a5eIl4Mg7jX4hEGOSJ/vWCNGy1WFY7vPpQDN4p5UxP7OF1sHBHr9rOy9v0QZ75Ec7H3YL1qeuj/wPhfMD+ZgQQBQO7R8PbUj65+wSXaopRFpRvIyGxm6x60aoGMnzl4r9PApUm+KfVv+PyawfMEhxooFeugZS4KHsv3KzMyKQHlROste/kC/mTQaonDzdpchGXxrtpHFJxcsOvT7+WqtOq8YiOCZi+2NX8i+yplVqevqimFMxYn6GZqOgJwXzCkADVH+H1fcXZAbav0VHvlOmiNZmyxZTw7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XQoopnyfCcC3lvJyTH8XVMAFFsvmpTfJOmiKVptrHgw=; b=cEOP/vFt3iKZBmc+88pghqFf7sYbsuiuIymaWMIVDoqstAzbZzBaWEWFqoIwkFY//wDtUshEI6ry+YO3qLuTJoqo//waUhpw7QvlKCdUpUxBxiXnHx3esaPOBQlbXdDjdVX3YBd9/zRvoc351Bt0QgHk8U1SQKIHrMAQ1gKAwRooRjcOjEkdbJMKWCkKxUQdkWu6y3+uev2RNvZJeaUcL4Iclru5tBl/qnYi/9KUpXoDNxq6MWEWTSxAwJ5ekKlkObQO/9UiaR9kvwEQJ2lUbSpbok+olsYWcaDR5SeSDNOwLO2nhYVSnFWc4rlxt2vgReFcLrYP/q4i+5g7zJ5dfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=fer.hr; dmarc=pass action=none header.from=fer.hr; dkim=pass header.d=fer.hr; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ferhr.onmicrosoft.com; s=selector2-ferhr-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XQoopnyfCcC3lvJyTH8XVMAFFsvmpTfJOmiKVptrHgw=; b=F6wYZd46HqXUDcbr0XgzdZmmHXyp9D8Ndv9z+zY3Ng3jkeWKpDxY1D281veGsGyd3DrIdyhCLfe1DCmkbia45xtWOHQK37kh7Lurf0XySQ6XPvWwMXAc7BxQjP5wum4gOe27kNzrn6yIB5RZPTKvBhZG6Cuwi+WQWHfX1USWGF4= Received: from AM0PR08MB5315.eurprd08.prod.outlook.com (10.255.225.87) by AM0PR08MB5010.eurprd08.prod.outlook.com (10.255.29.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.18; Thu, 19 Mar 2020 13:08:01 +0000 Received: from AM0PR08MB5315.eurprd08.prod.outlook.com ([fe80::ccc2:ade:260d:b6db]) by AM0PR08MB5315.eurprd08.prod.outlook.com ([fe80::ccc2:ade:260d:b6db%7]) with mapi id 15.20.2814.021; Thu, 19 Mar 2020 13:08:01 +0000 Date: Thu, 19 Mar 2020 14:08:48 +0100 From: Marko Zec To: Lev Serebryakov Cc: freebsd-net@freebsd.org Subject: Re: IPFW In-Kernel NAT vs PF NAT Performance Message-ID: <20200319140848.4160644c@x23> In-Reply-To: <2ea463e1-a1ee-defe-b640-ad45f56a4949@FreeBSD.org> References: <55dbea1fe75777780be166756c7641e8@neelc.org> <2ea463e1-a1ee-defe-b640-ad45f56a4949@FreeBSD.org> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; amd64-portbld-freebsd11.3) Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-ClientProxiedBy: VI1PR0501CA0032.eurprd05.prod.outlook.com (2603:10a6:800:60::18) To AM0PR08MB5315.eurprd08.prod.outlook.com (2603:10a6:208:18e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from x23 (31.147.121.189) by VI1PR0501CA0032.eurprd05.prod.outlook.com (2603:10a6:800:60::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.15 via Frontend Transport; Thu, 19 Mar 2020 13:08:01 +0000 X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; amd64-portbld-freebsd11.3) X-Originating-IP: [31.147.121.189] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e472e025-5ba9-4c79-5e62-08d7cc068d90 X-MS-TrafficTypeDiagnostic: AM0PR08MB5010: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 0347410860 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(136003)(346002)(366004)(39850400004)(199004)(6916009)(86362001)(66556008)(4744005)(33716001)(478600001)(81156014)(53546011)(66946007)(1076003)(6666004)(66476007)(52116002)(5660300002)(6496006)(8676002)(450100002)(4326008)(956004)(16526019)(186003)(8936002)(55016002)(26005)(9686003)(316002)(786003)(9576002)(2906002)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR08MB5010; H:AM0PR08MB5315.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; Received-SPF: None (protection.outlook.com: fer.hr does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oL8khNmsUKGA1cu0ehXOlhLt6kNSs1F/JMlD8Q4wjA9VT+HLAD5BLSQkgQLlspIR/70CJvXK/XSAm5gVUegvgkl+wNiDbkpd4BTE6+yzL4jE2XOXLqzv/fh9WGiTuwtfi+WCpH5VXCV1JJEngL8tehI4M/4HGy9YfNYJjJoLF6bjNdGnNc7TEIBL8jpCC8eKyHRHppA93bR7NAuI3mMfHBYhpHAKDuEfU6Fni0SJWTGlKceQDckahd3ZHM4WR+SHUugTf6/4/2FWnDCM8uvCtlZVX68KKFgJYglUe6wpk/gfDnNSEvvVSmr5DyLO22fCmWwiL22tDkQADsmkZ7uTrNrTvlFzjiHOHeB+BqerRN/A/aXCru+ZtP61PTE2dGpfgOCiX4GCPdoRbhv4EmlNZXOgJKRVMcY9UUYfYwz7NXs4MoCd6zYG49m0mi6thPDP X-MS-Exchange-AntiSpam-MessageData: oiUStPOV9C+c6XKo4lF6jXrMjBYUUPqvaUtJc08dL1sJGTlxP/mARgRHaNMbZzMVnmRt/FJLM5TD9ItXRP/fs8iUcAnxww4TVKEErE3QUxUU0hJ9z+JhPIgsISdBq3cvaCuG0pco2ES2z8Kjvtm9tw== X-OriginatorOrg: fer.hr X-MS-Exchange-CrossTenant-Network-Message-Id: e472e025-5ba9-4c79-5e62-08d7cc068d90 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 13:08:01.5045 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: ca71eddc-cc7b-4e5b-95bd-55b658e696be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hgvg40hSS/NCBx5NLqvk1jOpUWiZSFb3agNr+zowASu0zUi3qPKea9Fvvq3nFLuO X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5010 X-Rspamd-Queue-Id: 48jnJg4MVTz41Bv X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-2.52 / 15.00]; NEURAL_SPAM_MEDIUM(0.58)[0.575,0]; REPLY(-4.00)[]; NEURAL_SPAM_LONG(0.90)[0.903,0] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2020 13:08:04 -0000 On Thu, 19 Mar 2020 14:33:34 +0300 Lev Serebryakov wrote: > On 19.03.2020 7:14, Neel Chauhan wrote: > > > However, if you know, where in the code does libalias use only 4096 > > buckets? I want to know incase I want/have to switch back to IPFW. > 4096 is my mistake, it is 4001 and must be prime. It is here: > > sys/netinet/libalias/alias_local.h:69-70: > > #define LINK_TABLE_OUT_SIZE 4001 > #define LINK_TABLE_IN_SIZE 4001 Out of curiosity, why exactly _must_ the hash size be a prime here? Doing a quick fgrep -R powerof2 /sys/netinet | fgrep hash reveals that a completely different line of thought prevails there, and probably elsewhere as well? What gives? Marko