From owner-freebsd-net@FreeBSD.ORG Thu Aug 29 21:40:57 2013 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DDB5CEE7 for ; Thu, 29 Aug 2013 21:40:56 +0000 (UTC) (envelope-from btv1==9536076923e==tgubatayao@barracuda.com) Received: from bsf03.barracuda.com (bsf03.barracuda.com [64.235.145.83]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 96E982BEF for ; Thu, 29 Aug 2013 21:40:56 +0000 (UTC) X-ASG-Debug-ID: 1377812454-05b9635b3a5dd640001-oFaieN Received: from BN-SCL-FE02.Cudanet.local (bn-scl-fe02.cudanet.local [10.8.96.69]) by bsf03.barracuda.com with ESMTP id NrfXEpN5DlYB44gl (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Thu, 29 Aug 2013 14:40:54 -0700 (PDT) X-Barracuda-Envelope-From: tgubatayao@barracuda.com Received: from BN-SCL-FE04.Cudanet.local (10.8.96.204) by BN-SCL-FE02.Cudanet.local (10.8.96.69) with Microsoft SMTP Server (TLS) id 8.3.298.1; Thu, 29 Aug 2013 14:40:54 -0700 Received: from BN-SCL-MBX03.Cudanet.local ([fe80::e5b6:9fef:a4d2:a5ba]) by BN-SCL-FE04.Cudanet.local ([fe80::7443:fe71:7539:9156%10]) with mapi; Thu, 29 Aug 2013 14:40:54 -0700 From: "T.C. Gubatayao" To: Alan Somers Date: Thu, 29 Aug 2013 14:40:53 -0700 Subject: Re: Flow ID, LACP, and igb Thread-Topic: Flow ID, LACP, and igb X-ASG-Orig-Subj: Re: Flow ID, LACP, and igb Thread-Index: Ac6lAHAMARmm9ywPRcWaH417AVY3jw== Message-ID: References: <521BBD21.4070304@freebsd.org> <521EE8DA.3060107@freebsd.org> <0771FC4F-BCDD-4985-A33F-09951806AD99@barracuda.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-apple-encoding-hint: 513 x-universally-unique-identifier: 2f974b20-2ce7-4994-a8de-d34babbf2057 x-apple-mail-remote-attachments: YES x-apple-base-url: x-msg://4347/ x-apple-mail-signature: x-uniform-type-identifier: com.apple.mail-draft acceptlanguage: en-US Content-Type: multipart/mixed; boundary="_002_C209B12FA40447EC82253F5E4123E05Ebarracudacom_" MIME-Version: 1.0 X-Barracuda-Connect: bn-scl-fe02.cudanet.local[10.8.96.69] X-Barracuda-Start-Time: 1377812454 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: http://10.8.98.66:8000/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at barracuda.com X-Barracuda-Spam-Score: 0.62 X-Barracuda-Spam-Status: No, SCORE=0.62 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests=COMMA_SUBJECT, THREAD_INDEX, THREAD_TOPIC X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.139774 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.01 THREAD_INDEX thread-index: AcO7Y8iR61tzADqsRmmc5wNiFHEOig== 0.01 THREAD_TOPIC Thread-Topic: ...(Japanese Subject)... 0.60 COMMA_SUBJECT Subject is like 'Re: FDSDS, this is a subject' X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: Jack F Vogel , "Justin T. Gibbs" , Andre Oppermann , "net@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 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, 29 Aug 2013 21:40:57 -0000 --_002_C209B12FA40447EC82253F5E4123E05Ebarracudacom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Aug 29, 2013, at 4:21 PM, Alan Somers wrote: > They're faster, but even with this change, jenkins_hash is still 6 times > slower than FNV hash. Actually, I think your test isn't accurately simulating memory access, whic= h might be skewing the results. For example, from net/if_lagg.c: p =3D hash32_buf(&eh->ether_shost, ETHER_ADDR_LEN, p); p =3D hash32_buf(&eh->ether_dhost, ETHER_ADDR_LEN, p); These two calls can't both be aligned, since ETHER_ADDR_LEN is 6 octets. T= he same is true for the other hashed fields in the IP and TCP/UDP headers. Assuming the mbuf data pointer is aligned, the IP addresses and ports are b= oth on 2-byte alignments (without VLAN or IP options). In your test, they're a= ll =20 aligned and in the same cache line. When I modify the test to simulate an mbuf, lookup3 beats FNV and hash32, a= nd SipHash is only 2-3 times slower. > Also, your technique of copying the hashable fields into a separate buffe= r > would need modification to work with different types of packet and differ= ent > LAGG_F_HASH[234] flags. Because different packets have different hashabl= e > fields, struct key would need to be expanded to include the vlan tag, IPV= 6 > addresses, and IPv6 flowid. lagg_hashmbuf would then have to zero the un= used > fields. Agreed, but this is relatively simple with a buffer on the stack, and does = not require zeroes or padding. See my modified test, attached. T.C.= --_002_C209B12FA40447EC82253F5E4123E05Ebarracudacom_--