From owner-freebsd-net@freebsd.org Thu Nov 7 09:52:29 2019 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 AE5AD1AE95F for ; Thu, 7 Nov 2019 09:52:29 +0000 (UTC) (envelope-from damien.deville@stormshield.eu) Received: from work.stormshield.eu (gwlille.netasq.com [91.212.116.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 477zGN5nKDz4PtY; Thu, 7 Nov 2019 09:52:28 +0000 (UTC) (envelope-from damien.deville@stormshield.eu) Received: from work.stormshield.eu (localhost.localdomain [127.0.0.1]) by work.stormshield.eu (Postfix) with ESMTPS id AE41D3AA1EBC; Thu, 7 Nov 2019 10:52:11 +0100 (CET) Received: from localhost (localhost.localdomain [127.0.0.1]) by work.stormshield.eu (Postfix) with ESMTP id 9DA023AA1EBA; Thu, 7 Nov 2019 10:52:11 +0100 (CET) Received: from work.stormshield.eu ([127.0.0.1]) by localhost (work.stormshield.eu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id LkIbHEQNF37d; Thu, 7 Nov 2019 10:52:11 +0100 (CET) Received: from work.stormshield.eu (localhost.localdomain [127.0.0.1]) by work.stormshield.eu (Postfix) with ESMTP id 859D23ABE325; Thu, 7 Nov 2019 10:52:11 +0100 (CET) Date: Thu, 7 Nov 2019 10:52:11 +0100 (CET) From: Damien DEVILLE To: Eugene Grosbein Cc: Lawrence Stewart , olivier , freebsd-net@freebsd.org, Kurt Jaeger Message-ID: <972466586.1921723.1573120331472.JavaMail.zimbra@stormshield.eu> In-Reply-To: <54db0c82-ad44-13ed-8e1f-702557f331e5@grosbein.net> References: <20191104194637.GA71627@home.opsec.eu> <20191105191514.GG8521@funkthat.com> <261b842d-51eb-4522-6ef5-0672e5d1594e@grosbein.net> <20191107073255.GU8521@funkthat.com> <54db0c82-ad44-13ed-8e1f-702557f331e5@grosbein.net> Subject: Re: 10g IPsec ? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thread-Topic: 10g IPsec ? Thread-Index: BNxjSrxtFjpkQsM9dObwrNZIqo4JZA== X-Rspamd-Queue-Id: 477zGN5nKDz4PtY X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of damien.deville@stormshield.eu designates 91.212.116.1 as permitted sender) smtp.mailfrom=damien.deville@stormshield.eu X-Spamd-Result: default: False [1.91 / 15.00]; ARC_NA(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:91.212.116.1]; NEURAL_HAM_LONG(-0.02)[-0.019,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[stormshield.eu]; NEURAL_SPAM_MEDIUM(0.71)[0.707,0]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[1.116.212.91.list.dnswl.org : 127.0.10.0]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:49068, ipnet:91.212.116.0/24, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.52)[ip: (1.37), ipnet: 91.212.116.0/24(0.68), asn: 49068(0.55), country: FR(-0.00)] 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, 07 Nov 2019 09:52:29 -0000 Hi freebsd-net, At Stormshield we have various patches related to that topic that we can sh= are. On the flow id part, we have a patch that recompute a new flowid for the IP= sec flow after encapsulation based on the spi. This force the usage of the same transmit queue on the network card side fo= r each tunnel/SPI. If you are interested i can make a review for this one to upstream it, it i= s a small and simple modification. On the single tunnel optimisation we recently took some time to optimize so= me code we made earlier and commited to FreeBSD 11 https://github.com/freebsd/freebsd/commit/fbc9da5dbe50b72a335de7a27b6834fba= 8ee3cf0 + https://github.com/freebsd/freebsd/commit/c8b6f569add600b6ce34184= 8bcc28a79fb5f273b The goal was to optimize this code in the context of a single IPsec tunnel = and a single network flow in that tunnel. On one of our high end hardware (Intel(R) Xeon(R) E-2176G with 6 cores / ix= l network cards), the previous code was running around 2.4Gbps using AES-GC= M with a mix of packet size whose average size was around 650 bytes. After various heavy optimization in opencrypto/crypto.c and on IPsec stack = we managed to increase the performance on the same test to around 5Gbps. Ta= ke care this is mainly targeted to the subset of opencrypto feature we are = using in our products (mainly IPsec with or without hardware cryptography) I can take some time to review and submit this big patch if there is some i= nterest in it. It will require some work on our side cause at the moment this patch is for= FreeBSD 10.3 and has some depencies to our custom polling code which is no= t in FreeBSD. We made the modification to work using kproc in the non polli= ng code but we have still to test those on an unmodified FreeBSD. I can also share the various benchmark we did to illustrate the impact of s= ome of the optimisation we did. Damien -- Damien Deville IPS Technical Leader http://www.stormshield.eu Stormshield 2/6 Avenue de l'Horizon, Bat. 6 - FR 59650 Villeneuve d'Ascq ----- Le 7 Nov 19, =C3=A0 8:48, Eugene Grosbein eugen@grosbein.net a =C3=A9= crit : | 07.11.2019 14:32, John-Mark Gurney wrote: |=20 |> Don't we have the option of doing soft re-classification? Where we |> recalculate the hash, and then do a netisr defer? I mean that'd burn |> a bunch of extra cpu cycles, but you gotta do what you gotta do. |=20 | If the host got a packet already, it can just process it without extra | re-classification. |=20 | The only case I know when such re-classification can be useful is assigni= ng | M_FLOWID to the mbuf | so that lagg(4) using LACP could send it further using such M_FLOWID and = maybe | distribute distinct IPsec flows over distinct ports of LAGG group. |=20 | I doubt this has much practical use :-) Generally we terminate IPsec loca= lly | or route packets to other hosts without need to differ them from other tr= ansit | traffic. |=20 | _______________________________________________ | freebsd-net@freebsd.org mailing list | https://lists.freebsd.org/mailman/listinfo/freebsd-net | To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"