From owner-freebsd-hackers@freebsd.org Tue Oct 27 04:32:47 2020 Return-Path: Delivered-To: freebsd-hackers@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 E598743CB56 for ; Tue, 27 Oct 2020 04:32:47 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-qb1can01on0605.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5c::605]) (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 4CKzMf4WJdz4HWN; Tue, 27 Oct 2020 04:32:46 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b2jMfzGe0Q39OJ8GFprDEXWLOBGLggUqaJTYEsISQSRrTSQRH/oksuFeixgeLA/bCAUfpeBCYkId/7dOVSNLtSRvQLG3clwbMlqw4PbUODD7cHOIeqvNxmf2IUYC8NZFDwUpbmafZpgoN1BdTFPgz0JvZDFu49NIo31eg2k0jemuWiPPa24j5DVmMVNC6fdL9ONZdpSeq8xLC5+UduP+RkUXq+RpTky/ge2ixVjJLxZZ0zP7yr3qbQlNLbYcrSmO3fs66V3rBGuJjImqqjQnlZSgm67qNN4jubko1btGoKoUbPZjgnlDASSTQlXwfjgdPG6K1xspiQeIOaUn3QdR+w== 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=VIjyMeSc35osmpkx5e/o49LKa115dnDXtuMGeGU6v1s=; b=AqK5wweioDbhGzk+j1K7isFqoZgwn81uD8/UiiktRmvWPeMfH6/IvAIHEIKGAwvurLQCU8jbjlXsopWzN2mWxNSbnH1NTmTOJVqzvUr9zbifBc4zF9HK8SHaN9i/FMfIoOXa0gIaPKE+7qz77fjSmI0if1h6nJSt/xztbFym9p9Qy/Y+uEUVkdD4dxoWoEcqencjqJC1+fGFR5qS9N1ciax85djoYIW+X8HDQCPake4IgaiDFv/9RwtzlvIWqy9r+LujVU6O8MuMMO1sPuhmrAWv1OOipSQlJghRo9fQyq/lItYyEUgCaxEFQ6ITjFg9xWsEkdFM0gyzrlmB7vlkHQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=uoguelph.ca; dmarc=pass action=none header.from=uoguelph.ca; dkim=pass header.d=uoguelph.ca; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uoguelph.ca; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VIjyMeSc35osmpkx5e/o49LKa115dnDXtuMGeGU6v1s=; b=drzYYBscKM2XJsmvnrSgLmDNWdhA0DLwJ78fO2/gXH/NqmPgAvFq3BsQ2hz9AZWEa1O0Pr3GKBkfZr+QMdww22NoYDqPRh3sy0Tnh1zHStwyFGhYMQ712iTzViJvrn2c/ktAJYB78lAjxn9Y20p9JSgL+Texgzpi0PDtziu9S8hamz4X1kztagSlkGNsUFqPB8v/y3o4PJmbl1mQPlnK2aDVnWvx/jRmfkmOsc5fFETJik69WylSx0E/ouJ7mLWgIVVvCjo2+gwWIx5chW/SiC5QYDhpQjwyMNsGy1j6wnCDMknXAmBlW8t93JOApo2PvB3PKdssAkBX9JeFOpcKng== Received: from YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:24::27) by YT1PR01MB2508.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:6::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.23; Tue, 27 Oct 2020 04:32:40 +0000 Received: from YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM ([fe80::687f:d85a:a0a3:bd20]) by YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM ([fe80::687f:d85a:a0a3:bd20%6]) with mapi id 15.20.3499.018; Tue, 27 Oct 2020 04:32:40 +0000 From: Rick Macklem To: Mark Johnston , Neel Chauhan CC: "freebsd-hackers@freebsd.org" , "jhb@FreeBSD.org" Subject: Re: QAT driver Thread-Topic: QAT driver Thread-Index: AQHWrA1RAR1VF3VbeUCYrguyOo0PK6mqygwAgAAP+qg= Date: Tue, 27 Oct 2020 04:32:40 +0000 Message-ID: References: <20201026200059.GA66299@raichu> <723fbd7326df42ce30cd5e361db9c736@neelc.org>,<20201027032720.GB31663@raichu> In-Reply-To: <20201027032720.GB31663@raichu> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 08798dda-5c5b-4427-ad8a-08d87a3156f6 x-ms-traffictypediagnostic: YT1PR01MB2508: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /ehU97DAhElnyyDaBqMqIsrqVuQdMJ97VY3hzppyl4k6HZkVGeKlDYS5Bk2mCFIGR35vx8dnx9/U3QThBFHAZit7T50BBDFTGjOI2hN8NCP+bRvv5aFtuYXbGlDiZQsgHT9/g0u5aXQoUzUmoExSSXW2vPvPd49pzJXOCEUnQSLBOpByUppiSMzMU9IOEeo9qpZQOsejUNZC3f/j98xuXqRdqtv/fhEDcOEstPUzN9Nzo5PLt7+D1DTYrxVLy+p94To+bN0gxCnOmKfKw5WSkvPoeiDA6wftsLu0pokT+6erkzmGLTVunW0tvq1G66ewj2pGtx/uNXdk1On90eiekqdREupeVhQgyKy0pfV2b+BINWjp9apQFhQBtZMyiEyiODz+000IGRQ+gss4549ONA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(136003)(346002)(376002)(39860400002)(366004)(396003)(66946007)(478600001)(66556008)(4326008)(9686003)(316002)(786003)(66476007)(64756008)(66446008)(83380400001)(7696005)(186003)(71200400001)(54906003)(110136005)(8936002)(3480700007)(5660300002)(6506007)(52536014)(2906002)(966005)(33656002)(86362001)(8676002)(91956017)(76116006)(55016002)(7116003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: 7rUduJyH3E2KI1y/CE9kDPy/KKShtVXxuJVwbOsp/vfrhC3qi9Gqe/REJUs1BtLBbyH9QkKHNpuPQ2bxdzJW1YGnvA8pYywGtaAqyhr3TRB+XXK6s6BzIu6z/yrrXNB/X+1php3l1IpqwYOwpzAkaZlFaKwW3RAL6x7vPdsYIH1fSPz40kz/190XdBANT5eFEYC8kzrNfKk13KJBWdrSRLr9P3TgqxHePewg1mbjjtoETzG2RIw6nccG352XrZaTsN654DeWUi4UxmfDVuf5Br0rHUBNds1LVLOMdbYm5kIg+xDdglA0un0JVPbul1Xu7UPpf3qxAR7iOLc2CZnkEAIoLIEh8DHSyO47wwMHW8WyjHQ5pohxvVoRM5a0otd4ex/+eOWrTqMB78Fj9erKoPd5kmdnWl+7BFWsx8YgN8C198XsT0W91ZqNWe+FFzCvmeS0uKQp3xQGqFC36vCf9CjVzsAhb4dMwEH9tdg2vOUxJl2YS8Sk7D0hVeZ4Y+vzlHoa4wKMK+KAAGNPMgaUDi0nnHtDBvXr0b12IFgzA9ubaTdkhr4I+do4LxTZc1ENVjWezQc4hDlDw0/ihbr+Dc7NN5aGPil1JXuEoIWHnmr3v9Aqnfb1c17zHEqbLApt8ArmImw1wOm7FebBU197GpOqOIBmLywxSrDFTU7kEoWUKcDvoU8HoWrAEcDgjySFs153P8G4rRs+NsYGN1BaxQ== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 08798dda-5c5b-4427-ad8a-08d87a3156f6 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Oct 2020 04:32:40.2858 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: YAoOXQ97vDXohQ1V/MUmEiLPVXk8n8FJwl7a89jGQyKOuaX+6L6pCvoKhqIxoMuIMqahGRO2buJyiOgUjIIcxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YT1PR01MB2508 X-Rspamd-Queue-Id: 4CKzMf4WJdz4HWN X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=uoguelph.ca header.s=selector1 header.b=drzYYBsc; dmarc=pass (policy=none) header.from=uoguelph.ca; spf=pass (mx1.freebsd.org: domain of rmacklem@uoguelph.ca designates 2a01:111:f400:fe5c::605 as permitted sender) smtp.mailfrom=rmacklem@uoguelph.ca X-Spamd-Result: default: False [-6.48 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.987]; R_DKIM_ALLOW(-0.20)[uoguelph.ca:s=selector1]; FREEFALL_USER(0.00)[rmacklem]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a01:111:f400::/48]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.01)[-1.010]; DWL_DNSWL_LOW(-1.00)[uoguelph.ca:dkim]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[uoguelph.ca:+]; DMARC_POLICY_ALLOW(-0.50)[uoguelph.ca,none]; NEURAL_HAM_SHORT(-1.48)[-1.478]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:8075, ipnet:2a01:111:f000::/36, country:US]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; MAILMAN_DEST(0.00)[freebsd-hackers] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2020 04:32:48 -0000 Mark Johnston wrote:=0A= >On Mon, Oct 26, 2020 at 08:00:08PM -0700, Neel Chauhan wrote:=0A= >> Hi,=0A= >>=0A= >> This is great news for me with my home HPE ML110 G10/Xeon 4108 server.= =0A= >>=0A= >> However, I will not be able to test this patch unless it can get=0A= >> backported to 12.1 or 12.2 once it's out, and I don't expect backporting= =0A= >> to happen.=0A= >=0A= >Indeed, it wouldn't appear before 12.3.=0A= >=0A= >> I have one question about this: will I be able to use this to accelerate= =0A= >> OpenSSL? Is additional code needed?=0A= >=0A= >In principle OpenSSL can make use of cryptodev(4) using the cryptodev=0A= >engine, which would allow requests to be handled by qat(4) (or any other= =0A= >hardware crypto driver loaded in the kernel). I don't know that the=0A= >cryptodev engine is really maintained these days though. More=0A= >importantly, using the kernel to perform crypto transforms carries a lot= =0A= >of overhead since OpenSSL would have to switch into the kernel and copy=0A= >data between userspace and the kernel for each request. I'd be=0A= >surprised if you get any benefit from this versus using the AES-NI=0A= >extensions in userspace, which OpenSSL should do out of the box.=0A= Can it be made to work with the KERN_TLS in head?=0A= (KERN_TLS works fine for me using the ktls_ocf and aesni modules.)=0A= I think it is only head and requires the patched OpenSSL3 that jhb@=0A= currently has.=0A= I know nothing about it, except that it seems to work well, doing=0A= the TLS application data records in the kernel for a TCP socket=0A= enabled by the patched OpenSSL library.=0A= I've cc'd jhb@, so hopefully he can let us know what it needs?=0A= =0A= >There are QAT drivers designed to service userspace requests=0A= >efficiently, such as the one published by Intel and the one included=0A= >with DPDK. This one is a fair bit simpler and really mostly intended=0A= >for kernel consumers, mainly IPSec and disk encryption subsystems.=0A= >=0A= >> I use the mentioned HPE server for Tor and Tor is very crypto-heavy (yet= =0A= >> singlethreaded).=0A= >>=0A= >> I believe the official Intel drivers allow OpenSSL acceleration, but I'd= =0A= >> prefer to avoid out-of-band drivers whether possible (ports/src is=0A= >> fine).=0A= >=0A= >It'd still be worth testing if you think a significant gain may be had.=0A= =0A= rick=0A= _______________________________________________=0A= freebsd-hackers@freebsd.org mailing list=0A= https://lists.freebsd.org/mailman/listinfo/freebsd-hackers=0A= To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"= =0A= =0A=