From: Atul Gupta Subject: RE: [RFC crypto v3 8/9] chtls: Register the ULP Date: Thu, 8 Feb 2018 10:26:13 +0000 Message-ID: References: <20180125210850.GA69117@davejwatson-mba> <20180130171144.GA42146@davejwatson-mba> <9e81c5b4-f319-8b33-5dec-dad19582bde4@chelsio.com> <20180131164347.GA34501@davejwatson-mba> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "sd@queasysnail.net" , "herbert@gondor.apana.org.au" , "linux-crypto@vger.kernel.org" , "ganeshgr@chelsio.co" , "netdev@vger.kernel.org" , "davem@davemloft.net" , Boris Pismenny , Ilya Lesokhin To: Dave Watson Return-path: Received: from mail-bl2nam02on0136.outbound.protection.outlook.com ([104.47.38.136]:7713 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750806AbeBHK0Q (ORCPT ); Thu, 8 Feb 2018 05:26:16 -0500 In-Reply-To: Content-Language: en-US Sender: linux-crypto-owner@vger.kernel.org List-ID: I thought about this and approach below can avoid new ulp type: 1. Register Inline TLS driver to net TLS=20 2. enable ethtool -K tls-hw-record-offload on 3. Issue " setsockopt(fd, SOL_TCP, TCP_ULP, "tls", sizeof("tls")) " after B= ind, this will enable user fetch net_device corresponding to ipaadr bound t= o interface, if dev found is the one registered and record-offload enabled,= program the sk->sk_prot as required. 4. fallback to SW TLS for any other case, bind to inaddr_any falls in this = category and need proper handling? tls-hw-record-offload is TLS record offload to HW, which does tx/rx and rec= ord creation Inline. enum { TLS_BASE_TX, TLS_SW_TX, TLS_RECORD_HW, /* TLS record processed Inline */ TLS_NUM_CONFIG, }; -----Original Message----- From: Dave Watson [mailto:davejwatson@fb.com] Sent: Wednesday, January 31, 2018 10:14 PM To: Atul Gupta Cc: sd@queasysnail.net; herbert@gondor.apana.org.au; linux-crypto@vger.kern= el.org; ganeshgr@chelsio.co; netdev@vger.kernel.org; davem@davemloft.net; B= oris Pismenny ; Ilya Lesokhin Subject: Re: [RFC crypto v3 8/9] chtls: Register the ULP On 01/31/18 04:14 PM, Atul Gupta wrote: >=20 >=20 > On Tuesday 30 January 2018 10:41 PM, Dave Watson wrote: > > On 01/30/18 06:51 AM, Atul Gupta wrote: > >=20 > > > What I was referring is that passing "tls" ulp type in setsockopt=20 > > > may be insufficient to make the decision when multi HW assist=20 > > > Inline TLS solution exists. > > Setting the ULP doesn't choose HW or SW implementation, I think that=20 > > should be done later when setting up crypto with > >=20 > > setsockopt(SOL_TLS, TLS_TX, struct crypto_info). > setsockpot [mentioned above] is quite late for driver to enable HW=20 > implementation, we require something as early as tls_init=20 > [setsockopt(sock, SOL_TCP, TCP_ULP, "tls", sizeof("tls"))], for driver=20 > to set HW prot and offload connection beside Inline Tx/Rx. > >=20 > > Any reason we can't use ethtool to choose HW vs SW implementation,=20 > > if available on the device? > Thought about it,=A0 the interface index is not available to fetch=20 > netdev and caps check to set HW prot eg. bind [prot.hash] --> tls_hash to= program HW. Perhaps this is the part I don't follow - why do you need to override hash = and check for LISTEN? I briefly looked through the patch named "CPL handle= r definition", this looks like it is a full TCP offload? Yes, this is connection and record layer offload, and the reason I used dif= ferent ulp type, need to see what additional info or check can help setup t= he required sk prot.